From 14499c0084ae19062a7c7f84d1a186657f31d85b Mon Sep 17 00:00:00 2001 From: Abhijith Gopakumar Date: Mon, 27 Dec 2021 14:12:38 -0600 Subject: [PATCH 01/43] Introduced environmental variables in .env file for easier OQMD hosting --- .env.example | 83 ++++++++++++++++++++++++++++++++++++++ .gitignore | 3 ++ qmpy/db/settings.py | 27 +++++++------ qmpy/rester/qmpy_rester.py | 8 ++-- requirements.txt | 7 ++-- 5 files changed, 110 insertions(+), 18 deletions(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 00000000..bc1c3c62 --- /dev/null +++ b/.env.example @@ -0,0 +1,83 @@ +################################################################################# +# This is an example file with all the required environment variables to +# create the ".env" file. For security reasons, ".env" is not included in +# version control (see .gitignore) and thus, not pushed to GitHub. +# +# Steps to follow: +# +# Step 1: Copy this file (".env.example") to a new file named ".env" in +# this directory. +# +# Step 2: Close this file (".env.example") and pen the new file (".env") +# and proceed to the Step 3 from ".env". +# +# Step 3: Modify the environment values below to match your system and +# configuration. +# +# Step 4: Save this ".env" file. +# +################################################################################ + +# Database-related variables. +# +# Make sure to set them to match your MySQL DB configuration. +# See their usage in qmpy/db/settings.py file. +# In short, they are used to define Django's DATABASES dictionary +OQMD_DB_name='qmdb' +OQMD_DB_user='root' +OQMD_DB_pswd='' +OQMD_DB_host='127.0.0.1' +OQMD_DB_port='3306' + + +# Web-hosting related variables +# +# The "OQMD_WEB_hosts" variable holds comma-separated hostnames that are +# to be included in Django's ALLOWED_HOSTS tag. +# See qmpy/qmpy/db/settings.py file. +# +# Set OQMD_WEB_debug=True only when the server is not in production. +# OQMD_WEB_debug=False prints too many details during error enounters -> high security risk +OQMD_WEB_hosts="example.com,localhost,127.0.0.1,www.example.com" +OQMD_WEB_debug='False' + + +# REST API-related variables +# These values are required to make queries from the /api/search page +# Regular REST API from /optimade/ and /oqmdapi/ pages would work fine even without these +# These values should match the host:port values provided in server hosting command +# Eg: +# A server hosted using "python manage.py runserver example.com:8888" should +# have OQMD_REST_host='example.com' and OQMD_REST_port='8888' +OQMD_REST_host='localhost' +OQMD_REST_port='80' + + +# Static file storage-related variables +# These values are used in qmpy/db/settings.py file. +# The correct values for your implementation depends on where the static files are stored +# for your server. +# +# "OQMD_STATIC_root" and "OQMD_STATIC_url" are assigned to Django's STATIC_ROOT +# and STATIC_URL respectively. +# https://docs.djangoproject.com/en/2.2/ref/contrib/staticfiles/#settings +# +# OQMD_USE_CDN refers to whether CDN-hosted JS files are to be loaded instead of +# local static JS files +# Used in qmpy/templatetags/custom_filters.py +OQMD_STATIC_root='/home/oqmd/oqmd.org/static/' +OQMD_STATIC_url='static/' +OQMD_USE_CDN='True' + +# Secret Key for signing cookies, hash generation and some authentication in Django. +# +# It's more significant in Django servers where the user authentication +# is required, unlike oqmd.org +# +# More details: +# https://docs.djangoproject.com/en/2.2/ref/settings/#secret-key +# +# You can simply generate a 50 character key anytime. +# https://github.com/django/django/blob/stable/2.2.x/django/core/management/utils.py#L76 +# The key given is randomly generated, but not used in any of our servers: +OQMD_DJANGO_secretkey='48o2)h#gwow!iyg&__4d%zkv8v&h=n!sv)0rvj$*1yj8tw0riu' diff --git a/.gitignore b/.gitignore index 2f3bec7e..5147edcd 100644 --- a/.gitignore +++ b/.gitignore @@ -56,3 +56,6 @@ docs/_build/ # Django migrations */migrations + +# Implementation Secrets +.env diff --git a/qmpy/db/settings.py b/qmpy/db/settings.py index cd34a6af..5695e2ce 100644 --- a/qmpy/db/settings.py +++ b/qmpy/db/settings.py @@ -1,17 +1,20 @@ # Django settings for oqmd project. import os +from dotenv import load_dotenv, find_dotenv + +# Loading environment variables from .env file +load_dotenv(find_dotenv()) INSTALL_PATH = os.path.dirname(os.path.abspath(__file__)) INSTALL_PATH = os.path.split(INSTALL_PATH)[0] INSTALL_PATH = os.path.split(INSTALL_PATH)[0] -# DEBUG = False -DEBUG = True +DEBUG = True if os.environ.get("OQMD_WEB_debug").lower() == 'true' else False TEMPLATE_DEBUG = DEBUG ADMINS = ( ("Scott Kirklin", "scott.kirklin@gmail.com"), - ("Vinay Hegde", "hegdevinayi@gmail.com"), + ("OQMD Dev Team", "oqmd.questions@gmail.com"), ) MANAGERS = ADMINS @@ -19,15 +22,15 @@ DATABASES = { "default": { "ENGINE": "django.db.backends.mysql", - "NAME": os.environ.get("qmdb_v1_1_name"), - "USER": os.environ.get("qmdb_v1_1_user"), - "PASSWORD": os.environ.get("qmdb_v1_1_pswd"), - "HOST": os.environ.get("qmdb_v1_1_host"), - "PORT": os.environ.get("qmdb_v1_1_port"), + "NAME": os.environ.get("OQMD_DB_name"), + "USER": os.environ.get("OQMD_DB_user"), + "PASSWORD": os.environ.get("OQMD_DB_pswd"), + "HOST": os.environ.get("OQMD_DB_host"), + "PORT": os.environ.get("OQMD_DB_port"), } } -ALLOWED_HOSTS = ["larue.northwestern.edu", "www.larue.northwestern.edu"] +ALLOWED_HOSTS = os.environ.get("OQMD_WEB_hosts").split(",") # Local time zone for this installation. Choices can be found here: # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name @@ -65,11 +68,11 @@ # Don't put anything in this directory yourself; store your static files # in apps' "static/" subdirectories and in STATICFILES_DIRS. # Example: "/home/media/media.lawrence.com/static/" -STATIC_ROOT = "/home/oqmd/oqmd2.org/static/" +STATIC_ROOT = os.environ.get("OQMD_STATIC_root") # URL prefix for static files. # Example: "http://media.lawrence.com/static/" -STATIC_URL = "/static/" +STATIC_URL = os.environ.get("OQMD_STATIC_url") # Additional locations of static files STATICFILES_DIRS = ( @@ -88,7 +91,7 @@ ) # Make this unique, and don't share it with anybody. -SECRET_KEY = "h23o7ac@^_upzx*zzs%1t1bn6#*(7@b3$kp*v9)6hbf%rkr!%z" +SECRET_KEY = os.environ.get("OQMD_DJANGO_secretkey") TEMPLATES = [ { diff --git a/qmpy/rester/qmpy_rester.py b/qmpy/rester/qmpy_rester.py index f2f89714..cedca299 100644 --- a/qmpy/rester/qmpy_rester.py +++ b/qmpy/rester/qmpy_rester.py @@ -1,10 +1,12 @@ import json import os -WEBPORT = os.environ.get("web_port") +REST_WEBHOST = os.environ.get("OQMD_REST_host") +REST_WEBPORT = os.environ.get("OQMD_REST_port") + +REST_OPTIMADE = "http://{}:{}/optimade".format(REST_WEBHOST,REST_WEBPORT) +REST_OQMDAPI = "http://{}:{}/oqmdapi".format(REST_WEBHOST,REST_WEBPORT) -REST_OPTIMADE = "http://larue.northwestern.edu:" + WEBPORT + "/optimade" -REST_OQMDAPI = "http://larue.northwestern.edu:" + WEBPORT + "/oqmdapi" REST_END_POINT = REST_OQMDAPI diff --git a/requirements.txt b/requirements.txt index 428f3a86..405d6740 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,15 +1,15 @@ ase bokeh == 0.12.15 Django == 2.2.24 -django-crispy-forms == 1.8.1 +django-crispy-forms django-extensions > 2.2.5 -django-filter +django-filter == 21.1 djangorestframework > 3.10 -djangorestframework-filters djangorestframework-queryfields djangorestframework-xml djangorestframework-yaml lark-parser +lxml matplotlib mysqlclient networkx @@ -20,6 +20,7 @@ PyCifRW >= 4.3 pygraphviz pyparsing pytest +python-dotenv python-memcached PyYAML requests From 3f60ac011fe7677846d46e85118abf204883660d Mon Sep 17 00:00:00 2001 From: Abhijith Gopakumar Date: Thu, 6 Jan 2022 14:42:52 -0600 Subject: [PATCH 02/43] cleaned up the imports of a few JS files to improve page loading speed. Also better CDN usage depending upon the environment variable --- qmpy/web/static/js/bokeh-0.12.11.min.js | 185 -- qmpy/web/static/js/jquery-ui.min.js | 13 + .../js/jquery.base-oqmd.combined.min.js | 49 - .../static/js/jquery.flot.axislabels.js.alt | 2477 ----------------- .../static/js/jquery.flot.axislabels.min.js | 1 - .../static/js/jquery.flot.compressed_all.js | 9 + qmpy/web/static/js/jquery.flot.labels.js | 207 -- qmpy/web/static/js/jquery.flot.labels.min.js | 1 - qmpy/web/static/js/jquery.flot.pie.min.js | 1 - qmpy/web/static/js/jquery.flot.tooltip.min.js | 1 - qmpy/web/static/js/phasediagram_home.js | 479 ---- qmpy/web/templates/analysis/gclp.html | 5 +- .../web/templates/analysis/phase_diagram.html | 12 +- qmpy/web/templates/analysis/view_data.html | 8 +- qmpy/web/templates/base.html | 17 +- qmpy/web/templates/computing/hosts.html | 2 +- .../templates/computing/online_submit.html | 2 +- qmpy/web/templates/computing/project.html | 2 +- .../templates/computing/project_state.html | 2 +- qmpy/web/templates/computing/projects.html | 2 +- qmpy/web/templates/computing/queue.html | 2 +- qmpy/web/templates/index.html | 8 +- qmpy/web/templates/materials/composition.html | 11 +- qmpy/web/templates/materials/duplicates.html | 2 +- qmpy/web/templates/materials/entry.html | 10 +- .../materials/generic_composition.html | 2 +- qmpy/web/templates/materials/keyword.html | 2 +- qmpy/web/templates/materials/phasespace.html | 8 +- qmpy/web/templates/materials/prototype.html | 2 +- qmpy/web/templates/materials/structure.html | 2 +- 30 files changed, 78 insertions(+), 3446 deletions(-) delete mode 100644 qmpy/web/static/js/bokeh-0.12.11.min.js create mode 100644 qmpy/web/static/js/jquery-ui.min.js delete mode 100644 qmpy/web/static/js/jquery.base-oqmd.combined.min.js delete mode 100644 qmpy/web/static/js/jquery.flot.axislabels.js.alt delete mode 100644 qmpy/web/static/js/jquery.flot.axislabels.min.js create mode 100644 qmpy/web/static/js/jquery.flot.compressed_all.js delete mode 100644 qmpy/web/static/js/jquery.flot.labels.js delete mode 100644 qmpy/web/static/js/jquery.flot.labels.min.js delete mode 100644 qmpy/web/static/js/jquery.flot.pie.min.js delete mode 100644 qmpy/web/static/js/jquery.flot.tooltip.min.js delete mode 100644 qmpy/web/static/js/phasediagram_home.js diff --git a/qmpy/web/static/js/bokeh-0.12.11.min.js b/qmpy/web/static/js/bokeh-0.12.11.min.js deleted file mode 100644 index e35be16c..00000000 --- a/qmpy/web/static/js/bokeh-0.12.11.min.js +++ /dev/null @@ -1,185 +0,0 @@ -!function(t,e){t.Bokeh=e()}(this,function(){var t;return function(t,e,n){var i={},r=function(n){var o=null!=e[n]?e[n]:n;if(!i[o]){if(!t[o]){var s=new Error("Cannot find module '"+n+"'");throw s.code="MODULE_NOT_FOUND",s}var a=i[o]={exports:{}};t[o].call(a.exports,r,a,a.exports)}return i[o].exports},o=r(n);return o.require=r,o.register_plugin=function(n,i,s){for(var a in n)t[a]=n[a];for(var a in i)e[a]=i[a];var l=r(s);for(var a in l)o[a]=l[a];return l},o}([function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(135),r=t(30);n.overrides={};var o=r.clone(i);n.Models=function(t){var e=n.overrides[t]||o[t];if(null==e)throw new Error("Model '"+t+"' does not exist. This could be due to a widget\n or a custom model not being registered before first usage.");return e},n.Models.register=function(t,e){n.overrides[t]=e},n.Models.unregister=function(t){delete n.overrides[t]},n.Models.register_models=function(t,e,n){if(void 0===e&&(e=!1),null!=t)for(var i in t){var r=t[i];e||!o.hasOwnProperty(i)?o[i]=r:null!=n?n(i):console.warn("Model '"+i+"' was already registered")}},n.register_models=n.Models.register_models,n.Models.registered_names=function(){return Object.keys(o)},n.index={}},function(t,e,n){"use strict";function i(t,e,n){var i,s=new r.Promise(function(r,s){return i=new c(t,e,n,function(t){try{r(t)}catch(e){throw o.logger.error("Promise handler threw an error, closing session "+e),t.close(),e}},function(){s(new Error("Connection was closed before we successfully pulled a session"))}),i.connect().then(function(t){},function(t){throw o.logger.error("Failed to connect to Bokeh server "+t),t})});return s}Object.defineProperty(n,"__esModule",{value:!0});var r=t(302),o=t(14),s=t(47),a=t(245),l=t(246),u=t(2);n.DEFAULT_SERVER_WEBSOCKET_URL="ws://localhost:5006/ws",n.DEFAULT_SESSION_ID="default";var h=0,c=function(){function t(t,e,i,r,s){void 0===t&&(t=n.DEFAULT_SERVER_WEBSOCKET_URL),void 0===e&&(e=n.DEFAULT_SESSION_ID),void 0===i&&(i=null),void 0===r&&(r=null),void 0===s&&(s=null),this.url=t,this.id=e,this.args_string=i,this._on_have_session_hook=r,this._on_closed_permanently_hook=s,this._number=h++,this.socket=null,this.session=null,this.closed_permanently=!1,this._current_handler=null,this._pending_ack=null,this._pending_replies={},this._receiver=new l.Receiver,o.logger.debug("Creating websocket "+this._number+" to '"+this.url+"' session '"+this.id+"'")}return t.prototype.connect=function(){var t=this;if(this.closed_permanently)return r.Promise.reject(new Error("Cannot connect() a closed ClientConnection"));if(null!=this.socket)return r.Promise.reject(new Error("Already connected"));this._pending_replies={},this._current_handler=null;try{var e=this.url+"?bokeh-protocol-version=1.0&bokeh-session-id="+this.id;return null!=this.args_string&&this.args_string.length>0&&(e+="&"+this.args_string),this.socket=new WebSocket(e),new r.Promise(function(e,n){t.socket.binaryType="arraybuffer",t.socket.onopen=function(){return t._on_open(e,n)},t.socket.onmessage=function(e){return t._on_message(e)},t.socket.onclose=function(e){return t._on_close(e)},t.socket.onerror=function(){return t._on_error(n)}})}catch(n){return o.logger.error("websocket creation failed to url: "+this.url),o.logger.error(" - "+n),r.Promise.reject(n)}},t.prototype.close=function(){this.closed_permanently||(o.logger.debug("Permanently closing websocket connection "+this._number),this.closed_permanently=!0,null!=this.socket&&this.socket.close(1e3,"close method called on ClientConnection "+this._number),this.session._connection_closed(),null!=this._on_closed_permanently_hook&&(this._on_closed_permanently_hook(),this._on_closed_permanently_hook=null))},t.prototype._schedule_reconnect=function(t){var e=this,n=function(){e.closed_permanently||o.logger.info("Websocket connection "+e._number+" disconnected, will not attempt to reconnect")};setTimeout(n,t)},t.prototype.send=function(t){if(null==this.socket)throw new Error("not connected so cannot send "+t);t.send(this.socket)},t.prototype.send_with_reply=function(t){var e=this,n=new r.Promise(function(n,i){e._pending_replies[t.msgid()]=[n,i],e.send(t)});return n.then(function(t){if("ERROR"===t.msgtype())throw new Error("Error reply "+t.content.text);return t},function(t){throw t})},t.prototype._pull_doc_json=function(){var t=a.Message.create("PULL-DOC-REQ",{}),e=this.send_with_reply(t);return e.then(function(t){if(!("doc"in t.content))throw new Error("No 'doc' field in PULL-DOC-REPLY");return t.content.doc},function(t){throw t})},t.prototype._repull_session_doc=function(){var t=this;null==this.session?o.logger.debug("Pulling session for first time"):o.logger.debug("Repulling session"),this._pull_doc_json().then(function(e){if(null==t.session)if(t.closed_permanently)o.logger.debug("Got new document after connection was already closed");else{var n=s.Document.from_json(e),i=s.Document._compute_patch_since_json(e,n);if(i.events.length>0){o.logger.debug("Sending "+i.events.length+" changes from model construction back to server");var r=a.Message.create("PATCH-DOC",{},i);t.send(r)}t.session=new u.ClientSession(t,n,t.id),o.logger.debug("Created a new session from new pulled doc"),null!=t._on_have_session_hook&&(t._on_have_session_hook(t.session),t._on_have_session_hook=null)}else t.session.document.replace_with_json(e),o.logger.debug("Updated existing session with new pulled doc")},function(t){throw t})["catch"](function(t){null!=console.trace&&console.trace(t),o.logger.error("Failed to repull session "+t)})},t.prototype._on_open=function(t,e){var n=this;o.logger.info("Websocket connection "+this._number+" is now open"),this._pending_ack=[t,e],this._current_handler=function(t){n._awaiting_ack_handler(t)}},t.prototype._on_message=function(t){null==this._current_handler&&o.logger.error("Got a message with no current handler set");try{this._receiver.consume(t.data)}catch(e){this._close_bad_protocol(e.toString())}if(null!=this._receiver.message){var n=this._receiver.message,i=n.problem();null!=i&&this._close_bad_protocol(i),this._current_handler(n)}},t.prototype._on_close=function(t){var e=this;o.logger.info("Lost websocket "+this._number+" connection, "+t.code+" ("+t.reason+")"),this.socket=null,null!=this._pending_ack&&(this._pending_ack[1](new Error("Lost websocket connection, "+t.code+" ("+t.reason+")")),this._pending_ack=null);for(var n=function(){for(var t in e._pending_replies){var n=e._pending_replies[t];return delete e._pending_replies[t],n}return null},i=n();null!=i;)i[1]("Disconnected"),i=n();this.closed_permanently||this._schedule_reconnect(2e3)},t.prototype._on_error=function(t){o.logger.debug("Websocket error on socket "+this._number),t(new Error("Could not open websocket"))},t.prototype._close_bad_protocol=function(t){o.logger.error("Closing connection: "+t),null!=this.socket&&this.socket.close(1002,t)},t.prototype._awaiting_ack_handler=function(t){var e=this;"ACK"===t.msgtype()?(this._current_handler=function(t){return e._steady_state_handler(t)},this._repull_session_doc(),null!=this._pending_ack&&(this._pending_ack[0](this),this._pending_ack=null)):this._close_bad_protocol("First message was not an ACK")},t.prototype._steady_state_handler=function(t){if(t.reqid()in this._pending_replies){var e=this._pending_replies[t.reqid()];delete this._pending_replies[t.reqid()],e[0](t)}else this.session.handle(t)},t}();n.ClientConnection=c,n.pull_session=i},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(14),r=t(47),o=t(245),s=function(){function t(t,e,n){var i=this;this._connection=t,this.document=e,this.id=n,this._document_listener=function(t){return i._document_changed(t)},this.document.on_change(this._document_listener),this.event_manager=this.document.event_manager,this.event_manager.session=this}return t.prototype.handle=function(t){var e=t.msgtype();"PATCH-DOC"===e?this._handle_patch(t):"OK"===e?this._handle_ok(t):"ERROR"===e?this._handle_error(t):i.logger.debug("Doing nothing with message "+t.msgtype())},t.prototype.close=function(){this._connection.close()},t.prototype.send_event=function(t){var e=o.Message.create("EVENT",{},JSON.stringify(t));this._connection.send(e)},t.prototype._connection_closed=function(){this.document.remove_on_change(this._document_listener)},t.prototype.request_server_info=function(){var t=o.Message.create("SERVER-INFO-REQ",{}),e=this._connection.send_with_reply(t);return e.then(function(t){return t.content})},t.prototype.force_roundtrip=function(){return this.request_server_info().then(function(t){})},t.prototype._document_changed=function(t){if(t.setter_id!==this.id&&(!(t instanceof r.ModelChangedEvent)||t.attr in t.model.serializable_attributes())){var e=o.Message.create("PATCH-DOC",{},this.document.create_json_patch([t]));this._connection.send(e)}},t.prototype._handle_patch=function(t){this.document.apply_json_patch(t.content,t.buffers,this.id)},t.prototype._handle_ok=function(t){i.logger.trace("Unhandled OK reply to "+t.reqid())},t.prototype._handle_error=function(t){i.logger.error("Unhandled ERROR reply to "+t.reqid()+": "+t.content.text)},t}();n.ClientSession=s},function(t,e,n){"use strict";function i(t){return function(e){e.prototype.event_name=t,l[t]=e}}function r(t){for(var e=[],n=1;nu;a=0<=u?++l:--l)this.properties[i[a]].change.emit(s[i[a]]);if(r)return this;if(!h&&!e.no_change)for(;this._pending;)this._pending=!1,this.change.emit();return this._pending=!1,this._changing=!1,this},t.prototype.setv=function(t,e,n){var r,o,s,a,l;_.isObject(t)||null===t?(r=t,n=e):(r={},r[t]=e),null==n&&(n={});for(t in r)if(i.call(r,t)){if(l=r[t],s=t,null==this.props[s])throw new Error("property "+this.type+"."+s+" wasn't declared");null!=n&&n.defaults||(this._set_after_defaults[t]=!0)}if(!c.isEmpty(r)){o={};for(t in r)e=r[t],o[t]=this.getv(t);if(this._setv(r,n),null==(null!=n?n.silent:void 0)){a=[];for(t in r)e=r[t],a.push(this._tell_document_about_change(t,o[t],this.getv(t),n));return a}}},t.prototype.set=function(t,e,n){return r.logger.warn("HasProps.set('prop_name', value) is deprecated, use HasProps.prop_name = value instead"),this.setv(t,e,n)},t.prototype.get=function(t){return r.logger.warn("HasProps.get('prop_name') is deprecated, use HasProps.prop_name instead"),this.getv(t)},t.prototype.getv=function(t){if(null==this.props[t])throw new Error("property "+this.type+"."+t+" wasn't declared");return this.attributes[t]},t.prototype.ref=function(){return a.create_ref(this)},t.prototype.set_subtype=function(t){return this._subtype=t},t.prototype.attribute_is_serializable=function(t){var e;if(e=this.props[t],null==e)throw new Error(this.type+".attribute_is_serializable('"+t+"'): "+t+" wasn't declared");return!e.internal},t.prototype.serializable_attributes=function(){var t,e,n,i;t={},n=this.attributes;for(e in n)i=n[e],this.attribute_is_serializable(e)&&(t[e]=i);return t},t._value_to_json=function(e,n,r){var o,s,a,l,u,h,c;if(n instanceof t)return n.ref();if(_.isArray(n)){for(l=[],o=s=0,a=n.length;sa;r=0<=a?++s:--s)u=n[r],c=i[r],hi&&(s=[i,n],n=s[0],i=s[1]),r>o&&(a=[o,r],r=a[0],o=a[1]),{minX:n,minY:r,maxX:i,maxY:o};var s,a},r=function(t){return t*t},n.dist_2_pts=function(t,e,n,i){return r(t-n)+r(e-i)},n.dist_to_segment_squared=function(t,e,i){var r,o;return r=n.dist_2_pts(e.x,e.y,i.x,i.y),0===r?n.dist_2_pts(t.x,t.y,e.x,e.y):(o=((t.x-e.x)*(i.x-e.x)+(t.y-e.y)*(i.y-e.y))/r,o<0?n.dist_2_pts(t.x,t.y,e.x,e.y):o>1?n.dist_2_pts(t.x,t.y,i.x,i.y):n.dist_2_pts(t.x,t.y,e.x+o*(i.x-e.x),e.y+o*(i.y-e.y)))},n.dist_to_segment=function(t,e,i){return Math.sqrt(n.dist_to_segment_squared(t,e,i))},n.check_2_segments_intersect=function(t,e,n,i,r,o,s,a){var l,u,h,c,_,p,d;return h=(a-o)*(n-t)-(s-r)*(i-e),0===h?{hit:!1,x:null,y:null}:(l=e-o,u=t-r,c=(s-r)*l-(a-o)*u,_=(n-t)*l-(i-e)*u,l=c/h,u=_/h,p=t+l*(n-t),d=e+l*(i-e),{hit:l>0&&l<1&&u>0&&u<1,x:p,y:d})}},function(t,e,n){"use strict";function i(t,e){var n=[];if(e.length>0){n.push(o.EQ(s.head(e)._bottom,[-1,t._bottom])),n.push(o.EQ(s.tail(e)._top,[-1,t._top])),n.push.apply(n,s.pairwise(e,function(t,e){return o.EQ(t._top,[-1,e._bottom])}));for(var i=0,r=e;i0){n.push(o.EQ(s.head(e)._right,[-1,t._right])),n.push(o.EQ(s.tail(e)._left,[-1,t._left])),n.push.apply(n,s.pairwise(e,function(t,e){return o.EQ(t._left,[-1,e._right])}));for(var i=0,r=e;i0&&(i="middle",n=p[r]),t.textBaseline=i,t.textAlign=n,t},e.prototype.get_label_angle_heuristic=function(t){var e;return e=this.side,d[e][t]},e}(y.LayoutCanvas);n.SidePanel=k,k.prototype.type="SidePanel",k.internal({side:[b.String]}),k.getters({is_horizontal:function(){return"above"===this.side||"below"===this.side},is_vertical:function(){return"left"===this.side||"right"===this.side}})},function(t,e,n){"use strict";function i(t){return function(){for(var e=[],n=0;n0){var i=s[e];return null==i&&(s[e]=i=new t(e,n)),i}throw new TypeError("Logger.get() expects a non-empty string name and an optional log-level")},Object.defineProperty(t.prototype,"level",{get:function(){return this.get_level()},enumerable:!0,configurable:!0}),t.prototype.get_level=function(){return this._log_level},t.prototype.set_level=function(e){if(e instanceof a)this._log_level=e;else{if(!o.isString(e)||null==t.log_levels[e])throw new Error("Logger.set_level() expects a log-level object or a string name of a log-level");this._log_level=t.log_levels[e]}var n="["+this._name+"]";for(var r in t.log_levels){var s=t.log_levels[r];s.levele;n=0<=e?++t:--t)r.push(o);return r}());return null!=this.spec.transform&&(r=this.spec.transform.v_compute(r)),r},t.prototype._init=function(){var t,e,n,i;if(i=this.obj,null==i)throw new Error("missing property object");if(null==i.properties)throw new Error("property object must be a HasProps");if(t=this.attr,null==t)throw new Error("missing property attr");if(e=i.getv(t),void 0===e&&(n=this.default_value,e=function(){switch(!1){case void 0!==n:return null;case!_.isArray(n):return h.copy(n);case!_.isFunction(n):return n(i);default:return n}}(),i.setv(t,e,{silent:!0,defaults:!0})),_.isArray(e)?this.spec={value:e}:_.isObject(e)&&(void 0===e.value?0:1)+(void 0===e.field?0:1)+(void 0===e.expr?0:1)===1?this.spec=e:this.spec={value:e},null!=this.spec.field&&!_.isString(this.spec.field))throw new Error("field value for property '"+t+"' is not a string");return null!=this.spec.value&&this.validate(this.spec.value),this.init()},t.prototype.toString=function(){return this.name+"("+this.obj+"."+this.attr+", spec: "+i(this.spec)+")"},t}();n.Property=p,c.extend(p.prototype,s.Signalable),p.prototype.dataspec=!1,n.simple_prop=function(t,e){var n;return n=function(){var n=function(n){function o(){return null!==n&&n.apply(this,arguments)||this}return r.__extends(o,n),o.prototype.validate=function(n){if(!e(n))throw new Error(t+" property '"+this.attr+"' given invalid value: "+i(n))},o}(p);return n.prototype.name=t,n}()},n.Any=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.simple_prop("Any",function(t){return!0})),n.Array=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.simple_prop("Array",function(t){return _.isArray(t)||t instanceof Float64Array})),n.Bool=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.simple_prop("Bool",_.isBoolean)),n.Boolean=n.Bool,n.Color=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.simple_prop("Color",function(t){return null!=l[t.toLowerCase()]||"#"===t.substring(0,1)||u.valid_rgb(t)})),n.Instance=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.simple_prop("Instance",function(t){return null!=t.properties})),n.Number=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.simple_prop("Number",function(t){return _.isNumber(t)||_.isBoolean(t)})),n.Int=n.Number,n.Percent=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.simple_prop("Number",function(t){return(_.isNumber(t)||_.isBoolean(t))&&0<=t&&t<=1})),n.String=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.simple_prop("String",_.isString)),n.Font=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.String),n.enum_prop=function(t,e){var i;return i=function(){var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.simple_prop(t,function(t){return o.call(e,t)>=0}));return i.prototype.name=t,i}()},n.Anchor=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("Anchor",a.LegendLocation)),n.AngleUnits=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("AngleUnits",a.AngleUnits)),n.Direction=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.transform=function(t){var e,n,i,r;for(r=new Uint8Array(t.length),e=n=0,i=t.length;0<=i?ni;e=0<=i?++n:--n)switch(t[e]){case"clock":r[e]=!1;break;case"anticlock":r[e]=!0}return r},e}(n.enum_prop("Direction",a.Direction)),n.Dimension=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("Dimension",a.Dimension)),n.Dimensions=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("Dimensions",a.Dimensions)),n.FontStyle=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("FontStyle",a.FontStyle)),n.LatLon=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("LatLon",a.LatLon)),n.LineCap=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("LineCap",a.LineCap)),n.LineJoin=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("LineJoin",a.LineJoin)),n.LegendLocation=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("LegendLocation",a.LegendLocation)),n.Location=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("Location",a.Location)),n.OutputBackend=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("OutputBackend",a.OutputBackend)),n.Orientation=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("Orientation",a.Orientation)),n.VerticalAlign=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("VerticalAlign",a.VerticalAlign)),n.TextAlign=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("TextAlign",a.TextAlign)),n.TextBaseline=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("TextBaseline",a.TextBaseline)),n.RenderLevel=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("RenderLevel",a.RenderLevel)),n.RenderMode=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("RenderMode",a.RenderMode)),n.SizingMode=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("SizingMode",a.SizingMode)),n.SpatialUnits=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("SpatialUnits",a.SpatialUnits)),n.Distribution=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("Distribution",a.DistributionTypes)),n.StepMode=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("StepMode",a.StepModes)),n.PaddingUnits=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("PaddingUnits",a.PaddingUnits)),n.StartEnd=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(n.enum_prop("StartEnd",a.StartEnd)),n.units_prop=function(t,e,i){var s;return s=function(){var s=function(n){function s(){return null!==n&&n.apply(this,arguments)||this}return r.__extends(s,n),s.prototype.init=function(){var n;if(null==this.spec.units&&(this.spec.units=i),this.units=this.spec.units,n=this.spec.units,o.call(e,n)<0)throw new Error(t+" units must be one of "+e+", given invalid value: "+n)},s}(n.Number);return s.prototype.name=t,s}()},n.Angle=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.transform=function(e){var n;return"deg"===this.spec.units&&(e=function(){var t,i,r;for(r=[],t=0,i=e.length;t0)&&"pinch"===e?(o.logger.debug("Registering scroll on touch screen"),r.connect(this.scroll,function(t){if(t.id===n)return r._scroll(t.e)})):void 0},t.prototype._hit_test_renderers=function(t,e){var n,i,r,o;for(i=this.plot_view.get_renderer_views(),n=i.length-1;n>=0;n+=-1)if(o=i[n],("annotation"===(r=o.model.level)||"overlay"===r)&&null!=o.bbox&&o.bbox().contains(t,e))return o;return null},t.prototype._hit_test_frame=function(t,e){return this.plot_view.frame.bbox.contains(t,e)},t.prototype._trigger=function(t,e){var n,i,r,o,s,a,u,h,c,_,p;switch(a=t.name,o=a.split(":")[0],p=this._hit_test_renderers(e.bokeh.sx,e.bokeh.sy),o){case"move":for(i=this.toolbar.inspectors.filter(function(t){return t.active}),s="default",null!=p?(null!=p.model.cursor&&(s=p.model.cursor()),l.isEmpty(i)||(t=this.move_exit,a=t.name)):this._hit_test_frame(e.bokeh.sx,e.bokeh.sy)&&(l.isEmpty(i)||(s="crosshair")),this.plot_view.set_cursor(s),_=[],u=0,c=i.length;u0?"pinch":"scroll",n=this.toolbar.gestures[r].active,null!=n)return e.preventDefault(),e.stopPropagation(),this.trigger(t,e,n.id);break;default:if(n=this.toolbar.gestures[o].active,null!=n)return this.trigger(t,e,n.id)}},t.prototype.trigger=function(t,e,n){return void 0===n&&(n=null),t.emit({id:n,e:e})},t.prototype._event_sxy=function(t){var e,n;return i=s.offset(this.hit_area),e=i.left,n=i.top,{sx:t.pageX-e,sy:t.pageY-n};var i},t.prototype._bokify_hammer=function(t,e){void 0===e&&(e={});var n;return t.bokeh=l.extend(this._event_sxy(t.srcEvent),e),n=u.BokehEvent.event_class(t),null!=n?this.plot.trigger_event(n.from_event(t)):o.logger.debug("Unhandled event of type "+t.type)},t.prototype._bokify_point_event=function(t,e){void 0===e&&(e={});var n;return t.bokeh=l.extend(this._event_sxy(t),e),n=u.BokehEvent.event_class(t),null!=n?this.plot.trigger_event(n.from_event(t)):o.logger.debug("Unhandled event of type "+t.type)},t.prototype._tap=function(t){return this._bokify_hammer(t),this._trigger(this.tap,t)},t.prototype._doubletap=function(t){return this._bokify_hammer(t),this.trigger(this.doubletap,t)},t.prototype._press=function(t){return this._bokify_hammer(t),this._trigger(this.press,t)},t.prototype._pan_start=function(t){return this._bokify_hammer(t),t.bokeh.sx-=t.deltaX,t.bokeh.sy-=t.deltaY,this._trigger(this.pan_start,t)},t.prototype._pan=function(t){return this._bokify_hammer(t),this._trigger(this.pan,t)},t.prototype._pan_end=function(t){return this._bokify_hammer(t),this._trigger(this.pan_end,t)},t.prototype._pinch_start=function(t){return this._bokify_hammer(t),this._trigger(this.pinch_start,t)},t.prototype._pinch=function(t){return this._bokify_hammer(t),this._trigger(this.pinch,t)},t.prototype._pinch_end=function(t){return this._bokify_hammer(t),this._trigger(this.pinch_end,t)},t.prototype._rotate_start=function(t){return this._bokify_hammer(t),this._trigger(this.rotate_start,t)},t.prototype._rotate=function(t){return this._bokify_hammer(t),this._trigger(this.rotate,t)},t.prototype._rotate_end=function(t){return this._bokify_hammer(t),this._trigger(this.rotate_end,t)},t.prototype._mouse_enter=function(t){return this._bokify_point_event(t),this._trigger(this.move_enter,t)},t.prototype._mouse_move=function(t){return this._bokify_point_event(t),this._trigger(this.move,t)},t.prototype._mouse_exit=function(t){ -return this._bokify_point_event(t),this._trigger(this.move_exit,t)},t.prototype._mouse_wheel=function(t){return this._bokify_point_event(t,{delta:a.getDeltaY(t)}),this._trigger(this.scroll,t)},t.prototype._key_down=function(t){return this.trigger(this.keydown,t)},t.prototype._key_up=function(t){return this.trigger(this.keyup,t)},t}()},function(t,e,n){"use strict";function i(t){return t[0]}function r(t){return t[t.length-1]}function o(t){return t[t.length-1]}function s(t){return L.call(t)}function a(t){return(e=[]).concat.apply(e,t);var e}function l(t,e){return t.indexOf(e)!==-1}function u(t,e){return t[e>=0?e:t.length+e]}function h(t,e){for(var n=Math.min(t.length,e.length),i=new Array(n),r=0;rn&&(n=e);return n}function b(t,e){if(0==t.length)throw new Error("maxBy() called with an empty array");for(var n=t[0],i=e(n),r=1,o=t.length;ri&&(n=s,i=a)}return n}function x(t){return g(_(t.length),function(e){return t[e]})}function w(t){return b(_(t.length),function(e){return t[e]})}function k(t,e){for(var n=0,i=t;n0?0:i-1;r>=0&&ri||void 0===n)return 1;if(n=0&&h>=0))throw new Error("invalid bbox {x: "+a+", y: "+l+", width: "+u+", height: "+h+"}");this.x0=a,this.y0=l,this.x1=a+u,this.y1=l+h}}return Object.defineProperty(t.prototype,"minX",{get:function(){return this.x0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minY",{get:function(){return this.y0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxX",{get:function(){return this.x1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxY",{get:function(){return this.y1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this.x0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"p0",{get:function(){return[this.x0,this.y0]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"p1",{get:function(){return[this.x1,this.y1]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this.x0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.y0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.x1-this.x0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.y1-this.y0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"rect",{get:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"h_range",{get:function(){return{start:this.x0,end:this.x1}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"v_range",{get:function(){return{start:this.y0,end:this.y1}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ranges",{get:function(){return[this.h_range,this.v_range]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"aspect",{get:function(){return this.width/this.height},enumerable:!0,configurable:!0}),t.prototype.contains=function(t,e){return t>=this.x0&&t<=this.x1&&e>=this.y0&&e<=this.y1},t.prototype.clip=function(t,e){return tthis.x1&&(t=this.x1),ethis.y1&&(e=this.y1),[t,e]},t.prototype.union=function(e){return new t({x0:a(this.x0,e.x0),y0:a(this.y0,e.y0),x1:l(this.x1,e.x1),y1:l(this.y1,e.y1)})},t}();n.BBox=u},function(t,e,n){"use strict";function i(t,e){return setTimeout(t,e)}function r(t){return a(t)}function o(t,e,n){void 0===n&&(n={});var i,r,o,s=null,a=0,l=function(){a=n.leading===!1?0:Date.now(),s=null,o=t.apply(i,r),s||(i=r=null)};return function(){var u=Date.now();a||n.leading!==!1||(a=u);var h=e-(u-a);return i=this,r=arguments,h<=0||h>e?(s&&(clearTimeout(s),s=null),a=u,o=t.apply(i,r),s||(i=r=null)):s||n.trailing===!1||(s=setTimeout(l,h)),o}}function s(t){var e,n=!1;return function(){return n||(n=!0,e=t()),e}} -// (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors -// Underscore may be freely distributed under the MIT license. -Object.defineProperty(n,"__esModule",{value:!0}),n.delay=i;var a="function"==typeof requestAnimationFrame?requestAnimationFrame:setImmediate;n.defer=r,n.throttle=o,n.once=s},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r,o,s,a;o=function(t){if(t.setLineDash||(t.setLineDash=function(e){return t.mozDash=e,t.webkitLineDash=e}),!t.getLineDash)return t.getLineDash=function(){return t.mozDash}},s=function(t){return t.setLineDashOffset=function(e){return t.lineDashOffset=e,t.mozDashOffset=e,t.webkitLineDashOffset=e},t.getLineDashOffset=function(){return t.mozDashOffset}},r=function(t){return t.setImageSmoothingEnabled=function(e){return t.imageSmoothingEnabled=e,t.mozImageSmoothingEnabled=e,t.oImageSmoothingEnabled=e,t.webkitImageSmoothingEnabled=e,t.msImageSmoothingEnabled=e},t.getImageSmoothingEnabled=function(){var e;return null==(e=t.imageSmoothingEnabled)||e}},a=function(t){if(t.measureText&&null==t.html5MeasureText)return t.html5MeasureText=t.measureText,t.measureText=function(e){var n;return n=t.html5MeasureText(e),n.ascent=1.6*t.html5MeasureText("m").width,n}},i=function(t){var e;if(e=function(e,n,i,r,o,s,a,l){void 0===l&&(l=!1);var u,h,c;u=.551784,t.translate(e,n),t.rotate(o),h=i,c=r,l&&(h=-i,c=-r),t.moveTo(-h,0),t.bezierCurveTo(-h,c*u,-h*u,c,0,c),t.bezierCurveTo(h*u,c,h,c*u,h,0),t.bezierCurveTo(h,-c*u,h*u,-c,0,-c),t.bezierCurveTo(-h*u,-c,-h,-c*u,-h,0),t.rotate(-o),t.translate(-e,-n)},!t.ellipse)return t.ellipse=e},n.fixup_ctx=function(t){return o(t),s(t),r(t),a(t),i(t)},n.get_scale_ratio=function(t,e,n){var i,r;return"svg"===n?1:e?(r=window.devicePixelRatio||1,i=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1,r/i):1}},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r=[].indexOf,o=t(38);i=function(t){var e;return e=Number(t).toString(16),e=1===e.length?"0"+e:e},n.color2hex=function(t){var e,n,r,s;return t+="",0===t.indexOf("#")?t:null!=o[t]?o[t]:0===t.indexOf("rgb")?(r=t.replace(/^rgba?\(|\s+|\)$/g,"").split(","),e=function(){var t,e,n,o;for(n=r.slice(0,3),o=[],t=0,e=n.length;t=0)throw new Error("color expects rgb to have value between 0 and 255");return!0}},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(22),r=t(28),o=t(42),s=function(){function t(){this._dict={}}return t.prototype._existing=function(t){return t in this._dict?this._dict[t]:null},t.prototype.add_value=function(t,e){var n=this._existing(t);null==n?this._dict[t]=e:o.isArray(n)?n.push(e):this._dict[t]=[n,e]},t.prototype.remove_value=function(t,e){var n=this._existing(t);if(o.isArray(n)){var s=i.difference(n,[e]);s.length>0?this._dict[t]=s:delete this._dict[t]}else r.isEqual(n,e)&&delete this._dict[t]},t.prototype.get_one=function(t,e){var n=this._existing(t);if(o.isArray(n)){if(1===n.length)return n[0];throw new Error(e)}return n},t}();n.MultiDict=s;var a=function(){function t(e){null==e?this.values=[]:e instanceof t?this.values=i.copy(e.values):this.values=this._compact(e)}return t.prototype._compact=function(t){for(var e=[],n=0,i=t;n2*Math.PI;)t-=2*Math.PI;return t}function r(t,e){return Math.abs(i(t-e))}function o(t,e,n,o){var s=i(t),a=r(e,n),l=r(e,s)<=a&&r(s,n)<=a;return"anticlock"==o?l:!l}function s(){return Math.random()}function a(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))}function l(t,e){return Math.atan2(e[1]-t[1],e[0]-t[0])}function u(t,e){for(var n,i;;)if(n=s(),i=s(),i=(2*i-1)*Math.sqrt(2*(1/Math.E)),-4*n*n*Math.log(n)>=i*i)break;var r=i/n;return r=t+e*r}function h(t,e,n){return t>n?n:ti[e][0]&&t0?e["1d"].indices:e["2d"].indices.length>0?e["2d"].indices:[]}},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r,o,s,a,l,u=t(42);n.ARRAY_TYPES={float32:Float32Array,float64:Float64Array,uint8:Uint8Array,int8:Int8Array,uint16:Uint16Array,int16:Int16Array,uint32:Uint32Array,int32:Int32Array},n.DTYPES={};for(a in n.ARRAY_TYPES)l=n.ARRAY_TYPES[a],n.DTYPES[l.name]=a;r=new ArrayBuffer(2),s=new Uint8Array(r),o=new Uint16Array(r),s[0]=170,s[1]=187,i=48042===o[0]?"little":"big",n.BYTE_ORDER=i,n.swap16=function(t){var e,n,i,r,o;for(o=new Uint8Array(t.buffer,t.byteOffset,2*t.length),e=n=0,i=o.length;ns;i=0<=s?++r:--r)n[i]=e.charCodeAt(i);return n.buffer},n.decode_base64=function(t){var e,i,r,o;return i=n.base64ToArrayBuffer(t.__ndarray__),r=t.dtype,r in n.ARRAY_TYPES&&(e=new n.ARRAY_TYPES[r](i)),o=t.shape,[e,o]},n.encode_base64=function(t,e){var i,r,o;return i=n.arrayBufferToBase64(t.buffer),o=n.DTYPES[t.constructor.name],r={__ndarray__:i,shape:e,dtype:o}},n.decode_column_data=function(t,e){var i,r,o,s,h,c,_,p,d;h={},c={};for(a in t)if(l=t[a],u.isArray(l)){if(0===l.length||!u.isObject(l[0])&&!u.isArray(l[0])){h[a]=l;continue}for(r=[],d=[],o=0,s=l.length;oh;i=0<=h?++r:--r)(null!=(c=l[i])?c.buffer:void 0)instanceof ArrayBuffer?o.push(n.encode_base64(l[i],null!=e&&null!=(_=e[a])?_[i]:void 0)):o.push(l[i]);l=o}s[a]=l}return s}},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(361),o=function(){function t(){}return t}();n.SpatialIndex=o;var s=function(t){function e(e){var n=t.call(this)||this;return n.index=r(),n.index.load(e),n}return i.__extends(e,t),Object.defineProperty(e.prototype,"bbox",{get:function(){var t=this.index.toJSON(),e=t.minX,n=t.minY,i=t.maxX,r=t.maxY;return{minX:e,minY:n,maxX:i,maxY:r}},enumerable:!0,configurable:!0}),e.prototype.search=function(t){return this.index.search(t)},e.prototype.indices=function(t){for(var e=this.search(t),n=e.length,i=new Array(n),r=0;r"'`])/g,function(t){switch(t){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"`":return"`";default:return t}})}function a(t){return t.replace(/&(amp|lt|gt|quot|#x27|#x60);/g,function(t,e){switch(e){case"amp":return"&";case"lt":return"<";case"gt":return">";case"quot":return'"';case"#x27":return"'";case"#x60":return"`";default:return e}})}Object.defineProperty(n,"__esModule",{value:!0});var l=t(19);n.startsWith=i,n.uuid4=r;var u=1e3;n.uniqueId=o,n.escape=s,n.unescape=a},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.indianred="#CD5C5C",n.lightcoral="#F08080",n.salmon="#FA8072",n.darksalmon="#E9967A",n.lightsalmon="#FFA07A",n.crimson="#DC143C",n.red="#FF0000",n.firebrick="#B22222",n.darkred="#8B0000",n.pink="#FFC0CB",n.lightpink="#FFB6C1",n.hotpink="#FF69B4",n.deeppink="#FF1493",n.mediumvioletred="#C71585",n.palevioletred="#DB7093",n.coral="#FF7F50",n.tomato="#FF6347",n.orangered="#FF4500",n.darkorange="#FF8C00",n.orange="#FFA500",n.gold="#FFD700",n.yellow="#FFFF00",n.lightyellow="#FFFFE0",n.lemonchiffon="#FFFACD",n.lightgoldenrodyellow="#FAFAD2",n.papayawhip="#FFEFD5",n.moccasin="#FFE4B5",n.peachpuff="#FFDAB9",n.palegoldenrod="#EEE8AA",n.khaki="#F0E68C",n.darkkhaki="#BDB76B",n.lavender="#E6E6FA",n.thistle="#D8BFD8",n.plum="#DDA0DD",n.violet="#EE82EE",n.orchid="#DA70D6",n.fuchsia="#FF00FF",n.magenta="#FF00FF",n.mediumorchid="#BA55D3",n.mediumpurple="#9370DB",n.blueviolet="#8A2BE2",n.darkviolet="#9400D3",n.darkorchid="#9932CC",n.darkmagenta="#8B008B",n.purple="#800080",n.indigo="#4B0082",n.slateblue="#6A5ACD",n.darkslateblue="#483D8B",n.mediumslateblue="#7B68EE",n.greenyellow="#ADFF2F",n.chartreuse="#7FFF00",n.lawngreen="#7CFC00",n.lime="#00FF00",n.limegreen="#32CD32",n.palegreen="#98FB98",n.lightgreen="#90EE90",n.mediumspringgreen="#00FA9A",n.springgreen="#00FF7F",n.mediumseagreen="#3CB371",n.seagreen="#2E8B57",n.forestgreen="#228B22",n.green="#008000",n.darkgreen="#006400",n.yellowgreen="#9ACD32",n.olivedrab="#6B8E23",n.olive="#808000",n.darkolivegreen="#556B2F",n.mediumaquamarine="#66CDAA",n.darkseagreen="#8FBC8F",n.lightseagreen="#20B2AA",n.darkcyan="#008B8B",n.teal="#008080",n.aqua="#00FFFF",n.cyan="#00FFFF",n.lightcyan="#E0FFFF",n.paleturquoise="#AFEEEE",n.aquamarine="#7FFFD4",n.turquoise="#40E0D0",n.mediumturquoise="#48D1CC",n.darkturquoise="#00CED1",n.cadetblue="#5F9EA0",n.steelblue="#4682B4",n.lightsteelblue="#B0C4DE",n.powderblue="#B0E0E6",n.lightblue="#ADD8E6",n.skyblue="#87CEEB",n.lightskyblue="#87CEFA",n.deepskyblue="#00BFFF",n.dodgerblue="#1E90FF",n.cornflowerblue="#6495ED",n.royalblue="#4169E1",n.blue="#0000FF",n.mediumblue="#0000CD",n.darkblue="#00008B",n.navy="#000080",n.midnightblue="#191970",n.cornsilk="#FFF8DC",n.blanchedalmond="#FFEBCD",n.bisque="#FFE4C4",n.navajowhite="#FFDEAD",n.wheat="#F5DEB3",n.burlywood="#DEB887",n.tan="#D2B48C",n.rosybrown="#BC8F8F",n.sandybrown="#F4A460",n.goldenrod="#DAA520",n.darkgoldenrod="#B8860B",n.peru="#CD853F",n.chocolate="#D2691E",n.saddlebrown="#8B4513",n.sienna="#A0522D",n.brown="#A52A2A",n.maroon="#800000",n.white="#FFFFFF",n.snow="#FFFAFA",n.honeydew="#F0FFF0",n.mintcream="#F5FFFA",n.azure="#F0FFFF",n.aliceblue="#F0F8FF",n.ghostwhite="#F8F8FF",n.whitesmoke="#F5F5F5",n.seashell="#FFF5EE",n.beige="#F5F5DC",n.oldlace="#FDF5E6",n.floralwhite="#FFFAF0",n.ivory="#FFFFF0",n.antiquewhite="#FAEBD7",n.linen="#FAF0E6",n.lavenderblush="#FFF0F5",n.mistyrose="#FFE4E1",n.gainsboro="#DCDCDC",n.lightgray="#D3D3D3",n.lightgrey="#D3D3D3",n.silver="#C0C0C0",n.darkgray="#A9A9A9",n.darkgrey="#A9A9A9",n.gray="#808080",n.grey="#808080",n.dimgray="#696969",n.dimgrey="#696969",n.lightslategray="#778899",n.lightslategrey="#778899",n.slategray="#708090",n.slategrey="#708090",n.darkslategray="#2F4F4F",n.darkslategrey="#2F4F4F",n.black="#000000"},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r=t(362),o=t(332),s=t(363),a=t(37),l=t(42);i=function(t){var e;return l.isNumber(t)?(e=function(){switch(!1){case Math.floor(t)!==t:return"%d";case!(Math.abs(t)>.1&&Math.abs(t)<1e3):return"%0.3f";default:return"%0.3e"}}(),r.sprintf(e,t)):""+t},n.replace_placeholders=function(t,e,n,l,u){return void 0===u&&(u={}),t=t.replace(/(^|[^\$])\$(\w+)/g,function(t,e,n){return e+"@$"+n}),t=t.replace(/(^|[^@])@(?:(\$?\w+)|{([^{}]+)})(?:{([^{}]+)})?/g,function(t,h,c,_,p){var d,f,m;if(c=null!=_?_:c,m="$"===c[0]?u[c.substring(1)]:null!=(d=e.get_column(c))?d[n]:void 0,f=null,null==m)f="???";else{if("safe"===p)return""+h+m;if(null!=p)if(null!=l&&c in l)if("numeral"===l[c])f=o.format(m,p);else if("datetime"===l[c])f=s(m,p);else{if("printf"!==l[c])throw new Error("Unknown tooltip field formatter type '"+l[c]+"'");f=r.sprintf(p,m)}else f=o.format(m,p);else f=i(m)}return f=""+h+a.escape(f)})}},function(t,e,n){"use strict";function i(t){if(null!=o[t])return o[t];var e=r.span({style:{font:t}},"Hg"),n=r.div({style:{display:"inline-block",width:"1px",height:"0px"}}),i=r.div({},e,n);document.body.appendChild(i);try{n.style.verticalAlign="baseline";var s=r.offset(n).top-r.offset(e).top;n.style.verticalAlign="bottom";var a=r.offset(n).top-r.offset(e).top,l={height:a,ascent:s,descent:a-s};return o[t]=l,l}finally{document.body.removeChild(i)}}Object.defineProperty(n,"__esModule",{value:!0});var r=t(5),o={};n.get_text_height=i},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r;i=function(t){return t()},r=("undefined"!=typeof window&&null!==window?window.requestAnimationFrame:void 0)||("undefined"!=typeof window&&null!==window?window.mozRequestAnimationFrame:void 0)||("undefined"!=typeof window&&null!==window?window.webkitRequestAnimationFrame:void 0)||("undefined"!=typeof window&&null!==window?window.msRequestAnimationFrame:void 0)||i,n.throttle=function(t,e){var n,i,o,s,a,l,u;return h=[null,null,null,null],i=h[0],n=h[1],u=h[2],l=h[3],a=0,s=!1,o=function(){return a=new Date,u=null,s=!1,l=t.apply(i,n)},function(){var t,h;return t=new Date,h=e-(t-a),i=this,n=arguments,h<=0&&!s?(clearTimeout(u),s=!0,r(o)):u||s||(u=setTimeout(function(){return r(o)},h)),l};var h}},function(t,e,n){"use strict";function i(t){return t===!0||t===!1||"[object Boolean]"===c.call(t)}function r(t){return"[object Number]"===c.call(t)}function o(t){return r(t)&&isFinite(t)&&Math.floor(t)===t}function s(t){return"[object String]"===c.call(t)}function a(t){return r(t)&&t!==+t}function l(t){return"[object Function]"===c.call(t)}function u(t){return Array.isArray(t)}function h(t){var e=typeof t;return"function"===e||"object"===e&&!!t} -// (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors -// Underscore may be freely distributed under the MIT license. -Object.defineProperty(n,"__esModule",{value:!0});var c=Object.prototype.toString;n.isBoolean=i,n.isNumber=r,n.isInteger=o,n.isString=s,n.isStrictNaN=a,n.isFunction=l,n.isArray=u,n.isObject=h},function(t,e,n){"use strict";function i(t){var e=getComputedStyle(t).fontSize;return null!=e?parseInt(e,10):null}function r(t){var e=t.offsetParent||document.body;return i(e)||i(t)||16}function o(t){return t.clientHeight}function s(t){var e=-t.deltaY;if(t.target instanceof HTMLElement)switch(t.deltaMode){case t.DOM_DELTA_LINE:e*=r(t.target);break;case t.DOM_DELTA_PAGE:e*=o(t.target)}return e}/*! - * jQuery Mousewheel 3.1.13 - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license - * http://jquery.org/license - */ -Object.defineProperty(n,"__esModule",{value:!0}),n.getDeltaY=s},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(29);n.scale_highlow=function(t,e,n){void 0===n&&(n=null);var i,r,o,s,a;return l=[t.start,t.end],r=l[0],i=l[1],o=null!=n?n:(i+r)/2,s=r-(r-o)*e,a=i-(i-o)*e,[s,a];var l},n.get_info=function(t,e){var n,i,r,o,s,a=e[0],l=e[1];i={};for(r in t)o=t[r],u=o.r_invert(a,l),s=u[0],n=u[1],i[r]={start:s,end:n};return i;var u},n.scale_range=function(t,e,r,o,s){void 0===r&&(r=!0),void 0===o&&(o=!0),void 0===s&&(s=null);var a,l,u,h,c,_,p,d;return e=i.clamp(e,-.9,.9),a=r?e:0,f=n.scale_highlow(t.bbox.h_range,a,null!=s?s.x:void 0),l=f[0],u=f[1],p=n.get_info(t.xscales,[l,u]),_=o?e:0,m=n.scale_highlow(t.bbox.v_range,_,null!=s?s.y:void 0),h=m[0],c=m[1],d=n.get_info(t.yscales,[h,c]),{xrs:p,yrs:d,factor:e};var f,m}},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(20),r=t(37),o=t(30),s=function(){function t(t){void 0===t&&(t={});var e;if(this.removed=new i.Signal(this,"removed"),null==t.model)throw new Error("model of a view wasn't configured");this.model=t.model,this._parent=t.parent,this.id=null!=(e=t.id)?e:r.uniqueId(),this.initialize(t),t.connect_signals!==!1&&this.connect_signals()}return t.getters=function(t){var e,n,i;i=[];for(n in t)e=t[n],i.push(Object.defineProperty(this.prototype,n,{get:e}));return i},t.prototype.initialize=function(t){},t.prototype.remove=function(){return this._parent=void 0,this.disconnect_signals(),this.removed.emit()},t.prototype.toString=function(){return this.model.type+"View("+this.id+")"},t.prototype.connect_signals=function(){},t.prototype.disconnect_signals=function(){return i.Signal.disconnectReceiver(this)},t}();n.View=s,o.extend(s.prototype,i.Signalable),s.getters({parent:function(){if(void 0!==this._parent)return this._parent;throw new Error("parent of a view wasn't configured")},is_root:function(){return null===this.parent},root:function(){return this.is_root?this:this.parent.root}})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r=t(364),o={}.hasOwnProperty,s=t(16),a=t(26);i=function(){function t(t,e){void 0===e&&(e="");var n,i,r,o,s;for(this.obj=t,this.prefix=e,this.cache={},i=t.properties[e+this.do_attr].spec,this.doit=null!==i.value,s=this.attrs,r=0,o=s.length;r0;)t.push(this.remove_root(this._roots[0]));return t}finally{this._pop_all_models_freeze()}},t.prototype.interactive_start=function(t){return null===this._interactive_plot&&(this._interactive_plot=t,this._interactive_plot.trigger_event(new l.LODStart({}))),this._interactive_timestamp=Date.now()},t.prototype.interactive_stop=function(t){var e;return(null!=(e=this._interactive_plot)?e.id:void 0)===t.id&&this._interactive_plot.trigger_event(new l.LODEnd({})),this._interactive_plot=null,this._interactive_timestamp=null},t.prototype.interactive_duration=function(){return null===this._interactive_timestamp?-1:Date.now()-this._interactive_timestamp},t.prototype.destructively_move=function(t){var e,n,i,r,o,s,a,l,u;if(t===this)throw new Error("Attempted to overwrite a document with itself");for(t.clear(),u=[],l=this._roots,e=0,i=l.length;e=0)){this._push_all_models_freeze();try{this._roots.push(t)}finally{this._pop_all_models_freeze()}return this._trigger_on_change(new n.RootAddedEvent(this,t,e))}},t.prototype.remove_root=function(t,e){var i;if(i=this._roots.indexOf(t),!(i<0)){this._push_all_models_freeze();try{this._roots.splice(i,1)}finally{this._pop_all_models_freeze()}return this._trigger_on_change(new n.RootRemovedEvent(this,t,e))}},t.prototype.title=function(){return this._title},t.prototype.set_title=function(t,e){if(t!==this._title)return this._title=t,this._trigger_on_change(new n.TitleChangedEvent(this,t,e))},t.prototype.get_model_by_id=function(t){return t in this._all_models?this._all_models[t]:null},t.prototype.get_model_by_name=function(t){return this._all_models_by_name.get_one(t,"Multiple models are named '"+t+"'")},t.prototype.on_change=function(t){if(!(r.call(this._callbacks,t)>=0))return this._callbacks.push(t)},t.prototype.remove_on_change=function(t){var e;if(e=this._callbacks.indexOf(t),e>=0)return this._callbacks.splice(e,1)},t.prototype._trigger_on_change=function(t){var e,n,i,r,o;for(r=this._callbacks,o=[],n=0,i=r.length;n0||d.difference(k,o).length>0)throw new Error("Not implemented: computing add/remove of document roots");T={},i=[],y=n._all_models;for(a in y)p=y[a],a in r&&(S=t._events_to_sync_objects(r[a],w[a],n,T),i=i.concat(S));return{events:i,references:t._references_json(f.values(T),l=!1)}},t.prototype.to_json_string=function(t){return void 0===t&&(t=!0),JSON.stringify(this.to_json(t))},t.prototype.to_json=function(e){void 0===e&&(e=!0);var n,i,r,o,s,a;for(s=[],o=this._roots,n=0,i=o.length;n0?t.consume(e.buffers[0].buffer):t.consume(e.content.data),e=t.message,null!=e)return this.apply_json_patch(e.content,e.buffers)},h=function(t,e,n){var i;if(t===n.target_name)return i=new x.Receiver,n.on_msg(s.bind(e,i))},a=function(t,e){var n,i,r,o,a,l;if("undefined"==typeof Jupyter||null===Jupyter||null==Jupyter.notebook.kernel)return console.warn("Jupyter notebooks comms not available. push_notebook() will not function");v.logger.info("Registering Jupyter comms for target "+t),n=Jupyter.notebook.kernel.comm_manager,l=function(n){return h(t,e,n)},a=n.comms;for(r in a)o=a[r],o.then(l);try{return n.register_target(t,function(n,i){var r;return v.logger.info("Registering Jupyter comms for target "+t),r=new x.Receiver,n.on_msg(s.bind(e,r))})}catch(u){return i=u,v.logger.warn("Jupyter comms failed to register. push_notebook() will not function. (exception reported: "+i+")")}},i=function(t){var e;return e=new t.default_view({model:t,parent:null}),f.index[t.id]=e,e},l=function(t,e,n){var r,o,s,a,l,u,h;h={},l=function(e){var n;return n=i(e),n.renderTo(t),h[e.id]=n},u=function(e){var n;if(e.id in h)return n=h[e.id],t.removeChild(n.el),delete h[e.id],delete f.index[e.id]},a=e.roots();for(r=0,o=a.length;r0&&v.set_log_level(n.bokehLogLevel),null!=n.bokehDocId&&n.bokehDocId.length>0&&(e.docid=n.bokehDocId),null!=n.bokehModelId&&n.bokehModelId.length>0&&(e.modelid=n.bokehModelId),null!=n.bokehSessionId&&n.bokehSessionId.length>0&&(e.sessionid=n.bokehSessionId),v.logger.info("Will inject Bokeh script tag with params "+JSON.stringify(e))},n.embed_items=function(t,e,n,i){return b.defer(function(){return r(t,e,n,i)})},r=function(t,e,i,r){var o,s,l,u,h,f,m,b,x,M,S,T,O,A,E;T="ws:","https:"===window.location.protocol&&(T="wss:"),null!=r?(M=document.createElement("a"),M.href=r):M=window.location,null!=i?"/"===i&&(i=""):i=M.pathname.replace(/\/+$/,""),E=T+"//"+M.host+i+"/ws",v.logger.debug("embed: computed ws url: "+E),w.isString(t)&&(t=JSON.parse(k.unescape(t))),u={};for(l in t)u[l]=g.Document.from_json(t[l]);for(O=[],m=0,x=e.length;m");if("SCRIPT"===h.tagName&&(d(h,b),s=y.div({"class":n.BOKEH_ROOT}),y.replaceWith(h,s),o=y.div(),s.appendChild(o),h=o),A=null!=b.use_for_title&&b.use_for_title,S=null,null!=b.modelid)if(null!=b.docid)p(h,b.modelid,u[b.docid]);else{if(null==b.sessionid)throw new Error("Error rendering Bokeh model "+b.modelid+" to element "+f+": no document ID or session ID specified");S=_(h,E,b.modelid,b.sessionid)}else if(null!=b.docid)n.add_document_static(h,u[b.docid],A);else{if(null==b.sessionid)throw new Error("Error rendering Bokeh document to element "+f+": no document ID or session ID specified");S=c(h,E,b.sessionid,A)}null!==S?O.push(S.then(function(t){return console.log("Bokeh items were rendered successfully")},function(t){return console.log("Error rendering Bokeh items ",t)})):O.push(void 0)}return O}},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),t(244);var i=t(248);n.version=i.version;var r=t(48);n.embed=r;var o=t(14);n.logger=o.logger,n.set_log_level=o.set_log_level;var s=t(19);n.settings=s.settings;var a=t(0);n.Models=a.Models,n.index=a.index;var l=t(47);n.documents=l.documents;var u=t(247);n.safely=u.safely},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(8),o=t(15),s=t(42),a=t(30),l=t(14),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.connect_signals=function(){var e,n,i,r,o,s,a;t.prototype.connect_signals.call(this),a=this.js_property_callbacks;for(r in a)for(n=a[r],l=r.split(":"),r=l[0],u=l[1],e=void 0===u?null:u,o=0,s=n.length;oi;e=0<=i?++n:--n)this.visuals.line.set_vectorize(t,e),t.beginPath(),t.moveTo(this.start[0][e],this.start[1][e]),t.lineTo(this.end[0][e],this.end[1][e]),r.push(t.stroke());return r}},e.prototype._arrow_head=function(t,e,n,i,r){var o,s,a,u,h;for(h=[],s=a=0,u=this._x_start.length;0<=u?au;s=0<=u?++a:--a)o=Math.PI/2+l.atan2([i[0][s],i[1][s]],[r[0][s],r[1][s]]),t.save(),t.translate(r[0][s],r[1][s]),t.rotate(o),"render"===e?n.render(t):"clip"===e&&n.clip(t),h.push(t.restore());return h},e}(r.AnnotationView);var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Annotation);n.Arrow=u,u.prototype.default_view=n.ArrowView,u.prototype.type="Arrow",u.mixins(["line"]),u.define({x_start:[a.NumberSpec],y_start:[a.NumberSpec],start_units:[a.String,"data"],start:[a.Instance,null],x_end:[a.NumberSpec],y_end:[a.NumberSpec],end_units:[a.String,"data"],end:[a.Instance,new o.OpenHead({})],source:[a.Instance],x_range_name:[a.String,"default"],y_range_name:[a.String,"default"]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(51),o=t(46),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.visuals=new o.Visuals(this)},e.prototype.render=function(t,e){return null},e.prototype.clip=function(t,e){return null},e}(r.Annotation);n.ArrowHead=a,a.prototype.type="ArrowHead";var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.clip=function(t,e){return this.visuals.line.set_vectorize(t,e),t.moveTo(.5*this.size,this.size),t.lineTo(.5*this.size,-2),t.lineTo(-.5*this.size,-2),t.lineTo(-.5*this.size,this.size),t.lineTo(0,0),t.lineTo(.5*this.size,this.size)},e.prototype.render=function(t,e){if(this.visuals.line.doit)return this.visuals.line.set_vectorize(t,e),t.beginPath(),t.moveTo(.5*this.size,this.size),t.lineTo(0,0),t.lineTo(-.5*this.size,this.size),t.stroke()},e}(a);n.OpenHead=l,l.prototype.type="OpenHead",l.mixins(["line"]),l.define({size:[s.Number,25]});var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.clip=function(t,e){return this.visuals.line.set_vectorize(t,e),t.moveTo(.5*this.size,this.size),t.lineTo(.5*this.size,-2),t.lineTo(-.5*this.size,-2),t.lineTo(-.5*this.size,this.size),t.lineTo(.5*this.size,this.size)},e.prototype.render=function(t,e){if(this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,e),this._normal(t,e),t.fill()),this.visuals.line.doit)return this.visuals.line.set_vectorize(t,e),this._normal(t,e),t.stroke()},e.prototype._normal=function(t,e){return t.beginPath(),t.moveTo(.5*this.size,this.size),t.lineTo(0,0),t.lineTo(-.5*this.size,this.size),t.closePath()},e}(a);n.NormalHead=u,u.prototype.type="NormalHead",u.mixins(["line","fill"]),u.define({size:[s.Number,25]}),u.override({fill_color:"black"});var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.clip=function(t,e){return this.visuals.line.set_vectorize(t,e),t.moveTo(.5*this.size,this.size),t.lineTo(.5*this.size,-2),t.lineTo(-.5*this.size,-2),t.lineTo(-.5*this.size,this.size),t.lineTo(0,.5*this.size),t.lineTo(.5*this.size,this.size)},e.prototype.render=function(t,e){if(this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,e),this._vee(t,e),t.fill()),this.visuals.line.doit)return this.visuals.line.set_vectorize(t,e),this._vee(t,e),t.stroke()},e.prototype._vee=function(t,e){return t.beginPath(),t.moveTo(.5*this.size,this.size),t.lineTo(0,0),t.lineTo(-.5*this.size,this.size),t.lineTo(0,.5*this.size),t.closePath()},e}(a);n.VeeHead=h,h.prototype.type="VeeHead",h.mixins(["line","fill"]),h.define({size:[s.Number,25]}),h.override({fill_color:"black"});var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.render=function(t,e){if(this.visuals.line.doit)return this.visuals.line.set_vectorize(t,e),t.beginPath(),t.moveTo(.5*this.size,0),t.lineTo(-.5*this.size,0),t.stroke()},e}(a);n.TeeHead=c,c.prototype.type="TeeHead",c.mixins(["line"]),c.define({size:[s.Number,25]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(51),o=t(173),s=t(15);n.BandView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.set_data(this.model.source)},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.source.streaming,function(){return this.set_data(this.model.source)}),this.connect(this.model.source.patching,function(){return this.set_data(this.model.source)}),this.connect(this.model.source.change,function(){return this.set_data(this.model.source)})},e.prototype.set_data=function(e){return t.prototype.set_data.call(this,e),this.visuals.warm_cache(e),this.plot_view.request_render()},e.prototype._map_data=function(){var t,e,n,i,r,o,s,a,l,u,h,c,_,p,d;return l=this.plot_view.frame,a=this.model.dimension,p=l.xscales[this.model.x_range_name],d=l.yscales[this.model.y_range_name],c="height"===a?d:p,o="height"===a?p:d,_="height"===a?l.yview:l.xview,s="height"===a?l.xview:l.yview,n="data"===this.model.lower.units?c.v_compute(this._lower):_.v_compute(this._lower),r="data"===this.model.upper.units?c.v_compute(this._upper):_.v_compute(this._upper),t="data"===this.model.base.units?o.v_compute(this._base):s.v_compute(this._base),f="height"===a?[1,0]:[0,1],u=f[0],h=f[1],e=[n,t],i=[r,t],this._lower_sx=e[u],this._lower_sy=e[h],this._upper_sx=i[u],this._upper_sy=i[h];var f},e.prototype.render=function(){var t,e,n,i,r,o,s,a,l,u;if(this.model.visible){for(this._map_data(),t=this.plot_view.canvas_view.ctx,t.beginPath(),t.moveTo(this._lower_sx[0],this._lower_sy[0]),e=n=0,s=this._lower_sx.length;0<=s?ns;e=0<=s?++n:--n)t.lineTo(this._lower_sx[e],this._lower_sy[e]);for(e=i=a=this._upper_sx.length-1;a<=0?i<=0:i>=0;e=a<=0?++i:--i)t.lineTo(this._upper_sx[e],this._upper_sy[e]);for(t.closePath(),this.visuals.fill.doit&&(this.visuals.fill.set_value(t),t.fill()),t.beginPath(),t.moveTo(this._lower_sx[0],this._lower_sy[0]),e=r=0,l=this._lower_sx.length;0<=l?rl;e=0<=l?++r:--r)t.lineTo(this._lower_sx[e],this._lower_sy[e]);for(this.visuals.line.doit&&(this.visuals.line.set_value(t),t.stroke()),t.beginPath(),t.moveTo(this._upper_sx[0],this._upper_sy[0]),e=o=0,u=this._upper_sx.length;0<=u?ou;e=0<=u?++o:--o)t.lineTo(this._upper_sx[e],this._upper_sy[e]);return this.visuals.line.doit?(this.visuals.line.set_value(t),t.stroke()):void 0}},e}(r.AnnotationView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Annotation);n.Band=a,a.prototype.default_view=n.BandView,a.prototype.type="Band",a.mixins(["line","fill"]),a.define({lower:[s.DistanceSpec],upper:[s.DistanceSpec],base:[s.DistanceSpec],dimension:[s.Dimension,"height"],source:[s.Instance,function(){return new o.ColumnDataSource}],x_range_name:[s.String,"default"],y_range_name:[s.String,"default"]}),a.override({fill_color:"#fff9ba",fill_alpha:.4,line_color:"#cccccc",line_alpha:.3})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(51),o=t(20),s=t(5),a=t(15),l=t(42);n.BoxAnnotationView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.plot_view.canvas_overlays.appendChild(this.el),this.el.classList.add("bk-shading"),s.hide(this.el)},e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),"css"===this.model.render_mode?(this.connect(this.model.change,function(){return this.render()}),this.connect(this.model.data_update,function(){return this.render()})):(this.connect(this.model.change,function(){return e.plot_view.request_render()}),this.connect(this.model.data_update,function(){return e.plot_view.request_render()}))},e.prototype.render=function(){var t,e,n,i,r,o,a,l,u,h=this;if(this.model.visible||"css"!==this.model.render_mode||s.hide(this.el),this.model.visible)return null==this.model.left&&null==this.model.right&&null==this.model.top&&null==this.model.bottom?(s.hide(this.el),null):(n=this.plot_model.frame,l=n.xscales[this.model.x_range_name],u=n.yscales[this.model.y_range_name],t=function(t,e,n,i,r){var o;return o=null!=t?h.model.screen?t:"data"===e?n.compute(t):i.compute(t):r},r=t(this.model.left,this.model.left_units,l,n.xview,n._left.value),o=t(this.model.right,this.model.right_units,l,n.xview,n._right.value),a=t(this.model.top,this.model.top_units,u,n.yview,n._top.value),i=t(this.model.bottom,this.model.bottom_units,u,n.yview,n._bottom.value),(e="css"===this.model.render_mode?this._css_box.bind(this):this._canvas_box.bind(this))(r,o,i,a))},e.prototype._css_box=function(t,e,n,i){var r,o,a;return a=Math.abs(e-t),o=Math.abs(n-i),this.el.style.left=t+"px",this.el.style.width=a+"px",this.el.style.top=i+"px",this.el.style.height=o+"px",this.el.style.borderWidth=this.model.line_width.value+"px",this.el.style.borderColor=this.model.line_color.value,this.el.style.backgroundColor=this.model.fill_color.value,this.el.style.opacity=this.model.fill_alpha.value,r=this.model.line_dash,l.isArray(r)&&(r=r.length<2?"solid":"dashed"),l.isString(r)&&(this.el.style.borderStyle=r),s.show(this.el)},e.prototype._canvas_box=function(t,e,n,i){var r;return r=this.plot_view.canvas_view.ctx,r.save(),r.beginPath(),r.rect(t,i,e-t,n-i),this.visuals.fill.set_value(r),r.fill(),this.visuals.line.set_value(r),r.stroke(),r.restore()},e}(r.AnnotationView);var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this.data_update=new o.Signal(this,"data_update")},e.prototype.update=function(t){var e=t.left,n=t.right,i=t.top,r=t.bottom;return this.setv({left:e,right:n,top:i,bottom:r,screen:!0},{silent:!0}),this.data_update.emit()},e}(r.Annotation);n.BoxAnnotation=u,u.prototype.default_view=n.BoxAnnotationView,u.prototype.type="BoxAnnotation",u.mixins(["line","fill"]),u.define({render_mode:[a.RenderMode,"canvas"],x_range_name:[a.String,"default"],y_range_name:[a.String,"default"],top:[a.Number,null],top_units:[a.SpatialUnits,"data"],bottom:[a.Number,null],bottom_units:[a.SpatialUnits,"data"],left:[a.Number,null],left_units:[a.SpatialUnits,"data"],right:[a.Number,null],right_units:[a.SpatialUnits,"data"]}),u.internal({screen:[a.Boolean,!1]}),u.override({fill_color:"#fff9ba",fill_alpha:.4,line_color:"#cccccc",line_alpha:.3})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r,o,s=t(364),a=t(51),l=t(180),u=t(91),h=t(146),c=t(168),_=t(169),p=t(160),d=t(15),f=t(40),m=t(22),v=t(30),g=t(42);o=25,r=.3,i=.8,n.ColorBarView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this._set_canvas_image()},e.prototype.connect_signals=function(){var e=this;if(t.prototype.connect_signals.call(this),this.connect(this.model.properties.visible.change,function(){return e.plot_view.request_render()}),this.connect(this.model.ticker.change,function(){return e.plot_view.request_render()}),this.connect(this.model.formatter.change,function(){return e.plot_view.request_render()}),null!=this.model.color_mapper)return this.connect(this.model.color_mapper.change,function(){return this._set_canvas_image(),this.plot_view.request_render()})},e.prototype._get_size=function(){var t,e;return null==this.model.color_mapper?0:(t=this.compute_legend_dimensions(),e=this.model.panel.side,"above"===e||"below"===e?t.height:"left"===e||"right"===e?t.width:void 0)},e.prototype._set_canvas_image=function(){var t,e,n,i,r,o,s,a,l,u;if(null!=this.model.color_mapper){switch(a=this.model.color_mapper.palette,"vertical"===this.model.orientation&&(a=a.slice(0).reverse()),this.model.orientation){case"vertical":c=[1,a.length],u=c[0],r=c[1];break;case"horizontal":_=[a.length,1],u=_[0],r=_[1]}return n=document.createElement("canvas"),p=[u,r],n.width=p[0],n.height=p[1],o=n.getContext("2d"),s=o.getImageData(0,0,u,r),i=new h.LinearColorMapper({palette:a}),t=i.v_map_screen(function(){l=[];for(var t=0,e=a.length;0<=e?te;0<=e?t++:t--)l.push(t);return l}.apply(this)),e=new Uint8Array(t),s.data.set(e),o.putImageData(s,0,0),this.image=n;var c,_,p}},e.prototype.compute_legend_dimensions=function(){var t,e,n,i,r,o,s,a,l;switch(t=this.model._computed_image_dimensions(),u=[t.height,t.width],e=u[0],n=u[1],i=this._get_label_extent(),l=this.model._title_extent(),a=this.model._tick_extent(),s=this.model.padding,this.model.orientation){case"vertical":r=e+l+2*s,o=n+a+i+2*s;break;case"horizontal":r=e+l+a+i+2*s,o=n+2*s}return{height:r,width:o};var u},e.prototype.compute_legend_location=function(){var t,e,n,i,r,o,s,a,l,u,h,c,_;if(e=this.compute_legend_dimensions(),p=[e.height,e.width],n=p[0],r=p[1],i=this.model.margin,s=null!=(a=this.model.panel)?a:this.plot_view.frame,d=s.bbox.ranges,t=d[0],h=d[1],o=this.model.location,g.isString(o))switch(o){case"top_left":l=t.start+i,u=h.start+i;break;case"top_center":l=(t.end+t.start)/2-r/2,u=h.start+i;break;case"top_right":l=t.end-i-r,u=h.start+i;break;case"bottom_right":l=t.end-i-r,u=h.end-i-n;break;case"bottom_center":l=(t.end+t.start)/2-r/2,u=h.end-i-n;break;case"bottom_left":l=t.start+i,u=h.end-i-n;break;case"center_left":l=t.start+i,u=(h.end+h.start)/2-n/2;break;case"center":l=(t.end+t.start)/2-r/2,u=(h.end+h.start)/2-n/2;break;case"center_right":l=t.end-i-r,u=(h.end+h.start)/2-n/2}else g.isArray(o)&&2===o.length&&(c=o[0],_=o[1],l=s.xview.compute(c),u=s.yview.compute(_)-n);return{sx:l,sy:u};var p,d},e.prototype.render=function(){var t,e,n,i,r;if(this.model.visible&&null!=this.model.color_mapper){return t=this.plot_view.canvas_view.ctx,t.save(),o=this.compute_legend_location(),n=o.sx,i=o.sy,t.translate(n,i),this._draw_bbox(t),e=this._get_image_offset(),t.translate(e.x,e.y),this._draw_image(t),null!=this.model.color_mapper.low&&null!=this.model.color_mapper.high&&(r=this.model.tick_info(),this._draw_major_ticks(t,r),this._draw_minor_ticks(t,r),this._draw_major_labels(t,r)),this.model.title&&this._draw_title(t),t.restore();var o}},e.prototype._draw_bbox=function(t){var e;return e=this.compute_legend_dimensions(),t.save(),this.visuals.background_fill.doit&&(this.visuals.background_fill.set_value(t),t.fillRect(0,0,e.width,e.height)),this.visuals.border_line.doit&&(this.visuals.border_line.set_value(t),t.strokeRect(0,0,e.width,e.height)),t.restore()},e.prototype._draw_image=function(t){var e;return e=this.model._computed_image_dimensions(),t.save(),t.setImageSmoothingEnabled(!1),t.globalAlpha=this.model.scale_alpha,t.drawImage(this.image,0,0,e.width,e.height),this.visuals.bar_line.doit&&(this.visuals.bar_line.set_value(t),t.strokeRect(0,0,e.width,e.height)),t.restore()},e.prototype._draw_major_ticks=function(t,e){var n,i,r,o,s,a,l,u,h,c,_,p;if(this.visuals.major_tick_line.doit){for(d=this.model._normals(),o=d[0],s=d[1],i=this.model._computed_image_dimensions(),f=[i.width*o,i.height*s],_=f[0],p=f[1],m=e.coords.major,l=m[0],u=m[1],h=this.model.major_tick_in,c=this.model.major_tick_out,t.save(),t.translate(_,p),this.visuals.major_tick_line.set_value(t),n=r=0,a=l.length;0<=a?ra;n=0<=a?++r:--r)t.beginPath(),t.moveTo(Math.round(l[n]+o*c),Math.round(u[n]+s*c)),t.lineTo(Math.round(l[n]-o*h),Math.round(u[n]-s*h)),t.stroke();return t.restore();var d,f,m}},e.prototype._draw_minor_ticks=function(t,e){var n,i,r,o,s,a,l,u,h,c,_,p;if(this.visuals.minor_tick_line.doit){for(d=this.model._normals(),o=d[0],s=d[1],i=this.model._computed_image_dimensions(),f=[i.width*o,i.height*s],_=f[0],p=f[1],m=e.coords.minor,l=m[0],u=m[1],h=this.model.minor_tick_in,c=this.model.minor_tick_out,t.save(),t.translate(_,p),this.visuals.minor_tick_line.set_value(t),n=r=0,a=l.length;0<=a?ra;n=0<=a?++r:--r)t.beginPath(),t.moveTo(Math.round(l[n]+o*c),Math.round(u[n]+s*c)),t.lineTo(Math.round(l[n]-o*h),Math.round(u[n]-s*h)),t.stroke();return t.restore();var d,f,m}},e.prototype._draw_major_labels=function(t,e){var n,i,r,o,s,a,l,u,h,c,_,p,d,f;if(this.visuals.major_label_text.doit){for(m=this.model._normals(),s=m[0],a=m[1],r=this.model._computed_image_dimensions(),v=[r.width*s,r.height*a],_=v[0],d=v[1],u=this.model.label_standoff+this.model._tick_extent(),g=[u*s,u*a],p=g[0],f=g[1],y=e.coords.major,h=y[0],c=y[1],n=e.labels.major,this.visuals.major_label_text.set_value(t),t.save(),t.translate(_+p,d+f),i=o=0,l=h.length;0<=l?ol;i=0<=l?++o:--o)t.fillText(n[i],Math.round(h[i]+s*this.model.label_standoff),Math.round(c[i]+a*this.model.label_standoff));return t.restore();var m,v,g,y}},e.prototype._draw_title=function(t){if(this.visuals.title_text.doit)return t.save(),this.visuals.title_text.set_value(t),t.fillText(this.model.title,0,-this.model.title_standoff),t.restore()},e.prototype._get_label_extent=function(){var t,e,n,i;if(i=this.model.tick_info().labels.major,null==this.model.color_mapper.low||null==this.model.color_mapper.high||v.isEmpty(i))n=0;else{switch(t=this.plot_view.canvas_view.ctx,t.save(),this.visuals.major_label_text.set_value(t),this.model.orientation){case"vertical":n=m.max(function(){var n,r,o;for(o=[],n=0,r=i.length;ns;i=0<=s?++r:--r)e[i]in this.major_label_overrides&&(n[i]=this.major_label_overrides[e[i]]);return n},e.prototype.tick_info=function(){var t,e,n,i,r,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y;switch(o=this._computed_image_dimensions(),this.orientation){case"vertical":v=o.height;break;case"horizontal":v=o.width}for(m=this._tick_coordinate_scale(v),b=this._normals(),i=b[0],s=b[1],x=[this.color_mapper.low,this.color_mapper.high],g=x[0],n=x[1],y=this.ticker.get_ticks(g,n,null,null,this.ticker.desired_num_ticks),e={major:[[],[]],minor:[[],[]]},c=y.major,p=y.minor,h=e.major,_=e.minor,r=a=0,d=c.length;0<=d?ad;r=0<=d?++a:--a)c[r]n||(h[i].push(c[r]),h[s].push(0));for(r=l=0,f=p.length;0<=f?lf;r=0<=f?++l:--l)p[r]n||(_[i].push(p[r]),_[s].push(0));return u={major:this._format_major_labels(h[i].slice(0),c)},h[i]=m.v_compute(h[i]),_[i]=m.v_compute(_[i]),"vertical"===this.orientation&&(h[i]=new Float64Array(function(){var e,n,r,o;for(r=h[i],o=[],n=0,e=r.length;nr;n=0<=r?++i:--i)this.title_div=s.div({"class":"bk-annotation-child",style:{display:"none"}}),o.push(this.el.appendChild(this.title_div));return o}},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),"css"===this.model.render_mode?(this.connect(this.model.change,function(){return this.set_data(this.model.source),this.render()}),this.connect(this.model.source.streaming,function(){return this.set_data(this.model.source),this.render()}),this.connect(this.model.source.patching,function(){return this.set_data(this.model.source),this.render()}),this.connect(this.model.source.change,function(){return this.set_data(this.model.source),this.render()})):(this.connect(this.model.change,function(){return this.set_data(this.model.source),this.plot_view.request_render()}),this.connect(this.model.source.streaming,function(){return this.set_data(this.model.source),this.plot_view.request_render()}),this.connect(this.model.source.patching,function(){return this.set_data(this.model.source),this.plot_view.request_render()}),this.connect(this.model.source.change,function(){return this.set_data(this.model.source),this.plot_view.request_render()}))},e.prototype.set_data=function(e){return t.prototype.set_data.call(this,e),this.visuals.warm_cache(e)},e.prototype._map_data=function(){var t,e,n,i,r,o;return r=this.plot_view.frame.xscales[this.model.x_range_name],o=this.plot_view.frame.yscales[this.model.y_range_name],t=null!=(e=this.model.panel)?e:this.plot_view.frame,n="data"===this.model.x_units?r.v_compute(this._x):t.xview.v_compute(this._x),i="data"===this.model.y_units?o.v_compute(this._y):t.yview.v_compute(this._y),[n,i]},e.prototype.render=function(){var t,e,n,i,r,o,a,l;if(this.model.visible||"css"!==this.model.render_mode||s.hide(this.el),this.model.visible){for(e="canvas"===this.model.render_mode?this._v_canvas_text.bind(this):this._v_css_text.bind(this),t=this.plot_view.canvas_view.ctx,u=this._map_data(),a=u[0],l=u[1],o=[],n=i=0,r=this._text.length;0<=r?ir;n=0<=r?++i:--i)o.push(e(t,n,this._text[n],a[n]+this._x_offset[n],l[n]-this._y_offset[n],this._angle[n]));return o;var u}},e.prototype._get_size=function(){var t,e,n,i;return t=this.plot_view.canvas_view.ctx,this.visuals.text.set_value(t),n=this.model.panel.side,"above"===n||"below"===n?e=t.measureText(this._text[0]).ascent:"left"===n||"right"===n?i=t.measureText(this._text[0]).width:void 0},e.prototype._v_canvas_text=function(t,e,n,i,r,o){var s;return this.visuals.text.set_vectorize(t,e),s=this._calculate_bounding_box_dimensions(t,n),t.save(),t.beginPath(),t.translate(i,r),t.rotate(o),t.rect(s[0],s[1],s[2],s[3]),this.visuals.background_fill.doit&&(this.visuals.background_fill.set_vectorize(t,e),t.fill()),this.visuals.border_line.doit&&(this.visuals.border_line.set_vectorize(t,e),t.stroke()),this.visuals.text.doit&&(this.visuals.text.set_vectorize(t,e),t.fillText(n,0,0)),t.restore()},e.prototype._v_css_text=function(t,e,n,i,r,o){var a,u,h,c;return u=this.el.childNodes[e],u.textContent=n,this.visuals.text.set_vectorize(t,e),a=this._calculate_bounding_box_dimensions(t,n),h=this.visuals.border_line.line_dash.value(),l.isArray(h)&&(c=h.length<2?"solid":"dashed"),l.isString(h)&&(c=h),this.visuals.border_line.set_vectorize(t,e),this.visuals.background_fill.set_vectorize(t,e),u.style.position="absolute",u.style.left=i+a[0]+"px",u.style.top=r+a[1]+"px",u.style.color=""+this.visuals.text.text_color.value(),u.style.opacity=""+this.visuals.text.text_alpha.value(),u.style.font=""+this.visuals.text.font_value(),u.style.lineHeight="normal",o&&(u.style.transform="rotate("+o+"rad)"),this.visuals.background_fill.doit&&(u.style.backgroundColor=""+this.visuals.background_fill.color_value()),this.visuals.border_line.doit&&(u.style.borderStyle=""+c,u.style.borderWidth=this.visuals.border_line.line_width.value()+"px",u.style.borderColor=""+this.visuals.border_line.color_value()),s.show(u)},e}(r.TextAnnotationView);var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.TextAnnotation);n.LabelSet=u,u.prototype.default_view=n.LabelSetView,u.prototype.type="Label",u.mixins(["text","line:border_","fill:background_"]),u.define({x:[a.NumberSpec],y:[a.NumberSpec],x_units:[a.SpatialUnits,"data"],y_units:[a.SpatialUnits,"data"],text:[a.StringSpec,{field:"text"}],angle:[a.AngleSpec,0],x_offset:[a.NumberSpec,{value:0}],y_offset:[a.NumberSpec,{value:0}],source:[a.Instance,function(){return new o.ColumnDataSource}],x_range_name:[a.String,"default"],y_range_name:[a.String,"default"],render_mode:[a.RenderMode,"canvas"]}),u.override({background_fill_color:null,border_line_color:null})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(51),o=t(15),s=t(40),a=t(23),l=t(22),u=t(30),h=t(42),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e)},e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),this.connect(this.model.properties.visible.change,function(){return e.plot_view.request_render()})},e.prototype.compute_legend_bbox=function(){var t,e,n,i,r,o,a,c,_,p,d,f,m,v,g,y,b,x,w,k,M,S,T,O,A,E,j;for(d=this.model.get_legend_names(),e=this.model.glyph_height,n=this.model.glyph_width,o=this.model.label_height,c=this.model.label_width,this.max_label_height=l.max([s.get_text_height(this.visuals.label_text.font_value()).height,o,e]),t=this.plot_view.canvas_view.ctx,t.save(),this.visuals.label_text.set_value(t),this.text_widths={},r=0,g=d.length;rr;n=0<=r?++i:--i)"screen"===this.model.xs_units&&(o=this.model.screen?a[n]:e.xview.compute(a[n])),"screen"===this.model.ys_units&&(s=this.model.screen?l[n]:e.yview.compute(l[n])),0===n?(t.beginPath(),t.moveTo(o,s)):t.lineTo(o,s);return t.closePath(),this.visuals.line.doit&&(this.visuals.line.set_value(t),t.stroke()),this.visuals.fill.doit?(this.visuals.fill.set_value(t),t.fill()):void 0}},e}(r.AnnotationView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this.data_update=new o.Signal(this,"data_update")},e.prototype.update=function(t){var e=t.xs,n=t.ys;return this.setv({xs:e,ys:n,screen:!0},{silent:!0}),this.data_update.emit()},e}(r.Annotation);n.PolyAnnotation=a,a.prototype.default_view=n.PolyAnnotationView,a.prototype.type="PolyAnnotation",a.mixins(["line","fill"]),a.define({xs:[s.Array,[]],xs_units:[s.SpatialUnits,"data"],ys:[s.Array,[]],ys_units:[s.SpatialUnits,"data"],x_range_name:[s.String,"default"],y_range_name:[s.String,"default"]}),a.internal({screen:[s.Boolean,!1]}),a.override({fill_color:"#fff9ba",fill_alpha:.4,line_color:"#cccccc",line_alpha:.3})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(51),o=t(5),s=t(15);n.SpanView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.plot_view.canvas_overlays.appendChild(this.el),this.el.style.position="absolute",o.hide(this.el)},e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),this.model.for_hover?this.connect(this.model.properties.computed_location.change,function(){return this._draw_span()}):"canvas"===this.model.render_mode?(this.connect(this.model.change,function(){return e.plot_view.request_render()}),this.connect(this.model.properties.location.change,function(){return e.plot_view.request_render()})):(this.connect(this.model.change,function(){return this.render()}),this.connect(this.model.properties.location.change,function(){return this._draw_span()}))},e.prototype.render=function(){if(this.model.visible||"css"!==this.model.render_mode||o.hide(this.el),this.model.visible)return this._draw_span()},e.prototype._draw_span=function(){var t,e,n,i,r,s,a,l,u,h,c=this;return r=this.model.for_hover?this.model.computed_location:this.model.location,null==r?void o.hide(this.el):(n=this.plot_view.frame,u=n.xscales[this.model.x_range_name],h=n.yscales[this.model.y_range_name],t=function(t,e){return c.model.for_hover?c.model.computed_location:"data"===c.model.location_units?t.compute(r):e.compute(r)},"width"===this.model.dimension?(a=t(h,n.yview),s=n._left.value,l=n._width.value,i=this.model.properties.line_width.value()):(a=n._top.value,s=t(u,n.xview),l=this.model.properties.line_width.value(),i=n._height.value),"css"===this.model.render_mode?(this.el.style.top=a+"px",this.el.style.left=s+"px",this.el.style.width=l+"px",this.el.style.height=i+"px",this.el.style.zIndex=1e3,this.el.style.backgroundColor=this.model.properties.line_color.value(),this.el.style.opacity=this.model.properties.line_alpha.value(),o.show(this.el)):"canvas"===this.model.render_mode?(e=this.plot_view.canvas_view.ctx,e.save(),e.beginPath(),this.visuals.line.set_value(e),e.moveTo(s,a),"width"===this.model.dimension?e.lineTo(s+l,a):e.lineTo(s,a+i),e.stroke(),e.restore()):void 0)},e}(r.AnnotationView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Annotation);n.Span=a,a.prototype.default_view=n.SpanView,a.prototype.type="Span",a.mixins(["line"]),a.define({render_mode:[s.RenderMode,"canvas"],x_range_name:[s.String,"default"],y_range_name:[s.String,"default"],location:[s.Number,null],location_units:[s.SpatialUnits,"data"],dimension:[s.Dimension,"width"]}),a.override({line_color:"black"}),a.internal({for_hover:[s.Boolean,!1],computed_location:[s.Number,null]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(51),o=t(5),s=t(42),a=t(40);n.TextAnnotationView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){if(t.prototype.initialize.call(this,e),"css"===this.model.render_mode)return this.el.classList.add("bk-annotation"),this.plot_view.canvas_overlays.appendChild(this.el)},e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),"css"===this.model.render_mode?this.connect(this.model.change,function(){return this.render()}):this.connect(this.model.change,function(){return e.plot_view.request_render()})},e.prototype._calculate_text_dimensions=function(t,e){var n,i;return i=t.measureText(e).width,n=a.get_text_height(this.visuals.text.font_value()).height,[i,n]},e.prototype._calculate_bounding_box_dimensions=function(t,e){var n,i,r,o;switch(s=this._calculate_text_dimensions(t,e),i=s[0],n=s[1],t.textAlign){case"left":r=0;break;case"center":r=-i/2;break;case"right":r=-i}switch(t.textBaseline){case"top":o=0;break;case"middle":o=-.5*n;break;case"bottom":o=-1*n;break;case"alphabetic":o=-.8*n;break;case"hanging":o=-.17*n;break;case"ideographic":o=-.83*n}return[r,o,i,n];var s},e.prototype._get_size=function(){var t;return t=this.plot_view.canvas_view.ctx,this.visuals.text.set_value(t),t.measureText(this.model.text).ascent},e.prototype.render=function(){return null},e.prototype._canvas_text=function(t,e,n,i,r){var o;return this.visuals.text.set_value(t),o=this._calculate_bounding_box_dimensions(t,e),t.save(),t.beginPath(),t.translate(n,i),r&&t.rotate(r),t.rect(o[0],o[1],o[2],o[3]),this.visuals.background_fill.doit&&(this.visuals.background_fill.set_value(t),t.fill()),this.visuals.border_line.doit&&(this.visuals.border_line.set_value(t),t.stroke()),this.visuals.text.doit&&(this.visuals.text.set_value(t),t.fillText(e,0,0)),t.restore()},e.prototype._css_text=function(t,e,n,i,r){var a,l,u;return o.hide(this.el),this.visuals.text.set_value(t),a=this._calculate_bounding_box_dimensions(t,e),l=this.visuals.border_line.line_dash.value(),s.isArray(l)&&(u=l.length<2?"solid":"dashed"),s.isString(l)&&(u=l),this.visuals.border_line.set_value(t),this.visuals.background_fill.set_value(t),this.el.style.position="absolute",this.el.style.left=n+a[0]+"px",this.el.style.top=i+a[1]+"px",this.el.style.color=""+this.visuals.text.text_color.value(),this.el.style.opacity=""+this.visuals.text.text_alpha.value(),this.el.style.font=""+this.visuals.text.font_value(),this.el.style.lineHeight="normal",r&&(this.el.style.transform="rotate("+r+"rad)"),this.visuals.background_fill.doit&&(this.el.style.backgroundColor=""+this.visuals.background_fill.color_value()),this.visuals.border_line.doit&&(this.el.style.borderStyle=""+u,this.el.style.borderWidth=this.visuals.border_line.line_width.value()+"px",this.el.style.borderColor=""+this.visuals.border_line.color_value()),this.el.textContent=e,o.show(this.el)},e}(r.AnnotationView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Annotation);n.TextAnnotation=l,l.prototype.type="TextAnnotation",l.prototype.default_view=n.TextAnnotationView},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(64),o=t(5),s=t(15),a=t(46);n.TitleView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.visuals.text=new a.Text(this.model)},e.prototype._get_location=function(){var t,e,n,i,r;switch(e=this.model.panel,t=this.model.offset,r=5,e.side){case"above":case"below":switch(this.model.vertical_align){case"top":i=e._top.value+r;break;case"middle":i=e._vcenter.value;break;case"bottom":i=e._bottom.value-r}switch(this.model.align){case"left":n=e._left.value+t;break;case"center":n=e._hcenter.value;break;case"right":n=e._right.value-t}break;case"left":switch(this.model.vertical_align){case"top":n=e._left.value-r;break;case"middle":n=e._hcenter.value;break;case"bottom":n=e._right.value+r}switch(this.model.align){case"left":i=e._bottom.value-t;break;case"center":i=e._vcenter.value;break;case"right":i=e._top.value+t}break;case"right":switch(this.model.vertical_align){case"top":n=e._right.value-r;break;case"middle":n=e._hcenter.value;break;case"bottom":n=e._left.value+r}switch(this.model.align){case"left":i=e._top.value+t;break;case"center":i=e._vcenter.value;break;case"right":i=e._bottom.value-t}}return[n,i]},e.prototype.render=function(){var t,e,n,i,r;if(!this.model.visible)return void("css"===this.model.render_mode&&o.hide(this.el));if(r=this.model.text,null!=r&&0!==r.length){return this.model.text_baseline=this.model.vertical_align,this.model.text_align=this.model.align,s=this._get_location(),n=s[0],i=s[1],t=this.model.panel.get_label_angle_heuristic("parallel"),(e="canvas"===this.model.render_mode?this._canvas_text.bind(this):this._css_text.bind(this))(this.plot_view.canvas_view.ctx,r,n,i,t);var s}},e.prototype._get_size=function(){var t,e;return e=this.model.text,null==e||0===e.length?0:(t=this.plot_view.canvas_view.ctx,this.visuals.text.set_value(t),t.measureText(e).ascent+10)},e}(r.TextAnnotationView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.TextAnnotation);n.Title=l,l.prototype.default_view=n.TitleView,l.prototype.type="Title",l.mixins(["line:border_","fill:background_"]),l.define({text:[s.String],text_font:[s.Font,"helvetica"],text_font_size:[s.FontSizeSpec,"10pt"],text_font_style:[s.FontStyle,"bold"],text_color:[s.ColorSpec,"#444444"],text_alpha:[s.NumberSpec,1],vertical_align:[s.VerticalAlign,"bottom"],align:[s.TextAlign,"left"],offset:[s.Number,0],render_mode:[s.RenderMode,"canvas"]}),l.override({background_fill_color:null,border_line_color:null}),l.internal({text_align:[s.TextAlign,"left"],text_baseline:[s.TextBaseline,"bottom"]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(51),o=t(4),s=t(5),a=t(15);n.ToolbarPanelView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.plot_view.canvas_events.appendChild(this.el),this._toolbar_views={},o.build_views(this._toolbar_views,[this.model.toolbar],{parent:this})},e.prototype.remove=function(){return o.remove_views(this._toolbar_views),t.prototype.remove.call(this)},e.prototype.render=function(){var e,n;return t.prototype.render.call(this),this.model.visible?(e=this.model.panel,this.el.style.position="absolute",this.el.style.left=e._left.value+"px",this.el.style.top=e._top.value+"px",this.el.style.width=e._width.value+"px",this.el.style.height=e._height.value+"px",this.el.style.overflow="hidden",n=this._toolbar_views[this.model.toolbar.id],n.render(),s.empty(this.el),this.el.appendChild(n.el),s.show(this.el)):void s.hide(this.el)},e.prototype._get_size=function(){return 30},e}(r.AnnotationView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Annotation);n.ToolbarPanel=l,l.prototype.type="ToolbarPanel",l.prototype.default_view=n.ToolbarPanelView,l.define({toolbar:[a.Instance]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(51),o=t(5),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.plot_view.canvas_overlays.appendChild(this.el),this.el.style.zIndex=1010,o.hide(this.el)},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.properties.data.change,function(){return this._draw_tips()})},e.prototype.render=function(){if(this.model.visible)return this._draw_tips()},e.prototype._draw_tips=function(){var t,e,n,i,r,s,a,l,u,h,c,_,p,d;if(i=this.model.data,o.empty(this.el),o.hide(this.el),this.model.custom?this.el.classList.add("bk-tooltip-custom"):this.el.classList.remove("bk-tooltip-custom"),0!==i.length){for(r=this.plot_view.frame,s=0,l=i.length;s0?(this.el.style.top=p+"px",this.el.style.left=a+"px"):o.hide(this.el)}},e}(r.AnnotationView);n.TooltipView=a,a.prototype.className="bk-tooltip";var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.clear=function(){return this.data=[]},e.prototype.add=function(t,e,n){var i;return i=this.data,i.push([t,e,n]),this.data=i,this.properties.data.change.emit()},e}(r.Annotation);n.Tooltip=l,l.prototype.default_view=a,l.prototype.type="Tooltip",l.define({attachment:[s.String,"horizontal"],inner_only:[s.Bool,!0],show_arrow:[s.Bool,!0]}),l.override({level:"overlay"}),l.internal({data:[s.Any,[]],custom:[s.Any]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(51),o=t(173),s=t(53),a=t(15);n.WhiskerView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.set_data(this.model.source)},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.source.streaming,function(){return this.set_data(this.model.source)}),this.connect(this.model.source.patching,function(){return this.set_data(this.model.source)}),this.connect(this.model.source.change,function(){return this.set_data(this.model.source)})},e.prototype.set_data=function(e){return t.prototype.set_data.call(this,e),this.visuals.warm_cache(e),this.plot_view.request_render()},e.prototype._map_data=function(){var t,e,n,i,r,o,s,a,l,u,h,c,_,p,d;return l=this.plot_model.frame,a=this.model.dimension,p=l.xscales[this.model.x_range_name],d=l.yscales[this.model.y_range_name],c="height"===a?d:p,o="height"===a?p:d,_="height"===a?l.yview:l.xview,s="height"===a?l.xview:l.yview,n="data"===this.model.lower.units?c.v_compute(this._lower):_.v_compute(this._lower),r="data"===this.model.upper.units?c.v_compute(this._upper):_.v_compute(this._upper),t="data"===this.model.base.units?o.v_compute(this._base):s.v_compute(this._base),f="height"===a?[1,0]:[0,1],u=f[0],h=f[1],e=[n,t],i=[r,t],this._lower_sx=e[u],this._lower_sy=e[h],this._upper_sx=i[u],this._upper_sy=i[h];var f},e.prototype.render=function(){var t,e,n,i,r,o,s,a,l,u;if(this.model.visible){if(this._map_data(),e=this.plot_view.canvas_view.ctx,this.visuals.line.doit)for(n=i=0,s=this._lower_sx.length;0<=s?is;n=0<=s?++i:--i)this.visuals.line.set_vectorize(e,n),e.beginPath(),e.moveTo(this._lower_sx[n],this._lower_sy[n]),e.lineTo(this._upper_sx[n],this._upper_sy[n]),e.stroke();if(t="height"===this.model.dimension?0:Math.PI/2,null!=this.model.lower_head)for(n=r=0,a=this._lower_sx.length;0<=a?ra;n=0<=a?++r:--r)e.save(),e.translate(this._lower_sx[n],this._lower_sy[n]),e.rotate(t+Math.PI),this.model.lower_head.render(e,n),e.restore();if(null!=this.model.upper_head){for(u=[],n=o=0,l=this._upper_sx.length;0<=l?ol;n=0<=l?++o:--o)e.save(),e.translate(this._upper_sx[n],this._upper_sy[n]),e.rotate(t),this.model.upper_head.render(e,n),u.push(e.restore());return u}}},e}(r.AnnotationView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Annotation);n.Whisker=l,l.prototype.default_view=n.WhiskerView,l.prototype.type="Whisker",l.mixins(["line"]),l.define({lower:[a.DistanceSpec],lower_head:[a.Instance,function(){return new s.TeeHead({level:"underlay",size:10})}],upper:[a.DistanceSpec],upper_head:[a.Instance,function(){return new s.TeeHead({level:"underlay",size:10})}],base:[a.DistanceSpec],dimension:[a.Dimension,"height"],source:[a.Instance,function(){return new o.ColumnDataSource}],x_range_name:[a.String,"default"],y_range_name:[a.String,"default"]}),l.override({level:"underlay"})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(12),o=t(163),s=t(165),a=t(14),l=t(15),u=t(22),h=t(42);n.AxisView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.render=function(){var t,e,n;if(this.model.visible!==!1)return e={tick:this._tick_extent(),tick_label:this._tick_label_extents(),axis_label:this._axis_label_extent()},n=this.model.tick_coords,t=this.plot_view.canvas_view.ctx,t.save(),this._draw_rule(t,e),this._draw_major_ticks(t,e,n),this._draw_minor_ticks(t,e,n),this._draw_major_labels(t,e,n),this._draw_axis_label(t,e,n),null!=this._render&&this._render(t,e,n),t.restore()},e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return e.plot_view.request_render()})},e.prototype._get_size=function(){return this._tick_extent()+this._tick_label_extent()+this._axis_label_extent()},e.prototype.get_size=function(){return this.model.visible?Math.round(this._get_size()):0},e.prototype._draw_rule=function(t,e,n){var i,r,o,s,a,l,u,h,c,_,p;if(this.visuals.axis_line.doit){for(d=this.model.rule_coords,h=d[0],_=d[1],f=this.plot_view.map_to_screen(h,_,this.model.x_range_name,this.model.y_range_name),l=f[0],u=f[1],m=this.model.normals,o=m[0],s=m[1],v=this.model.offsets,c=v[0],p=v[1],this.visuals.axis_line.set_value(t),t.beginPath(),t.moveTo(Math.round(l[0]+o*c),Math.round(u[0]+s*p)),i=r=1,a=l.length;1<=a?ra;i=1<=a?++r:--r)l=Math.round(l[i]+o*c),u=Math.round(u[i]+s*p),t.lineTo(l,u);t.stroke();var d,f,m,v}},e.prototype._draw_major_ticks=function(t,e,n){var i,r,o;i=this.model.major_tick_in,r=this.model.major_tick_out,o=this.visuals.major_tick_line,this._draw_ticks(t,n.major,i,r,o)},e.prototype._draw_minor_ticks=function(t,e,n){var i,r,o;i=this.model.minor_tick_in,r=this.model.minor_tick_out,o=this.visuals.minor_tick_line,this._draw_ticks(t,n.minor,i,r,o)},e.prototype._draw_major_labels=function(t,e,n){var i,r,o,s,a;i=n.major,r=this.model.compute_labels(i[this.model.dimension]),o=this.model.major_label_orientation,s=e.tick+this.model.major_label_standoff,a=this.visuals.major_label_text,this._draw_oriented_labels(t,r,i,o,this.model.panel_side,s,a)},e.prototype._draw_axis_label=function(t,e,n){var i,r,o,s,a;if(null!=this.model.axis_label&&0!==this.model.axis_label.length){switch(this.model.panel.side){case"above":o=this.model.panel._hcenter.value,s=this.model.panel._bottom.value;break;case"below":o=this.model.panel._hcenter.value,s=this.model.panel._top.value;break;case"left":o=this.model.panel._right.value,s=this.model.panel._vcenter._value;break;case"right":o=this.model.panel._left.value,s=this.model.panel._vcenter._value}i=[[o],[s]],r=e.tick+u.sum(e.tick_label)+this.model.axis_label_standoff,a=this.visuals.axis_label_text,this._draw_oriented_labels(t,[this.model.axis_label],i,"parallel",this.model.panel_side,r,a,"screen")}},e.prototype._draw_ticks=function(t,e,n,i,r){var o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k;if(r.doit&&0!==e.length){for(b=e[0],w=e[1],M=this.plot_view.map_to_screen(b,w,this.model.x_range_name,this.model.y_range_name),m=M[0],y=M[1],S=this.model.normals,a=S[0],h=S[1],T=this.model.offsets,x=T[0],k=T[1],O=[a*(x-n),h*(k-n)],l=O[0],c=O[1],A=[a*(x+i),h*(k+i)],u=A[0],_=A[1],r.set_value(t),o=s=0,p=m.length;0<=p?sp;o=0<=p?++s:--s)d=Math.round(m[o]+u),v=Math.round(y[o]+_),f=Math.round(m[o]+l),g=Math.round(y[o]+c),t.beginPath(),t.moveTo(d,v),t.lineTo(f,g),t.stroke();var M,S,T,O,A}},e.prototype._draw_oriented_labels=function(t,e,n,i,r,o,s,a){void 0===a&&(a="data");var l,u,c,_,p,d,f,m,v,g,y,b,x,w,k,M;if(s.doit&&0!==e.length){for("screen"===a?(b=n[0],w=n[1],S=[0,0],k=S[0],M=S[1]):(u=n[0],c=n[1],T=this.plot_view.map_to_screen(u,c,this.model.x_range_name,this.model.y_range_name),b=T[0],w=T[1],O=this.model.offsets,k=O[0],M=O[1]),A=this.model.normals,d=A[0],m=A[1],f=d*(k+o),v=m*(M+o),s.set_value(t),this.model.panel.apply_label_text_heuristics(t,i),l=h.isString(i)?this.model.panel.get_label_angle_heuristic(i):-i,_=p=0,g=b.length;0<=g?pg;_=0<=g?++p:--p)y=Math.round(b[_]+f),x=Math.round(w[_]+v),t.translate(y,x),t.rotate(l),t.fillText(e[_],0,0),t.rotate(-l),t.translate(-y,-x);var S,T,O,A}},e.prototype._axis_label_extent=function(){var t,e;return null==this.model.axis_label||""===this.model.axis_label?0:(t=this.model.axis_label_standoff,e=this.visuals.axis_label_text,this._oriented_labels_extent([this.model.axis_label],"parallel",this.model.panel_side,t,e))},e.prototype._tick_extent=function(){return this.model.major_tick_out},e.prototype._tick_label_extent=function(){return u.sum(this._tick_label_extents())},e.prototype._tick_label_extents=function(){var t,e,n,i,r;return t=this.model.tick_coords.major,e=this.model.compute_labels(t[this.model.dimension]),n=this.model.major_label_orientation,i=this.model.major_label_standoff,r=this.visuals.major_label_text,[this._oriented_labels_extent(e,n,this.model.panel_side,i,r)]},e.prototype._tick_label_extent=function(){return u.sum(this._tick_label_extents())},e.prototype._oriented_labels_extent=function(t,e,n,i,r){var o,s,a,l,u,c,_,p,d,f,m,v;if(0===t.length)return 0;for(a=this.plot_view.canvas_view.ctx,r.set_value(a),h.isString(e)?(c=1,o=this.model.panel.get_label_angle_heuristic(e)):(c=2,o=-e),o=Math.abs(o),s=Math.cos(o),f=Math.sin(o),l=0,_=p=0,d=t.length;0<=d?pd;_=0<=d?++p:--p)v=1.1*a.measureText(t[_]).width,u=.9*a.measureText(t[_]).ascent,m="above"===n||"below"===n?v*f+u/c*s:v*s+u/c*f,m>l&&(l=m);return l>0&&(l+=i),l},e}(s.RendererView);var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute_labels=function(t){var e,n,i,r;for(i=this.formatter.doFormat(t,this),e=n=0,r=t.length;0<=r?nr;e=0<=r?++n:--n)t[e]in this.major_label_overrides&&(i[e]=this.major_label_overrides[t[e]]);return i},e.prototype.label_info=function(t){var e,n;return n=this.major_label_orientation,e={dim:this.dimension,coords:t,side:this.panel_side,orient:n,standoff:this.major_label_standoff}},e.prototype.add_panel=function(t){return this.panel=new r.SidePanel({side:t}),this.panel.attach_document(this.document),this.panel_side=t},e.prototype._offsets=function(){var t,e,n,i;switch(e=this.panel_side,r=[0,0],n=r[0],i=r[1],t=this.plot.plot_canvas.frame,e){case"below":i=Math.abs(this.panel._top.value-t._bottom.value);break;case"above":i=Math.abs(this.panel._bottom.value-t._top.value);break;case"right":n=Math.abs(this.panel._left.value-t._right.value);break;case"left":n=Math.abs(this.panel._right.value-t._left.value)}return[n,i];var r},e.prototype._ranges=function(){var t,e,n,i;return e=this.dimension,n=(e+1)%2,t=this.plot.plot_canvas.frame,i=[t.x_ranges[this.x_range_name],t.y_ranges[this.y_range_name]],[i[e],i[n]]},e.prototype._computed_bounds=function(){var t,e,n,i,r,o,s;return l=this.ranges,n=l[0],t=l[1],s=null!=(r=this.bounds)?r:"auto",i=[n.min,n.max],"auto"===s?i:h.isArray(s)?(Math.abs(s[0]-s[1])>Math.abs(i[0]-i[1])?(o=Math.max(Math.min(s[0],s[1]),i[0]),e=Math.min(Math.max(s[0],s[1]),i[1])):(o=Math.min(s[0],s[1]),e=Math.max(s[0],s[1])),[o,e]):(a.logger.error("user bounds '"+s+"' not understood"),null);var l},e.prototype._rule_coords=function(){var t,e,n,i,r,o,s,a,l;return i=this.dimension,r=(i+1)%2,u=this.ranges,o=u[0],e=u[1],h=this.computed_bounds, -s=h[0],n=h[1],a=new Array(2),l=new Array(2),t=[a,l],t[i][0]=Math.max(s,o.min),t[i][1]=Math.min(n,o.max),t[i][0]>t[i][1]&&(t[i][0]=t[i][1]=NaN),t[r][0]=this.loc,t[r][1]=this.loc,t;var u,h},e.prototype._tick_coords=function(){var t,e,n,i,r,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x;for(i=this.dimension,o=(i+1)%2,w=this.ranges,p=w[0],e=w[1],k=this.computed_bounds,g=k[0],n=k[1],y=this.ticker.get_ticks(g,n,p,this.loc,{}),l=y.major,_=y.minor,b=[],x=[],t=[b,x],h=[],c=[],u=[h,c],M=[p.min,p.max],f=M[0],d=M[1],r=s=0,m=l.length;0<=m?sm;r=0<=m?++s:--s)l[r]d||(t[i].push(l[r]),t[o].push(this.loc));for(r=a=0,v=_.length;0<=v?av;r=0<=v?++a:--a)_[r]d||(u[i].push(_[r]),u[o].push(this.loc));return{major:t,minor:u};var w,k,M},e.prototype._get_loc=function(){var t,e,n,i,r;switch(o=this.ranges,i=o[0],e=o[1],n=e.start,t=e.end,r=this.panel_side){case"left":case"below":return e.start;case"right":case"above":return e.end}var o},e}(o.GuideRenderer);n.Axis=c,c.prototype.default_view=n.AxisView,c.prototype.type="Axis",c.mixins(["line:axis_","line:major_tick_","line:minor_tick_","text:major_label_","text:axis_label_"]),c.define({bounds:[l.Any,"auto"],ticker:[l.Instance,null],formatter:[l.Instance,null],x_range_name:[l.String,"default"],y_range_name:[l.String,"default"],axis_label:[l.String,""],axis_label_standoff:[l.Int,5],major_label_standoff:[l.Int,5],major_label_orientation:[l.Any,"horizontal"],major_label_overrides:[l.Any,{}],major_tick_in:[l.Number,2],major_tick_out:[l.Number,6],minor_tick_in:[l.Number,0],minor_tick_out:[l.Number,4]}),c.override({axis_line_color:"black",major_tick_line_color:"black",minor_tick_line_color:"black",major_label_text_font_size:"8pt",major_label_text_align:"center",major_label_text_baseline:"alphabetic",axis_label_text_font_size:"10pt",axis_label_text_font_style:"italic"}),c.internal({panel_side:[l.Any]}),c.getters({computed_bounds:function(){return this._computed_bounds()},rule_coords:function(){return this._rule_coords()},tick_coords:function(){return this._tick_coords()},ranges:function(){return this._ranges()},normals:function(){return this.panel._normals},dimension:function(){return this.panel._dim},offsets:function(){return this._offsets()},loc:function(){return this._get_loc()}})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(69),o=t(92),s=t(181);n.CategoricalAxisView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._render=function(t,e,n){return this._draw_group_separators(t,e,n)},e.prototype._draw_group_separators=function(t,e,n){var i,r,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k;if(M=this.model.ranges,v=M[0],o=M[1],S=this.model.computed_bounds,x=S[0],a=S[1],f=this.model.loc,k=this.model.ticker.get_ticks(x,a,v,f,{}),T=this.model.ranges,v=T[0],o=T[1],v.tops&&!(v.tops.length<2)&&this.visuals.separator_line.doit){for(s=this.model.dimension,i=(s+1)%2,r=[[],[]],h=0,u=_=0,g=v.tops.length-1;0<=g?_g;u=0<=g?++_:--_){for(c=p=y=h,b=v.factors.length;y<=b?pb;c=y<=b?++p:--p)if(v.factors[c][0]===v.tops[u+1]){O=[v.factors[c-1],v.factors[c]],l=O[0],d=O[1],h=c;break}m=(v.synthetic(l)+v.synthetic(d))/2,m>x&&m_;s=0<=_?++l:--l)f=a[s],u=f[0],r=f[1],c=f[2],d=f[3],this._draw_oriented_labels(t,u,r,c,this.model.panel_side,p,d),p+=e.tick_label[s];var f},e.prototype._tick_label_extents=function(){var t,e,n,i,r,o,s,a,l;for(i=this._get_factor_info(),n=[],r=0,s=i.length;r1&&(t.tops[i]=a.tops,t.tops[r]=function(){var t,e,n,i;for(n=a.tops,i=[],t=0,e=n.length;ti;e=0<=i?++n:--n)r.push(this[e]=t[e]);return r});var _=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){switch(t.prototype.initialize.call(this,e),this.map_el=this.model.map?this.el.appendChild(u.div({"class":"bk-canvas-map"})):null,this.model.output_backend){case"canvas":case"webgl":this.canvas_el=this.el.appendChild(u.canvas({"class":"bk-canvas"})),this._ctx=this.canvas_el.getContext("2d");break;case"svg":this._ctx=new c,this.canvas_el=this.el.appendChild(this._ctx.getSvg())}return this.overlays_el=this.el.appendChild(u.div({"class":"bk-canvas-overlays"})),this.events_el=this.el.appendChild(u.div({"class":"bk-canvas-events"})),this.ctx=this.get_ctx(),h.fixup_ctx(this.ctx),a.logger.debug("CanvasView initialized")},e.prototype.get_ctx=function(){return this._ctx},e.prototype.get_canvas_element=function(){return this.canvas_el},e.prototype.prepare_canvas=function(){var t,e,n;return n=this.model._width.value,t=this.model._height.value,this.el.style.width=n+"px",this.el.style.height=t+"px",e=h.get_scale_ratio(this.ctx,this.model.use_hidpi,this.model.output_backend),this.model.pixel_ratio=e,this.canvas_el.style.width=n+"px",this.canvas_el.style.height=t+"px",this.canvas_el.setAttribute("width",n*e),this.canvas_el.setAttribute("height",t*e),a.logger.debug("Rendering CanvasView with width: "+n+", height: "+t+", pixel ratio: "+e)},e.prototype.set_dims=function(t){var e=t[0],n=t[1];if(0!==e&&0!==n)return e!==this.model._width.value&&(null!=this._width_constraint&&this.solver.has_constraint(this._width_constraint)&&this.solver.remove_constraint(this._width_constraint),this._width_constraint=s.EQ(this.model._width,-e),this.solver.add_constraint(this._width_constraint)),n!==this.model._height.value&&(null!=this._height_constraint&&this.solver.has_constraint(this._height_constraint)&&this.solver.remove_constraint(this._height_constraint),this._height_constraint=s.EQ(this.model._height,-n),this.solver.add_constraint(this._height_constraint)),this.solver.update_variables()},e}(o.DOMView);n.CanvasView=_,_.prototype.className="bk-canvas-wrapper";var p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.LayoutCanvas);n.Canvas=p,p.prototype.type="Canvas",p.prototype.default_view=_,p.internal({map:[l.Boolean,!1],use_hidpi:[l.Boolean,!0],pixel_ratio:[l.Number,1],output_backend:[l.OutputBackend,"canvas"]}),p.getters({panel:function(){return this}})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(166),o=t(168),s=t(169),a=t(160),l=t(156),u=t(157),h=t(11),c=t(15),_=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){var i=this;return t.prototype.initialize.call(this,e,n),this._configure_scales(),this.connect(this.change,function(){return i._configure_scales()})},e.prototype.get_editables=function(){return t.prototype.get_editables.call(this).concat([this._width,this._height])},e.prototype.map_to_screen=function(t,e,n,i){void 0===n&&(n="default"),void 0===i&&(i="default");var r,o;return r=this.xscales[n].v_compute(t),o=this.yscales[i].v_compute(e),[r,o]},e.prototype._get_ranges=function(t,e){var n,i,r;if(r={},r["default"]=t,null!=e)for(i in e)n=e[i],r[i]=n;return r},e.prototype._get_scales=function(t,e,n){var i,h,c,_;_={};for(i in e){if(h=e[i],h instanceof l.DataRange1d||h instanceof a.Range1d){if(!(t instanceof s.LogScale||t instanceof o.LinearScale))throw new Error("Range "+h.type+" is incompatible is Scale "+t.type);if(t instanceof r.CategoricalScale)throw new Error("Range "+h.type+" is incompatible is Scale "+t.type)}if(h instanceof u.FactorRange&&!(t instanceof r.CategoricalScale))throw new Error("Range "+h.type+" is incompatible is Scale "+t.type);t instanceof s.LogScale&&h instanceof l.DataRange1d&&(h.scale_hint="log"),c=t.clone(),c.setv({source_range:h,target_range:n}),_[i]=c}return _},e.prototype._configure_frame_ranges=function(){return this._h_target=new a.Range1d({start:this._left.value,end:this._right.value}),this._v_target=new a.Range1d({start:this._bottom._value,end:this._top.value})},e.prototype._configure_scales=function(){return this._configure_frame_ranges(),this._x_ranges=this._get_ranges(this.x_range,this.extra_x_ranges),this._y_ranges=this._get_ranges(this.y_range,this.extra_y_ranges),this._xscales=this._get_scales(this.x_scale,this._x_ranges,this._h_target),this._yscales=this._get_scales(this.y_scale,this._y_ranges,this._v_target)},e.prototype._update_scales=function(){var t,e,n,i;this._configure_frame_ranges(),e=this._xscales;for(t in e)i=e[t],i.target_range=this._h_target;n=this._yscales;for(t in n)i=n[t],i.target_range=this._v_target;return null},e}(h.LayoutCanvas);n.CartesianFrame=_,_.prototype.type="CartesianFrame",_.getters({panel:function(){return this}}),_.getters({x_ranges:function(){return this._x_ranges},y_ranges:function(){return this._y_ranges},xscales:function(){return this._xscales},yscales:function(){return this._yscales}}),_.internal({extra_x_ranges:[c.Any,{}],extra_y_ranges:[c.Any,{}],x_range:[c.Instance],y_range:[c.Instance],x_scale:[c.Instance],y_scale:[c.Instance]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(79);n.Canvas=i.Canvas;var r=t(80);n.CartesianFrame=r.CartesianFrame},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(50);n.Expression=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this._connected={},this._result={}},e.prototype._v_compute=function(t){return null==this._connected[t.id]&&(this.connect(t.change,function(){return this._result[t.id]=null}),this._connected[t.id]=!0),null!=this._result[t.id]?this._result[t.id]:(this._result[t.id]=this.v_compute(t),this._result[t.id])},e}(r.Model)},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(82);n.Expression=i.Expression;var r=t(84);n.Stack=r.Stack},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(82),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.v_compute=function(t){var e,n,i,r,o,s,a,l,u,h;for(u=new Float64Array(t.get_length()),a=this.fields,i=0,o=a.length;i0?a.all(this.booleans,l.isBoolean)?(this.booleans.length!==t.get_length()&&s.logger.warn("BooleanFilter "+this.id+": length of booleans doesn't match data source"),function(){var t,n,i,r;for(i=a.range(0,this.booleans.length),r=[],t=0,n=i.length;t=0?a.all(this.filter,s.isBoolean)?function(){var e,n,i,r;for(i=a.range(0,this.filter.length),r=[],e=0,n=i.length;er;n=0<=r?++i:--i)e[n]===this.group&&o.push(n);return o}.call(this),0===this.indices.length&&s.logger.warn("group filter: group '"+this.group+"' did not match any values in column '"+this.column_name+"'"),this.indices)},e}(r.Filter);n.GroupFilter=a,a.prototype.type="GroupFilter",a.define({column_name:[o.String],group:[o.String]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(85);n.BooleanFilter=i.BooleanFilter;var r=t(86);n.CustomJSFilter=r.CustomJSFilter;var o=t(87);n.Filter=o.Filter;var s=t(88);n.GroupFilter=s.GroupFilter;var a=t(90);n.IndexFilter=a.IndexFilter},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(87),o=t(15),s=t(14),a=t(42),l=t(22),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute_indices=function(t){var e;return(null!=(e=this.indices)?e.length:void 0)>=0?l.all(this.indices,a.isInteger)?this.indices:(s.logger.warn("IndexFilter "+this.id+": indices should be array of integers, defaulting to no filtering"),null):(s.logger.warn("IndexFilter "+this.id+": indices was not set, defaulting to no filtering"),null)},e}(r.Filter);n.IndexFilter=u,u.prototype.type="IndexFilter",u.define({indices:[o.Array,null]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(100),o=t(15),s=t(42),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this.last_precision=3},e.prototype.doFormat=function(t,e){var n,i,r,o,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k;if(0===t.length)return[];if(k=0,t.length>=2&&(k=Math.abs(t[1]-t[0])/1e4),_=!1,this.use_scientific)for(r=0,u=t.length;rk&&(x>=this.scientific_limit_high||x<=this.scientific_limit_low)){_=!0;break}if(d=this.precision,null==d||s.isNumber(d)){if(l=new Array(t.length),_)for(n=o=0,f=t.length;0<=f?of;n=0<=f?++o:--o)l[n]=t[n].toExponential(d||void 0);else for(n=a=0,m=t.length;0<=m?am;n=0<=m?++a:--a)l[n]=t[n].toFixed(d||void 0).replace(/(\.[0-9]*?)0+$/,"$1").replace(/\.$/,"");return l}if("auto"===d)for(l=new Array(t.length),w=h=v=this.last_precision;v<=15?h<=15:h>=15;w=v<=15?++h:--h){if(i=!0,_){for(n=c=0,g=t.length;0<=g?cg;n=0<=g?++c:--c)if(l[n]=t[n].toExponential(w),n>0&&l[n]===l[n-1]){i=!1;break}if(i)break}else{for(n=p=0,y=t.length;0<=y?py;n=0<=y?++p:--p)if(l[n]=t[n].toFixed(w).replace(/(\.[0-9]*?)0+$/,"$1").replace(/\.$/,""),n>0&&l[n]===l[n-1]){i=!1;break}if(i)break}if(i)return this.last_precision=w,l}return l},e}(r.TickFormatter);n.BasicTickFormatter=a,a.prototype.type="BasicTickFormatter",a.define({precision:[o.Any,"auto"],use_scientific:[o.Bool,!0],power_limit_high:[o.Number,5],power_limit_low:[o.Number,-3]}),a.getters({scientific_limit_low:function(){return Math.pow(10,this.power_limit_low)},scientific_limit_high:function(){return Math.pow(10,this.power_limit_high)}})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(100),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.doFormat=function(t,e){return t},e}(r.TickFormatter);n.CategoricalTickFormatter=o,o.prototype.type="CategoricalTickFormatter"},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r,o,s=t(364),a=t(362),l=t(363),u=t(100),h=t(14),c=t(15),_=t(22),p=t(42);o=function(t){return Math.round(t/1e3%1*1e6)},i=function(t){return l(t,"%Y %m %d %H %M %S").split(/\s+/).map(function(t){return parseInt(t,10)})},r=function(t,e){var n;return p.isFunction(e)?e(t):(n=a.sprintf("$1%06d",o(t)),e=e.replace(/((^|[^%])(%%)*)%f/,n),e.indexOf("%")===-1?e:l(t,e))};var d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this._update_width_formats()},e.prototype._update_width_formats=function(){var t,e;return e=l(new Date),t=function(t){var n,i,o;return i=function(){var i,o,s;for(s=[],i=0,o=t.length;i=60?"minsec":"seconds";case!(n<3600):return e>=3600?"hourmin":"minutes";case!(n<86400):return"hours";case!(n<2678400):return"days";case!(n<31536e3):return"months";default:return"years"}},e.prototype.doFormat=function(t,e,n,o,s,a){void 0===n&&(n=null),void 0===o&&(o=null),void 0===s&&(s=.3),void 0===a&&(a=null);var l,u,c,_,p,d,f,m,v,g,y,b,x,w,k,M,S,T,O,A,E,j,P,z,C,N,D;if(0===t.length)return[];if(j=Math.abs(t[t.length-1]-t[0])/1e3,M=a?a.resolution:j/(t.length-1),O=this._get_resolution_str(M,j),I=this._width_formats[O],D=I[0],_=I[1],c=_[0],o){for(p=[],f=m=0,S=D.length;0<=S?mS;f=0<=S?++m:--m)D[f]*t.length0&&(c=p[p.length-1])}for(y=[],A=this.format_order.indexOf(O),C={},T=this.format_order,v=0,b=T.length;vs;i=0<=s?++r:--r)if(o[i]=n+"^"+Math.round(Math.log(t[i])/Math.log(n)),i>0&&o[i]===o[i-1]){a=!0;break}return a&&(o=this.basic_formatter.doFormat(t)),o},e}(o.TickFormatter);n.LogTickFormatter=l,l.prototype.type="LogTickFormatter",l.define({ticker:[a.Instance,null]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(91),o=t(15),s=t(31),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.doFormat=function(e,n){var i,r,o,a,l,u,h,c;if(null==this.dimension)throw new Error("MercatorTickFormatter.dimension not configured");if(0===e.length)return[];if(u=new Array(e.length),"lon"===this.dimension)for(i=r=0,h=e.length;0<=h?rh;i=0<=h?++r:--r)_=s.proj4(s.mercator).inverse([e[i],n.loc]),l=_[0],a=_[1],u[i]=l;else for(i=o=0,c=e.length;0<=c?oc;i=0<=c?++o:--o)p=s.proj4(s.mercator).inverse([n.loc,e[i]]),l=p[0],a=p[1],u[i]=a;return t.prototype.doFormat.call(this,u,n);var _,p},e}(r.BasicTickFormatter);n.MercatorTickFormatter=a,a.prototype.type="MercatorTickFormatter",a.define({dimension:[o.LatLon]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(332),o=t(100),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.doFormat=function(t,e){var n,i,o,s,a;return n=this.format,o=this.language,s=function(){switch(this.rounding){case"round":case"nearest":return Math.round;case"floor":case"rounddown":return Math.floor;case"ceil":case"roundup":return Math.ceil}}.call(this),i=function(){var e,i,l;for(l=[],e=0,i=t.length;en;t=0<=n?++e:--e)i.push(this._angle[t]=this._end_angle[t]-this._start_angle[t]);return i},e.prototype._render=function(t,e,n){var i,r,o,s,a,l=n.sx,u=n.sy,h=n._start_angle,c=n._angle,_=n.sinner_radius,p=n.souter_radius;for(i=this.model.properties.direction.value(),a=[],o=0,s=e.length;o=h&&i.push([u,s]);for(r=this.model.properties.direction.value(),l=[],_=0,d=i.length;_=0||navigator.userAgent.indexOf("Trident")>0||navigator.userAgent.indexOf("Edge")>0,this.visuals.fill.doit){if(this.visuals.fill.set_vectorize(t,r),t.beginPath(),o)for(h=[!1,!0],a=0,u=h.length;a=s&&i.push([r,n]);return o.create_1d_hit_test_result(i);var k,M},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){var s,a,l,u,h,c,_;return a=[o],c={},c[o]=(e+n)/2,_={},_[o]=(i+r)/2,l=.5*Math.min(Math.abs(n-e),Math.abs(r-i)),u={},u[o]=.4*l,h={},h[o]=.8*l,s={sx:c,sy:_,sinner_radius:u,souter_radius:h},this._render(t,a,s)},e}(r.XYGlyphView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Annulus=a,a.prototype.default_view=n.AnnulusView,a.prototype.type="Annulus",a.mixins(["line","fill"]),a.define({inner_radius:[s.DistanceSpec],outer_radius:[s.DistanceSpec]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(128),o=t(15);n.ArcView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._map_data=function(){return"data"===this.model.properties.radius.units?this.sradius=this.sdist(this.renderer.xscale,this._x,this._radius):this.sradius=this._radius},e.prototype._render=function(t,e,n){var i,r,o,s,a,l=n.sx,u=n.sy,h=n.sradius,c=n._start_angle,_=n._end_angle;if(this.visuals.line.doit){for(i=this.model.properties.direction.value(),a=[],o=0,s=e.length;or;t=0<=r?++e:--e)isNaN(this._x0[t]+this._x1[t]+this._y0[t]+this._y1[t]+this._cx0[t]+this._cy0[t]+this._cx1[t]+this._cy1[t])||(h=i(this._x0[t],this._y0[t],this._x1[t],this._y1[t],this._cx0[t],this._cy0[t],this._cx1[t],this._cy1[t]),s=h[0],l=h[1],a=h[2],u=h[3],n.push({minX:s,minY:l,maxX:a,maxY:u,i:t}));return new o.RBush(n);var h},e.prototype._render=function(t,e,n){var i,r,o,s,a=n.sx0,l=n.sy0,u=n.sx1,h=n.sy1,c=(n.scx,n.scx0),_=n.scy0,p=n.scx1,d=n.scy1;if(this.visuals.line.doit){for(s=[],r=0,o=e.length;rl;n=0<=l?++i:--i)h=this._lrtb(n),o=h[0],a=h[1],u=h[2],e=h[3],!isNaN(o+a+u+e)&&isFinite(o+a+u+e)&&s.push({minX:o,minY:e,maxX:a,maxY:u,i:n});return new r.RBush(s);var h},e.prototype._render=function(t,e,n){var i,r,o,s,a=n.sleft,l=n.sright,u=n.stop,h=n.sbottom;for(s=[],r=0,o=e.length;re;0<=e?t++:t--)u.push(t);return u}.apply(this),n=[],i=s=0,a=e.length;0<=a?sa;i=0<=a?++s:--s)r=e[i],o.point_in_poly(this.sx[i],this.sy[i],h,c)&&n.push(r);return l=o.create_hit_test_result(),l["1d"].indices=n,l},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){var s,a,l,u,h;return a=[o],u={},u[o]=(e+n)/2,h={},h[o]=(i+r)/2,l={},l[o]=.2*Math.min(Math.abs(n-e),Math.abs(r-i)),s={sx:u,sy:h,sradius:l},this._render(t,a,s)},e}(r.XYGlyphView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this.properties.radius.optional=!0},e}(r.XYGlyph);n.Circle=a,a.prototype.default_view=n.CircleView,a.prototype.type="Circle",a.mixins(["line","fill"]),a.define({angle:[s.AngleSpec,0],size:[s.DistanceSpec,{units:"screen",value:4}],radius:[s.DistanceSpec,null],radius_dimension:[s.String,"x"]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(128),o=t(15);n.EllipseView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._set_data=function(){if(this.max_w2=0,"data"===this.model.properties.width.units&&(this.max_w2=this.max_width/2),this.max_h2=0,"data"===this.model.properties.height.units)return this.max_h2=this.max_height/2},e.prototype._map_data=function(){return"data"===this.model.properties.width.units?this.sw=this.sdist(this.renderer.xscale,this._x,this._width,"center"):this.sw=this._width,"data"===this.model.properties.height.units?this.sh=this.sdist(this.renderer.yscale,this._y,this._height,"center"):this.sh=this._height},e.prototype._render=function(t,e,n){var i,r,o,s,a=n.sx,l=n.sy,u=n.sw,h=n.sh;for(s=[],r=0,o=e.length;r1?(c[o]=s,h[o]=s/u):(c[o]=s*u,h[o]=s),a={sx:_,sy:p,sw:c,sh:h},this._render(t,l,a)},e.prototype._bounds=function(t){return this.max_wh2_bounds(t)},e}(r.XYGlyphView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Ellipse=s,s.prototype.default_view=n.EllipseView,s.prototype.type="Ellipse",s.mixins(["line","fill"]),s.define({angle:[o.AngleSpec,0],width:[o.DistanceSpec],height:[o.DistanceSpec]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(9),o=t(15),s=t(23),a=t(32),l=t(45),u=t(50),h=t(46),c=t(14),_=t(30),p=t(42),d=t(114);n.GlyphView=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(n,e),n.prototype.initialize=function(n){var i,r,o,s;if(e.prototype.initialize.call(this,n),this._nohit_warned={},this.renderer=n.renderer,this.visuals=new h.Visuals(this.model),r=this.renderer.plot_view.canvas_view.ctx,null!=r.glcanvas){try{s=t(425)}catch(a){if(o=a,"MODULE_NOT_FOUND"!==o.code)throw o;c.logger.warn("WebGL was requested and is supported, but bokeh-gl(.min).js is not available, falling back to 2D rendering."),s=null}if(null!=s&&(i=s[this.model.type+"GLGlyph"],null!=i))return this.glglyph=new i(r.glcanvas.gl,this)}},n.prototype.set_visuals=function(t){if(this.visuals.warm_cache(t),null!=this.glglyph)return this.glglyph.set_visuals_changed()},n.prototype.render=function(t,e,n){if(t.beginPath(),null==this.glglyph||!this.glglyph.render(t,e,n))return this._render(t,e,n)},n.prototype.has_finished=function(){return!0},n.prototype.notify_finished=function(){return this.renderer.notify_finished()},n.prototype.bounds=function(){return null==this.index?s.empty():this._bounds(this.index.bbox)},n.prototype.log_bounds=function(){var t,e,n,i,r,o,a,l,u;if(null==this.index)return s.empty();for(t=s.empty(),o=this.index.search(s.positive_x()),a=this.index.search(s.positive_y()),e=0,i=o.length;et.maxX&&(t.maxX=l.maxX);for(n=0,r=a.length;nt.maxY&&(t.maxY=u.maxY);return this._bounds(t)},n.prototype.max_wh2_bounds=function(t){return{minX:t.minX-this.max_w2,maxX:t.maxX+this.max_w2,minY:t.minY-this.max_h2,maxY:t.maxY+this.max_h2}},n.prototype.get_anchor_point=function(t,e,n){var i=n[0],r=n[1];switch(t){case"center":return{x:this.scx(e,i,r),y:this.scy(e,i,r)};default:return null}},n.prototype.scx=function(t){return this.sx[t]},n.prototype.scy=function(t){return this.sy[t]},n.prototype.sdist=function(t,e,n,i,r){void 0===i&&(i="edge"),void 0===r&&(r=!1);var o,s,a,l,u,h,c;return null!=t.source_range.v_synthetic&&(e=t.source_range.v_synthetic(e)),"center"===i?(s=function(){var t,e,i;for(i=[],t=0,e=n.length;tn;a=0<=n?++t:--t)i.push(e[a]-s[a]);return i}(),u=function(){var t,n,i;for(i=[],a=t=0,n=e.length;0<=n?tn;a=0<=n?++t:--t)i.push(e[a]+s[a]);return i}()):(l=e,u=function(){var t,e,i;for(i=[],a=t=0,e=l.length;0<=e?te;a=0<=e?++t:--t)i.push(l[a]+n[a]);return i}()),h=t.v_compute(l),c=t.v_compute(u),r?function(){var t,e,n;for(n=[],a=t=0,e=h.length;0<=e?te;a=0<=e?++t:--t)n.push(Math.ceil(Math.abs(c[a]-h[a])));return n}():function(){var t,e,n;for(n=[],a=t=0,e=h.length;0<=e?te;a=0<=e?++t:--t)n.push(Math.abs(c[a]-h[a]));return n}()},n.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return null},n.prototype._generic_line_legend=function(t,e,n,i,r,o){return t.save(),t.beginPath(),t.moveTo(e,(i+r)/2),t.lineTo(n,(i+r)/2),this.visuals.line.doit&&(this.visuals.line.set_vectorize(t,o),t.stroke()),t.restore()},n.prototype._generic_area_legend=function(t,e,n,i,r,o){var s,a,l,u,h,c,_,p,d;if(u=[o],d=Math.abs(n-e),a=.1*d,l=Math.abs(r-i),s=.1*l,h=e+a,c=n-a,_=i+s,p=r-s,this.visuals.fill.doit&&(this.visuals.fill.set_vectorize(t,o),t.fillRect(h,_,c-h,p-_)),this.visuals.line.doit)return t.beginPath(),t.rect(h,_,c-h,p-_),this.visuals.line.set_vectorize(t,o),t.stroke()},n.prototype.hit_test=function(t){var e,n;return n=null,e="_hit_"+t.type,null!=this[e]?n=this[e](t):null==this._nohit_warned[t.type]&&(c.logger.debug("'"+t.type+"' selection not available for "+this.model.type),this._nohit_warned[t.type]=!0),n},n.prototype._hit_rect_against_index=function(t){var e,n,i,o,s,a,l,u,h,c;return i=t.sx0,o=t.sx1,s=t.sy0,a=t.sy1,_=this.renderer.xscale.r_invert(i,o),l=_[0],u=_[1],p=this.renderer.yscale.r_invert(s,a),h=p[0],c=p[1],e=r.validate_bbox_coords([l,u],[h,c]),n=r.create_hit_test_result(),n["1d"].indices=this.index.indices(e),n;var _,p},n.prototype.set_data=function(t,e,n){var i,r,o,s,l,u,h,c,p,f,m,v;if(i=this.model.materialize_dataspecs(t),this.visuals.set_all_indices(e),e&&!(this instanceof d.LineView)){r={};for(l in i)c=i[l],"_"===l.charAt(0)?r[l]=function(){var t,n,i;for(i=[],t=0,n=e.length;tl;t=0<=l?++n:--n)g=this.map_to_screen(this[d][t],this[f][t]),u=g[0],c=g[1],this[h].push(u),this[_].push(c);else y=this.map_to_screen(this[d],this[f]),this[h]=y[0],this[_]=y[1];return this._map_data();var m,v,g,y},n.prototype._map_data=function(){},n.prototype.map_to_screen=function(t,e){return this.renderer.plot_view.map_to_screen(t,e,this.model.x_range_name,this.model.y_range_name)},n}(l.View);var f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.coords=function(t){var e,n,i,r,s,a;for(e=this.prototype._coords.concat(t),this.prototype._coords=e,r={},n=0,i=t.length;nn;t=0<=n?++e:--e)this.stop.push(this.sy[t]-this.sh[t]/2),this.sbottom.push(this.sy[t]+this.sh[t]/2);return null},e}(r.BoxView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Box);n.HBar=s,s.prototype.default_view=n.HBarView,s.prototype.type="HBar",s.coords([["left","y"]]),s.define({height:[o.DistanceSpec],right:[o.NumberSpec]}),s.override({left:0})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r=t(364),o=t(128),s=t(146),a=t(15),l=t(22);n.ImageView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.connect(this.model.color_mapper.change,function(){return this._update_image()})},e.prototype._update_image=function(){if(null!=this.image_data)return this._set_data(),this.renderer.plot_view.request_render()},e.prototype._set_data=function(){var t,e,n,i,r,o,s,a,u,h,c,_;for(null!=this.image_data&&this.image_data.length===this._image.length||(this.image_data=new Array(this._image.length)),null!=this._width&&this._width.length===this._image.length||(this._width=new Array(this._image.length)),null!=this._height&&this._height.length===this._image.length||(this._height=new Array(this._image.length)),c=[],o=u=0,h=this._image.length;0<=h?uh;o=0<=h?++u:--u)_=[],null!=this._image_shape&&(_=this._image_shape[o]),_.length>0?(a=this._image[o],this._height[o]=_[0],this._width[o]=_[1]):(a=l.concat(this._image[o]),this._height[o]=this._image[o].length,this._width[o]=this._image[o][0].length),null!=this.image_data[o]&&this.image_data[o].width===this._width[o]&&this.image_data[o].height===this._height[o]?n=this.image_data[o]:(n=document.createElement("canvas"),n.width=this._width[o],n.height=this._height[o]),r=n.getContext("2d"),s=r.getImageData(0,0,this._width[o],this._height[o]),i=this.model.color_mapper,t=i.v_map_screen(a,!0),e=new Uint8Array(t),s.data.set(e),r.putImageData(s,0,0),this.image_data[o]=n,this.max_dw=0,"data"===this._dw.units&&(this.max_dw=l.max(this._dw)),this.max_dh=0,"data"===this._dh.units?c.push(this.max_dh=l.max(this._dh)):c.push(void 0);return c},e.prototype._map_data=function(){switch(this.model.properties.dw.units){case"data":this.sw=this.sdist(this.renderer.xscale,this._x,this._dw,"edge",this.model.dilate);break;case"screen":this.sw=this._dw}switch(this.model.properties.dh.units){case"data":return this.sh=this.sdist(this.renderer.yscale,this._y,this._dh,"edge",this.model.dilate);case"screen":return this.sh=this._dh}},e.prototype._render=function(t,e,n){var i,r,o,s,a,l=n.image_data,u=n.sx,h=n.sy,c=n.sw,_=n.sh;for(s=t.getImageSmoothingEnabled(),t.setImageSmoothingEnabled(!1),r=0,o=e.length;rd;u=0<=d?++_:--_)if(!(null!=e&&e.indexOf(u)<0)){if(v=[],null!=this._image_shape&&(v=this._image_shape[u]),v.length>0)n=this._image[u].buffer,this._height[u]=v[0],this._width[u]=v[1];else{for(l=s.concat(this._image[u]),n=new ArrayBuffer(4*l.length),o=new Uint32Array(n),c=p=0,f=l.length;0<=f?pf;c=0<=f?++p:--p)o[c]=l[c];this._height[u]=this._image[u].length,this._width[u]=this._image[u][0].length}null!=this.image_data[u]&&this.image_data[u].width===this._width[u]&&this.image_data[u].height===this._height[u]?r=this.image_data[u]:(r=document.createElement("canvas"),r.width=this._width[u],r.height=this._height[u]),a=r.getContext("2d"),h=a.getImageData(0,0,this._width[u],this._height[u]),i=new Uint8Array(n),h.data.set(i),a.putImageData(h,0,0),this.image_data[u]=r,this.max_dw=0,"data"===this._dw.units&&(this.max_dw=s.max(this._dw)),this.max_dh=0,"data"===this._dh.units?m.push(this.max_dh=s.max(this._dh)):m.push(void 0)}return m},e.prototype._map_data=function(){switch(this.model.properties.dw.units){case"data":this.sw=this.sdist(this.renderer.xscale,this._x,this._dw,"edge",this.model.dilate);break;case"screen":this.sw=this._dw}switch(this.model.properties.dh.units){case"data":return this.sh=this.sdist(this.renderer.yscale,this._y,this._dh,"edge",this.model.dilate);case"screen":return this.sh=this._dh}},e.prototype._render=function(t,e,n){var i,r,o,s,a,l=n.image_data,u=n.sx,h=n.sy,c=n.sw,_=n.sh;for(s=t.getImageSmoothingEnabled(),t.setImageSmoothingEnabled(!1),r=0,o=e.length;ri;t=0<=i?++n:--n)null!=this._url[t]&&(e=new Image,e.onerror=function(t,e){return function(){return l.retries[t]>0?(o.logger.trace("ImageURL failed to load "+l._url[t]+" image, retrying in "+a+" ms"),setTimeout(function(){return e.src=l._url[t]},a)):o.logger.warn("ImageURL unable to load "+l._url[t]+" image after "+s+" retries"),l.retries[t]-=1}}(t,e),e.onload=function(t,e){return function(){return l.image[e]=t,l.renderer.request_render()}}(e,t),r.push(e.src=this._url[t]));return r},e.prototype.has_finished=function(){return t.prototype.has_finished.call(this)&&this._images_rendered===!0},e.prototype._map_data=function(){var t,e,n;switch(e=function(){var t,e,i,r;if(null!=this.model.w)return this._w;for(i=this._x,r=[],t=0,e=i.length;t1&&(t.stroke(),i=!1)}i?t.lineTo(l[r],u[r]):(t.beginPath(),t.moveTo(l[r],u[r]),i=!0),s=r}if(i)return t.stroke()},e.prototype._hit_point=function(t){var e,n,i,r,s,a,l,u,h,c;for(u=o.create_hit_test_result(),a={x:t.sx,y:t.sy},h=9999,c=Math.max(2,this.visuals.line.line_width.value()/2),n=i=0,l=this.sx.length-1;0<=l?il;n=0<=l?++i:--i)_=[{x:this.sx[n],y:this.sy[n]},{x:this.sx[n+1],y:this.sy[n+1]}],r=_[0],s=_[1],e=o.dist_to_segment(a,r,s),ei;e=0<=i?++n:--n)(u[e]<=l&&l<=u[e+1]||u[e+1]<=l&&l<=u[e])&&(r["0d"].glyph=this.model,r["0d"].get_view=function(){return this}.bind(this),r["0d"].flag=!0,r["0d"].indices.push(e));return r},e.prototype.get_interpolation_hit=function(t,e){var n,i,r,s,a,l,u,h,c,_,p;return i=e.sx,r=e.sy,d=[this._x[t],this._y[t],this._x[t+1],this._y[t+1]],l=d[0],_=d[1],u=d[2],p=d[3],"point"===e.type?(f=this.renderer.yscale.r_invert(r-1,r+1),h=f[0],c=f[1],m=this.renderer.xscale.r_invert(i-1,i+1),s=m[0],a=m[1]):"v"===e.direction?(v=this.renderer.yscale.r_invert(r,r),h=v[0],c=v[1],g=[l,u],s=g[0],a=g[1]):(y=this.renderer.xscale.r_invert(i,i),s=y[0],a=y[1],b=[_,p],h=b[0],c=b[1]),n=o.check_2_segments_intersect(s,h,a,c,l,_,u,p),[n.x,n.y];var d,f,m,v,g,y,b},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_line_legend(t,e,n,i,r,o)},e}(r.XYGlyphView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Line=s,s.prototype.default_view=n.LineView,s.prototype.type="Line",s.mixins(["line"])},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(36),o=t(9),s=t(22),a=t(42),l=t(108);n.MultiLineView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._index_data=function(){var t,e,n,i,o,l,u,h;for(n=[],t=e=0,i=this._xs.length;0<=i?ei;t=0<=i?++e:--e)null!==this._xs[t]&&0!==this._xs[t].length&&(l=function(){var e,n,i,r;for(i=this._xs[t],r=[],e=0,n=i.length;el;r=0<=l?++s:--s)0!==r?isNaN(h[r])||isNaN(c[r])?(t.stroke(),t.beginPath()):t.lineTo(h[r],c[r]):(t.beginPath(),t.moveTo(h[r],c[r]));u.push(t.stroke())}return u;var d},e.prototype._hit_point=function(t){var e,n,i,r,s,a,l,u,h,c,_,p,d,f,m;for(d=o.create_hit_test_result(),h={x:t.sx,y:t.sy},f=9999,n={},i=s=0,_=this.sxs.length;0<=_?s<_:s>_;i=0<=_?++s:--s){for(m=Math.max(2,this.visuals.line.cache_select("line_width",i)/2),c=null,r=a=0,p=this.sxs[i].length-1;0<=p?ap;r=0<=p?++a:--a)v=[{x:this.sxs[i][r],y:this.sys[i][r]},{x:this.sxs[i][r+1],y:this.sys[i][r+1]}],l=v[0],u=v[1],e=o.dist_to_segment(h,l,u),el;n=0<=l?++r:--r){for(a=[],i=s=0,u=d[n].length-1;0<=u?su;i=0<=u?++s:--s)d[n][i]<=p&&p<=d[n][i+1]&&a.push(i);a.length>0&&(e[n]=a)}return h["1d"].indices=function(){var t,i,r,o;for(r=Object.keys(e),o=[],i=0,t=r.length;i1?(c[o]=s,h[o]=s/u):(c[o]=s*u,h[o]=s),a={sx:_,sy:p,sw:c,sh:h},this._render(t,l,a)},e.prototype._bounds=function(t){return this.max_wh2_bounds(t)},e}(r.XYGlyphView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Oval=s,s.prototype.default_view=n.OvalView,s.prototype.type="Oval",s.mixins(["line","fill"]),s.define({angle:[o.AngleSpec,0],width:[o.DistanceSpec],height:[o.DistanceSpec]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(128);n.PatchView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._render=function(t,e,n){var i,r,o,s,a,l=n.sx,u=n.sy;if(this.visuals.fill.doit){for(this.visuals.fill.set_value(t),r=0,s=e.length;rc;i=0<=c?++r:--r)for(n[i]=[],u=s.copy(t[i]);u.length>0;)o=s.findLastIndex(u,function(t){return a.isStrictNaN(t)}),o>=0?h=u.splice(o):(h=u,u=[]),e=function(){var t,e,n;for(n=[],t=0,e=h.length;ta;t=0<=a?++n:--n)for(e=i=0,l=h[t].length;0<=l?il;e=0<=l?++i:--i)u=h[t][e],c=_[t][e],0!==u.length&&o.push({minX:s.min(u),minY:s.min(c),maxX:s.max(u),maxY:s.max(c),i:t});return new r.RBush(o)},e.prototype._mask_data=function(t){var e,n,i,r,o,s,a,u;return o=this.renderer.plot_view.frame.x_ranges["default"],h=[o.min,o.max],i=h[0],r=h[1],u=this.renderer.plot_view.frame.y_ranges["default"],c=[u.min,u.max],s=c[0],a=c[1],e=l.validate_bbox_coords([i,r],[s,a]),n=this.index.indices(e),n.sort(function(t,e){return t-e});var h,c},e.prototype._render=function(t,e,n){var i,r,o,s,a,l,u,h,c,_,p,d=n.sxs,f=n.sys;for(this.renderer.sxss=this._build_discontinuous_object(d),this.renderer.syss=this._build_discontinuous_object(f),c=[],o=0,a=e.length;ou;r=0<=u?++s:--s)0!==r?isNaN(_[r]+p[r])?(t.closePath(),t.fill(),t.beginPath()):t.lineTo(_[r],p[r]):(t.beginPath(),t.moveTo(_[r],p[r]));t.closePath(),t.fill()}if(this.visuals.line.doit){for(this.visuals.line.set_vectorize(t,i),r=l=0,h=_.length;0<=h?lh;r=0<=h?++l:--l)0!==r?isNaN(_[r]+p[r])?(t.closePath(),t.stroke(),t.beginPath()):t.lineTo(_[r],p[r]):(t.beginPath(),t.moveTo(_[r],p[r]));t.closePath(),c.push(t.stroke())}else c.push(void 0)}return c;var m},e.prototype._hit_point=function(t){var e,n,i,r,o,s,a,u,h,c,_,p,d,f,m,v;for(_=t.sx,d=t.sy,m=this.renderer.xscale.invert(_),v=this.renderer.yscale.invert(d),e=this.index.indices({minX:m,minY:v,maxX:m,maxY:v}),n=[],i=s=0,u=e.length;0<=u?su;i=0<=u?++s:--s)for(r=e[i],p=this.renderer.sxss[r],f=this.renderer.syss[r],o=a=0,h=p.length;0<=h?ah;o=0<=h?++a:--a)l.point_in_poly(_,d,p[o],f[o])&&n.push(r);return c=l.create_hit_test_result(),c["1d"].indices=n,c},e.prototype._get_snap_coord=function(t){var e,n,i,r;for(r=0,e=0,n=t.length;eo;i=0<=o?++r:--r)if(l.point_in_poly(e,n,s[i],a[i]))return this._get_snap_coord(s[i]);return null},e.prototype.scy=function(t,e,n){var i,r,o,s,a;if(1===this.renderer.syss[t].length)return this._get_snap_coord(this.sys[t]);for(s=this.renderer.sxss[t],a=this.renderer.syss[t],i=r=0,o=s.length;0<=o?ro;i=0<=o?++r:--r)if(l.point_in_poly(e,n,s[i],a[i]))return this._get_snap_coord(a[i])},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_area_legend(t,e,n,i,r,o)},e}(o.GlyphView);var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.Glyph);n.Patches=u,u.prototype.default_view=n.PatchesView,u.prototype.type="Patches",u.coords([["xs","ys"]]),u.mixins(["line","fill"])},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(105);n.QuadView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_anchor_point=function(t,e,n){var i,r,o,s;switch(r=Math.min(this.sleft[e],this.sright[e]),o=Math.max(this.sright[e],this.sleft[e]),s=Math.min(this.stop[e],this.sbottom[e]),i=Math.max(this.sbottom[e],this.stop[e]),t){case"top_left":return{x:r,y:s};case"top_center":return{x:(r+o)/2,y:s};case"top_right":return{x:o,y:s};case"center_right":return{x:o,y:(s+i)/2};case"bottom_right":return{x:o,y:i};case"bottom_center":return{x:(r+o)/2,y:i};case"bottom_left":return{x:r,y:i};case"center_left":return{x:r,y:(s+i)/2};case"center":return{x:(r+o)/2,y:(s+i)/2}}},e.prototype.scx=function(t){return(this.sleft[t]+this.sright[t])/2},e.prototype.scy=function(t){return(this.stop[t]+this.sbottom[t])/2},e.prototype._index_data=function(){return this._index_box(this._right.length)},e.prototype._lrtb=function(t){var e,n,i,r;return n=this._left[t],i=this._right[t],r=this._top[t],e=this._bottom[t],[n,i,r,e]},e}(r.BoxView);var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Box);n.Quad=o,o.prototype.default_view=n.QuadView,o.prototype.type="Quad",o.coords([["right","bottom"],["left","top"]])},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r=t(364),o=t(36),s=t(108);i=function(t,e,n){var i,r;return e===(t+n)/2?[t,n]:(r=(t-e)/(t-2*e+n),i=t*Math.pow(1-r,2)+2*e*(1-r)*r+n*Math.pow(r,2),[Math.min(t,n,i),Math.max(t,n,i)])},n.QuadraticView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype._index_data=function(){var t,e,n,r,s,a,l,u;for(n=[],t=e=0,r=this._x0.length;0<=r?er;t=0<=r?++e:--e)isNaN(this._x0[t]+this._x1[t]+this._y0[t]+this._y1[t]+this._cx[t]+this._cy[t])||(h=i(this._x0[t],this._cx[t],this._x1[t]),s=h[0],a=h[1],c=i(this._y0[t],this._cy[t],this._y1[t]),l=c[0],u=c[1],n.push({minX:s,minY:l,maxX:a,maxY:u,i:t}));return new o.RBush(n);var h,c},e.prototype._render=function(t,e,n){var i,r,o,s,a=n.sx0,l=n.sy0,u=n.sx1,h=n.sy1,c=n.scx,_=n.scy;if(this.visuals.line.doit){for(s=[],r=0,o=e.length;ru;r=0<=u?++s:--s)0===d[r]&&(d[r]=o);for(h=[],a=0,l=e.length;an;t=0<=n?++e:--e)i.push(this.sx[t]-this.sw[t]/2);return i}.call(this)),"data"===this.model.properties.height.units?(n=this._map_dist_corner_for_data_side_length(this._y,this._height,this.renderer.yscale,1),this.sh=n[0],this.sy1=n[1]):(this.sh=this._height,this.sy1=function(){var e,n,i;for(i=[],t=e=0,n=this.sy.length;0<=n?en;t=0<=n?++e:--e)i.push(this.sy[t]-this.sh[t]/2);return i}.call(this)),this.ssemi_diag=function(){var e,n,i;for(i=[],t=e=0,n=this.sw.length;0<=n?en;t=0<=n?++e:--e)i.push(Math.sqrt(this.sw[t]/2*this.sw[t]/2+this.sh[t]/2*this.sh[t]/2));return i}.call(this);var e,n},e.prototype._render=function(t,e,n){var i,r,o,s,a,l=n.sx,u=n.sy,h=n.sx0,c=n.sy1,_=n.sw,p=n.sh,d=n._angle;if(this.visuals.fill.doit)for(r=0,s=e.length;re;l=0<=e?++t:--t)n.push(this.sx0[l]+this.sw[l]/2);return n}.call(this),y=function(){var t,e,n;for(n=[],l=t=0,e=this.sy1.length;0<=e?te;l=0<=e?++t:--t)n.push(this.sy1[l]+this.sh[l]/2);return n}.call(this),c=a.max(this._ddist(0,g,this.ssemi_diag)),_=a.max(this._ddist(1,y,this.ssemi_diag)),M=k-c,S=k+c,O=T-_,A=T+_,s=[],e=o.validate_bbox_coords([M,S],[O,A]),f=this.index.indices(e),u=0,h=f.length;u=0,r=x-this.sy1[l]<=this.sh[l]&&x-this.sy1[l]>=0),r&&w&&s.push(l);return m=o.create_hit_test_result(),m["1d"].indices=s,m},e.prototype._map_dist_corner_for_data_side_length=function(t,e,n,i){var r,o,s,a,l,u,h,c,_,p,d,f,m;if(r=this.renderer.plot_view.frame,null!=n.source_range.synthetic&&(t=function(){var e,i,r;for(r=[],e=0,i=t.length;ei;o=0<=i?++n:--n)r.push(Number(t[o])-e[o]/2);return r}(),u=function(){var n,i,r;for(r=[],o=n=0,i=t.length;0<=i?ni;o=0<=i?++n:--n)r.push(Number(t[o])+e[o]/2);return r}(),_=n.v_compute(l),p=n.v_compute(u),f=this.sdist(n,l,e,"edge",this.model.dilate),0===i){for(d=_,o=s=0,h=_.length;0<=h?sh;o=0<=h?++s:--s)if(_[o]!==p[o]){d=_[o]c;o=0<=c?++a:--a)if(_[o]!==p[o]){d=_[o]e;i=0<=e?++t:--t)r.push(a[i]+n[i]);return r}(),r=s.v_invert(a),o=s.v_invert(l),function(){var t,e,n;for(n=[],i=t=0,e=r.length;0<=e?te;i=0<=e?++t:--t)n.push(Math.abs(o[i]-r[i]));return n}()},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_area_legend(t,e,n,i,r,o)},e.prototype._bounds=function(t){return this.max_wh2_bounds(t)},e}(r.XYGlyphView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Rect=l,l.prototype.default_view=n.RectView,l.prototype.type="Rect",l.mixins(["line","fill"]),l.define({angle:[s.AngleSpec,0],width:[s.DistanceSpec],height:[s.DistanceSpec],dilate:[s.Bool,!1]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(9),o=t(36),s=t(108);n.SegmentView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._index_data=function(){var t,e,n,i;for(n=[],t=e=0,i=this._x0.length;0<=i?ei;t=0<=i?++e:--e)isNaN(this._x0[t]+this._x1[t]+this._y0[t]+this._y1[t])||n.push({minX:Math.min(this._x0[t],this._x1[t]),minY:Math.min(this._y0[t],this._y1[t]),maxX:Math.max(this._x0[t],this._x1[t]),maxY:Math.max(this._y0[t],this._y1[t]),i:t});return new o.RBush(n)},e.prototype._render=function(t,e,n){var i,r,o,s,a=n.sx0,l=n.sy0,u=n.sx1,h=n.sy1;if(this.visuals.line.doit){for(s=[],r=0,o=e.length;rs;r=1<=s?++o:--o){switch(this.model.mode){case"before":d=[_[r-1],p[r]],a=d[0],h=d[1],f=[_[r],p[r]],l=f[0],c=f[1];break;case"after":m=[_[r],p[r-1]],a=m[0],h=m[1],v=[_[r],p[r]],l=v[0],c=v[1];break;case"center":u=(_[r-1]+_[r])/2,g=[u,p[r-1]],a=g[0],h=g[1],y=[u,p[r]],l=y[0],c=y[1]}t.lineTo(a,h),t.lineTo(l,c)}return t.lineTo(_[i-1],p[i-1]),t.stroke();var d,f,m,v,g,y}},e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){return this._generic_line_legend(t,e,n,i,r,o)},e}(r.XYGlyphView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Step=s,s.prototype.default_view=n.StepView,s.prototype.type="Step",s.mixins(["line"]),s.define({mode:[o.StepMode,"before"]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(128),o=t(15),s=t(40);n.TextView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._render=function(t,e,n){var i,r,o,a,l,u,h,c,_,p,d,f,m,v,g,y=n.sx,b=n.sy,x=n._x_offset,w=n._y_offset,k=n._angle,M=n._text;for(m=[],u=0,c=e.length;un;t=0<=n?++e:--e)this.sleft.push(this.sx[t]-this.sw[t]/2),this.sright.push(this.sx[t]+this.sw[t]/2);return null},e}(r.BoxView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Box);n.VBar=s,s.prototype.default_view=n.VBarView,s.prototype.type="VBar",s.coords([["x","bottom"]]),s.define({width:[o.DistanceSpec],top:[o.NumberSpec]}),s.override({bottom:0})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(128),o=t(9),s=t(15),a=t(29);n.WedgeView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._map_data=function(){return"data"===this.model.properties.radius.units?this.sradius=this.sdist(this.renderer.xscale,this._x,this._radius):this.sradius=this._radius},e.prototype._render=function(t,e,n){var i,r,o,s,a,l=n.sx,u=n.sy,h=n.sradius,c=n._start_angle,_=n._end_angle;for(i=this.model.properties.direction.value(),a=[],o=0,s=e.length;oi;t=0<=i?++e:--e)o=this._x[t],s=this._y[t],!isNaN(o+s)&&isFinite(o+s)&&n.push({minX:o,minY:s,maxX:o,maxY:s,i:t});return new r.RBush(n)},e}(o.GlyphView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.Glyph);n.XYGlyph=s,s.prototype.type="XYGlyph",s.prototype.default_view=n.XYGlyphView,s.coords([["x","y"]])},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(50),o=t(22),s=t(9);n.GraphHitTestPolicy=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.do_selection=function(t,e,n,i){return!1},e.prototype.do_inspection=function(t,e,n,i){return!1},e}(r.Model);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._do=function(t,e,n,i){var r,o;return o=e.node_view,r=o.glyph.hit_test(t),null!==r&&(this._node_selector.update(r,n,i),!this._node_selector.indices.is_empty())},e.prototype.do_selection=function(t,e,n,i){var r;return this._node_selector=e.node_view.model.data_source.selection_manager.selector,r=this._do(t,e,n,i),e.node_view.model.data_source.selected=this._node_selector.indices,e.node_view.model.data_source.select.emit(),r},e.prototype.do_inspection=function(t,e,n,i){var r;return this._node_selector=e.model.get_selection_manager().get_or_create_inspector(e.node_view.model),r=this._do(t,e,n,i),e.node_view.model.data_source.setv({inspected:this._node_selector.indices},{silent:!0}),e.node_view.model.data_source.inspect.emit([e.node_view,{geometry:t}]),r},e}(n.GraphHitTestPolicy);n.NodesOnly=a,a.prototype.type="NodesOnly";var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._do=function(t,e,n,i){var r,a,l,u,h,c,_,p,d,f,m,v;if(g=[e.node_view,e.edge_view],m=g[0],l=g[1],u=m.glyph.hit_test(t),null===u)return!1;for(this._node_selector.update(u,n,i),f=function(){var t,e,n,i;for(n=u["1d"].indices,i=[],t=0,e=n.length;tv;h=0<=v?++c:--c)(o.contains(f,a.data.start[h])||o.contains(f,a.data.end[h]))&&r.push(h);for(d=s.create_hit_test_result(),_=0,p=r.length;_a;r=0<=a?++s:--s)o=null!=this.graph_layout[u[r]]&&null!=this.graph_layout[n[r]],i&&o?(h.push(t.data.xs[r]),c.push(t.data.ys[r])):(o?(p=[this.graph_layout[u[r]],this.graph_layout[n[r]]],l=p[0],e=p[1]):(d=[[NaN,NaN],[NaN,NaN]],l=d[0],e=d[1]),h.push([l[0],e[0]]),c.push([l[1],e[1]]));return[h,c];var _,p,d},e}(r.LayoutProvider);n.StaticLayoutProvider=s,s.prototype.type="StaticLayoutProvider",s.define({graph_layout:[o.Any,{}]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(163),o=t(165),s=t(15),a=t(42);n.GridView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this._x_range_name=this.model.x_range_name,this._y_range_name=this.model.y_range_name},e.prototype.render=function(){var t;if(this.model.visible!==!1)return t=this.plot_view.canvas_view.ctx,t.save(),this._draw_regions(t),this._draw_minor_grids(t),this._draw_grids(t),t.restore()},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return this.request_render()})},e.prototype._draw_regions=function(t){var e,n,i,r,o,s,a,l,u;if(this.visuals.band_fill.doit){for(h=this.model.grid_coords("major",!1),l=h[0],u=h[1],this.visuals.band_fill.set_value(t),e=n=0,i=l.length-1;0<=i?ni;e=0<=i?++n:--n)e%2===1&&(c=this.plot_view.map_to_screen(l[e],u[e],this._x_range_name,this._y_range_name),r=c[0],s=c[1],_=this.plot_view.map_to_screen(l[e+1],u[e+1],this._x_range_name,this._y_range_name),o=_[0],a=_[1],t.fillRect(r[0],s[0],o[1]-r[0],a[1]-s[0]),t.fill());var h,c,_}},e.prototype._draw_grids=function(t){var e,n;if(this.visuals.grid_line.doit){return i=this.model.grid_coords("major"),e=i[0],n=i[1],this._draw_grid_helper(t,this.visuals.grid_line,e,n);var i}},e.prototype._draw_minor_grids=function(t){var e,n;if(this.visuals.minor_grid_line.doit){return i=this.model.grid_coords("minor"),e=i[0],n=i[1],this._draw_grid_helper(t,this.visuals.minor_grid_line,e,n);var i}},e.prototype._draw_grid_helper=function(t,e,n,i){var r,o,s,a,l,u,h;for(e.set_value(t),r=o=0,a=n.length;0<=a?oa;r=0<=a?++o:--o){for(c=this.plot_view.map_to_screen(n[r],i[r],this._x_range_name,this._y_range_name),u=c[0],h=c[1],t.beginPath(),t.moveTo(Math.round(u[0]),Math.round(h[0])),r=s=1,l=u.length;1<=l?sl;r=1<=l?++s:--s)t.lineTo(Math.round(u[r]),Math.round(h[r]));t.stroke()}var c},e}(o.RendererView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.ranges=function(){var t,e,n,i;return e=this.dimension,n=(e+1)%2,t=this.plot.plot_canvas.frame,i=[t.x_ranges[this.x_range_name],t.y_ranges[this.y_range_name]],[i[e],i[n]]},e.prototype.computed_bounds=function(){var t,e,n,i,r,o;return s=this.ranges(),n=s[0],t=s[1],o=this.bounds,i=[n.min,n.max],a.isArray(o)?(r=Math.min(o[0],o[1]),e=Math.max(o[0],o[1]),ri[1]&&(r=null),e>i[1]?e=i[1]:eb;c=0<=b?++p:--p)if(k[c]!==v&&k[c]!==m||!e){for(a=[],l=[],n=2,g=d=0,x=n;0<=x?dx;g=0<=x?++d:--d)f=r+(i-r)/(n-1)*g,a.push(k[c]),l.push(f);o[h].push(a),o[_].push(l)}return o;var S,T},e}(r.GuideRenderer);n.Grid=l,l.prototype.default_view=n.GridView,l.prototype.type="Grid",l.mixins(["line:grid_","line:minor_grid_","fill:band_"]),l.define({bounds:[s.Any,"auto"],dimension:[s.Number,0],ticker:[s.Instance],x_range_name:[s.String,"default"],y_range_name:[s.String,"default"]}),l.override({level:"underlay",band_fill_color:null,band_fill_alpha:0,grid_line_color:"#e5e5e5",minor_grid_line_color:null})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(133);n.Grid=i.Grid},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364);i.__exportStar(t(57),n),i.__exportStar(t(73),n),i.__exportStar(t(77),n),i.__exportStar(t(81),n),i.__exportStar(t(83),n),i.__exportStar(t(89),n),i.__exportStar(t(95),n),i.__exportStar(t(113),n),i.__exportStar(t(130),n),i.__exportStar(t(134),n),i.__exportStar(t(138),n),i.__exportStar(t(145),n),i.__exportStar(t(238),n),i.__exportStar(t(148),n),i.__exportStar(t(152),n),i.__exportStar(t(158),n),i.__exportStar(t(164),n),i.__exportStar(t(167),n),i.__exportStar(t(177),n),i.__exportStar(t(187),n),i.__exportStar(t(199),n),i.__exportStar(t(226),n)},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=[].indexOf,o=t(13),s=t(15),a=t(22),l=t(30),u=t(139),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),this.connect(this.model.properties.children.change,function(){return e.rebuild_child_views()})},e.prototype.get_height=function(){var t,e,n;return e=this.model.get_layoutable_children(),t=e.map(function(t){return t._height.value}),n=this.model._horizontal?a.max(t):a.sum(t)},e.prototype.get_width=function(){var t,e,n;return e=this.model.get_layoutable_children(),t=e.map(function(t){return t._width.value}),n=this.model._horizontal?a.sum(t):a.max(t)},e}(u.LayoutDOMView);n.BoxView=h,h.prototype.className="bk-grid";var c=function(t){function e(e,n){var i=t.call(this,e,n)||this;return i._child_equal_size_width=new o.Variable(i.toString()+".child_equal_size_width"),i._child_equal_size_height=new o.Variable(i.toString()+".child_equal_size_height"),i._box_equal_size_top=new o.Variable(i.toString()+".box_equal_size_top"),i._box_equal_size_bottom=new o.Variable(i.toString()+".box_equal_size_bottom"),i._box_equal_size_left=new o.Variable(i.toString()+".box_equal_size_left"),i._box_equal_size_right=new o.Variable(i.toString()+".box_equal_size_right"),i._box_cell_align_top=new o.Variable(i.toString()+".box_cell_align_top"),i._box_cell_align_bottom=new o.Variable(i.toString()+".box_cell_align_bottom"),i._box_cell_align_left=new o.Variable(i.toString()+".box_cell_align_left"),i._box_cell_align_right=new o.Variable(i.toString()+".box_cell_align_right"),i}return i.__extends(e,t),e.prototype.get_layoutable_children=function(){return this.children},e.prototype.get_constrained_variables=function(){return l.extend({},t.prototype.get_constrained_variables.call(this),{box_equal_size_top:this._box_equal_size_top,box_equal_size_bottom:this._box_equal_size_bottom,box_equal_size_left:this._box_equal_size_left,box_equal_size_right:this._box_equal_size_right,box_cell_align_top:this._box_cell_align_top,box_cell_align_bottom:this._box_cell_align_bottom,box_cell_align_left:this._box_cell_align_left,box_cell_align_right:this._box_cell_align_right})},e.prototype.get_constraints=function(){var e,n,i,r,s,a,l,u,h,c,_,p,d;if(r=t.prototype.get_constraints.call(this),e=function(){for(var t=[],e=0;ep;s=1<=p?++l:--l)c=this._info(i[s].get_constrained_variables()),u.span.size&&e(o.EQ(u.span.start,u.span.size,[-1,c.span.start])),e(o.WEAK_EQ(u.whitespace.after,c.whitespace.before,0-this.spacing)),e(o.GE(u.whitespace.after,c.whitespace.before,0-this.spacing)),u=c;return this._horizontal?null!=d.width&&e(o.EQ(u.span.start,u.span.size,[-1,this._width])):null!=d.height&&e(o.EQ(u.span.start,u.span.size,[-1,this._height])),r=r.concat(this._align_outer_edges_constraints(!0),this._align_outer_edges_constraints(!1),this._align_inner_cell_edges_constraints(),this._box_equal_size_bounds(!0),this._box_equal_size_bounds(!1),this._box_cell_align_bounds(!0),this._box_cell_align_bounds(!1),this._box_whitespace(!0),this._box_whitespace(!1))},e.prototype._child_rect=function(t){return{x:t.origin_x,y:t.origin_y,width:t.width,height:t.height}},e.prototype._span=function(t){return this._horizontal?{start:t.x,size:t.width}:{start:t.y,size:t.height}},e.prototype._info=function(t){var e,n;return n=this._horizontal?{before:t.whitespace_left,after:t.whitespace_right}:{before:t.whitespace_top,after:t.whitespace_bottom},e=this._span(this._child_rect(t)),{span:e,whitespace:n}},e.prototype._flatten_cell_edge_variables=function(t){var n,i,r,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w;for(x=t?e._top_bottom_inner_cell_edge_variables:e._left_right_inner_cell_edge_variables,n=t!==this._horizontal,l=this.get_layoutable_children(),r=l.length,h={},o=0,c=0,f=l.length;c1?y[1]:"",u=this._horizontal?"row":"col",g=d+" "+u+"-"+r+"-"+o+"-"+b):g=p,g in h?h[g]=h[g].concat(w):h[g]=w;o+=1}return h},e.prototype._align_inner_cell_edges_constraints=function(){var t,e,n,i,s,a,l,u;if(t=[],null!=this.document&&r.call(this.document.roots(),this)>=0){e=this._flatten_cell_edge_variables(this._horizontal);for(s in e)if(u=e[s],u.length>1)for(a=u[0],n=i=1,l=u.length;1<=l?il;n=1<=l?++i:--i)t.push(o.EQ(u[n],[-1,a]))}return t},e.prototype._find_edge_leaves=function(t){var n,i,r,o,s,a,l,u;if(r=this.get_layoutable_children(),a=[[],[]],r.length>0)if(this._horizontal===t)u=r[0],o=r[r.length-1],u instanceof e?a[0]=a[0].concat(u._find_edge_leaves(t)[0]):a[0].push(u),o instanceof e?a[1]=a[1].concat(o._find_edge_leaves(t)[1]):a[1].push(o);else for(s=0,l=r.length;s1){for(n=t[0],i=r=1,s=t.length;1<=s?rs;i=1<=s?++r:--r)e=t[i],a.push(o.EQ([-1,n],e));return null}},e(l),e(i),a;var c},e.prototype._box_insets_from_child_insets=function(t,e,n,i){var r,s,a,l,u,h,c,_;return p=this._find_edge_leaves(t),c=p[0],s=p[1],t?(_=e+"_left",a=e+"_right",u=this[n+"_left"],l=this[n+"_right"]):(_=e+"_top",a=e+"_bottom",u=this[n+"_top"],l=this[n+"_bottom"]),h=[],r=function(t,e,n){var r,s,a,l,u;for(r=[],s=0,l=e.length;s0;)n=i.shift(),n instanceof e&&i.push.apply(i,n.get_layoutable_children()),t[n.toString()]=n.layout_bbox;return console.table(t)},e.prototype.get_all_constraints=function(){var t,e,n,i,r;for(e=this.get_constraints(),r=this.get_layoutable_children(),n=0,i=r.length;n0?this.model._width.value-20+"px":"100%",this.el.style.width=t)},e.prototype.get_height=function(){var t,e,n,i,o,s,a,l;n=0,a=this.child_views;for(i in a)r.call(a,i)&&(t=a[i],e=t.el,l=getComputedStyle(e),s=parseInt(l.marginTop)||0,o=parseInt(l.marginBottom)||0,n+=e.offsetHeight+s+o);return n+20},e.prototype.get_width=function(){var t,e,n,i,o;if(null!=this.model.width)return this.model.width;o=this.el.scrollWidth+20,i=this.child_views;for(n in i)r.call(i,n)&&(t=i[n],e=t.el.scrollWidth,e>o&&(o=e));return o},e}(l.LayoutDOMView);n.WidgetBoxView=u,u.prototype.className="bk-widget-box";var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){if(t.prototype.initialize.call(this,e),"fixed"===this.sizing_mode&&null===this.width&&(this.width=300,o.logger.info("WidgetBox mode is fixed, but no width specified. Using default of 300.")),"scale_height"===this.sizing_mode)return o.logger.warn("sizing_mode `scale_height` is not experimental for WidgetBox. Please report your results to the bokeh dev team so we can improve.")},e.prototype.get_constrained_variables=function(){var e;return e=a.extend({},t.prototype.get_constrained_variables.call(this),{on_edge_align_top:this._top,on_edge_align_bottom:this._height_minus_bottom,on_edge_align_left:this._left,on_edge_align_right:this._width_minus_right,box_cell_align_top:this._top,box_cell_align_bottom:this._height_minus_bottom,box_cell_align_left:this._left,box_cell_align_right:this._width_minus_right,box_equal_size_top:this._top,box_equal_size_bottom:this._height_minus_bottom}),"fixed"!==this.sizing_mode&&(e.box_equal_size_left=this._left,e.box_equal_size_right=this._width_minus_right),e},e.prototype.get_layoutable_children=function(){return this.children},e}(l.LayoutDOM);n.WidgetBox=h,h.prototype.type="WidgetBox",h.prototype.default_view=u,h.define({children:[s.Array,[]]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r=t(364),o=t(144),s=t(15),a=t(22),l=t(42);i=function(t,e){var n,i,r;if(t.length!==e.length)return!1;for(n=i=0,r=t.length;0<=r?ir;n=0<=r?++i:--i)if(t[n]!==e[n])return!1;return!0};var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype._get_values=function(t,e){var n,r,o,s,u,h;for(h=[],o=0,u=t.length;o=e.length?this.nan_color:e[s],h.push(n);return h},e}(o.ColorMapper);n.CategoricalColorMapper=u,u.prototype.type="CategoricalColorMapper",u.define({factors:[s.Array],start:[s.Number,0],end:[s.Number]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(15),o=t(243),s=t(42),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this._little_endian=this._is_little_endian(),this._palette=this._build_palette(this.palette),this.connect(this.change,function(){return this._palette=this._build_palette(this.palette)})},e.prototype.v_map_screen=function(t,e){void 0===e&&(e=!1);var n,i,r,o,s,a,l,u,h,c;if(c=this._get_values(t,this._palette,e),n=new ArrayBuffer(4*t.length),this._little_endian)for(i=new Uint8Array(n),r=s=0,l=t.length;0<=l?sl;r=0<=l?++s:--s)h=c[r],o=4*r,i[o]=Math.floor(h/4278190080*255),i[o+1]=(16711680&h)>>16,i[o+2]=(65280&h)>>8,i[o+3]=255&h;else for(i=new Uint32Array(n),r=a=0,u=t.length;0<=u?au;r=0<=u?++a:--a)h=c[r],i[r]=h<<8|255;return n},e.prototype.compute=function(t){return null},e.prototype.v_compute=function(t){var e;return e=this._get_values(t,this.palette)},e.prototype._get_values=function(t,e,n){return void 0===n&&(n=!1),[]},e.prototype._is_little_endian=function(){var t,e,n,i;return t=new ArrayBuffer(4),n=new Uint8Array(t),e=new Uint32Array(t),e[1]=168496141,i=!0,10===n[4]&&11===n[5]&&12===n[6]&&13===n[7]&&(i=!1),i},e.prototype._build_palette=function(t){var e,n,i,r,o;for(r=new Uint32Array(t.length),e=function(t){return s.isNumber(t)?t:(9!==t.length&&(t+="ff"),parseInt(t.slice(1),16))},n=i=0,o=t.length;0<=o?io;n=0<=o?++i:--i)r[n]=e(t[n]);return r},e}(o.Transform);n.ColorMapper=a,a.prototype.type="ColorMapper",a.define({palette:[r.Any],nan_color:[r.Color,"gray"]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(143);n.CategoricalColorMapper=i.CategoricalColorMapper;var r=t(144);n.ColorMapper=r.ColorMapper;var o=t(146);n.LinearColorMapper=o.LinearColorMapper;var s=t(147);n.LogColorMapper=s.LogColorMapper},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(15),o=t(26),s=t(22),a=t(144),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this._nan_color=this._build_palette([o.color2hex(this.nan_color)])[0],this._high_color=null!=this.high_color?this._build_palette([o.color2hex(this.high_color)])[0]:void 0,this._low_color=null!=this.low_color?this._build_palette([o.color2hex(this.low_color)])[0]:void 0},e.prototype._get_values=function(t,e,n){void 0===n&&(n=!1);var i,r,o,a,l,u,h,c,_,p,d,f,m,v,g,y;for(h=null!=(v=this.low)?v:s.min(t),r=null!=(g=this.high)?g:s.max(t),_=e.length-1,y=[],p=n?this._nan_color:this.nan_color,c=n?this._low_color:this.low_color,o=n?this._high_color:this.high_color,d=1/(r-h),m=1/e.length,a=0,u=t.length;a_?null!=this.high_color?y.push(o):y.push(e[_]):y.push(e[l])):y.push(e[_]);return y},e}(a.ColorMapper);n.LinearColorMapper=l,l.prototype.type="LinearColorMapper",l.define({high:[r.Number],low:[r.Number],high_color:[r.Color],low_color:[r.Color]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r,o=t(364),s=t(15),a=t(26),l=t(22),u=t(144);i=null!=(r=Math.log1p)?r:function(t){return Math.log(1+t)};var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this._nan_color=this._build_palette([a.color2hex(this.nan_color)])[0],this._high_color=null!=this.high_color?this._build_palette([a.color2hex(this.high_color)])[0]:void 0,this._low_color=null!=this.low_color?this._build_palette([a.color2hex(this.low_color)])[0]:void 0},e.prototype._get_values=function(t,e,n){void 0===n&&(n=!1);var r,o,s,a,u,h,c,_,p,d,f,m,v,g,y,b;for(f=e.length,_=null!=(v=this.low)?v:l.min(t),o=null!=(g=this.high)?g:l.max(t),y=f/(i(o)-i(_)),d=e.length-1,b=[],m=n?this._nan_color:this.nan_color,s=n?this._high_color:this.high_color,p=n?this._low_color:this.low_color,a=0,h=t.length;ao?null!=this.high_color?b.push(s):b.push(e[d]):r!==o?r<_?null!=this.low_color?b.push(p):b.push(e[0]):(c=i(r)-i(_),u=Math.floor(c*y),u>d&&(u=d),b.push(e[u])):b.push(e[d]);return b},e}(u.ColorMapper);n.LogColorMapper=h,h.prototype.type="LogColorMapper",h.define({high:[s.Number],low:[s.Number],high_color:[s.Color],low_color:[s.Color]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x=t(364),w=t(149);i=Math.sqrt(3),l=function(t,e){return t.moveTo(-e,e),t.lineTo(e,-e),t.moveTo(-e,-e),t.lineTo(e,e)},o=function(t,e){return t.moveTo(0,e),t.lineTo(0,-e),t.moveTo(-e,0),t.lineTo(e,0)},s=function(t,e){return t.moveTo(0,e),t.lineTo(e/1.5,0),t.lineTo(0,-e),t.lineTo(-e/1.5,0),t.closePath()},a=function(t,e){var n,r;return r=e*i,n=r/3,t.moveTo(-e,n),t.lineTo(e,n),t.lineTo(0,n-r),t.closePath()},u=function(t,e,n,i,r,s,a){var u;u=.65*r,o(t,r),l(t,u),s.doit&&(s.set_vectorize(t,e),t.stroke())},h=function(t,e,n,i,r,s,a){t.arc(0,0,r,0,2*Math.PI,!1),a.doit&&(a.set_vectorize(t,e),t.fill()),s.doit&&(s.set_vectorize(t,e),o(t,r),t.stroke())},c=function(t,e,n,i,r,o,s){t.arc(0,0,r,0,2*Math.PI,!1),s.doit&&(s.set_vectorize(t,e),t.fill()),o.doit&&(o.set_vectorize(t,e),l(t,r),t.stroke())},_=function(t,e,n,i,r,s,a){o(t,r),s.doit&&(s.set_vectorize(t,e),t.stroke())},p=function(t,e,n,i,r,o,a){s(t,r),a.doit&&(a.set_vectorize(t,e),t.fill()),o.doit&&(o.set_vectorize(t,e),t.stroke())},d=function(t,e,n,i,r,a,l){s(t,r),l.doit&&(l.set_vectorize(t,e),t.fill()),a.doit&&(a.set_vectorize(t,e),o(t,r),t.stroke())},f=function(t,e,n,i,r,o,s){t.rotate(Math.PI),a(t,r),t.rotate(-Math.PI),s.doit&&(s.set_vectorize(t,e),t.fill()),o.doit&&(o.set_vectorize(t,e),t.stroke())},m=function(t,e,n,i,r,o,s){var a;a=2*r,t.rect(-r,-r,a,a),s.doit&&(s.set_vectorize(t,e),t.fill()),o.doit&&(o.set_vectorize(t,e),t.stroke())},v=function(t,e,n,i,r,s,a){var l;l=2*r,t.rect(-r,-r,l,l),a.doit&&(a.set_vectorize(t,e),t.fill()),s.doit&&(s.set_vectorize(t,e),o(t,r),t.stroke())},g=function(t,e,n,i,r,o,s){var a;a=2*r,t.rect(-r,-r,a,a),s.doit&&(s.set_vectorize(t,e),t.fill()),o.doit&&(o.set_vectorize(t,e),l(t,r),t.stroke())},y=function(t,e,n,i,r,o,s){a(t,r),s.doit&&(s.set_vectorize(t,e),t.fill()),o.doit&&(o.set_vectorize(t,e),t.stroke())},b=function(t,e,n,i,r,o,s){l(t,r),o.doit&&(o.set_vectorize(t,e),t.stroke())},r=function(t,e){var n,i;return i=function(){var t=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return x.__extends(e,t),e}(w.MarkerView);return t.prototype._render_one=e,t}(),n=function(){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return x.__extends(e,t),e}(w.Marker);return e.prototype.default_view=i,e.prototype.type=t,e}()},n.Asterisk=r("Asterisk",u),n.CircleCross=r("CircleCross",h),n.CircleX=r("CircleX",c),n.Cross=r("Cross",_),n.Diamond=r("Diamond",p),n.DiamondCross=r("DiamondCross",d),n.InvertedTriangle=r("InvertedTriangle",f),n.Square=r("Square",m),n.SquareCross=r("SquareCross",v),n.SquareX=r("SquareX",g),n.Triangle=r("Triangle",y),n.X=r("X",b)},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(128),o=t(9),s=t(15);n.MarkerView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.draw_legend_for_index=function(t,e,n,i,r,o){var s,a,l,u,h,c;return l=[o],h={},h[o]=(e+n)/2,c={},c[o]=(i+r)/2,u={},u[o]=.4*Math.min(Math.abs(n-e),Math.abs(r-i)),s={},s[o]=this._angle[o],a={sx:h,sy:c,_size:u,_angle:s},this._render(t,l,a)},e.prototype._render=function(t,e,n){var i,r,o,s,a,l=n.sx,u=n.sy,h=n._size,c=n._angle;for(a=[],r=0,o=e.length;re;0<=e?t++:t--)u.push(t);return u}.apply(this),n=[],i=s=0,a=e.length;0<=a?sa;i=0<=a?++s:--s)r=e[i],o.point_in_poly(this.sx[i],this.sy[i],h,c)&&n.push(r);return l=o.create_hit_test_result(),l["1d"].indices=n,l},e}(r.XYGlyphView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.XYGlyph);n.Marker=a,a.mixins(["line","fill"]),a.define({size:[s.DistanceSpec,{units:"screen",value:4}],angle:[s.AngleSpec,0]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(14),o=t(151),s=t(153),a=t(15),l=t(50),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(l.Model);n.MapOptions=u,u.prototype.type="MapOptions",u.define({lat:[a.Number],lng:[a.Number],zoom:[a.Number,12]});var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(u);n.GMapOptions=h,h.prototype.type="GMapOptions",h.define({map_type:[a.String,"roadmap"],scale_control:[a.Bool,!1],styles:[a.String]}),n.GMapPlotView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(s.PlotView);var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){if(t.prototype.initialize.call(this,e),!this.api_key)return r.logger.error("api_key is required. See https://developers.google.com/maps/documentation/javascript/get-api-key for more information on how to obtain your own.")},e.prototype._init_plot_canvas=function(){return new o.GMapPlotCanvas({plot:this})},e}(s.Plot);n.GMapPlot=c,c.prototype.type="GMapPlot",c.prototype.default_view=n.GMapPlotView,c.define({map_options:[a.Instance],api_key:[a.String]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r,o=t(364),s=function(t,e){if(!(t instanceof e))throw new Error("Bound instance method accessed before binding")},a=t(31),l=t(154),u=t(20);i=new u.Signal(this,"gmaps_ready"),r=function(t){var e;return window._bokeh_gmaps_callback=function(){return i.emit()},e=document.createElement("script"),e.type="text/javascript",e.src="https://maps.googleapis.com/maps/api/js?key="+t+"&callback=_bokeh_gmaps_callback",document.body.appendChild(e)},n.GMapPlotCanvasView=function(t){function e(){var e=t.apply(this,arguments)||this;return e._get_latlon_bounds=e._get_latlon_bounds.bind(e),e._get_projected_bounds=e._get_projected_bounds.bind(e),e._set_bokeh_ranges=e._set_bokeh_ranges.bind(e),e}return o.__extends(e,t),e.prototype.initialize=function(e){var n,o,s=this;return this.pause(),t.prototype.initialize.call(this,e),this._tiles_loaded=!1,this.zoom_count=0,n=this.model.plot.map_options,this.initial_zoom=n.zoom,this.initial_lat=n.lat,this.initial_lng=n.lng,this.canvas_view.map_el.style.position="absolute",null==(null!=(o=window.google)?o.maps:void 0)&&(null==window._bokeh_gmaps_callback&&r(this.model.plot.api_key),i.connect(function(){return s.request_render()})),this.unpause()},e.prototype.update_range=function(e){var n,i,r,o,s,a,l,u;if(null==e)n=this.model.plot.map_options,this.map.setCenter({lat:this.initial_lat,lng:this.initial_lng}),this.map.setOptions({zoom:this.initial_zoom}),t.prototype.update_range.call(this,null);else if(null!=e.sdx||null!=e.sdy)this.map.panBy(e.sdx,e.sdy),t.prototype.update_range.call(this,e);else if(null!=e.factor){if(10!==this.zoom_count)return void(this.zoom_count+=1);this.zoom_count=0,this.pause(),t.prototype.update_range.call(this,e),u=e.factor<0?-1:1,r=this.map.getZoom(),i=r+u,i>=2&&(this.map.setZoom(i),h=this._get_projected_bounds(),s=h[0],o=h[1],l=h[2],a=h[3],o-s<0&&this.map.setZoom(r)),this.unpause()}return this._set_bokeh_ranges();var h},e.prototype._build_map=function(){var t,e,n,i=this;return e=window.google.maps,this.map_types={satellite:e.MapTypeId.SATELLITE,terrain:e.MapTypeId.TERRAIN,roadmap:e.MapTypeId.ROADMAP,hybrid:e.MapTypeId.HYBRID},n=this.model.plot.map_options,t={center:new e.LatLng(n.lat,n.lng),zoom:n.zoom,disableDefaultUI:!0,mapTypeId:this.map_types[n.map_type],scaleControl:n.scale_control},null!=n.styles&&(t.styles=JSON.parse(n.styles)),this.map=new e.Map(this.canvas_view.map_el,t),e.event.addListener(this.map,"idle",function(){return i._set_bokeh_ranges()}),e.event.addListener(this.map,"bounds_changed",function(){return i._set_bokeh_ranges()}),e.event.addListenerOnce(this.map,"tilesloaded",function(){return i._render_finished()}),this.connect(this.model.plot.properties.map_options.change,function(){return i._update_options()}),this.connect(this.model.plot.map_options.properties.styles.change,function(){return i._update_styles()}),this.connect(this.model.plot.map_options.properties.lat.change,function(){return i._update_center("lat")}),this.connect(this.model.plot.map_options.properties.lng.change,function(){return i._update_center("lng")}),this.connect(this.model.plot.map_options.properties.zoom.change,function(){return i._update_zoom()}),this.connect(this.model.plot.map_options.properties.map_type.change,function(){return i._update_map_type()}),this.connect(this.model.plot.map_options.properties.scale_control.change,function(){return i._update_scale_control()})},e.prototype._render_finished=function(){return this._tiles_loaded=!0,this.notify_finished()},e.prototype.has_finished=function(){return t.prototype.has_finished.call(this)&&this._tiles_loaded===!0},e.prototype._get_latlon_bounds=function(){var t,n,i,r,o,a,l;return s(this,e),n=this.map.getBounds(),i=n.getNorthEast(),t=n.getSouthWest(),o=t.lng(),r=i.lng(),l=t.lat(),a=i.lat(),[o,r,l,a]},e.prototype._get_projected_bounds=function(){var t,n,i,r,o,l,u,h;return s(this,e),c=this._get_latlon_bounds(),l=c[0],o=c[1],h=c[2],u=c[3],_=a.proj4(a.mercator,[l,h]),n=_[0],r=_[1],p=a.proj4(a.mercator,[o,u]),t=p[0],i=p[1],[n,t,r,i];var c,_,p},e.prototype._set_bokeh_ranges=function(){var t,n,i,r;return s(this,e),o=this._get_projected_bounds(),n=o[0],t=o[1],r=o[2],i=o[3],this.frame.x_range.setv({start:n,end:t}),this.frame.y_range.setv({start:r,end:i});var o},e.prototype._update_center=function(t){var e;return e=this.map.getCenter().toJSON(),e[t]=this.model.plot.map_options[t],this.map.setCenter(e),this._set_bokeh_ranges()},e.prototype._update_map_type=function(){var t;return t=window.google.maps,this.map.setOptions({mapTypeId:this.map_types[this.model.plot.map_options.map_type]})},e.prototype._update_scale_control=function(){var t;return t=window.google.maps,this.map.setOptions({scaleControl:this.model.plot.map_options.scale_control})},e.prototype._update_options=function(){return this._update_styles(),this._update_center("lat"),this._update_center("lng"),this._update_zoom(),this._update_map_type()},e.prototype._update_styles=function(){return this.map.setOptions({styles:JSON.parse(this.model.plot.map_options.styles)})},e.prototype._update_zoom=function(){return this.map.setOptions({zoom:this.model.plot.map_options.zoom}),this._set_bokeh_ranges()},e.prototype._map_hook=function(t,e){var n,i,r,o,s;if(i=e[0],o=e[1],s=e[2],n=e[3],this.canvas_view.map_el.style.top=o+"px",this.canvas_view.map_el.style.left=i+"px",this.canvas_view.map_el.style.width=s+"px",this.canvas_view.map_el.style.height=n+"px",null==this.map&&null!=(null!=(r=window.google)?r.maps:void 0))return this._build_map()},e.prototype._paint_empty=function(t,e){var n,i,r,o,s,a;return s=this.canvas._width.value,o=this.canvas._height.value,r=e[0],a=e[1],i=e[2],n=e[3],t.clearRect(0,0,s,o),t.beginPath(),t.moveTo(0,0),t.lineTo(0,o),t.lineTo(s,o),t.lineTo(s,0),t.lineTo(0,0),t.moveTo(r,a),t.lineTo(r+i,a),t.lineTo(r+i,a+n),t.lineTo(r,a+n),t.lineTo(r,a),t.closePath(),t.fillStyle=this.model.plot.border_fill_color,t.fill()},e}(l.PlotCanvasView);var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e.prototype.initialize=function(e,n){return this.use_map=!0,t.prototype.initialize.call(this,e,n)},e}(l.PlotCanvas);n.GMapPlotCanvas=h,h.prototype.type="GMapPlotCanvas",h.prototype.default_view=n.GMapPlotCanvasView},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(150);n.MapOptions=i.MapOptions;var r=t(150);n.GMapOptions=r.GMapOptions;var o=t(150);n.GMapPlot=o.GMapPlot;var s=t(151);n.GMapPlotCanvas=s.GMapPlotCanvas;var a=t(153);n.Plot=a.Plot;var l=t(154);n.PlotCanvas=l.PlotCanvas},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(13),o=t(14),s=t(15),a=t(22),l=t(30),u=t(42),h=t(139),c=t(65),_=t(168),p=t(233),d=t(66),f=t(154),m=t(173),v=t(161),g=t(3),y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.connect_signals=function(){var e;return t.prototype.connect_signals.call(this),e="Title object cannot be replaced. Try changing properties on title to update it after initialization.",this.connect(this.model.properties.title.change,function(){return o.logger.warn(e)})},e.prototype.get_height=function(){return this.model._width.value/this.model.get_aspect_ratio()},e.prototype.get_width=function(){return this.model._height.value*this.model.get_aspect_ratio()},e.prototype.save=function(t){return this.plot_canvas_view.save(t)},e}(h.LayoutDOMView);n.PlotView=y,y.prototype.className="bk-plot-layout",y.getters({plot_canvas_view:function(){return this.child_views[this.model._plot_canvas.id]}});var b=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){var n,i,r,o,s,a,h,c,_,p,d,f,m,v,g,y;for(t.prototype.initialize.call(this,e),_=l.values(this.extra_x_ranges).concat(this.x_range),n=0,s=_.length;n=0},e.prototype.can_redo=function(){return this.state.index=0?a.push(e.selected=t[s.id]):a.push(void 0)):a.push(e.selection_manager.clear()));return a},e.prototype.reset_selection=function(){return this.update_selection(null)},e.prototype._update_ranges_together=function(t){var e,n,i,r,o,s,a,l;for(l=1,e=0,i=t.length;ed.end,n||(f=this._get_weight_to_constrain_interval(d,_),f<1&&(_.start=f*_.start+(1-f)*d.start,_.end=f*_.end+(1-f)*d.end)),null!=d.bounds&&(h=d.bounds[0],u=d.bounds[1],c=Math.abs(_.end-_.start),r?(null!=h&&h>=_.end&&(i=!0,_.end=h,null==e&&null==n||(_.start=h+c)),null!=u&&u<=_.start&&(i=!0,_.start=u,null==e&&null==n||(_.end=u-c))):(null!=h&&h>=_.start&&(i=!0,_.start=h,null==e&&null==n||(_.end=h+c)),null!=u&&u<=_.end&&(i=!0,_.end=u,null==e&&null==n||(_.start=u-c))));if(!n||!i){for(p=[],s=0,l=t.length;s0&&a0&&a>i&&(u=(i-l)/(a-l)),u=Math.max(0,Math.min(1,u))),u;var h},e.prototype.update_range=function(t,e,n){var i,r,o,s,a,l,u;if(this.pause(),null==t){o=this.frame.x_ranges;for(i in o)u=o[i],u.reset();s=this.frame.y_ranges;for(i in s)u=s[i],u.reset();this.update_dataranges()}else{r=[],a=this.frame.x_ranges;for(i in a)u=a[i],r.push([u,t.xrs[i]]);l=this.frame.y_ranges;for(i in l)u=l[i],r.push([u,t.yrs[i]]);n&&this._update_ranges_together(r),this._update_ranges_individually(r,e,n)}return this.unpause()},e.prototype.reset_range=function(){return this.update_range(null)},e.prototype.build_levels=function(){var t,e,n,i,r,o,s,a,l,u,h;for(l=this.model.plot.all_renderers,a=Object.keys(this.renderer_views),s=m.build_views(this.renderer_views,l,this.view_options()),u=A.difference(a,function(){var t,e,n;for(n=[],t=0,e=l.length;t=0&&io&&_.model.document.interactive_stop(_.model.plot),_.request_render()},o)):this.model.document.interactive_stop(this.model.plot)),a=this.renderer_views;for(r in a)if(l=a[r],null==this.range_update_timestamp||l.set_data_timestamp>this.range_update_timestamp){this.update_dataranges();break}return this.model.frame._update_scales(),t=this.canvas_view.ctx,t.pixel_ratio=s=this.canvas.pixel_ratio,t.save(),t.scale(s,s),t.translate(.5,.5),e=[this.frame._left.value,this.frame._top.value,this.frame._width.value,this.frame._height.value],this._map_hook(t,e),this._paint_empty(t,e),this.prepare_webgl(s,e),t.save(),this.visuals.outline_line.doit&&(this.visuals.outline_line.set_value(t),h=e[0],c=e[1],u=e[2],n=e[3],h+u===this.canvas._width.value&&(u-=1),c+n===this.canvas._height.value&&(n-=1),t.strokeRect(h,c,u,n)),t.restore(),this._paint_levels(t,["image","underlay","glyph"],e),this.blit_webgl(s),this._paint_levels(t,["annotation"],e),this._paint_levels(t,["overlay"]),null==this.initial_range_info&&this.set_initial_range(),t.restore(),this._has_finished?void 0:(this._has_finished=!0,this.notify_finished())}},e.prototype._paint_levels=function(t,e,n){var i,r,o,s,a,l,u,h,c,_,p,d,f,m;for(t.save(),null!=n&&"canvas"===this.model.plot.output_backend&&(t.beginPath(),t.rect.apply(t,n),t.clip()),r={},_=this.model.plot.renderers,i=o=0,a=_.length;o0&&(c=function(){var t,e,n;for(n=[],t=0,e=c.length;t=0&&n.push(u);return n}()),s.logger.debug("computed "+c.length+" renderers for DataRange1d "+this.id),n=0,r=c.length;nr&&("start"===this.follow?i=_+o*r:"end"===this.follow&&(_=i-o*r)),[_,i];var p,d,f},e.prototype.update=function(t,e,n){var i,r,o,s,a,l,u,h;if(!this.have_updated_interactively){return u=this.computed_renderers(),this.plot_bounds[n]=this._compute_plot_bounds(u,t),c=this._compute_min_max(this.plot_bounds,e),a=c[0],s=c[1],_=this._compute_range(a,s),h=_[0],o=_[1],null!=this._initial_start&&("log"===this.scale_hint?this._initial_start>0&&(h=this._initial_start):h=this._initial_start),null!=this._initial_end&&("log"===this.scale_hint?this._initial_end>0&&(o=this._initial_end):o=this._initial_end),p=[this.start,this.end],r=p[0],i=p[1],h===r&&o===i||(l={},h!==r&&(l.start=h),o!==i&&(l.end=o),this.setv(l)),"auto"===this.bounds&&this.setv({bounds:[h,o]},{silent:!0}),this.change.emit();var c,_,p}},e.prototype.reset=function(){return this.have_updated_interactively=!1,this.setv({range_padding:this._initial_range_padding,range_padding_units:this._initial_range_padding_units,follow:this._initial_follow,follow_interval:this._initial_follow_interval,default_span:this._initial_default_span},{silent:!0}),this.change.emit()},e}(r.DataRange);n.DataRange1d=u,u.prototype.type="DataRange1d",u.define({start:[a.Number],end:[a.Number],range_padding:[a.Number,.1],range_padding_units:[a.PaddingUnits,"percent"],flipped:[a.Bool,!1],follow:[a.StartEnd],follow_interval:[a.Number],default_span:[a.Number,2],bounds:[a.Any],min_interval:[a.Any],max_interval:[a.Any]}),u.internal({scale_hint:[a.String,"auto"]}),u.getters({min:function(){return Math.min(this.start,this.end)},max:function(){return Math.max(this.start,this.end)}})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(159),o=t(15),s=t(22),a=t(42);n.map_one_level=function(t,e,n){void 0===n&&(n=0);var i,r,o,s,a;for(a={},r=o=0,s=t.length;othis.end}})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=[].indexOf,o=t(165),s=t(114),a=t(178),l=t(172),u=t(14),h=t(15),c=t(22),_=t(30);n.GlyphRendererView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){var n,i,o,s,l,u,h,c,p,d;if(t.prototype.initialize.call(this,e),n=this.model.glyph,s=r.call(n.mixins,"fill")>=0,l=r.call(n.mixins,"line")>=0,o=_.clone(n.attributes),delete o.id,h=function(t){var e;return e=_.clone(o),s&&_.extend(e,t.fill),l&&_.extend(e,t.line),new n.constructor(e)},this.glyph=this.build_glyph_view(n),d=this.model.selection_glyph,null==d?d=h({fill:{},line:{}}):"auto"===d&&(d=h(this.model.selection_defaults)),this.selection_glyph=this.build_glyph_view(d),p=this.model.nonselection_glyph,null==p?p=h({fill:{},line:{}}):"auto"===p&&(p=h(this.model.nonselection_defaults)),this.nonselection_glyph=this.build_glyph_view(p),u=this.model.hover_glyph,null!=u&&(this.hover_glyph=this.build_glyph_view(u)),c=this.model.muted_glyph,null!=c&&(this.muted_glyph=this.build_glyph_view(c)),i=h(this.model.decimated_defaults),this.decimated_glyph=this.build_glyph_view(i),this.xscale=this.plot_view.frame.xscales[this.model.x_range_name],this.yscale=this.plot_view.frame.yscales[this.model.y_range_name],this.set_data(!1),this.model.data_source instanceof a.RemoteDataSource)return this.model.data_source.setup()},e.prototype.build_glyph_view=function(t){return new t.default_view({model:t,renderer:this,plot_view:this.plot_view,parent:this})},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return this.request_render()}),this.connect(this.model.glyph.change,function(){ -return this.set_data()}),this.connect(this.model.data_source.change,function(){return this.set_data()}),this.connect(this.model.data_source.streaming,function(){return this.set_data()}),this.connect(this.model.data_source.patching,function(t){return this.set_data(!0,t)}),this.connect(this.model.data_source.select,function(){return this.request_render()}),null!=this.hover_glyph&&this.connect(this.model.data_source.inspect,function(){return this.request_render()}),this.connect(this.model.properties.view.change,function(){return this.set_data()}),this.connect(this.model.view.change,function(){return this.set_data()}),this.connect(this.model.glyph.transformchange,function(){return this.set_data()})},e.prototype.have_selection_glyphs=function(){return null!=this.selection_glyph&&null!=this.nonselection_glyph},e.prototype.set_data=function(t,e){void 0===t&&(t=!0);var n,i,r,o,s,a,l;for(l=Date.now(),a=this.model.data_source,this.all_indices=this.model.view.indices,this.glyph.model.setv({x_range_name:this.model.x_range_name,y_range_name:this.model.y_range_name},{silent:!0}),this.glyph.set_data(a,this.all_indices,e),this.glyph.set_visuals(a),this.decimated_glyph.set_visuals(a),this.have_selection_glyphs()&&(this.selection_glyph.set_visuals(a),this.nonselection_glyph.set_visuals(a)),null!=this.hover_glyph&&this.hover_glyph.set_visuals(a),null!=this.muted_glyph&&this.muted_glyph.set_visuals(a),o=this.plot_model.plot.lod_factor,this.decimated=[],i=r=0,s=Math.floor(this.all_indices.length/o);0<=s?rs;i=0<=s?++r:--r)this.decimated.push(i*o);if(n=Date.now()-l,u.logger.debug(this.glyph.model.type+" GlyphRenderer ("+this.model.id+"): set_data finished in "+n+"ms"),this.set_data_timestamp=Date.now(),t)return this.request_render()},e.prototype.render=function(){var t,e,n,i,o,a,l,h,_,p,d,f,m,v,g,y,b,x,w,k,M,S,T,O,A,E,j,P,z,C,N;if(this.model.visible){if(j=Date.now(),l=this.glyph.glglyph,P=Date.now(),this.glyph.map_data(),e=Date.now()-j,z=Date.now(),p=this.glyph.mask_data(this.all_indices),p.length===this.all_indices.length&&(p=function(){T=[];for(var t=0,e=this.all_indices.length;0<=e?te;0<=e?t++:t--)T.push(t);return T}.apply(this)),n=Date.now()-z,t=this.plot_view.canvas_view.ctx,t.save(),O=this.model.data_source.selected,O=O&&0!==O.length?O["0d"].glyph?this.model.view.convert_indices_from_subset(p):O["1d"].indices.length>0?O["1d"].indices:function(){var t,e,n,i;for(n=Object.keys(O["2d"].indices),i=[],t=0,e=n.length;t0?d["1d"].indices:function(){var t,e,n,i;for(n=Object.keys(d["2d"].indices),i=[],t=0,e=n.length;t=0&&i.push(_);return i}.call(this),b=this.plot_model.plot.lod_threshold,(null!=(M=this.model.document)?M.interactive_duration():void 0)>0&&!l&&null!=b&&this.all_indices.length>b?(p=this.decimated,h=this.decimated_glyph,k=this.decimated_glyph,E=this.selection_glyph):(h=this.model.muted&&null!=this.muted_glyph?this.muted_glyph:this.glyph,k=this.nonselection_glyph,E=this.selection_glyph),null!=this.hover_glyph&&d.length&&(p=c.difference(p,d)),O.length&&this.have_selection_glyphs()){for(N=Date.now(),A={},f=0,v=O.length;f0&&(r=i))),r},e.prototype.hit_test_helper=function(t,e,n,i,r){var o,s,a,l;return!!this.visible&&(o=e.glyph.hit_test(t),null!==o&&(s=this.view.convert_selection_from_subset(o),"select"===r?(l=this.data_source.selection_manager.selector,l.update(s,n,i),this.data_source.selected=l.indices,this.data_source.select.emit()):(a=this.data_source.selection_manager.get_or_create_inspector(this),a.update(s,!0,!1,!0),this.data_source.setv({inspected:a.indices},{silent:!0}),this.data_source.inspect.emit([e,{geometry:t}])),!s.is_empty()))},e.prototype.get_selection_manager=function(){return this.data_source.selection_manager},e}(o.Renderer);n.GlyphRenderer=p,p.prototype.default_view=n.GlyphRendererView,p.prototype.type="GlyphRenderer",p.define({x_range_name:[h.String,"default"],y_range_name:[h.String,"default"],data_source:[h.Instance],view:[h.Instance,function(){return new l.CDSView}],glyph:[h.Instance],hover_glyph:[h.Instance],nonselection_glyph:[h.Any,"auto"],selection_glyph:[h.Any,"auto"],muted_glyph:[h.Instance],muted:[h.Bool,!1]}),p.override({level:"glyph"}),p.prototype.selection_defaults={fill:{},line:{}},p.prototype.decimated_defaults={fill:{fill_alpha:.3,fill_color:"grey"},line:{line_alpha:.3,line_color:"grey"}},p.prototype.nonselection_defaults={fill:{fill_alpha:.2,line_alpha:.2},line:{}}},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(165),o=t(129),s=t(15),a=t(4);n.GraphRendererView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.xscale=this.plot_view.frame.xscales["default"],this.yscale=this.plot_view.frame.yscales["default"],this._renderer_views={},n=a.build_views(this._renderer_views,[this.model.node_renderer,this.model.edge_renderer],this.plot_view.view_options()),this.node_view=n[0],this.edge_view=n[1],this.set_data();var n},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.layout_provider.change,function(){return this.set_data()}),this.connect(this.model.node_renderer.data_source.select,function(){return this.set_data()}),this.connect(this.model.node_renderer.data_source.inspect,function(){return this.set_data()}),this.connect(this.model.node_renderer.data_source.change,function(){return this.set_data()}),this.connect(this.model.edge_renderer.data_source.select,function(){return this.set_data()}),this.connect(this.model.edge_renderer.data_source.inspect,function(){return this.set_data()}),this.connect(this.model.edge_renderer.data_source.change,function(){return this.set_data()})},e.prototype.set_data=function(t){if(void 0===t&&(t=!0),this.node_view.glyph.model.setv({x_range_name:this.model.x_range_name,y_range_name:this.model.y_range_name},{silent:!0}),this.edge_view.glyph.model.setv({x_range_name:this.model.x_range_name,y_range_name:this.model.y_range_name},{silent:!0}),e=this.model.layout_provider.get_node_coordinates(this.model.node_renderer.data_source),this.node_view.glyph._x=e[0],this.node_view.glyph._y=e[1],n=this.model.layout_provider.get_edge_coordinates(this.model.edge_renderer.data_source),this.edge_view.glyph._xs=n[0],this.edge_view.glyph._ys=n[1],this.node_view.glyph.index=this.node_view.glyph._index_data(),this.edge_view.glyph.index=this.edge_view.glyph._index_data(),t)return this.request_render();var e,n},e.prototype.render=function(){return this.edge_view.render(),this.node_view.render()},e.prototype.hit_test=function(t,e,n,i){void 0===i&&(i="select");var r,o,s;return!!this.model.visible&&(r=!1,r="select"===i?null!=(o=this.model.selection_policy)?o.do_selection(t,this,e,n):void 0:null!=(s=this.model.inspection_policy)?s.do_inspection(t,this,e,n):void 0)},e}(r.RendererView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_selection_manager=function(){return this.node_renderer.data_source.selection_manager},e}(r.Renderer);n.GraphRenderer=l,l.prototype.default_view=n.GraphRendererView,l.prototype.type="GraphRenderer",l.define({x_range_name:[s.String,"default"],y_range_name:[s.String,"default"],layout_provider:[s.Instance],node_renderer:[s.Instance],edge_renderer:[s.Instance],selection_policy:[s.Instance,function(){return new o.NodesOnly}],inspection_policy:[s.Instance,function(){return new o.NodesOnly}]}),l.override({level:"glyph"})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(165),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.Renderer);n.GuideRenderer=s,s.prototype.type="GuideRenderer",s.define({plot:[o.Instance]}),s.override({level:"overlay"})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(161);n.GlyphRenderer=i.GlyphRenderer;var r=t(162);n.GraphRenderer=r.GraphRenderer;var o=t(163);n.GuideRenderer=o.GuideRenderer;var s=t(165);n.Renderer=s.Renderer},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(6),o=t(46),s=t(15),a=t(32),l=t(30),u=t(50),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.plot_view=e.plot_view,this.visuals=new o.Visuals(this.model),this._has_finished=!0},e.prototype.request_render=function(){return this.plot_view.request_render()},e.prototype.set_data=function(t){var e;if(e=this.model.materialize_dataspecs(t),l.extend(this,e),this.plot_model.use_map&&(null!=this._x&&(n=a.project_xy(this._x,this._y),this._x=n[0],this._y=n[1]),null!=this._xs))return i=a.project_xsys(this._xs,this._ys),this._xs=i[0],this._ys=i[1],i;var n,i},e.prototype.map_to_screen=function(t,e){return this.plot_view.map_to_screen(t,e,this.model.x_range_name,this.model.y_range_name)},e}(r.DOMView);n.RendererView=h,h.getters({plot_model:function(){return this.plot_view.model}});var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(u.Model);n.Renderer=c,c.prototype.type="Renderer",c.define({level:[s.RenderLevel,null],visible:[s.Bool,!0]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(168),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute=function(e){return t.prototype.compute.call(this,this.source_range.synthetic(e))},e.prototype.v_compute=function(e){return t.prototype.v_compute.call(this,this.source_range.v_synthetic(e))},e}(r.LinearScale);n.CategoricalScale=o,o.prototype.type="CategoricalScale"},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(166);n.CategoricalScale=i.CategoricalScale;var r=t(168);n.LinearScale=r.LinearScale;var o=t(169);n.LogScale=o.LogScale;var s=t(170);n.Scale=s.Scale},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(170),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute=function(t){var e,n;return i=this._compute_state(),e=i[0],n=i[1],e*t+n;var i},e.prototype.v_compute=function(t){var e,n,i,r,o,s,a;for(l=this._compute_state(),e=l[0],o=l[1],s=new Float64Array(t.length),i=n=0,r=t.length;nu;i=0<=u?++s:--s)c[i]=0;else for(i=a=0,h=t.length;0<=h?ah;i=0<=h?++a:--a)e=(Math.log(t[i])-o)/r,_=isFinite(e)?e*n+l:NaN,c[i]=_;return c;var p},e.prototype.invert=function(t){var e,n,i,r,o;return s=this._compute_state(),e=s[0],r=s[1],n=s[2],i=s[3],o=(t-r)/e,Math.exp(n*o+i);var s},e.prototype.v_invert=function(t){var e,n,i,r,o,s,a,l,u;for(h=this._compute_state(),e=h[0],s=h[1],i=h[2],r=h[3],l=new Float64Array(t.length),n=o=0,a=t.length;0<=a?oa;n=0<=a?++o:--o)u=(t[n]-s)/e,l[n]=Math.exp(i*u+r);return l;var h},e.prototype._get_safe_factor=function(t,e){var n,i,r;return r=t<0?0:t,n=e<0?0:e,r===n&&(0===r?(o=[1,10],r=o[0],n=o[1]):(i=Math.log(r)/Math.log(10),r=Math.pow(10,Math.floor(i)),n=Math.ceil(i)!==Math.floor(i)?Math.pow(10,Math.ceil(i)):Math.pow(10,Math.ceil(i)+1))),[r,n];var o},e.prototype._compute_state=function(){var t,e,n,i,r,o,s,a,l,u,h;return a=this.source_range.start,s=this.source_range.end,h=this.target_range.start,u=this.target_range.end,o=u-h,c=this._get_safe_factor(a,s),l=c[0],t=c[1],0===l?(n=Math.log(t),i=0):(n=Math.log(t)-Math.log(l),i=Math.log(l)),e=o,r=h,[e,r,n,i];var c},e}(r.Scale);n.LogScale=o,o.prototype.type="LogScale"},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(238),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute=function(t){},e.prototype.v_compute=function(t){},e.prototype.invert=function(t){},e.prototype.v_invert=function(t){},e.prototype.r_compute=function(t,e){return this.target_range.is_reversed?[this.compute(e),this.compute(t)]:[this.compute(t),this.compute(e)]},e.prototype.r_invert=function(t,e){return this.target_range.is_reversed?[this.invert(e),this.invert(t)]:[this.invert(t),this.invert(e)]},e}(r.Transform);n.Scale=s,s.prototype.type="Scale",s.internal({source_range:[o.Any],target_range:[o.Any]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=function(t,e){if(!(t instanceof e))throw new Error("Bound instance method accessed before binding")},o=t(178),s=t(14),a=t(15),l=function(t){function e(){var e=t.apply(this,arguments)||this;return e.destroy=e.destroy.bind(e),e.setup=e.setup.bind(e),e.get_data=e.get_data.bind(e),e}return i.__extends(e,t),e.prototype.destroy=function(){if(r(this,e),null!=this.interval)return clearInterval(this.interval)},e.prototype.setup=function(){if(r(this,e),null==this.initialized&&(this.initialized=!0,this.get_data(this.mode),this.polling_interval))return this.interval=setInterval(this.get_data,this.polling_interval,this.mode,this.max_size,this.if_modified)},e.prototype.get_data=function(t,n,i){var o=this;void 0===n&&(n=0),void 0===i&&(i=!1);var a,l,u,h;r(this,e),h=new XMLHttpRequest,h.open(this.method,this.data_url,!0),h.withCredentials=!1,h.setRequestHeader("Content-Type",this.content_type),l=this.http_headers;for(a in l)u=l[a],h.setRequestHeader(a,u);return h.addEventListener("load",function(){var e,i,r,s,a,l;if(200===h.status)switch(i=JSON.parse(h.responseText),t){case"replace":return o.data=i;case"append":for(a=o.data,l=o.columns(),r=0,s=l.length;r0?this.indices=a.intersection.apply(this,e):this.source instanceof l.ColumnarDataSource&&(this.indices=null!=(i=this.source)?i.get_indices():void 0),this.indices_map_to_subset()},e.prototype.indices_map_to_subset=function(){var t,e,n,i;for(this.indices_map={},i=[],t=e=0,n=this.indices.length;0<=n?en;t=0<=n?++e:--e)i.push(this.indices_map[this.indices[t]]=t);return i},e.prototype.convert_selection_from_subset=function(t){var e,n,i;return i=s.create_hit_test_result(),i.update_through_union(t),n=function(){var n,i,r,o;for(r=t["1d"].indices,o=[],n=0,i=r.length;ni&&(t=t.slice(-i)),t;if(p=t.length+e.length,null!=i&&p>i){for(c=p-i,r=t.length,t.lengthu;o=l<=u?++s:--s)t[o-c]=t[o];for(o=a=0,h=e.length;0<=h?ah;o=0<=h?++a:--a)t[o+(r-c)]=e[o];return t}return _=new t.constructor(e),n.concat_typed_arrays(t,_)},n.slice=function(t,e){var n,i,r,o,s,a;return h.isObject(t)?[null!=(n=t.start)?n:0,null!=(i=t.stop)?i:e,null!=(r=t.step)?r:1]:(l=[t,t+1,1],o=l[0],a=l[1],s=l[2],l);var l},n.patch_to_column=function(t,e,i){var r,o,s,a,u,c,_,p,d,f,m,v,g,y,b,x,w,k,M,S,T,O,A,E,j;for(x=new l.Set,w=!1,v=0,g=e.length;v0?yM;o=y+=S)for(p=b=T=d,O=m,A=f;A>0?bO;p=b+=A)w&&x.push(p),_[o*E[1]+p]=j[r],r++;return x;var P,z,C};var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),n=u.decode_column_data(this.data),this.data=n[0],this._shapes=n[1],n;var n},e.prototype.attributes_as_json=function(t,n){void 0===t&&(t=!0),void 0===n&&(n=e._value_to_json);var i,o,s,a;i={},s=this.serializable_attributes();for(o in s)r.call(s,o)&&(a=s[o],"data"===o&&(a=u.encode_column_data(a,this._shapes)),t?i[o]=a:o in this._set_after_defaults&&(i[o]=a));return n("attributes",i,this)},e._value_to_json=function(t,e,n){return h.isObject(e)&&"data"===t?u.encode_column_data(e,n._shapes):s.HasProps._value_to_json(t,e,n)},e.prototype.stream=function(t,e){var i,r,o;i=this.data;for(r in t)o=t[r],i[r]=n.stream_to_column(i[r],t[r],e);return this.setv("data",i,{silent:!0}),this.streaming.emit()},e.prototype.patch=function(t){var e,i,r,o;e=this.data,o=new l.Set;for(i in t)r=t[i],o=o.union(n.patch_to_column(e[i],r,this._shapes[i]));return this.setv("data",e,{silent:!0}),this.patching.emit(o.values)},e}(o.ColumnarDataSource);n.ColumnDataSource=c,c.prototype.type="ColumnDataSource",c.define({data:[a.Any,{}]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(175),o=t(20),s=t(14),a=t(17),l=t(15),u=t(22),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.select=new o.Signal(this,"select"),this.inspect=new o.Signal(this,"inspect"),this.streaming=new o.Signal(this,"streaming"),this.patching=new o.Signal(this,"patching")},e.prototype.get_column=function(t){var e;return null!=(e=this.data[t])?e:null},e.prototype.columns=function(){return Object.keys(this.data)},e.prototype.get_length=function(t){void 0===t&&(t=!0);var e,n,i,r;switch(n=u.uniq(function(){var t,n;t=this.data,n=[];for(e in t)r=t[e],n.push(r.length);return n}.call(this)),n.length){case 0:return null;case 1:return n[0];default:if(i="data source has columns of inconsistent lengths",t)return s.logger.warn(i),n.sort()[0];throw new Error(i)}},e.prototype.get_indices=function(){var t,e;return t=this.get_length(),null==t&&(t=1),function(){e=[];for(var n=0;0<=t?nt;0<=t?n++:n--)e.push(n);return e}.apply(this)},e}(r.DataSource);n.ColumnarDataSource=h,h.prototype.type="ColumnarDataSource",h.define({column_names:[l.Array,[]]}),h.internal({selection_manager:[l.Instance,function(t){return new a.SelectionManager({source:t})}],inspected:[l.Any],_shapes:[l.Any,{}]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(50),o=t(9),s=t(15),a=t(42),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){var n=this;return t.prototype.initialize.call(this,e),this.connect(this.properties.selected.change,function(){var t;if(t=n.callback,null!=t)return a.isFunction(t)?t(n):t.execute(n)})},e}(r.Model);n.DataSource=l,l.prototype.type="DataSource",l.define({selected:[s.Any,o.create_hit_test_result()],callback:[s.Any]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(174),o=t(14),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){var n=this;return t.prototype.initialize.call(this,e),this._update_data(),this.connect(this.properties.geojson.change,function(){return n._update_data()})},e.prototype._update_data=function(){return this.data=this.geojson_to_column_data()},e.prototype._get_new_list_array=function(t){var e,n,i,r;for(r=[],e=n=0,i=t;0<=i?ni;e=0<=i?++n:--n)r.push([]);return r},e.prototype._get_new_nan_array=function(t){var e,n,i,r;for(r=[],e=n=0,i=t;0<=i?ni;e=0<=i?++n:--n)r.push(NaN);return r},e.prototype._flatten_function=function(t,e){return t.concat([[NaN,NaN,NaN]]).concat(e)},e.prototype._add_properties=function(t,e,n,i){var r,o;o=[];for(r in t.properties)e.hasOwnProperty(r)||(e[r]=this._get_new_nan_array(i)),o.push(e[r][n]=t.properties[r]);return o},e.prototype._add_geometry=function(t,e,n){var i,r,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k,M,S,T,O,A,E,j;switch(t.type){case"Point":return r=t.coordinates,e.x[n]=r[0],e.y[n]=r[1],e.z[n]=null!=(x=r[2])?x:NaN;case"LineString":for(i=t.coordinates,O=[],u=h=0,_=i.length;h<_;u=++h)r=i[u],e.xs[n][u]=r[0],e.ys[n][u]=r[1],O.push(e.zs[n][u]=null!=(w=r[2])?w:NaN);return O;case"Polygon":for(t.coordinates.length>1&&o.logger.warn("Bokeh does not support Polygons with holes in, only exterior ring used."),s=t.coordinates[0],A=[],u=c=0,p=s.length;c1&&o.logger.warn("Bokeh does not support Polygons with holes in, only exterior ring used."),a.push(b[0]);for(l=a.reduce(this._flatten_function),j=[],u=y=0,m=l.length;yn&&ro)break;return i};var _=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e.prototype.initialize=function(e,n){var r,o;return e.num_minor_ticks=0,t.prototype.initialize.call(this,e,n),r=this.days,o=r.length>1?(r[1]-r[0])*i:31*i,this.interval=o},e.prototype.get_ticks_no_defaults=function(t,e,n,i){var s,a,l,u,h,_,p,d,f;return d=o(t,e),h=this.days,_=function(t,e){var n,i,o,s,a,l;for(n=[],a=0,l=h.length;a0&&D.length>0){for(S=c/E,T=function(){var t,e,n;for(n=[],h=t=0,e=E;0<=e?te;h=0<=e?++t:--t)n.push(h*S);return n}(),P=T.slice(1,+T.length+1||9e9),_=0,f=P.length;_0&&D.length>0){for(S=Math.pow(o,c)/E,T=function(){var t,e,n;for(n=[],h=t=1,e=E;1<=e?t<=e:t>=e;h=1<=e?++t:--t)n.push(h*S);return n}(),M=0,g=T.length;Mo)break;return i};var _=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e.prototype.initialize=function(e,n){var r,o;return t.prototype.initialize.call(this,e,n),o=this.months,r=o.length>1?(o[1]-o[0])*i:12*i,this.interval=r},e.prototype.get_ticks_no_defaults=function(t,e,n,i){var s,a,l,u,h,_,p,d;return d=o(t,e),h=this.months,_=function(t){return h.map(function(e){var n;return n=r(t),n.setUTCMonth(e),n})},u=c.concat(function(){var t,e,n;for(n=[],t=0,e=d.length;t0&&M.length>0){for(v=h/b,g=function(){var t,e,n;for(n=[],u=t=0,e=b;0<=e?te;u=0<=e?++t:--t)n.push(u*v);return n}(),x=g.slice(1,+g.length+1||9e9),c=0,d=x.length;c50))return t.constructor===Array?Array.prototype.push.apply(this.images,t):this.images.push(t)},t}()},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(15),o=t(50),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this.images={},this.normalize_case()},e.prototype.normalize_case=function(){"Note: should probably be refactored into subclasses.";var t;return t=this.url,t=t.replace("{xmin}","{XMIN}"),t=t.replace("{ymin}","{YMIN}"),t=t.replace("{xmax}","{XMAX}"),t=t.replace("{ymax}","{YMAX}"),t=t.replace("{height}","{HEIGHT}"),t=t.replace("{width}","{WIDTH}"),this.url=t},e.prototype.string_lookup_replace=function(t,e){var n,i,r;i=t;for(n in e)r=e[n],i=i.replace("{"+n+"}",r.toString());return i},e.prototype.add_image=function(t){return this.images[t.cache_key]=t},e.prototype.remove_image=function(t){return delete this.images[t.cache_key]},e.prototype.get_image_url=function(t,e,n,i,r,o){var s;return s=this.string_lookup_replace(this.url,this.extra_url_vars),s.replace("{XMIN}",t).replace("{YMIN}",e).replace("{XMAX}",n).replace("{YMAX}",i).replace("{WIDTH}",o).replace("{HEIGHT}",r)},e}(o.Model);n.ImageSource=s,s.prototype.type="ImageSource",s.define({url:[r.String,""],extra_url_vars:[r.Any,{}]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(195);n.BBoxTileSource=i.BBoxTileSource;var r=t(196);n.DynamicImageRenderer=r.DynamicImageRenderer;var o=t(198);n.ImageSource=o.ImageSource;var s=t(200);n.MercatorTileSource=s.MercatorTileSource;var a=t(201);n.QUADKEYTileSource=a.QUADKEYTileSource;var l=t(202);n.TileRenderer=l.TileRenderer;var u=t(203);n.TileSource=u.TileSource;var h=t(205);n.TMSTileSource=h.TMSTileSource;var c=t(206);n.WMTSTileSource=c.WMTSTileSource},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=[].indexOf,o=t(203),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){var n;return t.prototype.initialize.call(this,e),this._resolutions=function(){var t,e,i,r;for(r=[],n=t=e=this.min_zoom,i=this.max_zoom;e<=i?t<=i:t>=i;n=e<=i?++t:--t)r.push(this.get_resolution(n));return r}.call(this)},e.prototype._computed_initial_resolution=function(){return null!=this.initial_resolution?this.initial_resolution:2*Math.PI*6378137/this.tile_size},e.prototype.is_valid_tile=function(t,e,n){return!(!this.wrap_around&&(t<0||t>=Math.pow(2,n)))&&!(e<0||e>=Math.pow(2,n))},e.prototype.retain_children=function(t){var e,n,i,r,o,s,a;r=t.quadkey,i=r.length,n=i+3,o=this.tiles,s=[];for(e in o)a=o[e],0===a.quadkey.indexOf(r)&&a.quadkey.length>i&&a.quadkey.length<=n?s.push(a.retain=!0):s.push(void 0);return s},e.prototype.retain_neighbors=function(t){var e,n,i,o,s,a,l,u,h,c,_,p,d,f;n=4,m=t.tile_coords,c=m[0],_=m[1],p=m[2],i=function(){var t,e,i,r;for(r=[],d=t=e=c-n,i=c+n;e<=i?t<=i:t>=i;d=e<=i?++t:--t)r.push(d);return r}(),o=function(){var t,e,i,r;for(r=[],f=t=e=_-n,i=_+n;e<=i?t<=i:t>=i;f=e<=i?++t:--t)r.push(f);return r}(),s=this.tiles,u=[];for(e in s)h=s[e],h.tile_coords[2]===p&&(a=h.tile_coords[0],r.call(i,a)>=0)&&(l=h.tile_coords[1],r.call(o,l)>=0)?u.push(h.retain=!0):u.push(void 0);return u;var m},e.prototype.retain_parents=function(t){var e,n,i,r,o;n=t.quadkey,i=this.tiles,r=[];for(e in i)o=i[e],r.push(o.retain=0===n.indexOf(o.quadkey));return r},e.prototype.children_by_tile_xyz=function(t,e,n){var i,r,o,s,a,l;for(l=this.calculate_world_x_by_tile_xyz(t,e,n),0!==l&&(u=this.normalize_xyz(t,e,n),t=u[0],e=u[1],n=u[2]),a=this.tile_xyz_to_quadkey(t,e,n),r=[],o=s=0;s<=3;o=s+=1)h=this.quadkey_to_tile_xyz(a+o.toString()),t=h[0],e=h[1],n=h[2],0!==l&&(c=this.denormalize_xyz(t,e,n,l),t=c[0],e=c[1],n=c[2]),i=this.get_tile_meter_bounds(t,e,n),null!=i&&r.push([t,e,n,i]);return r;var u,h,c},e.prototype.parent_by_tile_xyz=function(t,e,n){var i,r;return r=this.tile_xyz_to_quadkey(t,e,n),i=r.substring(0,r.length-1),this.quadkey_to_tile_xyz(i)},e.prototype.get_resolution=function(t){return this._computed_initial_resolution()/Math.pow(2,t)},e.prototype.get_resolution_by_extent=function(t,e,n){var i,r;return i=(t[2]-t[0])/n,r=(t[3]-t[1])/e,[i,r]},e.prototype.get_level_by_extent=function(t,e,n){var i,r,o,s,a,l,u,h;for(u=(t[2]-t[0])/n,h=(t[3]-t[1])/e,l=Math.max(u,h),i=0,a=this._resolutions,r=0,o=a.length;rs){if(0===i)return 0;if(i>0)return i-1}i+=1}},e.prototype.get_closest_level_by_extent=function(t,e,n){var i,r,o,s,a;return s=(t[2]-t[0])/n,a=(t[3]-t[1])/e,r=Math.max(s,a),o=this._resolutions,i=this._resolutions.reduce(function(t,e){return Math.abs(e-r)=s;p=i+=-1)for(h=r=a=_,l=c;r<=l;h=r+=1)this.is_valid_tile(h,p,e)&&u.push([h,p,e,this.get_tile_meter_bounds(h,p,e)]);return u=this.sort_tiles_from_center(u,[_,f,c,d]);var b,x},e.prototype.quadkey_to_tile_xyz=function(t){"Computes tile x, y and z values based on quadKey.";var e,n,i,r,o,s,a,l;for(o=0,s=0,a=t.length,e=n=r=a;n>0;e=n+=-1)switch(l=t.charAt(a-e),i=1<0;r=o+=-1)i=0,s=1<0;)if(i=i.substring(0,i.length-1),s=this.quadkey_to_tile_xyz(i),t=s[0],e=s[1],n=s[2],a=this.denormalize_xyz(t,e,n,r),t=a[0],e=a[1],n=a[2],this.tile_xyz_to_key(t,e,n)in this.tiles)return[t,e,n];return[0,0,0];var o,s,a},e.prototype.normalize_xyz=function(t,e,n){var i;return this.wrap_around?(i=Math.pow(2,n),[(t%i+i)%i,e,n]):[t,e,n]},e.prototype.denormalize_xyz=function(t,e,n,i){return[t+i*Math.pow(2,n),e,n]},e.prototype.denormalize_meters=function(t,e,n,i){return[t+2*i*Math.PI*6378137,e]},e.prototype.calculate_world_x_by_tile_xyz=function(t,e,n){return Math.floor(t/Math.pow(2,n))},e}(o.TileSource);n.MercatorTileSource=a,a.prototype.type="MercatorTileSource",a.define({wrap_around:[s.Bool,!0]}),a.override({x_origin_offset:20037508.34,y_origin_offset:20037508.34,initial_resolution:156543.03392804097})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(200),o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.get_image_url=function(t,e,n){var i,r;return i=this.string_lookup_replace(this.url,this.extra_url_vars),o=this.tms_to_wmts(t,e,n),t=o[0],e=o[1],n=o[2],r=this.tile_xyz_to_quadkey(t,e,n),i.replace("{Q}",r);var o},e}(r.MercatorTileSource);n.QUADKEYTileSource=o,o.prototype.type="QUADKEYTileSource"},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=function(t,e){if(!(t instanceof e))throw new Error("Bound instance method accessed before binding")},o=[].indexOf,s=t(197),a=t(206),l=t(165),u=t(5),h=t(15),c=t(42);n.TileRendererView=function(t){function e(){var e=t.apply(this,arguments)||this;return e._add_attribution=e._add_attribution.bind(e),e._on_tile_load=e._on_tile_load.bind(e),e._on_tile_cache_load=e._on_tile_cache_load.bind(e),e._on_tile_error=e._on_tile_error.bind(e),e._prefetch_tiles=e._prefetch_tiles.bind(e),e._update=e._update.bind(e),e}return i.__extends(e,t),e.prototype.initialize=function(e){return this.attributionEl=null,this._tiles=[],t.prototype.initialize.call(this,e)},e.prototype.connect_signals=function(){return t.prototype.connect_signals.call(this),this.connect(this.model.change,function(){return this.request_render()})},e.prototype.get_extent=function(){return[this.x_range.start,this.y_range.start,this.x_range.end,this.y_range.end]},e.prototype._set_data=function(){return this.pool=new s.ImagePool,this.map_plot=this.plot_model.plot,this.map_canvas=this.plot_view.canvas_view.ctx,this.map_frame=this.plot_model.frame,this.x_range=this.map_plot.x_range,this.y_range=this.map_plot.y_range,this.extent=this.get_extent(),this._last_height=void 0,this._last_width=void 0},e.prototype._add_attribution=function(){var t,n,i,o,s;if(r(this,e),t=this.model.tile_source.attribution,c.isString(t)&&t.length>0)return null==this.attributionEl&&(s=this.plot_model.canvas._right.value-this.plot_model.frame._right.value,n=this.plot_model.canvas._bottom.value-this.plot_model.frame._bottom.value,i=this.map_frame._width.value,this.attributionEl=u.div({"class":"bk-tile-attribution",style:{position:"absolute",bottom:n+"px",right:s+"px","max-width":i+"px",padding:"2px","background-color":"rgba(255,255,255,0.8)","font-size":"9pt","font-family":"sans-serif"}}),o=this.plot_view.canvas_view.events_el,o.appendChild(this.attributionEl)),this.attributionEl.innerHTML=t},e.prototype._map_data=function(){var t,e;return this.initial_extent=this.get_extent(),e=this.model.tile_source.get_level_by_extent(this.initial_extent,this.map_frame._height.value,this.map_frame._width.value),t=this.model.tile_source.snap_to_zoom(this.initial_extent,this.map_frame._height.value,this.map_frame._width.value,e),this.x_range.start=t[0],this.y_range.start=t[1],this.x_range.end=t[2],this.y_range.end=t[3],this._add_attribution()},e.prototype._on_tile_load=function(t){var n;return r(this,e),n=t.target.tile_data,n.img=t.target,n.current=!0,n.loaded=!0,this.request_render()},e.prototype._on_tile_cache_load=function(t){var n;return r(this,e),n=t.target.tile_data,n.img=t.target,n.loaded=!0,n.finished=!0,this.notify_finished()},e.prototype._on_tile_error=function(t){var n;return r(this,e),n=t.target.tile_data,n.finished=!0},e.prototype._create_tile=function(t,e,n,i,r){void 0===r&&(r=!1);var o,s;return o=this.model.tile_source.normalize_xyz(t,e,n),s=this.pool.pop(),r?s.onload=this._on_tile_cache_load:s.onload=this._on_tile_load,s.onerror=this._on_tile_error,s.alt="",s.tile_data={tile_coords:[t,e,n],normalized_coords:o,quadkey:this.model.tile_source.tile_xyz_to_quadkey(t,e,n),cache_key:this.model.tile_source.tile_xyz_to_key(t,e,n),bounds:i,loaded:!1,finished:!1,x_coord:i[0],y_coord:i[3]},this.model.tile_source.tiles[s.tile_data.cache_key]=s.tile_data,s.src=(a=this.model.tile_source).get_image_url.apply(a,o),this._tiles.push(s),s;var a},e.prototype._enforce_aspect_ratio=function(){var t,e,n;return(this._last_height!==this.map_frame._height.value||this._last_width!==this.map_frame._width.value)&&(t=this.get_extent(),n=this.model.tile_source.get_level_by_extent(t,this.map_frame._height.value,this.map_frame._width.value),e=this.model.tile_source.snap_to_zoom(t,this.map_frame._height.value,this.map_frame._width.value,n),this.x_range.setv({start:e[0],end:e[2]}),this.y_range.setv({start:e[1],end:e[3]}),this.extent=e,this._last_height=this.map_frame._height.value,this._last_width=this.map_frame._width.value,!0)},e.prototype.has_finished=function(){var e,n,i,r;if(!t.prototype.has_finished.call(this))return!1;if(0===this._tiles.length)return!1;for(i=this._tiles,e=0,n=i.length;ex&&(_=this.extent,R=x,j=!0),j&&(this.x_range.setv({x_range:{start:_[0],end:_[2]}}),this.y_range.setv({start:_[1],end:_[3]}),this.extent=_),this.extent=_,N=C.get_tiles_by_extent(_,R),T=[],k=[],i=[],l=[],d=0,g=N.length;d=i?(p=[1,l/i],c=p[0],_=p[1]):(d=[i/l,1],c=d[0],_=d[1]),t[0]<=e[0]?(o=t[0],s=t[0]+h*c,s>hend&&(s=hend)):(s=t[0],o=t[0]-h*c,ovend&&(a=vend)):(a=t[1],r=t[1]-h/i,rn.end)&&(this.v_axis_only=!0),(os.end)&&(this.h_axis_only=!0)),null!=(i=this.model.document)?i.interactive_start(this.plot_model.plot):void 0;var a},e.prototype._pan=function(t){var e;return this._update(t.deltaX,t.deltaY),null!=(e=this.model.document)?e.interactive_start(this.plot_model.plot):void 0},e.prototype._pan_end=function(t){if(this.h_axis_only=!1,this.v_axis_only=!1,null!=this.pan_info)return this.plot_view.push_state("pan",{range:this.pan_info})},e.prototype._update=function(t,e){var n,i,r,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k,M,S,T;r=this.plot_view.frame,l=t-this.last_dx,u=e-this.last_dy,o=r.bbox.h_range,y=o.start-l,g=o.end-l,M=r.bbox.v_range,k=M.start-u,w=M.end-u,n=this.model.dimensions,"width"!==n&&"both"!==n||this.v_axis_only?(m=o.start,v=o.end,p=0):(m=y,v=g,p=-l),"height"!==n&&"both"!==n||this.h_axis_only?(b=M.start,x=M.end,d=0):(b=k,x=w,d=-u),this.last_dx=t,this.last_dy=e,S={},h=r.xscales;for(a in h)_=h[a],O=_.r_invert(m,v),f=O[0],i=O[1],S[a]={start:f,end:i};T={},c=r.yscales;for(a in c)_=c[a],A=_.r_invert(b,x),f=A[0],i=A[1],T[a]={start:f,end:i};return this.pan_info={xrs:S,yrs:T,sdx:p,sdy:d},this.plot_view.update_range(this.pan_info,s=!0),null;var O,A},e}(r.GestureToolView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.GestureTool);n.PanTool=s,s.prototype.default_view=n.PanToolView,s.prototype.type="PanTool",s.prototype.tool_name="Pan",s.prototype.event_type="pan",s.prototype.default_order=10,s.define({dimensions:[o.Dimensions,"both"]}),s.getters({tooltip:function(){return this._get_dim_tooltip("Pan",this.dimensions)},icon:function(){var t;return t=function(){switch(this.dimensions){case"both":return"pan";case"width":return"xpan";case"height":return"ypan"}}.call(this),"bk-tool-icon-"+t}})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r=t(364),o=t(222),s=t(62),a=t(15),l=t(22);n.PolySelectToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.connect(this.model.properties.active.change,function(){return this._active_change()}),this.data={sx:[],sy:[]}},e.prototype._active_change=function(){if(!this.model.active)return this._clear_data()},e.prototype._keyup=function(t){if(13===t.keyCode)return this._clear_data()},e.prototype._doubletap=function(t){var e,n;return e=null!=(n=t.srcEvent.shiftKey)&&n,this._do_select(this.data.sx,this.data.sy,!0,e),this.plot_view.push_state("poly_select",{selection:this.plot_view.get_selection()}),this._clear_data()},e.prototype._clear_data=function(){return this.data={sx:[],sy:[]},this.model.overlay.update({xs:[],ys:[]})},e.prototype._tap=function(t){var e,n,i;if(r=t.bokeh,n=r.sx,i=r.sy,e=this.plot_model.frame,e.bbox.contains(n,i)){return this.data.sx.push(n),this.data.sy.push(i),this.model.overlay.update({xs:l.copy(this.data.sx),ys:l.copy(this.data.sy)});var r}},e.prototype._do_select=function(t,e,n,i){var r;return r={type:"poly",sx:t,sy:e},this._select(r,n,i)},e.prototype._emit_callback=function(t){var e,n,i,r;n=this.computed_renderers[0],e=this.plot_model.frame,i=e.xscales[n.x_range_name],r=e.yscales[n.y_range_name],t.x=i.v_invert(t.sx),t.y=i.v_invert(t.sy),this.model.callback.execute(this.model,{geometry:t})},e}(o.SelectToolView),i=function(){return new s.PolyAnnotation({level:"overlay",xs_units:"screen",ys_units:"screen",fill_color:{value:"lightgrey"},fill_alpha:{value:.5},line_color:{value:"black"},line_alpha:{value:1},line_width:{value:2},line_dash:{value:[4,4]}})};var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(o.SelectTool);n.PolySelectTool=u,u.prototype.default_view=n.PolySelectToolView,u.prototype.type="PolySelectTool",u.prototype.tool_name="Poly Select",u.prototype.icon="bk-tool-icon-polygon-select",u.prototype.event_type="tap",u.prototype.default_order=11,u.define({callback:[a.Instance],overlay:[a.Instance,i]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(218),o=t(161),s=t(162),a=t(14),l=t(15),u=t(30),h=t(3),c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._computed_renderers_by_data_source=function(){var t,e,n,i,r,a;for(r={},i=this.computed_renderers,t=0,e=i.length;to;i=0<=o?++r:--r)n.x[i]=s.invert(n.sx[i]),n.y[i]=l.invert(n.sy[i]);break;default:a.logger.debug("Unrecognized selection geometry type: '"+n.type+"'")}return this.plot_model.plot.trigger_event(new h.SelectionGeometry({geometry:n,"final":e}));var c,_},e}(r.GestureToolView);n.SelectToolView=c,c.getters({computed_renderers:function(){var t,e,n,i;return i=this.model.renderers,e=this.model.names,0===i.length&&(t=this.plot_model.plot.renderers,i=function(){var e,i,r;for(r=[],e=0,i=t.length;e0&&(i=function(){var t,r,o;for(o=[],t=0,r=i.length;t=0&&o.push(n);return o}()),i}});var _=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.GestureTool);n.SelectTool=_,_.define({renderers:[l.Array,[]],names:[l.Array,[]]}),_.internal({multi_select_modifier:[l.String,"shift"]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(222),o=t(15),s=t(42);n.TapToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._tap=function(t){var e,n,i,r;return o=t.bokeh,i=o.sx,r=o.sy,e=null!=(n=t.srcEvent.shiftKey)&&n,this._select(i,r,!0,e);var o},e.prototype._select=function(t,e,n,i){var r,o,a,l,u,h,c,_,p,d,f,m,v;if(u={type:"point",sx:t,sy:e},o=this.model.callback,a={geometries:u},"select"===this.model.behavior){m=this._computed_renderers_by_data_source();for(r in m)f=m[r],v=f[0].get_selection_manager(),p=function(){var t,e,n;for(n=[],t=0,e=f.length;t.9?e=.9:e<-.9&&(e=-.9),this._update_ranges(e)},e.prototype._update_ranges=function(t){var e,n,i,r,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x,w,k;switch(n=this.plot_model.frame,i=n.bbox.h_range,x=n.bbox.v_range,M=[i.start,i.end],d=M[0],p=M[1],S=[x.start,x.end],y=S[0],g=S[1],this.model.dimension){case"height":b=Math.abs(g-y),c=d,_=p,m=y-b*t,v=g-b*t;break;case"width":f=Math.abs(p-d),c=d-f*t,_=p-f*t,m=y,v=g}w={},s=n.xscales;for(r in s)u=s[r],T=u.r_invert(c,_),h=T[0],e=T[1],w[r]={start:h,end:e};k={},a=n.yscales;for(r in a)u=a[r],O=u.r_invert(m,v),h=O[0],e=O[1],k[r]={ -start:h,end:e};return o={xrs:w,yrs:k,factor:t},this.plot_view.push_state("wheel_pan",{range:o}),this.plot_view.update_range(o,!1,!0),null!=(l=this.model.document)&&l.interactive_start(this.plot_model.plot),null;var M,S,T,O},e}(r.GestureToolView);var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.GestureTool);n.WheelPanTool=s,s.prototype.type="WheelPanTool",s.prototype.default_view=n.WheelPanToolView,s.prototype.tool_name="Wheel Pan",s.prototype.icon="bk-tool-icon-wheel-pan",s.prototype.event_type="scroll",s.prototype.default_order=12,s.getters({tooltip:function(){return this._get_dim_tooltip(this.tool_name,this.dimension)}}),s.define({dimension:[o.Dimension,"width"]}),s.internal({speed:[o.Number,.001]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(218),o=t(44),s=t(15);n.WheelZoomToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._pinch=function(t){var e;return e=t.scale>=1?20*(t.scale-1):-20/t.scale,t.bokeh.delta=e,this._scroll(t)},e.prototype._scroll=function(t){var e,n,i,r,s,a,l,u,h,c,_;return i=this.plot_model.frame,s=i.bbox.h_range,c=i.bbox.v_range,p=t.bokeh,l=p.sx,u=p.sy,e=this.model.dimensions,r=("width"===e||"both"===e)&&s.start0?"pinch":"scroll",a.prototype.default_order=10,a.getters({tooltip:function(){return this._get_dim_tooltip(this.tool_name,this.dimensions)}}),a.define({dimensions:[s.Dimensions,"both"]}),a.internal({speed:[s.Number,1/600]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(207);n.ActionTool=i.ActionTool;var r=t(208);n.HelpTool=r.HelpTool;var o=t(209);n.RedoTool=o.RedoTool;var s=t(210);n.ResetTool=s.ResetTool;var a=t(211);n.SaveTool=a.SaveTool;var l=t(212);n.UndoTool=l.UndoTool;var u=t(213);n.ZoomInTool=u.ZoomInTool;var h=t(214);n.ZoomOutTool=h.ZoomOutTool;var c=t(215);n.ButtonTool=c.ButtonTool;var _=t(216);n.BoxSelectTool=_.BoxSelectTool;var p=t(217);n.BoxZoomTool=p.BoxZoomTool;var d=t(218);n.GestureTool=d.GestureTool;var f=t(219);n.LassoSelectTool=f.LassoSelectTool;var m=t(220);n.PanTool=m.PanTool;var v=t(221);n.PolySelectTool=v.PolySelectTool;var g=t(222);n.SelectTool=g.SelectTool;var y=t(223);n.TapTool=y.TapTool;var b=t(224);n.WheelPanTool=b.WheelPanTool;var x=t(225);n.WheelZoomTool=x.WheelZoomTool;var w=t(227);n.CrosshairTool=w.CrosshairTool;var k=t(228);n.HoverTool=k.HoverTool;var M=t(229);n.InspectTool=M.InspectTool;var S=t(231);n.Tool=S.Tool;var T=t(232);n.ToolProxy=T.ToolProxy;var O=t(233);n.Toolbar=O.Toolbar;var A=t(234);n.ToolbarBase=A.ToolbarBase;var E=t(235);n.ProxyToolbar=E.ProxyToolbar;var j=t(235);n.ToolbarBox=j.ToolbarBox},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(229),o=t(63),s=t(15),a=t(30);n.CrosshairToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._move=function(t){var e,n;if(this.model.active){return i=t.bokeh,e=i.sx,n=i.sy,this.plot_model.frame.bbox.contains(e,n)||(e=n=null),this._update_spans(e,n);var i}},e.prototype._move_exit=function(t){return this._update_spans(null,null)},e.prototype._update_spans=function(t,e){var n;if(n=this.model.dimensions,"width"!==n&&"both"!==n||(this.model.spans.width.computed_location=e),"height"===n||"both"===n)return this.model.spans.height.computed_location=t},e}(r.InspectToolView);var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this.spans={width:new o.Span({for_hover:!0,dimension:"width",render_mode:this.render_mode,location_units:this.location_units,line_color:this.line_color,line_width:this.line_width,line_alpha:this.line_alpha}),height:new o.Span({for_hover:!0,dimension:"height",render_mode:this.render_mode,location_units:this.location_units,line_color:this.line_color,line_width:this.line_width,line_alpha:this.line_alpha})}},e}(r.InspectTool);n.CrosshairTool=l,l.prototype.default_view=n.CrosshairToolView,l.prototype.type="CrosshairTool",l.prototype.tool_name="Crosshair",l.prototype.icon="bk-tool-icon-crosshair",l.define({dimensions:[s.Dimensions,"both"],line_color:[s.Color,"black"],line_width:[s.Number,1],line_alpha:[s.Number,1]}),l.internal({location_units:[s.SpatialUnits,"screen"],render_mode:[s.RenderMode,"css"],spans:[s.Any]}),l.getters({tooltip:function(){return this._get_dim_tooltip("Crosshair",this.dimensions)},synthetic_renderers:function(){return a.values(this.spans)}})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(229),o=t(67),s=t(161),a=t(162),l=t(9),u=t(39),h=t(5),c=t(15),_=t(26),p=t(30),d=t(42),f=t(4);n._nearest_line_hit=function(t,e,n,i,r,o){var s,a,u,h,c,_;if(s=r[t],a=o[t],u=r[t+1],h=o[t+1],"span"===e.type)switch(e.direction){case"h":c=Math.abs(s-n),_=Math.abs(u-n);break;case"v":c=Math.abs(a-i),_=Math.abs(h-i)}else c=l.dist_2_pts(s,a,n,i),_=l.dist_2_pts(u,h,n,i);return c<_?[[s,a],t]:[[u,h],t+1]},n._line_hit=function(t,e,n){return[[t[n],e[n]],n]};var m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.ttviews={}},e.prototype.remove=function(){return f.remove_views(this.ttviews),t.prototype.remove.call(this)},e.prototype.connect_signals=function(){var e,n,i,r;for(t.prototype.connect_signals.call(this),r=this.computed_renderers,e=0,n=r.length;e0&&(i=function(){var t,r,o;for(o=[],t=0,r=i.length;t=0&&o.push(n);return o}()),i},e.prototype._compute_ttmodels=function(){var t,e,n,i,r,l,u;if(u={},l=this.model.tooltips,null!=l)for(i=this.computed_renderers,t=0,e=i.length;t=0){if(M=w.match(/\$color(\[.*\])?:(\w*)/),m=M[0],v=M[1],r=M[2],s=t.get_column(r),null==s){a=h.span({},r+" unknown"),i.appendChild(a);continue}if(l=(null!=v?v.indexOf("hex"):void 0)>=0,b=(null!=v?v.indexOf("swatch"):void 0)>=0,o=s[e],null==o){a=h.span({},"(null)"),i.appendChild(a);continue}l&&(o=_.color2hex(o)),a=h.span({},o),i.appendChild(a),b&&(a=h.span({"class":"bk-tooltip-color-block",style:{backgroundColor:o}}," "),i.appendChild(a))}else w=w.replace("$~","$data_"),a=h.span(),a.innerHTML=u.replace_placeholders(w,t,e,this.model.formatters,n),i.appendChild(a);return y;var k,M},e}(r.InspectToolView);n.HoverToolView=m,m.getters({computed_renderers:function(){return null==this._computed_renderers&&(this._computed_renderers=this._compute_renderers()),this._computed_renderers},ttmodels:function(){return null==this._ttmodels&&(this._ttmodels=this._compute_ttmodels()),this._ttmodels}});var v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r.InspectTool);n.HoverTool=v,v.prototype.default_view=m,v.prototype.type="HoverTool",v.prototype.tool_name="Hover",v.prototype.icon="bk-tool-icon-hover",v.define({tooltips:[c.Any,[["index","$index"],["data (x, y)","($x, $y)"],["screen (x, y)","($sx, $sy)"]]],formatters:[c.Any,{}],renderers:[c.Array,[]],names:[c.Array,[]],mode:[c.String,"mouse"],point_policy:[c.String,"snap_to_data"],line_policy:[c.String,"nearest"],show_arrow:[c.Boolean,!0],anchor:[c.String,"center"],attachment:[c.String,"horizontal"],callback:[c.Any]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(15),o=t(215),s=t(230);n.InspectToolView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.ButtonToolView);var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(o.ButtonTool);n.InspectTool=a,a.prototype.button_view=s.OnOffButtonView,a.prototype.event_type="move",a.define({toggleable:[r.Bool,!0]}),a.override({active:!0})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(215);n.OnOffButtonView=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.render=function(){return t.prototype.render.call(this),this.model.active?this.el.classList.add("bk-active"):this.el.classList.remove("bk-active")},e.prototype._clicked=function(){var t;return t=this.model.active,this.model.active=!t},e}(r.ButtonToolButtonView)},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(15),o=t(45),s=t(22),a=t(50),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.plot_view=e.plot_view},e.prototype.connect_signals=function(){var e=this;return t.prototype.connect_signals.call(this),this.connect(this.model.properties.active.change,function(){return e.model.active?e.activate():e.deactivate()})},e.prototype.activate=function(){},e.prototype.deactivate=function(){},e}(o.View);n.ToolView=l,l.getters({plot_model:function(){return this.plot_view.model}});var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype._get_dim_tooltip=function(t,e){switch(e){case"width":return t+" (x-axis)";case"height":return t+" (y-axis)";case"both":return t}},e.prototype._get_dim_limits=function(t,e,n,i){var r,o,a,l,u=t[0],h=t[1],c=e[0],_=e[1];return r=n.bbox.h_range,"width"===i||"both"===i?(o=[s.min([u,c]),s.max([u,c])],o=[s.max([o[0],r.start]),s.min([o[1],r.end])]):o=[r.start,r.end],l=n.bbox.v_range,"height"===i||"both"===i?(a=[s.min([h,_]),s.max([h,_])],a=[s.max([a[0],l.start]),s.min([a[1],l.end])]):a=[l.start,l.end],[o,a]},e}(a.Model);n.Tool=u,u.getters({synthetic_renderers:function(){return[]}}),u.internal({active:[r.Boolean,!1]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(15),o=t(20),s=t(50),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this["do"]=new o.Signal(this,"do"),this.connect(this["do"],function(){return this.doit()}),this.connect(this.properties.active.change,function(){return this.set_active()})},e.prototype.doit=function(){var t,e,n,i;for(n=this.tools,t=0,e=n.length;t0&&(w=y(C),this.gestures[i].tools.push(w),this.connect(w.properties.active.change,this._active_change.bind(this,w)))}this.actions=[];for(z in t)C=t[z],C.length>0&&this.actions.push(y(C));this.inspectors=[];for(z in h)C=h[z],C.length>0&&this.inspectors.push(y(C,e=!0));j=[];for(n in this.gestures)C=this.gestures[n].tools,0!==C.length&&(this.gestures[n].tools=a.sortBy(C,function(t){return t.default_order}),"pinch"!==n&&"scroll"!==n?j.push(this.gestures[n].tools[0].active=!0):j.push(void 0));return j;var D},e}(_.ToolbarBase);n.ProxyToolbar=m,m.prototype.type="ProxyToolbar";var v=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e){return t.prototype.initialize.call(this,e),this.model.toolbar.toolbar_location=this.model.toolbar_location,this._toolbar_views={},f.build_views(this._toolbar_views,[this.model.toolbar],{parent:this})},e.prototype.remove=function(){return f.remove_views(this._toolbar_views),t.prototype.remove.call(this)},e.prototype.render=function(){var e;return t.prototype.render.call(this),e=this._toolbar_views[this.model.toolbar.id],e.render(),s.empty(this.el),this.el.appendChild(e.el)},e.prototype.get_width=function(){return this.model.toolbar.vertical?30:null},e.prototype.get_height=function(){return this.model.toolbar.horizontal?30:null},e}(d.LayoutDOMView);n.ToolbarBoxView=v,v.prototype.className="bk-toolbar-box";var g=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(d.LayoutDOM);n.ToolbarBox=g,g.prototype.type="ToolbarBox",g.prototype.default_view=v,g.define({toolbar:[o.Instance],toolbar_location:[o.Location,"right"]}),g.getters({sizing_mode:function(){switch(this.toolbar_location){case"above":case"below":return"scale_width";case"left":case"right":return"scale_height"}}})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(243),o=t(15),s=t(30),a=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(r,e),r.prototype.compute=function(e){return this.scalar_transform.apply(this,this.values.concat([e,t,n]))},r.prototype.v_compute=function(e){return this.vector_transform.apply(this,this.values.concat([e,t,n]))},r.prototype._make_transform=function(t,e){return new(Function.bind.apply(Function,[void 0].concat(Object.keys(this.args),[t,"require","exports",e])))},r.prototype._make_values=function(){return s.values(this.args)},r}(r.Transform);n.CustomJSTransform=a,a.prototype.type="CustomJSTransform",a.define({args:[o.Any,{}],func:[o.String,""],v_func:[o.String,""]}),a.getters({values:function(){return this._make_values()},scalar_transform:function(){return this._make_transform("x",this.func)},vector_transform:function(){return this._make_transform("xs",this.v_func)}})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(243),o=t(15),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute=function(t,e){void 0===e&&(e=!0);var n;return null!=(null!=(n=this.range)?n.synthetic:void 0)&&e&&(t=this.range.synthetic(t)),t+this.value},e}(r.Transform);n.Dodge=s,s.define({value:[o.Number,0],range:[o.Instance]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(236);n.CustomJSTransform=i.CustomJSTransform;var r=t(237);n.Dodge=r.Dodge;var o=t(239);n.Interpolator=o.Interpolator;var s=t(240);n.Jitter=s.Jitter;var a=t(241);n.LinearInterpolator=a.LinearInterpolator;var l=t(242);n.StepInterpolator=l.StepInterpolator;var u=t(243);n.Transform=u.Transform},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=[].indexOf,o=t(243),s=t(15),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.initialize=function(e,n){return t.prototype.initialize.call(this,e,n),this._x_sorted=[],this._y_sorted=[],this._sorted_dirty=!0,this.connect(this.change,function(){return this._sorted_dirty=!0})},e.prototype.sort=function(t){void 0===t&&(t=!1);var e,n,i,o,s,a,l,u,h,c,_;if(typeof this.x!=typeof this.y)throw new Error("The parameters for x and y must be of the same type, either both strings which define a column in the data source or both arrays of the same length");if("string"==typeof this.x&&null===this.data)throw new Error("If the x and y parameters are not specified as an array, the data parameter is reqired.");if(this._sorted_dirty!==!1){if(c=[],_=[],"string"==typeof this.x){if(n=this.data,e=n.columns(),l=this.x,r.call(e,l)<0)throw new Error("The x parameter does not correspond to a valid column name defined in the data parameter");if(u=this.y,r.call(e,u)<0)throw new Error("The x parameter does not correspond to a valid column name defined in the data parameter");c=n.get_column(this.x),_=n.get_column(this.y)}else c=this.x,_=this.y;if(c.length!==_.length)throw new Error("The length for x and y do not match");if(c.length<2)throw new Error("x and y must have at least two elements to support interpolation");a=[];for(o in c)a.push({x:c[o],y:_[o]});for(t===!0?a.sort(function(t,e){var n,i;return null!=(n=t.xe.x)?n:-{1:null!=(i=t.x===e.x)?i:{0:1}}}),s=i=0,h=a.length;0<=h?ih;s=0<=h?++i:--i)this._x_sorted[s]=a[s].x,this._y_sorted[s]=a[s].y;return this._sorted_dirty=!1}},e}(o.Transform);n.Interpolator=a,a.define({x:[s.Any],y:[s.Any],data:[s.Any],clip:[s.Bool,!0]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(243),o=t(15),s=t(29),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute=function(t,e){void 0===e&&(e=!0);var n;return null!=(null!=(n=this.range)?n.synthetic:void 0)&&e&&(t=this.range.synthetic(t)),"uniform"===this.distribution?t+this.mean+(s.random()-.5)*this.width:"normal"===this.distribution?t+s.rnorm(this.mean,this.width):void 0},e}(r.Transform);n.Jitter=a,a.define({mean:[o.Number,0],width:[o.Number,1],distribution:[o.Distribution,"uniform"],range:[o.Instance]})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(364),r=t(22),o=t(239);n.LinearInterpolator=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.compute=function(t){var e,n,i,o,s,a,l;if(this.sort(e=!1),this.clip===!0){if(tthis._x_sorted[this._x_sorted.length-1])return null}else{if(tthis._x_sorted[this._x_sorted.length-1])return this._y_sorted[this._y_sorted.length-1]}return t===this._x_sorted[0]?this._y_sorted[0]:(n=r.findLastIndex(this._x_sorted,function(e){return ethis._x_sorted[this._x_sorted.length-1])return null}else{if(tthis._x_sorted[this._x_sorted.length-1])return this._y_sorted[this._y_sorted.length-1]}return i=-1,"after"===this.mode&&(i=s.findLastIndex(this._x_sorted,function(e){return t>=e})),"before"===this.mode&&(i=s.findIndex(this._x_sorted,function(e){return t<=e})),"center"===this.mode&&(n=function(){var e,n,i,r;for(i=this._x_sorted,r=[],e=0,n=i.length;e=1<<28)throw new RangeError("repeat count must not overflow maximum string size");for(var n="";1==(1&t)&&(n+=e),t>>>=1,0!=t;)e+=e;return n})},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(37),r=function(){function t(t,e,n){this.header=t,this.metadata=e,this.content=n,this.buffers=[]}return t.assemble=function(e,n,i){var r=JSON.parse(e),o=JSON.parse(n),s=JSON.parse(i);return new t(r,o,s)},t.prototype.assemble_buffer=function(t,e){var n=null!=this.header.num_buffers?this.header.num_buffers:0;if(n<=this.buffers.length)throw new Error("too many buffers received, expecting #{nb}");this.buffers.push([t,e])},t.create=function(e,n,i){void 0===i&&(i={});var r=t.create_header(e);return new t(r,n,i)},t.create_header=function(t){return{msgid:i.uniqueId(),msgtype:t}},t.prototype.complete=function(){return null!=this.header&&null!=this.metadata&&null!=this.content&&(!("num_buffers"in this.header)||this.buffers.length===this.header.num_buffers)},t.prototype.send=function(t){var e=null!=this.header.num_buffers?this.header.num_buffers:0;if(e>0)throw new Error("BokehJS only supports receiving buffers, not sending");var n=JSON.stringify(this.header),i=JSON.stringify(this.metadata),r=JSON.stringify(this.content);t.send(n),t.send(i),t.send(r)},t.prototype.msgid=function(){return this.header.msgid},t.prototype.msgtype=function(){return this.header.msgtype},t.prototype.reqid=function(){return this.header.reqid},t.prototype.problem=function(){return"msgid"in this.header?"msgtype"in this.header?null:"No msgtype in header":"No msgid in header"},t}();n.Message=r},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=t(245),r=function(){function t(){this.message=null,this._partial=null,this._fragments=[],this._buf_header=null,this._current_consumer=this._HEADER}return t.prototype.consume=function(t){this._current_consumer(t)},t.prototype._HEADER=function(t){this._assume_text(t),this.message=null,this._partial=null,this._fragments=[t],this._buf_header=null,this._current_consumer=this._METADATA},t.prototype._METADATA=function(t){this._assume_text(t),this._fragments.push(t),this._current_consumer=this._CONTENT},t.prototype._CONTENT=function(t){this._assume_text(t),this._fragments.push(t);var e=this._fragments.slice(0,3),n=e[0],r=e[1],o=e[2];this._partial=i.Message.assemble(n,r,o),this._check_complete()},t.prototype._BUFFER_HEADER=function(t){this._assume_text(t),this._buf_header=t,this._current_consumer=this._BUFFER_PAYLOAD},t.prototype._BUFFER_PAYLOAD=function(t){this._assume_binary(t),this._partial.assemble_buffer(this._buf_header,t),this._check_complete()},t.prototype._assume_text=function(t){if(t instanceof ArrayBuffer)throw new Error("Expected text fragment but received binary fragment")},t.prototype._assume_binary=function(t){if(!(t instanceof ArrayBuffer))throw new Error("Expected binary fragment but received text fragment")},t.prototype._check_complete=function(){this._partial.complete()?(this.message=this._partial,this._current_consumer=this._HEADER):this._current_consumer=this._BUFFER_HEADER},t}();n.Receiver=r},function(t,e,n){"use strict";function i(t){var e=document.createElement("div");e.style.backgroundColor="#f2dede",e.style.border="1px solid #a94442",e.style.borderRadius="4px",e.style.display="inline-block",e.style.fontFamily="sans-serif",e.style.marginTop="5px",e.style.minWidth="200px",e.style.padding="5px 5px 5px 10px";var n=document.createElement("span");n.style.backgroundColor="#a94442",n.style.borderRadius="0px 4px 0px 0px",n.style.color="white",n.style.cursor="pointer",n.style.cssFloat="right",n.style.fontSize="0.8em",n.style.margin="-6px -6px 0px 0px",n.style.padding="2px 5px 4px 5px",n.title="close",n.setAttribute("aria-label","close"),n.appendChild(document.createTextNode("x")),n.addEventListener("click",function(){return o.removeChild(e)});var i=document.createElement("h3");i.style.color="#a94442",i.style.margin="8px 0px 0px 0px",i.style.padding="0px",i.appendChild(document.createTextNode("Bokeh Error"));var r=document.createElement("pre");r.style.whiteSpace="unset",r.style.overflowX="auto",r.appendChild(document.createTextNode(t.message||t)),e.appendChild(n),e.appendChild(i),e.appendChild(r);var o=document.getElementsByTagName("body")[0];o.insertBefore(e,o.firstChild)}function r(t,e){void 0===e&&(e=!1);try{return t()}catch(n){if(i(n),e)return;throw n}}Object.defineProperty(n,"__esModule",{value:!0}),n.safely=r},function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.version="0.12.11"},function(t,e,n){!function(){"use strict";function t(t,e){var n,i=Object.keys(e);for(n=0;n1?(e=n,e.width=arguments[0],e.height=arguments[1]):e=t?t:n,this instanceof a?(this.width=e.width||n.width,this.height=e.height||n.height,this.enableMirroring=void 0!==e.enableMirroring?e.enableMirroring:n.enableMirroring,this.canvas=this,this.__document=e.document||document,e.ctx?this.__ctx=e.ctx:(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d")),this.__setDefaultStyles(),this.__stack=[this.__getStyleState()],this.__groupStack=[],this.__root=this.__document.createElementNS("http://www.w3.org/2000/svg","svg"),this.__root.setAttribute("version",1.1),this.__root.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.__root.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),this.__root.setAttribute("width",this.width),this.__root.setAttribute("height",this.height),this.__ids={},this.__defs=this.__document.createElementNS("http://www.w3.org/2000/svg","defs"),this.__root.appendChild(this.__defs),this.__currentElement=this.__document.createElementNS("http://www.w3.org/2000/svg","g"),void this.__root.appendChild(this.__currentElement)):new a(e)},a.prototype.__createElement=function(t,e,n){"undefined"==typeof e&&(e={});var i,r,o=this.__document.createElementNS("http://www.w3.org/2000/svg",t),s=Object.keys(e);for(n&&(o.setAttribute("fill","none"),o.setAttribute("stroke","none")),i=0;i0){"path"===this.__currentElement.nodeName&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:e,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());var n=this.__createElement("g");e.appendChild(n),this.__currentElement=n}var i=this.__currentElement.getAttribute("transform");i?i+=" ":i="",i+=t,this.__currentElement.setAttribute("transform",i)},a.prototype.scale=function(e,n){void 0===n&&(n=e),this.__addTransform(t("scale({x},{y})",{x:e,y:n}))},a.prototype.rotate=function(e){var n=180*e/Math.PI;this.__addTransform(t("rotate({angle},{cx},{cy})",{angle:n,cx:0,cy:0}))},a.prototype.translate=function(e,n){this.__addTransform(t("translate({x},{y})",{x:e,y:n}))},a.prototype.transform=function(e,n,i,r,o,s){this.__addTransform(t("matrix({a},{b},{c},{d},{e},{f})",{a:e,b:n,c:i,d:r,e:o,f:s}))},a.prototype.beginPath=function(){var t,e;this.__currentDefaultPath="",this.__currentPosition={},t=this.__createElement("path",{},!0),e=this.__closestGroupOrSvg(),e.appendChild(t),this.__currentElement=t},a.prototype.__applyCurrentDefaultPath=function(){var t=this.__currentElement;"path"===t.nodeName?t.setAttribute("d",this.__currentDefaultPath):console.error("Attempted to apply path command to node",t.nodeName)},a.prototype.__addPathCommand=function(t){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=t},a.prototype.moveTo=function(e,n){"path"!==this.__currentElement.nodeName&&this.beginPath(),this.__currentPosition={x:e,y:n},this.__addPathCommand(t("M {x} {y}",{x:e,y:n}))},a.prototype.closePath=function(){this.__currentDefaultPath&&this.__addPathCommand("Z")},a.prototype.lineTo=function(e,n){this.__currentPosition={x:e,y:n},this.__currentDefaultPath.indexOf("M")>-1?this.__addPathCommand(t("L {x} {y}",{x:e,y:n})):this.__addPathCommand(t("M {x} {y}",{x:e,y:n}))},a.prototype.bezierCurveTo=function(e,n,i,r,o,s){this.__currentPosition={x:o,y:s},this.__addPathCommand(t("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:e,cp1y:n,cp2x:i,cp2y:r,x:o,y:s}))},a.prototype.quadraticCurveTo=function(e,n,i,r){this.__currentPosition={x:i,y:r},this.__addPathCommand(t("Q {cpx} {cpy} {x} {y}",{cpx:e,cpy:n,x:i,y:r}))};var c=function(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]};a.prototype.arcTo=function(t,e,n,i,r){var o=this.__currentPosition&&this.__currentPosition.x,s=this.__currentPosition&&this.__currentPosition.y;if("undefined"!=typeof o&&"undefined"!=typeof s){if(r<0)throw new Error("IndexSizeError: The radius provided ("+r+") is negative.");if(o===t&&s===e||t===n&&e===i||0===r)return void this.lineTo(t,e);var a=c([o-t,s-e]),l=c([n-t,i-e]);if(a[0]*l[1]===a[1]*l[0])return void this.lineTo(t,e);var u=a[0]*l[0]+a[1]*l[1],h=Math.acos(Math.abs(u)),_=c([a[0]+l[0],a[1]+l[1]]),p=r/Math.sin(h/2),d=t+p*_[0],f=e+p*_[1],m=[-a[1],a[0]],v=[l[1],-l[0]],g=function(t){var e=t[0],n=t[1];return n>=0?Math.acos(e):-Math.acos(e)},y=g(m),b=g(v);this.lineTo(d+m[0]*r,f+m[1]*r),this.arc(d,f,r,y,b)}},a.prototype.stroke=function(){"path"===this.__currentElement.nodeName&&this.__currentElement.setAttribute("paint-order","fill stroke markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke")},a.prototype.fill=function(){"path"===this.__currentElement.nodeName&&this.__currentElement.setAttribute("paint-order","stroke fill markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill")},a.prototype.rect=function(t,e,n,i){"path"!==this.__currentElement.nodeName&&this.beginPath(),this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+i),this.lineTo(t,e+i),this.lineTo(t,e),this.closePath()},a.prototype.fillRect=function(t,e,n,i){var r,o;r=this.__createElement("rect",{x:t,y:e,width:n,height:i},!0),o=this.__closestGroupOrSvg(),o.appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("fill")},a.prototype.strokeRect=function(t,e,n,i){var r,o;r=this.__createElement("rect",{x:t,y:e,width:n,height:i},!0),o=this.__closestGroupOrSvg(),o.appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")},a.prototype.__clearCanvas=function(){for(var t=this.__closestGroupOrSvg(),e=t.getAttribute("transform"),n=this.__root.childNodes[1],i=n.childNodes,r=i.length-1;r>=0;r--)i[r]&&n.removeChild(i[r]);this.__currentElement=n,this.__groupStack=[],e&&this.__addTransform(e)},a.prototype.clearRect=function(t,e,n,i){if(0===t&&0===e&&n===this.width&&i===this.height)return void this.__clearCanvas();var r,o=this.__closestGroupOrSvg();r=this.__createElement("rect",{x:t,y:e,width:n,height:i,fill:"#FFFFFF"},!0),o.appendChild(r)},a.prototype.createLinearGradient=function(t,e,i,r){var o=this.__createElement("linearGradient",{id:n(this.__ids),x1:t+"px",x2:i+"px",y1:e+"px",y2:r+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__defs.appendChild(o),new l(o,this)},a.prototype.createRadialGradient=function(t,e,i,r,o,s){var a=this.__createElement("radialGradient",{id:n(this.__ids),cx:r+"px",cy:o+"px",r:s+"px",fx:t+"px",fy:e+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__defs.appendChild(a),new l(a,this)},a.prototype.__parseFont=function(){var t=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-,\'\"\sa-z0-9]+?)\s*$/i,e=t.exec(this.font),n={style:e[1]||"normal",size:e[4]||"10px",family:e[6]||"sans-serif",weight:e[3]||"normal",decoration:e[2]||"normal",href:null};return"underline"===this.__fontUnderline&&(n.decoration="underline"),this.__fontHref&&(n.href=this.__fontHref),n},a.prototype.__wrapTextLink=function(t,e){if(t.href){var n=this.__createElement("a");return n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",t.href),n.appendChild(e),n}return e},a.prototype.__applyText=function(t,e,n,i){var s=this.__parseFont(),a=this.__closestGroupOrSvg(),l=this.__createElement("text",{"font-family":s.family,"font-size":s.size,"font-style":s.style,"font-weight":s.weight,"text-decoration":s.decoration,x:e,y:n,"text-anchor":r(this.textAlign),"dominant-baseline":o(this.textBaseline)},!0);l.appendChild(this.__document.createTextNode(t)),this.__currentElement=l,this.__applyStyleToCurrentElement(i),a.appendChild(this.__wrapTextLink(s,l))},a.prototype.fillText=function(t,e,n){this.__applyText(t,e,n,"fill")},a.prototype.strokeText=function(t,e,n){this.__applyText(t,e,n,"stroke")},a.prototype.measureText=function(t){return this.__ctx.font=this.font,this.__ctx.measureText(t)},a.prototype.arc=function(e,n,i,r,o,s){if(r!==o){r%=2*Math.PI,o%=2*Math.PI,r===o&&(o=(o+2*Math.PI-.001*(s?-1:1))%(2*Math.PI));var a=e+i*Math.cos(o),l=n+i*Math.sin(o),u=e+i*Math.cos(r),h=n+i*Math.sin(r),c=s?0:1,_=0,p=o-r;p<0&&(p+=2*Math.PI),_=s?p>Math.PI?0:1:p>Math.PI?1:0,this.lineTo(u,h),this.__addPathCommand(t("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:i,ry:i,xAxisRotation:0,largeArcFlag:_,sweepFlag:c,endX:a,endY:l})),this.__currentPosition={x:a,y:l}}},a.prototype.clip=function(){var e=this.__closestGroupOrSvg(),i=this.__createElement("clipPath"),r=n(this.__ids),o=this.__createElement("g");this.__applyCurrentDefaultPath(),e.removeChild(this.__currentElement),i.setAttribute("id",r),i.appendChild(this.__currentElement),this.__defs.appendChild(i),e.setAttribute("clip-path",t("url(#{id})",{id:r})),e.appendChild(o),this.__currentElement=o},a.prototype.drawImage=function(){var t,e,n,i,r,o,s,l,u,h,c,_,p,d,f,m=Array.prototype.slice.call(arguments),v=m[0],g=0,y=0;if(3===m.length)t=m[1],e=m[2],r=v.width,o=v.height,n=r,i=o;else if(5===m.length)t=m[1],e=m[2],n=m[3],i=m[4],r=v.width,o=v.height;else{if(9!==m.length)throw new Error("Inavlid number of arguments passed to drawImage: "+arguments.length);g=m[1],y=m[2],r=m[3],o=m[4],t=m[5],e=m[6],n=m[7],i=m[8]}s=this.__closestGroupOrSvg(),c=this.__currentElement;var b="translate("+t+", "+e+")";if(v instanceof a){if(l=v.getSvg().cloneNode(!0),l.childNodes&&l.childNodes.length>1){for(u=l.childNodes[0];u.childNodes.length;)f=u.childNodes[0].getAttribute("id"),this.__ids[f]=f,this.__defs.appendChild(u.childNodes[0]);if(h=l.childNodes[1]){var x,w=h.getAttribute("transform");x=w?w+" "+b:b,h.setAttribute("transform",x),s.appendChild(h)}}}else"IMG"===v.nodeName?(_=this.__createElement("image"),_.setAttribute("width",n),_.setAttribute("height",i),_.setAttribute("preserveAspectRatio","none"),(g||y||r!==v.width||o!==v.height)&&(p=this.__document.createElement("canvas"),p.width=n,p.height=i,d=p.getContext("2d"),d.drawImage(v,g,y,r,o,0,0,n,i),v=p),_.setAttribute("transform",b),_.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","CANVAS"===v.nodeName?v.toDataURL():v.getAttribute("src")),s.appendChild(_)):"CANVAS"===v.nodeName&&(_=this.__createElement("image"),_.setAttribute("width",n),_.setAttribute("height",i),_.setAttribute("preserveAspectRatio","none"),p=this.__document.createElement("canvas"),p.width=n,p.height=i,d=p.getContext("2d"),d.imageSmoothingEnabled=!1,d.mozImageSmoothingEnabled=!1,d.oImageSmoothingEnabled=!1,d.webkitImageSmoothingEnabled=!1,d.drawImage(v,g,y,r,o,0,0,n,i),v=p,_.setAttribute("transform",b),_.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",v.toDataURL()),s.appendChild(_))},a.prototype.createPattern=function(t,e){var i,r=this.__document.createElementNS("http://www.w3.org/2000/svg","pattern"),o=n(this.__ids);return r.setAttribute("id",o),r.setAttribute("width",t.width),r.setAttribute("height",t.height),"CANVAS"===t.nodeName||"IMG"===t.nodeName?(i=this.__document.createElementNS("http://www.w3.org/2000/svg","image"),i.setAttribute("width",t.width),i.setAttribute("height",t.height),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","CANVAS"===t.nodeName?t.toDataURL():t.getAttribute("src")),r.appendChild(i),this.__defs.appendChild(r)):t instanceof a&&(r.appendChild(t.__root.childNodes[1]),this.__defs.appendChild(r)),new u(r,this)},a.prototype.setLineDash=function(t){t&&t.length>0?this.lineDash=t.join(","):this.lineDash=null},a.prototype.drawFocusRing=function(){},a.prototype.createImageData=function(){},a.prototype.getImageData=function(){},a.prototype.putImageData=function(){},a.prototype.globalCompositeOperation=function(){},a.prototype.setTransform=function(){},"object"==typeof window&&(window.C2S=a),"object"==typeof e&&"object"==typeof e.exports&&(e.exports=a)}()},function(t,e,n){"use strict";var i,r=t(273),o=t(283),s=t(287),a=t(282),l=t(287),u=t(289),h=Function.prototype.bind,c=Object.defineProperty,_=Object.prototype.hasOwnProperty;i=function(t,e,n){var i,o=u(e)&&l(e.value);return i=r(e),delete i.writable,delete i.value,i.get=function(){return!n.overwriteDefinition&&_.call(this,t)?o:(e.value=h.call(o,n.resolveContext?n.resolveContext(this):this),c(this,t,e),this[t])},i},e.exports=function(t){var e=o(arguments[1]);return null!=e.resolveContext&&s(e.resolveContext),a(t,function(t,n){return i(n,t,e)})}},function(t,e,n){"use strict";var i,r=t(270),o=t(283),s=t(276),a=t(290);i=e.exports=function(t,e){var n,i,s,l,u;return arguments.length<2||"string"!=typeof t?(l=e,e=t,t=null):l=arguments[2],null==t?(n=s=!0,i=!1):(n=a.call(t,"c"),i=a.call(t,"e"),s=a.call(t,"w")),u={value:e,configurable:n,enumerable:i,writable:s},l?r(o(l),u):u},i.gs=function(t,e,n){var i,l,u,h;return"string"!=typeof t?(u=n,n=e,e=t,t=null):u=arguments[3],null==e?e=void 0:s(e)?null==n?n=void 0:s(n)||(u=n,n=void 0):(u=e,e=n=void 0),null==t?(i=!0,l=!1):(i=a.call(t,"c"),l=a.call(t,"e")),h={get:e,set:n,configurable:i,enumerable:l},u?r(o(u),h):h}},function(t,e,n){"use strict";var i=t(289);e.exports=function(){return i(this).length=0,this}},function(t,e,n){"use strict";var i=t(264),r=t(268),o=t(289),s=Array.prototype.indexOf,a=Object.prototype.hasOwnProperty,l=Math.abs,u=Math.floor;e.exports=function(t){var e,n,h,c;if(!i(t))return s.apply(this,arguments);for(n=r(o(this).length),h=arguments[1],h=isNaN(h)?0:h>=0?u(h):r(this.length)-u(l(h)),e=h;e=55296&&g<=56319&&(w+=t[++n])),w=k?_.call(k,M,w,f):w,e?(p.value=w,d(m,f,p)):m[f]=w,++f;v=f}if(void 0===v)for(v=s(t.length),e&&(m=new e(v)),n=0;n0?1:-1}},function(t,e,n){"use strict";e.exports=t(265)()?Number.isNaN:t(266)},function(t,e,n){"use strict";e.exports=function(){var t=Number.isNaN;return"function"==typeof t&&(!t({})&&t(NaN)&&!t(34))}},function(t,e,n){"use strict";e.exports=function(t){return t!==t}},function(t,e,n){"use strict";var i=t(261),r=Math.abs,o=Math.floor;e.exports=function(t){return isNaN(t)?0:(t=Number(t),0!==t&&isFinite(t)?i(t)*o(r(t)):t)}},function(t,e,n){"use strict";var i=t(267),r=Math.max;e.exports=function(t){return r(0,i(t))}},function(t,e,n){"use strict";var i=t(287),r=t(289),o=Function.prototype.bind,s=Function.prototype.call,a=Object.keys,l=Object.prototype.propertyIsEnumerable;e.exports=function(t,e){return function(n,u){var h,c=arguments[2],_=arguments[3];return n=Object(r(n)),i(u),h=a(n),_&&h.sort("function"==typeof _?o.call(_,n):void 0),"function"!=typeof t&&(t=h[t]),s.call(t,h,function(t,i){return l.call(n,t)?s.call(u,c,n[t],t,n,i):e})}}},function(t,e,n){"use strict";e.exports=t(271)()?Object.assign:t(272)},function(t,e,n){"use strict";e.exports=function(){var t,e=Object.assign;return"function"==typeof e&&(t={foo:"raz"},e(t,{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},function(t,e,n){"use strict";var i=t(279),r=t(289),o=Math.max;e.exports=function(t,e){var n,s,a,l=o(arguments.length,2);for(t=Object(r(t)),a=function(i){try{t[i]=e[i]}catch(r){n||(n=r)}},s=1;s-1}},function(t,e,n){"use strict";var i=Object.prototype.toString,r=i.call("");e.exports=function(t){return"string"==typeof t||t&&"object"==typeof t&&(t instanceof String||i.call(t)===r)||!1}},function(t,e,n){"use strict";var i=Object.create(null),r=Math.random;e.exports=function(){var t;do t=r().toString(36).slice(2);while(i[t]);return t}},function(t,e,n){"use strict";var i,r=t(284),o=t(290),s=t(251),a=t(308),l=t(298),u=Object.defineProperty;i=e.exports=function(t,e){if(!(this instanceof i))throw new TypeError("Constructor requires 'new'");l.call(this,t),e=e?o.call(e,"key+value")?"key+value":o.call(e,"key")?"key":"value":"value",u(this,"__kind__",s("",e))},r&&r(i,l),delete i.prototype.constructor,i.prototype=Object.create(l.prototype,{_resolve:s(function(t){return"value"===this.__kind__?this.__list__[t]:"key+value"===this.__kind__?[t,this.__list__[t]]:t})}),u(i.prototype,a.toStringTag,s("c","Array Iterator"))},function(t,e,n){"use strict";var i=t(257),r=t(287),o=t(293),s=t(297),a=Array.isArray,l=Function.prototype.call,u=Array.prototype.some;e.exports=function(t,e){var n,h,c,_,p,d,f,m,v=arguments[2];if(a(t)||i(t)?n="array":o(t)?n="string":t=s(t),r(e),c=function(){_=!0},"array"===n)return void u.call(t,function(t){return l.call(e,v,t,c),_});if("string"!==n)for(h=t.next();!h.done;){if(l.call(e,v,h.value,c),_)return;h=t.next()}else for(d=t.length,p=0;p=55296&&m<=56319&&(f+=t[++p])),l.call(e,v,f,c),!_);++p);}},function(t,e,n){"use strict";var i=t(257),r=t(293),o=t(295),s=t(300),a=t(301),l=t(308).iterator;e.exports=function(t){return"function"==typeof a(t)[l]?t[l]():i(t)?new o(t):r(t)?new s(t):new o(t)}},function(t,e,n){"use strict";var i,r=t(252),o=t(270),s=t(287),a=t(289),l=t(251),u=t(250),h=t(308),c=Object.defineProperty,_=Object.defineProperties;e.exports=i=function(t,e){if(!(this instanceof i))throw new TypeError("Constructor requires 'new'");_(this,{__list__:l("w",a(t)),__context__:l("w",e),__nextIndex__:l("w",0)}),e&&(s(e.on),e.on("_add",this._onAdd),e.on("_delete",this._onDelete),e.on("_clear",this._onClear))},delete i.prototype.constructor,_(i.prototype,o({_next:l(function(){var t;if(this.__list__)return this.__redo__&&(t=this.__redo__.shift(),void 0!==t)?t:this.__nextIndex__=this.__nextIndex__)){if(++this.__nextIndex__,!this.__redo__)return void c(this,"__redo__",l("c",[t]));this.__redo__.forEach(function(e,n){e>=t&&(this.__redo__[n]=++e)},this),this.__redo__.push(t)}}),_onDelete:l(function(t){var e;t>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(e=this.__redo__.indexOf(t),e!==-1&&this.__redo__.splice(e,1),this.__redo__.forEach(function(e,n){e>t&&(this.__redo__[n]=--e)},this)))}),_onClear:l(function(){this.__redo__&&r.call(this.__redo__),this.__nextIndex__=0})}))),c(i.prototype,h.iterator,l(function(){return this}))},function(t,e,n){"use strict";var i=t(257),r=t(278),o=t(293),s=t(308).iterator,a=Array.isArray;e.exports=function(t){return!!r(t)&&(!!a(t)||(!!o(t)||(!!i(t)||"function"==typeof t[s])))}},function(t,e,n){"use strict";var i,r=t(284),o=t(251),s=t(308),a=t(298),l=Object.defineProperty;i=e.exports=function(t){if(!(this instanceof i))throw new TypeError("Constructor requires 'new'");t=String(t),a.call(this,t),l(this,"__length__",o("",t.length))},r&&r(i,a),delete i.prototype.constructor,i.prototype=Object.create(a.prototype,{_next:o(function(){if(this.__list__)return this.__nextIndex__=55296&&e<=56319?n+this.__list__[this.__nextIndex__++]:n)})}),l(i.prototype,s.toStringTag,o("c","String Iterator"))},function(t,e,n){"use strict";var i=t(299);e.exports=function(t){if(!i(t))throw new TypeError(t+" is not iterable");return t}},function(e,n,i){/*! - * @overview es6-promise - a tiny implementation of Promises/A+. - * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) - * @license Licensed under MIT license - * See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE - * @version 3.0.2 - */ -(function(){"use strict";function i(t){return"function"==typeof t||"object"==typeof t&&null!==t}function r(t){return"function"==typeof t}function o(t){return"object"==typeof t&&null!==t}function s(t){q=t}function a(t){H=t}function l(){return function(){process.nextTick(p)}}function u(){return function(){U(p)}}function h(){var t=0,e=new $(p),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function c(){var t=new MessageChannel;return t.port1.onmessage=p,function(){t.port2.postMessage(0)}}function _(){return function(){setTimeout(p,1)}}function p(){for(var t=0;t\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=e.console&&(e.console.warn||e.console.log);return o&&o.call(e.console,r,i),t.apply(this,arguments)}}function h(t,e,n){var i,r=e.prototype;i=t.prototype=Object.create(r),i.constructor=t,i._super=r,n&&pt(i,n)}function c(t,e){return function(){return t.apply(e,arguments)}}function _(t,e){return typeof t==mt?t.apply(e?e[0]||o:o,e):t}function p(t,e){return t===o?e:t}function d(t,e,n){l(g(e),function(e){t.addEventListener(e,n,!1)})}function f(t,e,n){l(g(e),function(e){t.removeEventListener(e,n,!1)})}function m(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function v(t,e){return t.indexOf(e)>-1}function g(t){return t.trim().split(/\s+/g)}function y(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var i=0;in[e]}):i.sort()),i}function w(t,e){for(var n,i,r=e[0].toUpperCase()+e.slice(1),s=0;s1&&!n.firstMultiple?n.firstMultiple=P(e):1===r&&(n.firstMultiple=!1);var o=n.firstInput,s=n.firstMultiple,a=s?s.center:o.center,l=e.center=z(i);e.timeStamp=yt(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=F(a,l),e.distance=D(a,l),E(n,e),e.offsetDirection=N(e.deltaX,e.deltaY);var u=C(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=u.x,e.overallVelocityY=u.y,e.overallVelocity=gt(u.x)>gt(u.y)?u.x:u.y,e.scale=s?B(s.pointers,i):1,e.rotation=s?I(s.pointers,i):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length,j(n,e);var h=t.element;m(e.srcEvent.target,h)&&(h=e.srcEvent.target),e.target=h}function E(t,e){var n=e.center,i=t.offsetDelta||{},r=t.prevDelta||{},o=t.prevInput||{};e.eventType!==zt&&o.eventType!==Nt||(r=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},i=t.offsetDelta={x:n.x,y:n.y}),e.deltaX=r.x+(n.x-i.x),e.deltaY=r.y+(n.y-i.y)}function j(t,e){var n,i,r,s,a=t.lastInterval||e,l=e.timeStamp-a.timeStamp;if(e.eventType!=Dt&&(l>Pt||a.velocity===o)){var u=e.deltaX-a.deltaX,h=e.deltaY-a.deltaY,c=C(l,u,h);i=c.x,r=c.y,n=gt(c.x)>gt(c.y)?c.x:c.y,s=N(u,h),t.lastInterval=e}else n=a.velocity,i=a.velocityX,r=a.velocityY,s=a.direction;e.velocity=n,e.velocityX=i,e.velocityY=r,e.direction=s}function P(t){for(var e=[],n=0;n=gt(e)?t<0?It:Bt:e<0?Rt:Lt}function D(t,e,n){n||(n=qt);var i=e[n[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return Math.sqrt(i*i+r*r)}function F(t,e,n){n||(n=qt);var i=e[n[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return 180*Math.atan2(r,i)/Math.PI}function I(t,e){return F(e[1],e[0],Yt)+F(t[1],t[0],Yt)}function B(t,e){return D(e[0],e[1],Yt)/D(t[0],t[1],Yt)}function R(){this.evEl=Wt,this.evWin=Ht,this.pressed=!1,S.apply(this,arguments)}function L(){this.evEl=$t,this.evWin=Zt,S.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function V(){this.evTarget=te,this.evWin=ee,this.started=!1,S.apply(this,arguments)}function G(t,e){var n=b(t.touches),i=b(t.changedTouches);return e&(Nt|Dt)&&(n=x(n.concat(i),"identifier",!0)),[n,i]}function U(){this.evTarget=ie,this.targetIds={},S.apply(this,arguments)}function q(t,e){var n=b(t.touches),i=this.targetIds;if(e&(zt|Ct)&&1===n.length)return i[n[0].identifier]=!0,[n,n];var r,o,s=b(t.changedTouches),a=[],l=this.target;if(o=n.filter(function(t){return m(t.target,l)}),e===zt)for(r=0;r-1&&i.splice(t,1)};setTimeout(r,re)}}function H(t){for(var e=t.srcEvent.clientX,n=t.srcEvent.clientY,i=0;i-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){function e(e){n.manager.emit(e,t)}var n=this,i=this.state;i=ge&&e(n.options.event+K(i))},tryEmit:function(t){return this.canEmit()?this.emit(t):void(this.state=xe)},canEmit:function(){for(var t=0;te.threshold&&r&e.direction},attrTest:function(t){return nt.prototype.attrTest.call(this,t)&&(this.state&me||!(this.state&me)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=tt(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),h(rt,nt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ce]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&me)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),h(ot,Z,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ue]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,i=t.distancee.time;if(this._input=t,!i||!n||t.eventType&(Nt|Dt)&&!r)this.reset();else if(t.eventType&zt)this.reset(),this._timer=s(function(){this.state=ye,this.tryEmit()},e.time,this);else if(t.eventType&Nt)return ye;return xe},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===ye&&(t&&t.eventType&Nt?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=yt(),this.manager.emit(this.options.event,this._input)))}}),h(st,nt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ce]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&me)}}),h(at,nt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Vt|Gt,pointers:1},getTouchAction:function(){return it.prototype.getTouchAction.call(this)},attrTest:function(t){var e,n=this.options.direction;return n&(Vt|Gt)?e=t.overallVelocity:n&Vt?e=t.overallVelocityX:n&Gt&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&>(e)>this.options.velocity&&t.eventType&Nt},emit:function(t){var e=tt(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),h(lt,Z,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[he]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,i=t.distance=";case i.Eq:return"=="}};return this._expression+" "+e()+" 0"},Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"expression",{get:function(){return this._expression},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"op",{get:function(){return this._operator},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"strength",{get:function(){return this._strength},enumerable:!0,configurable:!0}),t}();n.Constraint=o;var s=0},function(t,e,n){"use strict";function i(t){for(var e=0,n=function(){return 0},i=s.createMap(o.Variable.Compare),r=0,a=t.length;r=0?" + "+l+a:" - "+-l+a}var u=this.constant;return u<0?n+=" - "+-u:u>0&&(n+=" + "+u),n},Object.defineProperty(t.prototype,"terms",{get:function(){return this._terms},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"constant",{get:function(){return this._constant},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){var t=this._constant;return r.forEach(this._terms,function(e){t+=e.first.value*e.second}),t},enumerable:!0,configurable:!0}),t}();n.Expression=a},function(t,e,n){"use strict";/*----------------------------------------------------------------------------- -| Copyright (c) 2014, Nucleic Development Team. -| -| Distributed under the terms of the Modified BSD License. -| -| The full license is in the file COPYING.txt, distributed with this software. -|----------------------------------------------------------------------------*/ -function i(t){for(var e in t)n.hasOwnProperty(e)||(n[e]=t[e])}Object.defineProperty(n,"__esModule",{value:!0}),i(t(331)),i(t(320)),i(t(319)),i(t(324)),i(t(323))},function(t,e,n){"use strict";function i(t){return new r.AssociativeArray(t)}/*----------------------------------------------------------------------------- -| Copyright (c) 2014, Nucleic Development Team. -| -| Distributed under the terms of the Modified BSD License. -| -| The full license is in the file COPYING.txt, distributed with this software. -|----------------------------------------------------------------------------*/ -Object.defineProperty(n,"__esModule",{value:!0});var r=t(328);n.createMap=i},function(t,e,n){"use strict";function i(t){var e=1e-8;return t<0?-t0&&a.type()!==f.Dummy){var u=this._objective.coefficientFor(a),h=u/l;h0;)i=s>>1,r=o+i,n(t[r],e)<0?(o=r+1,s-=i+1):s=i;return o}function r(t,e,n){var r=i(t,e,n);if(r===t.length)return-1;var o=t[r];return 0!==n(o,e)?-1:r}function o(t,e,n){var r=i(t,e,n);if(r!==t.length){var o=t[r];if(0===n(o,e))return o}}function s(t,e){var n=p.asArray(t),i=n.length;if(i<=1)return n;n.sort(e);for(var r=[n[0]],o=1,s=0;o0))return!1;++r}}return!0}function l(t,e,n){var i=t.length,r=e.length;if(i>r)return!1;for(var o=0,s=0;o0?++s:(++o,++s)}return!(o0?(a.push(u),++r):(a.push(l),++i,++r)}for(;i0?++r:(a.push(l),++i,++r)}return a}function c(t,e,n){for(var i=0,r=0,o=t.length,s=e.length,a=[];i0?++r:(++i,++r)}for(;i0?(a.push(u),++r):(++i,++r)}for(;i0?(a.push(u.copy()),++r):(a.push(u.copy()),++i,++r)}for(;i=0},e.prototype.find=function(t){return l.binaryFind(this._array,t,this._wrapped)},e.prototype.setDefault=function(t,e){var n=this._array,i=l.lowerBound(n,t,this._wrapped);if(i===n.length){var r=new s.Pair(t,e());return n.push(r),r}var o=n[i];if(0!==this._compare(o.first,t)){var r=new s.Pair(t,e());return n.splice(i,0,r),r}return o},e.prototype.insert=function(t,e){var n=this._array,i=l.lowerBound(n,t,this._wrapped);if(i===n.length){var r=new s.Pair(t,e);return n.push(r),r}var o=n[i];if(0!==this._compare(o.first,t)){var r=new s.Pair(t,e);return n.splice(i,0,r),r}return o.second=e,o},e.prototype.update=function(t){var n=this;t instanceof e?this._array=r(this._array,t._array,this._compare):u.forEach(t,function(t){n.insert(t.first,t.second)})},e.prototype.erase=function(t){var e=this._array,n=l.binarySearch(e,t,this._wrapped);if(!(n<0))return e.splice(n,1)[0]},e.prototype.copy=function(){for(var t=new e(this._compare),n=t._array,i=this._array,r=0,o=i.length;r0&&(a+="."+r(e)),a}function s(t,e,n,i){var r,s,a=Math.pow(10,e);return s=t.toFixed(0).search("e")>-1?o(t,e):(n(t*a)/a).toFixed(e),i&&(r=new RegExp("0{1,"+i+"}$"),s=s.replace(r,"")),s}function a(t,e,n){var i;return i=e.indexOf("$")>-1?l(t,e,n):e.indexOf("%")>-1?u(t,e,n):e.indexOf(":")>-1?h(t):c(t,e,n)}function l(t,e,n){var i,r,o=e,s=o.indexOf("$"),a=o.indexOf("("),l=o.indexOf("+"),u=o.indexOf("-"),h="",_="";if(o.indexOf("$")===-1?"infix"===v[y].currency.position?(_=v[y].currency.symbol,v[y].currency.spaceSeparated&&(_=" "+_+" ")):v[y].currency.spaceSeparated&&(h=" "):o.indexOf(" $")>-1?(h=" ",o=o.replace(" $","")):o.indexOf("$ ")>-1?(h=" ",o=o.replace("$ ","")):o=o.replace("$",""),r=c(t,o,n,_),e.indexOf("$")===-1)switch(v[y].currency.position){case"postfix":r.indexOf(")")>-1?(r=r.split(""),r.splice(-1,0,h+v[y].currency.symbol),r=r.join("")):r=r+h+v[y].currency.symbol;break;case"infix":break;case"prefix":r.indexOf("(")>-1||r.indexOf("-")>-1?(r=r.split(""),i=Math.max(a,u)+1,r.splice(i,0,v[y].currency.symbol+h),r=r.join("")):r=v[y].currency.symbol+h+r;break;default:throw Error('Currency position should be among ["prefix", "infix", "postfix"]')}else s<=1?r.indexOf("(")>-1||r.indexOf("+")>-1||r.indexOf("-")>-1?(r=r.split(""),i=1,(s-1?(r=r.split(""),r.splice(-1,0,h+v[y].currency.symbol),r=r.join("")):r=r+h+v[y].currency.symbol;return r}function u(t,e,n){var i,r="";return t=100*t,e.indexOf(" %")>-1?(r=" ",e=e.replace(" %","")):e=e.replace("%",""),i=c(t,e,n),i.indexOf(")")>-1?(i=i.split(""),i.splice(-1,0,r+"%"),i=i.join("")):i=i+r+"%",i}function h(t){var e=Math.floor(t/60/60),n=Math.floor((t-60*e*60)/60),i=Math.round(t-60*e*60-60*n);return e+":"+(n<10?"0"+n:n)+":"+(i<10?"0"+i:i)}function c(t,e,n,i){var r,o,a,l,u,h,c,_,p,d,f,m,g,x,w,k,M,S,T=!1,O=!1,A=!1,E="",j=!1,P=!1,z=!1,C=!1,N=!1,D="",F="",I=Math.abs(t),B=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],R=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],L="",V=!1,G=!1,U="";if(0===t&&null!==b)return b;if(!isFinite(t))return""+t;if(0===e.indexOf("{")){var q=e.indexOf("}");if(q===-1)throw Error('Format should also contain a "}"');m=e.slice(1,q),e=e.slice(q+1)}else m="";if(e.indexOf("}")===e.length-1){var Y=e.indexOf("{");if(Y===-1)throw Error('Format should also contain a "{"');g=e.slice(Y+1,-1),e=e.slice(0,Y+1)}else g="";var X;if(X=e.indexOf(".")===-1?e.match(/([0-9]+).*/):e.match(/([0-9]+)\..*/),S=null===X?-1:X[1].length,e.indexOf("-")!==-1&&(V=!0),e.indexOf("(")>-1?(T=!0,e=e.slice(1,-1)):e.indexOf("+")>-1&&(O=!0,e=e.replace(/\+/g,"")),e.indexOf("a")>-1){if(d=e.split(".")[0].match(/[0-9]+/g)||["0"],d=parseInt(d[0],10),j=e.indexOf("aK")>=0,P=e.indexOf("aM")>=0,z=e.indexOf("aB")>=0,C=e.indexOf("aT")>=0,N=j||P||z||C,e.indexOf(" a")>-1?(E=" ",e=e.replace(" a","")):e=e.replace("a",""),u=Math.floor(Math.log(I)/Math.LN10)+1,c=u%3,c=0===c?3:c,d&&0!==I&&(h=Math.floor(Math.log(I)/Math.LN10)+1-d,_=3*~~((Math.min(d,u)-c)/3),I/=Math.pow(10,_),e.indexOf(".")===-1&&d>3))for(e+="[.]",k=0===h?0:3*~~(h/3)-h,k=k<0?k+3:k,r=0;r=Math.pow(10,12)&&!N||C?(E+=v[y].abbreviations.trillion,t/=Math.pow(10,12)):I=Math.pow(10,9)&&!N||z?(E+=v[y].abbreviations.billion,t/=Math.pow(10,9)):I=Math.pow(10,6)&&!N||P?(E+=v[y].abbreviations.million,t/=Math.pow(10,6)):(I=Math.pow(10,3)&&!N||j)&&(E+=v[y].abbreviations.thousand,t/=Math.pow(10,3)))}if(e.indexOf("b")>-1)for(e.indexOf(" b")>-1?(D=" ",e=e.replace(" b","")):e=e.replace("b",""),l=0;l<=B.length;l++)if(o=Math.pow(1024,l),a=Math.pow(1024,l+1),t>=o&&t0&&(t/=o);break}if(e.indexOf("d")>-1)for(e.indexOf(" d")>-1?(D=" ",e=e.replace(" d","")):e=e.replace("d",""),l=0;l<=R.length;l++)if(o=Math.pow(1e3,l),a=Math.pow(1e3,l+1),t>=o&&t0&&(t/=o);break}if(e.indexOf("o")>-1&&(e.indexOf(" o")>-1?(F=" ",e=e.replace(" o","")):e=e.replace("o",""),v[y].ordinal&&(F+=v[y].ordinal(t))),e.indexOf("[.]")>-1&&(A=!0,e=e.replace("[.]",".")),p=t.toString().split(".")[0],f=e.split(".")[1],x=e.indexOf(","),f){if(f.indexOf("*")!==-1?L=s(t,t.toString().split(".")[1].length,n):f.indexOf("[")>-1?(f=f.replace("]",""),f=f.split("["),L=s(t,f[0].length+f[1].length,n,f[1].length)):L=s(t,f.length,n),p=L.split(".")[0],L.split(".")[1].length){var W=i?E+i:v[y].delimiters.decimal;L=W+L.split(".")[1]}else L="";A&&0===Number(L.slice(1))&&(L="")}else p=s(t,null,n);return p.indexOf("-")>-1&&(p=p.slice(1),G=!0),p.length-1&&(p=p.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+v[y].delimiters.thousands)),0===e.indexOf(".")&&(p=""),w=e.indexOf("("),M=e.indexOf("-"),U=w2)&&(o.length<2?!!o[0].match(/^\d+.*\d$/)&&!o[0].match(a):1===o[0].length?!!o[0].match(/^\d+$/)&&!o[0].match(a)&&!!o[1].match(/^\d+$/):!!o[0].match(/^\d+.*\d$/)&&!o[0].match(a)&&!!o[1].match(/^\d+$/)))))},e.exports={format:d}},function(t,e,n){function i(t,e){if(!(this instanceof i))return new i(t);e=e||function(t){if(t)throw t};var n=r(t);if("object"!=typeof n)return void e(t);var s=i.projections.get(n.projName);if(!s)return void e(t);if(n.datumCode&&"none"!==n.datumCode){var h=l[n.datumCode];h&&(n.datum_params=h.towgs84?h.towgs84.split(","):null,n.ellps=h.ellipse,n.datumName=h.datumName?h.datumName:n.datumCode)}n.k0=n.k0||1,n.axis=n.axis||"enu";var c=a.sphere(n.a,n.b,n.rf,n.ellps,n.sphere),_=a.eccentricity(c.a,c.b,c.rf,n.R_A),p=n.datum||u(n.datumCode,n.datum_params,c.a,c.b,_.es,_.ep2);o(this,n),o(this,s),this.a=c.a,this.b=c.b,this.rf=c.rf,this.sphere=c.sphere,this.es=_.es,this.e=_.e,this.ep2=_.ep2,this.datum=p,this.init(),e(null,this)}var r=t(353),o=t(351),s=t(355),a=t(350),l=t(341),u=t(346);i.projections=s,i.projections.start(),e.exports=i},function(t,e,n){e.exports=function(t,e,n){var i,r,o,s=n.x,a=n.y,l=n.z||0,u={};for(o=0;o<3;o++)if(!e||2!==o||void 0!==n.z)switch(0===o?(i=s,r="x"):1===o?(i=a,r="y"):(i=l,r="z"),t.axis[o]){case"e":u[r]=i;break;case"w":u[r]=-i;break;case"n":u[r]=i;break;case"s":u[r]=-i;break;case"u":void 0!==n[r]&&(u.z=i);break;case"d":void 0!==n[r]&&(u.z=-i);break;default:return null}return u}},function(t,e,n){var i=2*Math.PI,r=3.14159265359,o=t(338);e.exports=function(t){return Math.abs(t)<=r?t:t-o(t)*i}},function(t,e,n){e.exports=function(t,e,n){var i=t*e;return n/Math.sqrt(1-i*i)}},function(t,e,n){var i=Math.PI/2;e.exports=function(t,e){for(var n,r,o=.5*t,s=i-2*Math.atan(e),a=0;a<=15;a++)if(n=t*Math.sin(s),r=i-2*Math.atan(e*Math.pow((1-n)/(1+n),o))-s,s+=r,Math.abs(r)<=1e-10)return s;return-9999}},function(t,e,n){e.exports=function(t){return t<0?-1:1}},function(t,e,n){e.exports=function(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}},function(t,e,n){var i=Math.PI/2;e.exports=function(t,e,n){var r=t*n,o=.5*t;return r=Math.pow((1-r)/(1+r),o),Math.tan(.5*(i-e))/r}},function(t,e,n){n.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},n.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},n.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},n.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},n.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},n.potsdam={towgs84:"606.0,23.0,413.0",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},n.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},n.hermannskogel={towgs84:"653.0,-212.0,449.0",ellipse:"bessel",datumName:"Hermannskogel"},n.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},n.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},n.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},n.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},n.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},n.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},n.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},n.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}},function(t,e,n){n.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},n.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},n.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},n.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},n.airy={a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},n.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},n.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},n.mod_airy={a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},n.andrae={a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},n.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},n.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},n.bessel={a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},n.bess_nam={a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},n.clrk66={a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},n.clrk80={a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},n.clrk58={a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},n.CPM={a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},n.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},n.engelis={a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},n.evrst30={a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},n.evrst48={a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},n.evrst56={a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},n.evrst69={a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},n.evrstSS={a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},n.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},n.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},n.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},n.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},n.hough={a:6378270,rf:297,ellipseName:"Hough"},n.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},n.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},n.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},n.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},n.new_intl={a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},n.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},n.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},n.SEasia={a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},n.walbeck={a:6376896,b:6355834.8467,ellipseName:"Walbeck"},n.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},n.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},n.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"},n.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"},n.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}},function(t,e,n){n.greenwich=0,n.lisbon=-9.131906111111,n.paris=2.337229166667,n.bogota=-74.080916666667,n.madrid=-3.687938888889,n.rome=12.452333333333,n.bern=7.439583333333,n.jakarta=106.807719444444,n.ferro=-17.666666666667,n.brussels=4.367975,n.stockholm=18.058277777778,n.athens=23.7163375,n.oslo=10.722916666667},function(t,e,n){n.ft={to_meter:.3048},n["us-ft"]={to_meter:1200/3937}},function(t,e,n){function i(t,e,n){var i;return Array.isArray(n)?(i=a(t,e,n),3===n.length?[i.x,i.y,i.z]:[i.x,i.y]):a(t,e,n)}function r(t){return t instanceof s?t:t.oProj?t.oProj:s(t)}function o(t,e,n){t=r(t);var o,s=!1;return"undefined"==typeof e?(e=t,t=l,s=!0):("undefined"!=typeof e.x||Array.isArray(e))&&(n=e,e=t,t=l,s=!0),e=r(e),n?i(t,e,n):(o={forward:function(n){return i(t,e,n)},inverse:function(n){return i(e,t,n)}},s&&(o.oProj=e),o)}var s=t(333),a=t(358),l=s("WGS84");e.exports=o},function(t,e,n){function i(t,e,n,i,u,h){var c={};return c.datum_type=s,t&&"none"===t&&(c.datum_type=a),e&&(c.datum_params=e.map(parseFloat),0===c.datum_params[0]&&0===c.datum_params[1]&&0===c.datum_params[2]||(c.datum_type=r),c.datum_params.length>3&&(0===c.datum_params[3]&&0===c.datum_params[4]&&0===c.datum_params[5]&&0===c.datum_params[6]||(c.datum_type=o,c.datum_params[3]*=l,c.datum_params[4]*=l,c.datum_params[5]*=l,c.datum_params[6]=c.datum_params[6]/1e6+1))),c.a=n,c.b=i,c.es=u,c.ep2=h,c}var r=1,o=2,s=4,a=5,l=484813681109536e-20;e.exports=i},function(t,e,n){"use strict";var i=1,r=2,o=Math.PI/2;n.compareDatums=function(t,e){return t.datum_type===e.datum_type&&(!(t.a!==e.a||Math.abs(this.es-e.es)>5e-11)&&(t.datum_type===i?this.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:t.datum_type!==r||t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6]))},n.geodeticToGeocentric=function(t,e,n){var i,r,s,a,l=t.x,u=t.y,h=t.z?t.z:0;if(u<-o&&u>-1.001*o)u=-o;else if(u>o&&u<1.001*o)u=o;else if(u<-o||u>o)return null;return l>Math.PI&&(l-=2*Math.PI),r=Math.sin(u),a=Math.cos(u),s=r*r,i=n/Math.sqrt(1-e*s),{x:(i+h)*a*Math.cos(l),y:(i+h)*a*Math.sin(l),z:(i*(1-e)+h)*r}},n.geocentricToGeodetic=function(t,e,n,i){var r,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b,x=1e-12,w=x*x,k=30,M=t.x,S=t.y,T=t.z?t.z:0;if(r=Math.sqrt(M*M+S*S),s=Math.sqrt(M*M+S*S+T*T),r/nw&&v-1})}function s(t){return"+"===t[0]}function a(t){return i(t)?r(t)?l[t]:o(t)?u(t):s(t)?h(t):void 0:t}var l=t(349),u=t(359),h=t(354),c=["GEOGCS","GEOCCS","PROJCS","LOCAL_CS"];e.exports=a},function(t,e,n){var i=.017453292519943295,r=t(343),o=t(344);e.exports=function(t){var e,n,s,a={},l=t.split("+").map(function(t){return t.trim()}).filter(function(t){return t}).reduce(function(t,e){var n=e.split("=");return n.push(!0),t[n[0].toLowerCase()]=n[1],t},{}),u={proj:"projName",datum:"datumCode",rf:function(t){a.rf=parseFloat(t)},lat_0:function(t){a.lat0=t*i},lat_1:function(t){a.lat1=t*i},lat_2:function(t){a.lat2=t*i},lat_ts:function(t){a.lat_ts=t*i},lon_0:function(t){a.long0=t*i},lon_1:function(t){a.long1=t*i},lon_2:function(t){a.long2=t*i},alpha:function(t){a.alpha=parseFloat(t)*i},lonc:function(t){a.longc=t*i},x_0:function(t){a.x0=parseFloat(t)},y_0:function(t){a.y0=parseFloat(t)},k_0:function(t){a.k0=parseFloat(t)},k:function(t){a.k0=parseFloat(t)},a:function(t){a.a=parseFloat(t)},b:function(t){a.b=parseFloat(t)},r_a:function(){a.R_A=!0},zone:function(t){a.zone=parseInt(t,10)},south:function(){a.utmSouth=!0},towgs84:function(t){a.datum_params=t.split(",").map(function(t){return parseFloat(t)})},to_meter:function(t){a.to_meter=parseFloat(t)},units:function(t){a.units=t,o[t]&&(a.to_meter=o[t].to_meter)},from_greenwich:function(t){a.from_greenwich=t*i},pm:function(t){a.from_greenwich=(r[t]?r[t]:parseFloat(t))*i},nadgrids:function(t){"@null"===t?a.datumCode="none":a.nadgrids=t},axis:function(t){var e="ewnsud";3===t.length&&e.indexOf(t.substr(0,1))!==-1&&e.indexOf(t.substr(1,1))!==-1&&e.indexOf(t.substr(2,1))!==-1&&(a.axis=t)}};for(e in l)n=l[e],e in u?(s=u[e],"function"==typeof s?s(n):a[s]=n):a[e]=n;return"string"==typeof a.datumCode&&"WGS84"!==a.datumCode&&(a.datumCode=a.datumCode.toLowerCase()),a}},function(t,e,n){function i(t,e){var n=s.length;return t.names?(s[n]=t,t.names.forEach(function(t){o[t.toLowerCase()]=n}),this):(console.log(e),!0)}var r=[t(357),t(356)],o={},s=[];n.add=i,n.get=function(t){if(!t)return!1;var e=t.toLowerCase();return"undefined"!=typeof o[e]&&s[o[e]]?s[o[e]]:void 0},n.start=function(){r.forEach(i)}},function(t,e,n){function i(t){return t}n.init=function(){},n.forward=i,n.inverse=i,n.names=["longlat","identity"]},function(t,e,n){var i=t(336),r=Math.PI/2,o=1e-10,s=57.29577951308232,a=t(335),l=Math.PI/4,u=t(340),h=t(337);n.init=function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=i(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},n.forward=function(t){var e=t.x,n=t.y;if(n*s>90&&n*s<-90&&e*s>180&&e*s<-180)return null;var i,h;if(Math.abs(Math.abs(n)-r)<=o)return null;if(this.sphere)i=this.x0+this.a*this.k0*a(e-this.long0),h=this.y0+this.a*this.k0*Math.log(Math.tan(l+.5*n));else{var c=Math.sin(n),_=u(this.e,n,c);i=this.x0+this.a*this.k0*a(e-this.long0),h=this.y0-this.a*this.k0*Math.log(_)}return t.x=i,t.y=h,t},n.inverse=function(t){var e,n,i=t.x-this.x0,o=t.y-this.y0;if(this.sphere)n=r-2*Math.atan(Math.exp(-o/(this.a*this.k0)));else{var s=Math.exp(-o/(this.a*this.k0));if(n=h(this.e,s),n===-9999)return null}return e=a(this.long0+i/(this.a*this.k0)),t.x=e,t.y=n,t},n.names=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},function(t,e,n){function i(t,e){return(t.datum.datum_type===s||t.datum.datum_type===a)&&"WGS84"!==e.datumCode||(e.datum.datum_type===s||e.datum.datum_type===a)&&"WGS84"!==t.datumCode}var r=.017453292519943295,o=57.29577951308232,s=1,a=2,l=t(348),u=t(334),h=t(333),c=t(339);e.exports=function _(t,e,n){var s;return Array.isArray(n)&&(n=c(n)),t.datum&&e.datum&&i(t,e)&&(s=new h("WGS84"),n=_(t,s,n),t=s),"enu"!==t.axis&&(n=u(t,!1,n)),"longlat"===t.projName?n={x:n.x*r,y:n.y*r}:(t.to_meter&&(n={x:n.x*t.to_meter,y:n.y*t.to_meter}),n=t.inverse(n)),t.from_greenwich&&(n.x+=t.from_greenwich),n=l(t.datum,e.datum,n),e.from_greenwich&&(n={x:n.x-e.grom_greenwich,y:n.y}),"longlat"===e.projName?n={x:n.x*o,y:n.y*o}:(n=e.forward(n),e.to_meter&&(n={x:n.x/e.to_meter,y:n.y/e.to_meter})),"enu"!==e.axis?u(e,!0,n):n}},function(t,e,n){function i(t,e,n){t[e]=n.map(function(t){var e={};return r(t,e),e}).reduce(function(t,e){return u(t,e)},{})}function r(t,e){var n;return Array.isArray(t)?(n=t.shift(),"PARAMETER"===n&&(n=t.shift()),1===t.length?Array.isArray(t[0])?(e[n]={},r(t[0],e[n])):e[n]=t[0]:t.length?"TOWGS84"===n?e[n]=t:(e[n]={},["UNIT","PRIMEM","VERT_DATUM"].indexOf(n)>-1?(e[n]={name:t[0].toLowerCase(),convert:t[1]},3===t.length&&(e[n].auth=t[2])):"SPHEROID"===n?(e[n]={name:t[0],a:t[1],rf:t[2]},4===t.length&&(e[n].auth=t[3])):["GEOGCS","GEOCCS","DATUM","VERT_CS","COMPD_CS","LOCAL_CS","FITTED_CS","LOCAL_DATUM"].indexOf(n)>-1?(t[0]=["name",t[0]],i(e,n,t)):t.every(function(t){return Array.isArray(t)})?i(e,n,t):r(t,e[n])):e[n]=!0,void 0):void(e[t]=!0)}function o(t,e){var n=e[0],i=e[1];!(n in t)&&i in t&&(t[n]=t[i],3===e.length&&(t[n]=e[2](t[n])))}function s(t){return t*l}function a(t){function e(e){var n=t.to_meter||1;return parseFloat(e,10)*n}"GEOGCS"===t.type?t.projName="longlat":"LOCAL_CS"===t.type?(t.projName="identity",t.local=!0):"object"==typeof t.PROJECTION?t.projName=Object.keys(t.PROJECTION)[0]:t.projName=t.PROJECTION,t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),"metre"===t.units&&(t.units="meter"),t.UNIT.convert&&("GEOGCS"===t.type?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=parseFloat(t.UNIT.convert,10)*t.DATUM.SPHEROID.a):t.to_meter=parseFloat(t.UNIT.convert,10))),t.GEOGCS&&(t.GEOGCS.DATUM?t.datumCode=t.GEOGCS.DATUM.name.toLowerCase():t.datumCode=t.GEOGCS.name.toLowerCase(),"d_"===t.datumCode.slice(0,2)&&(t.datumCode=t.datumCode.slice(2)),"new_zealand_geodetic_datum_1949"!==t.datumCode&&"new_zealand_1949"!==t.datumCode||(t.datumCode="nzgd49"),"wgs_1984"===t.datumCode&&("Mercator_Auxiliary_Sphere"===t.PROJECTION&&(t.sphere=!0),t.datumCode="wgs84"),"_ferro"===t.datumCode.slice(-6)&&(t.datumCode=t.datumCode.slice(0,-6)),"_jakarta"===t.datumCode.slice(-8)&&(t.datumCode=t.datumCode.slice(0,-8)),~t.datumCode.indexOf("belge")&&(t.datumCode="rnb72"),t.GEOGCS.DATUM&&t.GEOGCS.DATUM.SPHEROID&&(t.ellps=t.GEOGCS.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===t.ellps.toLowerCase().slice(0,13)&&(t.ellps="intl"),t.a=t.GEOGCS.DATUM.SPHEROID.a,t.rf=parseFloat(t.GEOGCS.DATUM.SPHEROID.rf,10)),~t.datumCode.indexOf("osgb_1936")&&(t.datumCode="osgb36")),t.b&&!isFinite(t.b)&&(t.b=t.a);var n=function(e){return o(t,e)},i=[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_2","Standard_Parallel_2"],["false_easting","False_Easting"],["false_northing","False_Northing"],["central_meridian","Central_Meridian"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",s],["longitude_of_center","Longitude_Of_Center"],["longc","longitude_of_center",s],["x0","false_easting",e],["y0","false_northing",e],["long0","central_meridian",s],["lat0","latitude_of_origin",s],["lat0","standard_parallel_1",s],["lat1","standard_parallel_1",s],["lat2","standard_parallel_2",s],["alpha","azimuth",s],["srsCode","name"]];i.forEach(n),t.long0||!t.longc||"Albers_Conic_Equal_Area"!==t.projName&&"Lambert_Azimuthal_Equal_Area"!==t.projName||(t.long0=t.longc),t.lat_ts||!t.lat1||"Stereographic_South_Pole"!==t.projName&&"Polar Stereographic (variant B)"!==t.projName||(t.lat0=s(t.lat1>0?90:-90),t.lat_ts=t.lat1)}var l=.017453292519943295,u=t(351);e.exports=function(t,e){var n=JSON.parse((","+t).replace(/\s*\,\s*([A-Z_0-9]+?)(\[)/g,',["$1",').slice(1).replace(/\s*\,\s*([A-Z_0-9]+?)\]/g,',"$1"]').replace(/,\["VERTCS".+/,"")),i=n.shift(),o=n.shift();n.unshift(["name",o]),n.unshift(["type",i]),n.unshift("output");var s={};return r(n,s),a(s.output),u(e,s.output)}},function(t,e,n){"use strict";function i(t,e,n,s,a){for(n=n||0,s=s||t.length-1,a=a||o;s>n;){if(s-n>600){var l=s-n+1,u=e-n+1,h=Math.log(l),c=.5*Math.exp(2*h/3),_=.5*Math.sqrt(h*c*(l-c)/l)*(u-l/2<0?-1:1),p=Math.max(n,Math.floor(e-u*c/l+_)),d=Math.min(s,Math.floor(e+(l-u)*c/l+_));i(t,e,p,d,a)}var f=t[e],m=n,v=s;for(r(t,n,e),a(t[s],f)>0&&r(t,n,s);m0;)v--}0===a(t[n],f)?r(t,n,v):(v++,r(t,v,s)),v<=e&&(n=v+1),e<=v&&(s=v-1)}}function r(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function o(t,e){return te?1:0}e.exports=i},function(t,e,n){"use strict";function i(t,e){return this instanceof i?(this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),void this.clear()):new i(t,e)}function r(t,e,n){if(!n)return e.indexOf(t);for(var i=0;i=t.minX&&e.maxY>=t.minY}function m(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-(1/0),maxY:-(1/0)}}function v(t,e,n,i,r){for(var o,s=[e,n];s.length;)n=s.pop(),e=s.pop(),n-e<=i||(o=e+Math.ceil((n-e)/i/2)*i,g(t,o,e,n,r),s.push(e,o,o,n))}e.exports=i;var g=t(360);i.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,n=[],i=this.toBBox;if(!f(t,e))return n;for(var r,o,s,a,l=[];e;){for(r=0,o=e.children.length;r=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(r,o,e)},_split:function(t,e){var n=t[e],i=n.children.length,r=this._minEntries;this._chooseSplitAxis(n,r,i);var s=this._chooseSplitIndex(n,r,i),a=m(n.children.splice(s,n.children.length-s));a.height=n.height,a.leaf=n.leaf,o(n,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)},_splitRoot:function(t,e){this.data=m([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var i,r,o,a,l,u,c,_;for(u=c=1/0,i=e;i<=n-e;i++)r=s(t,0,i,this.toBBox),o=s(t,i,n,this.toBBox),a=p(r,o),l=h(r)+h(o),a=e;r--)o=t.children[r],a(h,t.leaf?l(o):o),_+=c(h);return _},_adjustParentBBoxes:function(t,e,n){for(var i=n;i>=0;i--)a(e[i],t)},_condense:function(t){for(var e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children,e.splice(e.indexOf(t[n]),1)):this.clear():o(t[n],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}},function(e,n,i){!function(){"use strict";function e(t){return r(o(t),arguments)}function n(t,n){return e.apply(null,[t].concat(n||[]))}function r(t,n){var i,r,o,a,l,u,h,c,_,p=1,d=t.length,f="";for(r=0;r=0),a[8]){case"b":i=parseInt(i,10).toString(2);break;case"c":i=String.fromCharCode(parseInt(i,10));break;case"d":case"i":i=parseInt(i,10);break;case"j":i=JSON.stringify(i,null,a[6]?parseInt(a[6]):0);break;case"e":i=a[7]?parseFloat(i).toExponential(a[7]):parseFloat(i).toExponential();break;case"f":i=a[7]?parseFloat(i).toFixed(a[7]):parseFloat(i);break;case"g":i=a[7]?String(Number(i.toPrecision(a[7]))):parseFloat(i);break;case"o":i=(parseInt(i,10)>>>0).toString(8);break;case"s":i=String(i),i=a[7]?i.substring(0,a[7]):i;break;case"t":i=String(!!i),i=a[7]?i.substring(0,a[7]):i;break;case"T":i=Object.prototype.toString.call(i).slice(8,-1).toLowerCase(),i=a[7]?i.substring(0,a[7]):i;break;case"u":i=parseInt(i,10)>>>0;break;case"v":i=i.valueOf(),i=a[7]?i.substring(0,a[7]):i;break;case"x":i=(parseInt(i,10)>>>0).toString(16);break;case"X":i=(parseInt(i,10)>>>0).toString(16).toUpperCase()}s.json.test(a[8])?f+=i:(!s.number.test(a[8])||c&&!a[3]?_="":(_=c?"+":"-",i=i.toString().replace(s.sign,"")),u=a[4]?"0"===a[4]?"0":a[4].charAt(1):" ",h=a[6]-(_+i).length,l=a[6]&&h>0?u.repeat(h):"",f+=a[5]?_+i+l:"0"===u?_+l+i:l+_+i)}return f}function o(t){if(a[t])return a[t];for(var e,n=t,i=[],r=0;n;){if(null!==(e=s.text.exec(n)))i.push(e[0]);else if(null!==(e=s.modulo.exec(n)))i.push("%");else{if(null===(e=s.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){r|=1;var o=[],l=e[2],u=[];if(null===(u=s.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(o.push(u[1]);""!==(l=l.substring(u[0].length));)if(null!==(u=s.key_access.exec(l)))o.push(u[1]);else{if(null===(u=s.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");o.push(u[1])}e[2]=o}else r|=2;if(3===r)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");i.push(e)}n=n.substring(e[0].length)}return a[t]=i}var s={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i, -index_access:/^\[(\d+)\]/,sign:/^[\+\-]/},a=Object.create(null);"undefined"!=typeof i&&(i.sprintf=e,i.vsprintf=n),"undefined"!=typeof window&&(window.sprintf=e,window.vsprintf=n,"function"==typeof t&&t.amd&&t(function(){return{sprintf:e,vsprintf:n}}))}()},function(e,n,i){!function(e){"object"==typeof n&&n.exports?n.exports=e():"function"==typeof t?t(e):this.tz=e()}(function(){function t(t,e,n){var i,r=e.day[1];do i=new Date(Date.UTC(n,e.month,Math.abs(r++)));while(e.day[0]<7&&i.getUTCDay()!=e.day[0]);return i={clock:e.clock,sort:i.getTime(),rule:e,save:6e4*e.save,offset:t.offset},i[i.clock]=i.sort+6e4*e.time,i.posix?i.wallclock=i[i.clock]+(t.offset+e.saved):i.posix=i[i.clock]-(t.offset+e.saved),i}function e(e,n,i){var r,o,s,a,l,u,h,c=e[e.zone],_=[],p=new Date(i).getUTCFullYear(),d=1;for(r=1,o=c.length;r=p-d;--h)for(r=0,o=u.length;r=_[r][n]&&_[r][_[r].clock]>s[_[r].clock]&&(a=_[r])}return a&&((l=/^(.*)\/(.*)$/.exec(s.format))?a.abbrev=l[a.save?2:1]:a.abbrev=s.format.replace(/%s/,a.rule.letter)),a||s}function n(t,n){return"UTC"==t.zone?n:(t.entry=e(t,"posix",n),n+t.entry.offset+t.entry.save)}function i(t,n){if("UTC"==t.zone)return n;var i,r;return t.entry=i=e(t,"wallclock",n),r=n-i.wallclock,09)e+=a*c[l-10];else{if(o=new Date(n(t,e)),l<7)for(;a;)o.setUTCDate(o.getUTCDate()+s),o.getUTCDay()==l&&(a-=s);else 7==l?o.setUTCFullYear(o.getUTCFullYear()+a):8==l?o.setUTCMonth(o.getUTCMonth()+a):o.setUTCDate(o.getUTCDate()+a);null==(e=i(t,o.getTime()))&&(e=i(t,o.getTime()+864e5*s)-864e5*s)}return e}function o(t){if(!t.length)return"1.0.13";var e,o,s,a,l,u=Object.create(this),c=[];for(e=0;e=r?Math.floor((n-r)/7)+1:0}function a(t){var e,n,i;return n=t.getUTCFullYear(),e=new Date(Date.UTC(n,0)).getUTCDay(),i=s(t,1)+(e>1&&e<=4?1:0),i?53!=i||4==e||3==e&&29==new Date(n,1,29).getDate()?[i,t.getUTCFullYear()]:[1,t.getUTCFullYear()+1]:(n=t.getUTCFullYear()-1,e=new Date(Date.UTC(n,0)).getUTCDay(),i=4==e||3==e&&29==new Date(n,1,29).getDate()?53:52,[i,t.getUTCFullYear()-1])}var l={clock:function(){return+new Date},zone:"UTC",entry:{abbrev:"UTC",offset:0,save:0},UTC:1,z:function(t,e,n,i){var r,o,s=this.entry.offset+this.entry.save,a=Math.abs(s/1e3),l=[],u=3600;for(r=0;r<3;r++)l.push(("0"+Math.floor(a/u)).slice(-2)),a%=u,u/=60;return"^"!=n||s?("^"==n&&(i=3),3==i?(o=l.join(":"),o=o.replace(/:00$/,""),"^"!=n&&(o=o.replace(/:00$/,""))):i?(o=l.slice(0,i+1).join(":"),"^"==n&&(o=o.replace(/:00$/,""))):o=l.slice(0,2).join(""),o=(s<0?"-":"+")+o,o=o.replace(/([-+])(0)/,{_:" $1","-":"$1"}[n]||"$1$2")):"Z"},"%":function(t){return"%"},n:function(t){return"\n"},t:function(t){return"\t"},U:function(t){return s(t,0)},W:function(t){return s(t,1)},V:function(t){return a(t)[0]},G:function(t){return a(t)[1]},g:function(t){return a(t)[1]%100},j:function(t){return Math.floor((t.getTime()-Date.UTC(t.getUTCFullYear(),0))/864e5)+1},s:function(t){return Math.floor(t.getTime()/1e3)},C:function(t){return Math.floor(t.getUTCFullYear()/100)},N:function(t){return t.getTime()%1e3*1e6},m:function(t){return t.getUTCMonth()+1},Y:function(t){return t.getUTCFullYear()},y:function(t){return t.getUTCFullYear()%100},H:function(t){return t.getUTCHours()},M:function(t){return t.getUTCMinutes()},S:function(t){return t.getUTCSeconds()},e:function(t){return t.getUTCDate()},d:function(t){return t.getUTCDate()},u:function(t){return t.getUTCDay()||7},w:function(t){return t.getUTCDay()},l:function(t){return t.getUTCHours()%12||12},I:function(t){return t.getUTCHours()%12||12},k:function(t){return t.getUTCHours()},Z:function(t){return this.entry.abbrev},a:function(t){return this[this.locale].day.abbrev[t.getUTCDay()]},A:function(t){return this[this.locale].day.full[t.getUTCDay()]},h:function(t){return this[this.locale].month.abbrev[t.getUTCMonth()]},b:function(t){return this[this.locale].month.abbrev[t.getUTCMonth()]},B:function(t){return this[this.locale].month.full[t.getUTCMonth()]},P:function(t){return this[this.locale].meridiem[Math.floor(t.getUTCHours()/12)].toLowerCase()},p:function(t){return this[this.locale].meridiem[Math.floor(t.getUTCHours()/12)]},R:function(t,e){return this.convert([e,"%H:%M"])},T:function(t,e){return this.convert([e,"%H:%M:%S"])},D:function(t,e){return this.convert([e,"%m/%d/%y"])},F:function(t,e){return this.convert([e,"%Y-%m-%d"])},x:function(t,e){return this.convert([e,this[this.locale].date])},r:function(t,e){return this.convert([e,this[this.locale].time12||"%I:%M:%S"])},X:function(t,e){return this.convert([e,this[this.locale].time24])},c:function(t,e){return this.convert([e,this[this.locale].dateTime])},convert:o,locale:"en_US",en_US:{date:"%m/%d/%Y",time24:"%I:%M:%S %p",time12:"%I:%M:%S %p",dateTime:"%a %d %b %Y %I:%M:%S %p %Z",meridiem:["AM","PM"],month:{abbrev:"Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec".split("|"),full:"January|February|March|April|May|June|July|August|September|October|November|December".split("|")},day:{abbrev:"Sun|Mon|Tue|Wed|Thu|Fri|Sat".split("|"),full:"Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday".split("|")}}},u="Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|year|month|day|hour|minute|second|millisecond",h=new RegExp("^\\s*([+-])(\\d+)\\s+("+u+")s?\\s*$","i"),c=[36e5,6e4,1e3,1];return u=u.toLowerCase().split("|"),"delmHMSUWVgCIky".replace(/./g,function(t){l[t].pad=2}),l.N.pad=9,l.j.pad=3,l.k.style="_",l.l.style="_",l.e.style="_",function(){return l.convert(arguments)}})},function(e,n,i){/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ -var r,o,s,a,l,u,h,c,_,p,d,f,m,v,g,y,b;!function(e){function i(t,e){return"function"==typeof Object.create?Object.defineProperty(t,"__esModule",{value:!0}):t.__esModule=!0,function(n,i){return t[n]=e?e(n,i):i}}var r="object"==typeof global?global:"object"==typeof self?self:"object"==typeof this?this:{};"function"==typeof t&&t.amd?t("tslib",["exports"],function(t){e(i(r,i(t)))}):e("object"==typeof n&&"object"==typeof n.exports?i(r,i(n.exports)):i(r))}(function(t){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};r=function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)},o=Object.assign||function(t){for(var e,n=1,i=arguments.length;n=0;a--)(r=t[a])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s},l=function(t,e){return function(n,i){e(n,i,t)}},u=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},h=function(t,e,n,i){return new(n||(n=Promise))(function(r,o){function s(t){try{l(i.next(t))}catch(e){o(e)}}function a(t){try{l(i["throw"](t))}catch(e){o(e)}}function l(t){t.done?r(t.value):new n(function(e){e(t.value)}).then(s,a)}l((i=i.apply(t,e||[])).next())})},c=function(t,e){function n(t){return function(e){return i([t,e])}}function i(n){if(r)throw new TypeError("Generator is already executing.");for(;l;)try{if(r=1,o&&(s=o[2&n[0]?"return":n[0]?"throw":"next"])&&!(s=s.call(o,n[1])).done)return s;switch(o=0,s&&(n=[0,s.value]),n[0]){case 0:case 1:s=n;break;case 4:return l.label++,{value:n[1],done:!1};case 5:l.label++,o=n[1],n=[0];continue;case 7:n=l.ops.pop(),l.trys.pop();continue;default:if(s=l.trys,!(s=s.length>0&&s[s.length-1])&&(6===n[0]||2===n[0])){l=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}},d=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(a){r={error:a}}finally{try{i&&!i.done&&(n=o["return"])&&n.call(o)}finally{if(r)throw r.error}}return s},f=function(){for(var t=[],e=0;e1||r(t,e)})})}function r(t,e){try{o(h[t](e))}catch(n){l(c[0][3],n)}}function o(t){t.value instanceof m?Promise.resolve(t.value.v).then(s,a):l(c[0][2],t)}function s(t){r("next",t)}function a(t){r("throw",t)}function l(t,e){t(e),c.shift(),c.length&&r(c[0][0],c[0][1])}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var u,h=n.apply(t,e||[]),c=[];return u={},i("next"),i("throw"),i("return"),u[Symbol.asyncIterator]=function(){return this},u},g=function(t){function e(e,r){t[e]&&(n[e]=function(n){return(i=!i)?{value:m(t[e](n)),done:"return"===e}:r?r(n):n})}var n,i;return n={},e("next"),e("throw",function(t){throw t}),e("return"),n[Symbol.iterator]=function(){return this},n},y=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator];return e?e.call(t):"function"==typeof p?p(t):t[Symbol.iterator]()},b=function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},t("__extends",r),t("__assign",o),t("__rest",s),t("__decorate",a),t("__param",l),t("__metadata",u),t("__awaiter",h),t("__generator",c),t("__exportStar",_),t("__values",p),t("__read",d),t("__spread",f),t("__await",m),t("__asyncGenerator",v),t("__asyncDelegator",g),t("__asyncValues",y),t("__makeTemplateObject",b)})}],{base:0,"client/connection":1,"client/session":2,"core/bokeh_events":3,"core/build_views":4,"core/dom":5,"core/dom_view":6,"core/enums":7,"core/has_props":8,"core/hittest":9,"core/layout/alignments":10,"core/layout/layout_canvas":11,"core/layout/side_panel":12,"core/layout/solver":13,"core/logging":14,"core/properties":15,"core/property_mixins":16,"core/selection_manager":17,"core/selector":18,"core/settings":19,"core/signaling":20,"core/ui_events":21,"core/util/array":22,"core/util/bbox":23,"core/util/callback":24,"core/util/canvas":25,"core/util/color":26,"core/util/data_structures":27,"core/util/eq":28,"core/util/math":29,"core/util/object":30,"core/util/proj4":31,"core/util/projections":32,"core/util/refs":33,"core/util/selection":34,"core/util/serialization":35,"core/util/spatial":36,"core/util/string":37,"core/util/svg_colors":38,"core/util/templating":39,"core/util/text":40,"core/util/throttle":41,"core/util/types":42,"core/util/wheel":43,"core/util/zoom":44,"core/view":45,"core/visuals":46,document:47,embed:48,main:49,model:50,"models/annotations/annotation":51,"models/annotations/arrow":52,"models/annotations/arrow_head":53,"models/annotations/band":54,"models/annotations/box_annotation":55,"models/annotations/color_bar":56,"models/annotations/index":57,"models/annotations/label":58,"models/annotations/label_set":59,"models/annotations/legend":60,"models/annotations/legend_item":61,"models/annotations/poly_annotation":62,"models/annotations/span":63,"models/annotations/text_annotation":64,"models/annotations/title":65,"models/annotations/toolbar_panel":66,"models/annotations/tooltip":67,"models/annotations/whisker":68,"models/axes/axis":69,"models/axes/categorical_axis":70,"models/axes/continuous_axis":71,"models/axes/datetime_axis":72,"models/axes/index":73,"models/axes/linear_axis":74,"models/axes/log_axis":75,"models/callbacks/customjs":76,"models/callbacks/index":77,"models/callbacks/open_url":78,"models/canvas/canvas":79,"models/canvas/cartesian_frame":80,"models/canvas/index":81,"models/expressions/expression":82,"models/expressions/index":83,"models/expressions/stack":84,"models/filters/boolean_filter":85,"models/filters/customjs_filter":86,"models/filters/filter":87,"models/filters/group_filter":88,"models/filters/index":89,"models/filters/index_filter":90,"models/formatters/basic_tick_formatter":91,"models/formatters/categorical_tick_formatter":92,"models/formatters/datetime_tick_formatter":93,"models/formatters/func_tick_formatter":94,"models/formatters/index":95,"models/formatters/log_tick_formatter":96,"models/formatters/mercator_tick_formatter":97,"models/formatters/numeral_tick_formatter":98,"models/formatters/printf_tick_formatter":99,"models/formatters/tick_formatter":100,"models/glyphs/annular_wedge":101,"models/glyphs/annulus":102,"models/glyphs/arc":103,"models/glyphs/bezier":104,"models/glyphs/box":105,"models/glyphs/circle":106,"models/glyphs/ellipse":107,"models/glyphs/glyph":108,"models/glyphs/hbar":109,"models/glyphs/image":110,"models/glyphs/image_rgba":111,"models/glyphs/image_url":112,"models/glyphs/index":113,"models/glyphs/line":114,"models/glyphs/multi_line":115,"models/glyphs/oval":116,"models/glyphs/patch":117,"models/glyphs/patches":118,"models/glyphs/quad":119,"models/glyphs/quadratic":120,"models/glyphs/ray":121,"models/glyphs/rect":122,"models/glyphs/segment":123,"models/glyphs/step":124,"models/glyphs/text":125,"models/glyphs/vbar":126,"models/glyphs/wedge":127,"models/glyphs/xy_glyph":128,"models/graphs/graph_hit_test_policy":129,"models/graphs/index":130,"models/graphs/layout_provider":131,"models/graphs/static_layout_provider":132,"models/grids/grid":133,"models/grids/index":134,"models/index":135,"models/layouts/box":136,"models/layouts/column":137,"models/layouts/index":138,"models/layouts/layout_dom":139,"models/layouts/row":140,"models/layouts/spacer":141,"models/layouts/widget_box":142,"models/mappers/categorical_color_mapper":143,"models/mappers/color_mapper":144,"models/mappers/index":145,"models/mappers/linear_color_mapper":146,"models/mappers/log_color_mapper":147,"models/markers/index":148,"models/markers/marker":149,"models/plots/gmap_plot":150,"models/plots/gmap_plot_canvas":151,"models/plots/index":152,"models/plots/plot":153,"models/plots/plot_canvas":154,"models/ranges/data_range":155,"models/ranges/data_range1d":156,"models/ranges/factor_range":157,"models/ranges/index":158,"models/ranges/range":159,"models/ranges/range1d":160,"models/renderers/glyph_renderer":161,"models/renderers/graph_renderer":162,"models/renderers/guide_renderer":163,"models/renderers/index":164,"models/renderers/renderer":165,"models/scales/categorical_scale":166,"models/scales/index":167,"models/scales/linear_scale":168,"models/scales/log_scale":169,"models/scales/scale":170,"models/sources/ajax_data_source":171,"models/sources/cds_view":172,"models/sources/column_data_source":173,"models/sources/columnar_data_source":174,"models/sources/data_source":175,"models/sources/geojson_data_source":176,"models/sources/index":177,"models/sources/remote_data_source":178,"models/tickers/adaptive_ticker":179,"models/tickers/basic_ticker":180,"models/tickers/categorical_ticker":181,"models/tickers/composite_ticker":182,"models/tickers/continuous_ticker":183,"models/tickers/datetime_ticker":184,"models/tickers/days_ticker":185,"models/tickers/fixed_ticker":186,"models/tickers/index":187,"models/tickers/log_ticker":188,"models/tickers/mercator_ticker":189,"models/tickers/months_ticker":190,"models/tickers/single_interval_ticker":191,"models/tickers/ticker":192,"models/tickers/util":193,"models/tickers/years_ticker":194,"models/tiles/bbox_tile_source":195,"models/tiles/dynamic_image_renderer":196,"models/tiles/image_pool":197,"models/tiles/image_source":198,"models/tiles/index":199,"models/tiles/mercator_tile_source":200,"models/tiles/quadkey_tile_source":201,"models/tiles/tile_renderer":202,"models/tiles/tile_source":203,"models/tiles/tile_utils":204,"models/tiles/tms_tile_source":205,"models/tiles/wmts_tile_source":206,"models/tools/actions/action_tool":207,"models/tools/actions/help_tool":208,"models/tools/actions/redo_tool":209,"models/tools/actions/reset_tool":210,"models/tools/actions/save_tool":211,"models/tools/actions/undo_tool":212,"models/tools/actions/zoom_in_tool":213,"models/tools/actions/zoom_out_tool":214,"models/tools/button_tool":215,"models/tools/gestures/box_select_tool":216,"models/tools/gestures/box_zoom_tool":217,"models/tools/gestures/gesture_tool":218,"models/tools/gestures/lasso_select_tool":219,"models/tools/gestures/pan_tool":220,"models/tools/gestures/poly_select_tool":221,"models/tools/gestures/select_tool":222,"models/tools/gestures/tap_tool":223,"models/tools/gestures/wheel_pan_tool":224,"models/tools/gestures/wheel_zoom_tool":225,"models/tools/index":226,"models/tools/inspectors/crosshair_tool":227,"models/tools/inspectors/hover_tool":228,"models/tools/inspectors/inspect_tool":229,"models/tools/on_off_button":230,"models/tools/tool":231,"models/tools/tool_proxy":232,"models/tools/toolbar":233,"models/tools/toolbar_base":234,"models/tools/toolbar_box":235,"models/transforms/customjs_transform":236,"models/transforms/dodge":237,"models/transforms/index":238,"models/transforms/interpolator":239,"models/transforms/jitter":240,"models/transforms/linear_interpolator":241,"models/transforms/step_interpolator":242,"models/transforms/transform":243,polyfill:244,"protocol/message":245,"protocol/receiver":246,safely:247,version:248},49)});/*! -Copyright (c) 2012, Anaconda, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - -Redistributions of source code must retain the above copyright notice, -this list of conditions and the following disclaimer. - -Redistributions in binary form must reproduce the above copyright notice, -this list of conditions and the following disclaimer in the documentation -and/or other materials provided with the distribution. - -Neither the name of Anaconda nor the names of any contributors -may be used to endorse or promote products derived from this software -without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -THE POSSIBILITY OF SUCH DAMAGE. -*/ - -//# sourceMappingURL=bokeh.min.js.map diff --git a/qmpy/web/static/js/jquery-ui.min.js b/qmpy/web/static/js/jquery-ui.min.js new file mode 100644 index 00000000..117cb35e --- /dev/null +++ b/qmpy/web/static/js/jquery-ui.min.js @@ -0,0 +1,13 @@ +/*! jQuery UI - v1.12.1 - 2016-09-14 +* http://jqueryui.com +* Includes: widget.js, position.js, data.js, disable-selection.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js, focusable.js, form-reset-mixin.js, jquery-1-7.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/draggable.js, widgets/droppable.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/resizable.js, widgets/selectable.js, widgets/selectmenu.js, widgets/slider.js, widgets/sortable.js, widgets/spinner.js, widgets/tabs.js, widgets/tooltip.js +* Copyright jQuery Foundation and other contributors; Licensed MIT */ + +(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)})(function(t){function e(t){for(var e=t.css("visibility");"inherit"===e;)t=t.parent(),e=t.css("visibility");return"hidden"!==e}function i(t){for(var e,i;t.length&&t[0]!==document;){if(e=t.css("position"),("absolute"===e||"relative"===e||"fixed"===e)&&(i=parseInt(t.css("zIndex"),10),!isNaN(i)&&0!==i))return i;t=t.parent()}return 0}function s(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[""]),this.regional.en=t.extend(!0,{},this.regional[""]),this.regional["en-US"]=t.extend(!0,{},this.regional.en),this.dpDiv=n(t("
"))}function n(e){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.on("mouseout",i,function(){t(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).removeClass("ui-datepicker-next-hover")}).on("mouseover",i,o)}function o(){t.datepicker._isDisabledDatepicker(m.inline?m.dpDiv.parent()[0]:m.input[0])||(t(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),t(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).addClass("ui-datepicker-next-hover"))}function a(e,i){t.extend(e,i);for(var s in i)null==i[s]&&(e[s]=i[s]);return e}function r(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger("change")}}t.ui=t.ui||{},t.ui.version="1.12.1";var h=0,l=Array.prototype.slice;t.cleanData=function(e){return function(i){var s,n,o;for(o=0;null!=(n=i[o]);o++)try{s=t._data(n,"events"),s&&s.remove&&t(n).triggerHandler("remove")}catch(a){}e(i)}}(t.cleanData),t.widget=function(e,i,s){var n,o,a,r={},h=e.split(".")[0];e=e.split(".")[1];var l=h+"-"+e;return s||(s=i,i=t.Widget),t.isArray(s)&&(s=t.extend.apply(null,[{}].concat(s))),t.expr[":"][l.toLowerCase()]=function(e){return!!t.data(e,l)},t[h]=t[h]||{},n=t[h][e],o=t[h][e]=function(t,e){return this._createWidget?(arguments.length&&this._createWidget(t,e),void 0):new o(t,e)},t.extend(o,n,{version:s.version,_proto:t.extend({},s),_childConstructors:[]}),a=new i,a.options=t.widget.extend({},a.options),t.each(s,function(e,s){return t.isFunction(s)?(r[e]=function(){function t(){return i.prototype[e].apply(this,arguments)}function n(t){return i.prototype[e].apply(this,t)}return function(){var e,i=this._super,o=this._superApply;return this._super=t,this._superApply=n,e=s.apply(this,arguments),this._super=i,this._superApply=o,e}}(),void 0):(r[e]=s,void 0)}),o.prototype=t.widget.extend(a,{widgetEventPrefix:n?a.widgetEventPrefix||e:e},r,{constructor:o,namespace:h,widgetName:e,widgetFullName:l}),n?(t.each(n._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete n._childConstructors):i._childConstructors.push(o),t.widget.bridge(e,o),o},t.widget.extend=function(e){for(var i,s,n=l.call(arguments,1),o=0,a=n.length;a>o;o++)for(i in n[o])s=n[o][i],n[o].hasOwnProperty(i)&&void 0!==s&&(e[i]=t.isPlainObject(s)?t.isPlainObject(e[i])?t.widget.extend({},e[i],s):t.widget.extend({},s):s);return e},t.widget.bridge=function(e,i){var s=i.prototype.widgetFullName||e;t.fn[e]=function(n){var o="string"==typeof n,a=l.call(arguments,1),r=this;return o?this.length||"instance"!==n?this.each(function(){var i,o=t.data(this,s);return"instance"===n?(r=o,!1):o?t.isFunction(o[n])&&"_"!==n.charAt(0)?(i=o[n].apply(o,a),i!==o&&void 0!==i?(r=i&&i.jquery?r.pushStack(i.get()):i,!1):void 0):t.error("no such method '"+n+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; "+"attempted to call method '"+n+"'")}):r=void 0:(a.length&&(n=t.widget.extend.apply(null,[n].concat(a))),this.each(function(){var e=t.data(this,s);e?(e.option(n||{}),e._init&&e._init()):t.data(this,s,new i(n,this))})),r}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,i){i=t(i||this.defaultElement||this)[0],this.element=t(i),this.uuid=h++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},i!==this&&(t.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===i&&this.destroy()}}),this.document=t(i.style?i.ownerDocument:i.document||i),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var s,n,o,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},s=e.split("."),e=s.shift(),s.length){for(n=a[e]=t.widget.extend({},this.options[e]),o=0;s.length-1>o;o++)n[s[o]]=n[s[o]]||{},n=n[s[o]];if(e=s.pop(),1===arguments.length)return void 0===n[e]?null:n[e];n[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];a[e]=i}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var i,s,n;for(i in e)n=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&n&&n.length&&(s=t(n.get()),this._removeClass(n,i),s.addClass(this._classes({element:s,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){function i(i,o){var a,r;for(r=0;i.length>r;r++)a=n.classesElementLookup[i[r]]||t(),a=e.add?t(t.unique(a.get().concat(e.element.get()))):t(a.not(e.element).get()),n.classesElementLookup[i[r]]=a,s.push(i[r]),o&&e.classes[i[r]]&&s.push(e.classes[i[r]])}var s=[],n=this;return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&i(e.keys.match(/\S+/g)||[],!0),e.extra&&i(e.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,function(s,n){-1!==t.inArray(e.target,n)&&(i.classesElementLookup[s]=t(n.not(e.target).get()))})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof s?s:i;var n="string"==typeof t||null===t,o={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s};return o.element.toggleClass(this._classes(o),s),this},_on:function(e,i,s){var n,o=this;"boolean"!=typeof e&&(s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),t.each(s,function(s,a){function r(){return e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||t.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+o.eventNamespace,c=h[2];c?n.on(l,c,r):i.on(l,r)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(i).off(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}}),t.widget,function(){function e(t,e,i){return[parseFloat(t[0])*(u.test(t[0])?e/100:1),parseFloat(t[1])*(u.test(t[1])?i/100:1)]}function i(e,i){return parseInt(t.css(e,i),10)||0}function s(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}var n,o=Math.max,a=Math.abs,r=/left|center|right/,h=/top|center|bottom/,l=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,u=/%$/,d=t.fn.position;t.position={scrollbarWidth:function(){if(void 0!==n)return n;var e,i,s=t("
"),o=s.children()[0];return t("body").append(s),e=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,e===i&&(i=s[0].clientWidth),s.remove(),n=e-i},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.widthi?"left":e>0?"right":"center",vertical:0>r?"top":s>0?"bottom":"middle"};l>p&&p>a(e+i)&&(u.horizontal="center"),c>f&&f>a(s+r)&&(u.vertical="middle"),u.important=o(a(e),a(i))>o(a(s),a(r))?"horizontal":"vertical",n.using.call(this,t,u)}),h.offset(t.extend(D,{using:r}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,h=n-r,l=r+e.collisionWidth-a-n;e.collisionWidth>a?h>0&&0>=l?(i=t.left+h+e.collisionWidth-a-n,t.left+=h-i):t.left=l>0&&0>=h?n:h>l?n+a-e.collisionWidth:n:h>0?t.left+=h:l>0?t.left-=l:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,h=n-r,l=r+e.collisionHeight-a-n;e.collisionHeight>a?h>0&&0>=l?(i=t.top+h+e.collisionHeight-a-n,t.top+=h-i):t.top=l>0&&0>=h?n:h>l?n+a-e.collisionHeight:n:h>0?t.top+=h:l>0?t.top-=l:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,o=n.offset.left+n.scrollLeft,r=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=t.left-e.collisionPosition.marginLeft,c=l-h,u=l+e.collisionWidth-r-h,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-r-o,(0>i||a(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-h,(s>0||u>a(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,o=n.offset.top+n.scrollTop,r=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=t.top-e.collisionPosition.marginTop,c=l-h,u=l+e.collisionHeight-r-h,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,g=-2*e.offset[1];0>c?(s=t.top+p+f+g+e.collisionHeight-r-o,(0>s||a(c)>s)&&(t.top+=p+f+g)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+g-h,(i>0||u>a(i))&&(t.top+=p+f+g))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}}}(),t.ui.position,t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])}}),t.fn.extend({disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}});var c="ui-effects-",u="ui-effects-style",d="ui-effects-animated",p=t;t.effects={effect:{}},function(t,e){function i(t,e,i){var s=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:t>s.max?s.max:t)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(t,o){var a,r=o.re.exec(i),h=r&&o.parse(r),l=o.space||"rgba";return h?(a=s[l](h),s[c[l].cache]=a[c[l].cache],n=s._rgba=a._rgba,!1):e}),n.length?("0,0,0,0"===n.join()&&t.extend(n,o.transparent),s):o[i]}function n(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var o,a="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],l=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},c={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=l.support={},p=t("

")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),l.fn=t.extend(l.prototype,{parse:function(n,a,r,h){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(a),a=e);var u=this,d=t.type(n),p=this._rgba=[];return a!==e&&(n=[n,a,r,h],d="array"),"string"===d?this.parse(s(n)||o._default):"array"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(n[e.idx],e)}),this):"object"===d?(n instanceof l?f(c,function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}):f(c,function(e,s){var o=s.cache;f(s.props,function(t,e){if(!u[o]&&s.to){if("alpha"===t||null==n[t])return;u[o]=s.to(u._rgba)}u[o][e.idx]=i(n[t],e,!0)}),u[o]&&0>t.inArray(null,u[o].slice(0,3))&&(u[o][3]=1,s.from&&(u._rgba=s.from(u[o])))}),this):e},is:function(t){var i=l(t),s=!0,n=this;return f(c,function(t,o){var a,r=i[o.cache];return r&&(a=n[o.cache]||o.to&&o.to(n._rgba)||[],f(o.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===a[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return f(c,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=l(t),n=s._space(),o=c[n],a=0===this.alpha()?l("transparent"):this,r=a[o.cache]||o.to(a._rgba),h=r.slice();return s=s[o.cache],f(o.props,function(t,n){var o=n.idx,a=r[o],l=s[o],c=u[n.type]||{};null!==l&&(null===a?h[o]=l:(c.mod&&(l-a>c.mod/2?a+=c.mod:a-l>c.mod/2&&(a-=c.mod)),h[o]=i((l-a)*e+a,n)))}),this[n](h)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(e)._rgba;return l(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,o=t[2]/255,a=t[3],r=Math.max(s,n,o),h=Math.min(s,n,o),l=r-h,c=r+h,u=.5*c;return e=h===r?0:s===r?60*(n-o)/l+360:n===r?60*(o-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=u?l/c:l/(2-c),[Math.round(e)%360,i,u,null==a?1:a]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],o=t[3],a=.5>=s?s*(1+i):s+i-s*i,r=2*s-a;return[Math.round(255*n(r,a,e+1/3)),Math.round(255*n(r,a,e)),Math.round(255*n(r,a,e-1/3)),o]},f(c,function(s,n){var o=n.props,a=n.cache,h=n.to,c=n.from;l.fn[s]=function(s){if(h&&!this[a]&&(this[a]=h(this._rgba)),s===e)return this[a].slice();var n,r=t.type(s),u="array"===r||"object"===r?s:arguments,d=this[a].slice();return f(o,function(t,e){var s=u["object"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?(n=l(c(d)),n[a]=d,n):l(d)},f(o,function(e,i){l.fn[e]||(l.fn[e]=function(n){var o,a=t.type(n),h="alpha"===e?this._hsla?"hsla":"rgba":s,l=this[h](),c=l[i.idx];return"undefined"===a?c:("function"===a&&(n=n.call(this,c),a=t.type(n)),null==n&&i.empty?this:("string"===a&&(o=r.exec(n),o&&(n=c+parseFloat(o[2])*("+"===o[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,n){var o,a,r="";if("transparent"!==n&&("string"!==t.type(n)||(o=s(n)))){if(n=l(o||n),!d.rgba&&1!==n._rgba[3]){for(a="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&a&&a.style;)try{r=t.css(a,"backgroundColor"),a=a.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(h){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=l(e.elem,i),e.end=l(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},l.hook(a),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},o=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(p),function(){function e(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,o={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(o[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(o[i]=n[i]);return o}function i(e,i){var s,o,a={};for(s in i)o=i[s],e[s]!==o&&(n[s]||(t.fx.step[s]||!isNaN(parseFloat(o)))&&(a[s]=o));return a}var s=["add","remove","toggle"],n={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(p.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(n,o,a,r){var h=t.speed(o,a,r);return this.queue(function(){var o,a=t(this),r=a.attr("class")||"",l=h.children?a.find("*").addBack():a;l=l.map(function(){var i=t(this);return{el:i,start:e(this)}}),o=function(){t.each(s,function(t,e){n[e]&&a[e+"Class"](n[e])})},o(),l=l.map(function(){return this.end=e(this.el[0]),this.diff=i(this.start,this.end),this}),a.attr("class",r),l=l.map(function(){var e=this,i=t.Deferred(),s=t.extend({},h,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,l.get()).done(function(){o(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),h.complete.call(a[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,o){return s?t.effects.animateClass.call(this,{add:i},s,n,o):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,o){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,o):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(e){return function(i,s,n,o,a){return"boolean"==typeof s||void 0===s?n?t.effects.animateClass.call(this,s?{add:i}:{remove:i},n,o,a):e.apply(this,arguments):t.effects.animateClass.call(this,{toggle:i},s,n,o)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,o){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,o)}})}(),function(){function e(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function i(e){return!e||"number"==typeof e||t.fx.speeds[e]?!0:"string"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:"object"!=typeof e||e.effect?!1:!0:!0}function s(t,e){var i=e.outerWidth(),s=e.outerHeight(),n=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/,o=n.exec(t)||["",0,i,s,0];return{top:parseFloat(o[1])||0,right:"auto"===o[2]?i:parseFloat(o[2]),bottom:"auto"===o[3]?s:parseFloat(o[3]),left:parseFloat(o[4])||0}}t.expr&&t.expr.filters&&t.expr.filters.animated&&(t.expr.filters.animated=function(e){return function(i){return!!t(i).data(d)||e(i)}}(t.expr.filters.animated)),t.uiBackCompat!==!1&&t.extend(t.effects,{save:function(t,e){for(var i=0,s=e.length;s>i;i++)null!==e[i]&&t.data(c+e[i],t[0].style[e[i]])},restore:function(t,e){for(var i,s=0,n=e.length;n>s;s++)null!==e[s]&&(i=t.data(c+e[s]),t.css(e[s],i))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},s=t("

").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},o=document.activeElement;try{o.id}catch(a){o=document.body}return e.wrap(s),(e[0]===o||t.contains(e[0],o))&&t(o).trigger("focus"),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).trigger("focus")),e}}),t.extend(t.effects,{version:"1.12.1",define:function(e,i,s){return s||(s=i,i="effect"),t.effects.effect[e]=s,t.effects.effect[e].mode=i,s},scaledDimensions:function(t,e,i){if(0===e)return{height:0,width:0,outerHeight:0,outerWidth:0};var s="horizontal"!==i?(e||100)/100:1,n="vertical"!==i?(e||100)/100:1;return{height:t.height()*n,width:t.width()*s,outerHeight:t.outerHeight()*n,outerWidth:t.outerWidth()*s}},clipToBox:function(t){return{width:t.clip.right-t.clip.left,height:t.clip.bottom-t.clip.top,left:t.clip.left,top:t.clip.top}},unshift:function(t,e,i){var s=t.queue();e>1&&s.splice.apply(s,[1,0].concat(s.splice(e,i))),t.dequeue()},saveStyle:function(t){t.data(u,t[0].style.cssText)},restoreStyle:function(t){t[0].style.cssText=t.data(u)||"",t.removeData(u)},mode:function(t,e){var i=t.is(":hidden");return"toggle"===e&&(e=i?"show":"hide"),(i?"hide"===e:"show"===e)&&(e="none"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createPlaceholder:function(e){var i,s=e.css("position"),n=e.position();return e.css({marginTop:e.css("marginTop"),marginBottom:e.css("marginBottom"),marginLeft:e.css("marginLeft"),marginRight:e.css("marginRight")}).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()),/^(static|relative)/.test(s)&&(s="absolute",i=t("<"+e[0].nodeName+">").insertAfter(e).css({display:/^(inline|ruby)/.test(e.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:e.css("marginTop"),marginBottom:e.css("marginBottom"),marginLeft:e.css("marginLeft"),marginRight:e.css("marginRight"),"float":e.css("float")}).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).addClass("ui-effects-placeholder"),e.data(c+"placeholder",i)),e.css({position:s,left:n.left,top:n.top}),i},removePlaceholder:function(t){var e=c+"placeholder",i=t.data(e);i&&(i.remove(),t.removeData(e))},cleanUp:function(e){t.effects.restoreStyle(e),t.effects.removePlaceholder(e)},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var o=e.cssUnit(i);o[0]>0&&(n[i]=o[0]*s+o[1])}),n}}),t.fn.extend({effect:function(){function i(e){function i(){r.removeData(d),t.effects.cleanUp(r),"hide"===s.mode&&r.hide(),a()}function a(){t.isFunction(h)&&h.call(r[0]),t.isFunction(e)&&e()}var r=t(this);s.mode=c.shift(),t.uiBackCompat===!1||o?"none"===s.mode?(r[l](),a()):n.call(r[0],s,i):(r.is(":hidden")?"hide"===l:"show"===l)?(r[l](),a()):n.call(r[0],s,a)}var s=e.apply(this,arguments),n=t.effects.effect[s.effect],o=n.mode,a=s.queue,r=a||"fx",h=s.complete,l=s.mode,c=[],u=function(e){var i=t(this),s=t.effects.mode(i,l)||o;i.data(d,!0),c.push(s),o&&("show"===s||s===o&&"hide"===s)&&i.show(),o&&"none"===s||t.effects.saveStyle(i),t.isFunction(e)&&e()};return t.fx.off||!n?l?this[l](s.duration,h):this.each(function(){h&&h.call(this)}):a===!1?this.each(u).each(i):this.queue(r,u).queue(r,i)},show:function(t){return function(s){if(i(s))return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="show",this.effect.call(this,n) +}}(t.fn.show),hide:function(t){return function(s){if(i(s))return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="hide",this.effect.call(this,n)}}(t.fn.hide),toggle:function(t){return function(s){if(i(s)||"boolean"==typeof s)return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s},cssClip:function(t){return t?this.css("clip","rect("+t.top+"px "+t.right+"px "+t.bottom+"px "+t.left+"px)"):s(this.css("clip"),this)},transfer:function(e,i){var s=t(this),n=t(e.to),o="fixed"===n.css("position"),a=t("body"),r=o?a.scrollTop():0,h=o?a.scrollLeft():0,l=n.offset(),c={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},u=s.offset(),d=t("
").appendTo("body").addClass(e.className).css({top:u.top-r,left:u.left-h,height:s.innerHeight(),width:s.innerWidth(),position:o?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){d.remove(),t.isFunction(i)&&i()})}}),t.fx.step.clip=function(e){e.clipInit||(e.start=t(e.elem).cssClip(),"string"==typeof e.end&&(e.end=s(e.end,e.elem)),e.clipInit=!0),t(e.elem).cssClip({top:e.pos*(e.end.top-e.start.top)+e.start.top,right:e.pos*(e.end.right-e.start.right)+e.start.right,bottom:e.pos*(e.end.bottom-e.start.bottom)+e.start.bottom,left:e.pos*(e.end.left-e.start.left)+e.start.left})}}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}();var f=t.effects;t.effects.define("blind","hide",function(e,i){var s={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},n=t(this),o=e.direction||"up",a=n.cssClip(),r={clip:t.extend({},a)},h=t.effects.createPlaceholder(n);r.clip[s[o][0]]=r.clip[s[o][1]],"show"===e.mode&&(n.cssClip(r.clip),h&&h.css(t.effects.clipToBox(r)),r.clip=a),h&&h.animate(t.effects.clipToBox(r),e.duration,e.easing),n.animate(r,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("bounce",function(e,i){var s,n,o,a=t(this),r=e.mode,h="hide"===r,l="show"===r,c=e.direction||"up",u=e.distance,d=e.times||5,p=2*d+(l||h?1:0),f=e.duration/p,g=e.easing,m="up"===c||"down"===c?"top":"left",_="up"===c||"left"===c,v=0,b=a.queue().length;for(t.effects.createPlaceholder(a),o=a.css(m),u||(u=a["top"===m?"outerHeight":"outerWidth"]()/3),l&&(n={opacity:1},n[m]=o,a.css("opacity",0).css(m,_?2*-u:2*u).animate(n,f,g)),h&&(u/=Math.pow(2,d-1)),n={},n[m]=o;d>v;v++)s={},s[m]=(_?"-=":"+=")+u,a.animate(s,f,g).animate(n,f,g),u=h?2*u:u/2;h&&(s={opacity:0},s[m]=(_?"-=":"+=")+u,a.animate(s,f,g)),a.queue(i),t.effects.unshift(a,b,p+1)}),t.effects.define("clip","hide",function(e,i){var s,n={},o=t(this),a=e.direction||"vertical",r="both"===a,h=r||"horizontal"===a,l=r||"vertical"===a;s=o.cssClip(),n.clip={top:l?(s.bottom-s.top)/2:s.top,right:h?(s.right-s.left)/2:s.right,bottom:l?(s.bottom-s.top)/2:s.bottom,left:h?(s.right-s.left)/2:s.left},t.effects.createPlaceholder(o),"show"===e.mode&&(o.cssClip(n.clip),n.clip=s),o.animate(n,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("drop","hide",function(e,i){var s,n=t(this),o=e.mode,a="show"===o,r=e.direction||"left",h="up"===r||"down"===r?"top":"left",l="up"===r||"left"===r?"-=":"+=",c="+="===l?"-=":"+=",u={opacity:0};t.effects.createPlaceholder(n),s=e.distance||n["top"===h?"outerHeight":"outerWidth"](!0)/2,u[h]=l+s,a&&(n.css(u),u[h]=c+s,u.opacity=1),n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("explode","hide",function(e,i){function s(){b.push(this),b.length===u*d&&n()}function n(){p.css({visibility:"visible"}),t(b).remove(),i()}var o,a,r,h,l,c,u=e.pieces?Math.round(Math.sqrt(e.pieces)):3,d=u,p=t(this),f=e.mode,g="show"===f,m=p.show().css("visibility","hidden").offset(),_=Math.ceil(p.outerWidth()/d),v=Math.ceil(p.outerHeight()/u),b=[];for(o=0;u>o;o++)for(h=m.top+o*v,c=o-(u-1)/2,a=0;d>a;a++)r=m.left+a*_,l=a-(d-1)/2,p.clone().appendTo("body").wrap("
").css({position:"absolute",visibility:"visible",left:-a*_,top:-o*v}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:_,height:v,left:r+(g?l*_:0),top:h+(g?c*v:0),opacity:g?0:1}).animate({left:r+(g?0:l*_),top:h+(g?0:c*v),opacity:g?1:0},e.duration||500,e.easing,s)}),t.effects.define("fade","toggle",function(e,i){var s="show"===e.mode;t(this).css("opacity",s?0:1).animate({opacity:s?1:0},{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("fold","hide",function(e,i){var s=t(this),n=e.mode,o="show"===n,a="hide"===n,r=e.size||15,h=/([0-9]+)%/.exec(r),l=!!e.horizFirst,c=l?["right","bottom"]:["bottom","right"],u=e.duration/2,d=t.effects.createPlaceholder(s),p=s.cssClip(),f={clip:t.extend({},p)},g={clip:t.extend({},p)},m=[p[c[0]],p[c[1]]],_=s.queue().length;h&&(r=parseInt(h[1],10)/100*m[a?0:1]),f.clip[c[0]]=r,g.clip[c[0]]=r,g.clip[c[1]]=0,o&&(s.cssClip(g.clip),d&&d.css(t.effects.clipToBox(g)),g.clip=p),s.queue(function(i){d&&d.animate(t.effects.clipToBox(f),u,e.easing).animate(t.effects.clipToBox(g),u,e.easing),i()}).animate(f,u,e.easing).animate(g,u,e.easing).queue(i),t.effects.unshift(s,_,4)}),t.effects.define("highlight","show",function(e,i){var s=t(this),n={backgroundColor:s.css("backgroundColor")};"hide"===e.mode&&(n.opacity=0),t.effects.saveStyle(s),s.css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(n,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("size",function(e,i){var s,n,o,a=t(this),r=["fontSize"],h=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],l=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],c=e.mode,u="effect"!==c,d=e.scale||"both",p=e.origin||["middle","center"],f=a.css("position"),g=a.position(),m=t.effects.scaledDimensions(a),_=e.from||m,v=e.to||t.effects.scaledDimensions(a,0);t.effects.createPlaceholder(a),"show"===c&&(o=_,_=v,v=o),n={from:{y:_.height/m.height,x:_.width/m.width},to:{y:v.height/m.height,x:v.width/m.width}},("box"===d||"both"===d)&&(n.from.y!==n.to.y&&(_=t.effects.setTransition(a,h,n.from.y,_),v=t.effects.setTransition(a,h,n.to.y,v)),n.from.x!==n.to.x&&(_=t.effects.setTransition(a,l,n.from.x,_),v=t.effects.setTransition(a,l,n.to.x,v))),("content"===d||"both"===d)&&n.from.y!==n.to.y&&(_=t.effects.setTransition(a,r,n.from.y,_),v=t.effects.setTransition(a,r,n.to.y,v)),p&&(s=t.effects.getBaseline(p,m),_.top=(m.outerHeight-_.outerHeight)*s.y+g.top,_.left=(m.outerWidth-_.outerWidth)*s.x+g.left,v.top=(m.outerHeight-v.outerHeight)*s.y+g.top,v.left=(m.outerWidth-v.outerWidth)*s.x+g.left),a.css(_),("content"===d||"both"===d)&&(h=h.concat(["marginTop","marginBottom"]).concat(r),l=l.concat(["marginLeft","marginRight"]),a.find("*[width]").each(function(){var i=t(this),s=t.effects.scaledDimensions(i),o={height:s.height*n.from.y,width:s.width*n.from.x,outerHeight:s.outerHeight*n.from.y,outerWidth:s.outerWidth*n.from.x},a={height:s.height*n.to.y,width:s.width*n.to.x,outerHeight:s.height*n.to.y,outerWidth:s.width*n.to.x};n.from.y!==n.to.y&&(o=t.effects.setTransition(i,h,n.from.y,o),a=t.effects.setTransition(i,h,n.to.y,a)),n.from.x!==n.to.x&&(o=t.effects.setTransition(i,l,n.from.x,o),a=t.effects.setTransition(i,l,n.to.x,a)),u&&t.effects.saveStyle(i),i.css(o),i.animate(a,e.duration,e.easing,function(){u&&t.effects.restoreStyle(i)})})),a.animate(v,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){var e=a.offset();0===v.opacity&&a.css("opacity",_.opacity),u||(a.css("position","static"===f?"relative":f).offset(e),t.effects.saveStyle(a)),i()}})}),t.effects.define("scale",function(e,i){var s=t(this),n=e.mode,o=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"effect"!==n?0:100),a=t.extend(!0,{from:t.effects.scaledDimensions(s),to:t.effects.scaledDimensions(s,o,e.direction||"both"),origin:e.origin||["middle","center"]},e);e.fade&&(a.from.opacity=1,a.to.opacity=0),t.effects.effect.size.call(this,a,i)}),t.effects.define("puff","hide",function(e,i){var s=t.extend(!0,{},e,{fade:!0,percent:parseInt(e.percent,10)||150});t.effects.effect.scale.call(this,s,i)}),t.effects.define("pulsate","show",function(e,i){var s=t(this),n=e.mode,o="show"===n,a="hide"===n,r=o||a,h=2*(e.times||5)+(r?1:0),l=e.duration/h,c=0,u=1,d=s.queue().length;for((o||!s.is(":visible"))&&(s.css("opacity",0).show(),c=1);h>u;u++)s.animate({opacity:c},l,e.easing),c=1-c;s.animate({opacity:c},l,e.easing),s.queue(i),t.effects.unshift(s,d,h+1)}),t.effects.define("shake",function(e,i){var s=1,n=t(this),o=e.direction||"left",a=e.distance||20,r=e.times||3,h=2*r+1,l=Math.round(e.duration/h),c="up"===o||"down"===o?"top":"left",u="up"===o||"left"===o,d={},p={},f={},g=n.queue().length;for(t.effects.createPlaceholder(n),d[c]=(u?"-=":"+=")+a,p[c]=(u?"+=":"-=")+2*a,f[c]=(u?"-=":"+=")+2*a,n.animate(d,l,e.easing);r>s;s++)n.animate(p,l,e.easing).animate(f,l,e.easing);n.animate(p,l,e.easing).animate(d,l/2,e.easing).queue(i),t.effects.unshift(n,g,h+1)}),t.effects.define("slide","show",function(e,i){var s,n,o=t(this),a={up:["bottom","top"],down:["top","bottom"],left:["right","left"],right:["left","right"]},r=e.mode,h=e.direction||"left",l="up"===h||"down"===h?"top":"left",c="up"===h||"left"===h,u=e.distance||o["top"===l?"outerHeight":"outerWidth"](!0),d={};t.effects.createPlaceholder(o),s=o.cssClip(),n=o.position()[l],d[l]=(c?-1:1)*u+n,d.clip=o.cssClip(),d.clip[a[h][1]]=d.clip[a[h][0]],"show"===r&&(o.cssClip(d.clip),o.css(l,d[l]),d.clip=s,d[l]=n),o.animate(d,{queue:!1,duration:e.duration,easing:e.easing,complete:i})});var f;t.uiBackCompat!==!1&&(f=t.effects.define("transfer",function(e,i){t(this).transfer(e,i)})),t.ui.focusable=function(i,s){var n,o,a,r,h,l=i.nodeName.toLowerCase();return"area"===l?(n=i.parentNode,o=n.name,i.href&&o&&"map"===n.nodeName.toLowerCase()?(a=t("img[usemap='#"+o+"']"),a.length>0&&a.is(":visible")):!1):(/^(input|select|textarea|button|object)$/.test(l)?(r=!i.disabled,r&&(h=t(i).closest("fieldset")[0],h&&(r=!h.disabled))):r="a"===l?i.href||s:s,r&&t(i).is(":visible")&&e(t(i)))},t.extend(t.expr[":"],{focusable:function(e){return t.ui.focusable(e,null!=t.attr(e,"tabindex"))}}),t.ui.focusable,t.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):t(this[0].form)},t.ui.formResetMixin={_formResetHandler:function(){var e=t(this);setTimeout(function(){var i=e.data("ui-form-reset-instances");t.each(i,function(){this.refresh()})})},_bindFormResetHandler:function(){if(this.form=this.element.form(),this.form.length){var t=this.form.data("ui-form-reset-instances")||[];t.length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t)}},_unbindFormResetHandler:function(){if(this.form.length){var e=this.form.data("ui-form-reset-instances");e.splice(t.inArray(this,e),1),e.length?this.form.data("ui-form-reset-instances",e):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}},"1.7"===t.fn.jquery.substring(0,3)&&(t.each(["Width","Height"],function(e,i){function s(e,i,s,o){return t.each(n,function(){i-=parseFloat(t.css(e,"padding"+this))||0,s&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),o&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],o=i.toLowerCase(),a={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+i]=function(e){return void 0===e?a["inner"+i].call(this):this.each(function(){t(this).css(o,s(this,e)+"px")})},t.fn["outer"+i]=function(e,n){return"number"!=typeof e?a["outer"+i].call(this,e):this.each(function(){t(this).css(o,s(this,e,!0,n)+"px")})}}),t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},t.ui.escapeSelector=function(){var t=/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g;return function(e){return e.replace(t,"\\$1")}}(),t.fn.labels=function(){var e,i,s,n,o;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(n=this.eq(0).parents("label"),s=this.attr("id"),s&&(e=this.eq(0).parents().last(),o=e.add(e.length?e.siblings():this.siblings()),i="label[for='"+t.ui.escapeSelector(s)+"']",n=n.add(o.find(i).addBack(i))),this.pushStack(n))},t.fn.scrollParent=function(e){var i=this.css("position"),s="absolute"===i,n=e?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var e=t(this);return s&&"static"===e.css("position")?!1:n.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==i&&o.length?o:t(this[0].ownerDocument||document)},t.extend(t.expr[":"],{tabbable:function(e){var i=t.attr(e,"tabindex"),s=null!=i;return(!s||i>=0)&&t.ui.focusable(e,s)}}),t.fn.extend({uniqueId:function(){var t=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++t)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}}),t.widget("ui.accordion",{version:"1.12.1",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:!1,event:"click",header:"> li > :first-child, > :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var e=this.options;this.prevShow=this.prevHide=t(),this._addClass("ui-accordion","ui-widget ui-helper-reset"),this.element.attr("role","tablist"),e.collapsible||e.active!==!1&&null!=e.active||(e.active=0),this._processPanels(),0>e.active&&(e.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():t()}},_createIcons:function(){var e,i,s=this.options.icons;s&&(e=t(""),this._addClass(e,"ui-accordion-header-icon","ui-icon "+s.header),e.prependTo(this.headers),i=this.active.children(".ui-accordion-header-icon"),this._removeClass(i,s.header)._addClass(i,null,s.activeHeader)._addClass(this.headers,"ui-accordion-icons"))},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons"),this.headers.children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeAttr("role"),this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId(),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){return"active"===t?(this._activate(e),void 0):("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||this.options.active!==!1||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons()),void 0)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t),this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!t)},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var i=t.ui.keyCode,s=this.headers.length,n=this.headers.index(e.target),o=!1;switch(e.keyCode){case i.RIGHT:case i.DOWN:o=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:o=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(e);break;case i.HOME:o=this.headers[0];break;case i.END:o=this.headers[s-1]}o&&(t(e.target).attr("tabIndex",-1),t(o).attr("tabIndex",0),t(o).trigger("focus"),e.preventDefault())}},_panelKeyDown:function(e){e.keyCode===t.ui.keyCode.UP&&e.ctrlKey&&t(e.currentTarget).prev().trigger("focus")},refresh:function(){var e=this.options;this._processPanels(),e.active===!1&&e.collapsible===!0||!this.headers.length?(e.active=!1,this.active=t()):e.active===!1?this._activate(0):this.active.length&&!t.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(e.active=!1,this.active=t()):this._activate(Math.max(0,e.active-1)):e.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var t=this.headers,e=this.panels;this.headers=this.element.find(this.options.header),this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default"),this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide(),this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content"),e&&(this._off(t.not(this.headers)),this._off(e.not(this.panels)))},_refresh:function(){var e,i=this.options,s=i.heightStyle,n=this.element.parent();this.active=this._findActive(i.active),this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed"),this._addClass(this.active.next(),"ui-accordion-content-active"),this.active.next().show(),this.headers.attr("role","tab").each(function(){var e=t(this),i=e.uniqueId().attr("id"),s=e.next(),n=s.uniqueId().attr("id");e.attr("aria-controls",n),s.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(i.event),"fill"===s?(e=n.height(),this.element.siblings(":visible").each(function(){var i=t(this),s=i.css("position");"absolute"!==s&&"fixed"!==s&&(e-=i.outerHeight(!0))}),this.headers.each(function(){e-=t(this).outerHeight(!0)}),this.headers.next().each(function(){t(this).height(Math.max(0,e-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===s&&(e=0,this.headers.next().each(function(){var i=t(this).is(":visible");i||t(this).show(),e=Math.max(e,t(this).css("height","").height()),i||t(this).hide()}).height(e))},_activate:function(e){var i=this._findActive(e)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):t()},_setupEvents:function(e){var i={keydown:"_keydown"};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(e){var i,s,n=this.options,o=this.active,a=t(e.currentTarget),r=a[0]===o[0],h=r&&n.collapsible,l=h?t():a.next(),c=o.next(),u={oldHeader:o,oldPanel:c,newHeader:h?t():a,newPanel:l};e.preventDefault(),r&&!n.collapsible||this._trigger("beforeActivate",e,u)===!1||(n.active=h?!1:this.headers.index(a),this.active=r?t():a,this._toggle(u),this._removeClass(o,"ui-accordion-header-active","ui-state-active"),n.icons&&(i=o.children(".ui-accordion-header-icon"),this._removeClass(i,null,n.icons.activeHeader)._addClass(i,null,n.icons.header)),r||(this._removeClass(a,"ui-accordion-header-collapsed")._addClass(a,"ui-accordion-header-active","ui-state-active"),n.icons&&(s=a.children(".ui-accordion-header-icon"),this._removeClass(s,null,n.icons.header)._addClass(s,null,n.icons.activeHeader)),this._addClass(a.next(),"ui-accordion-content-active")))},_toggle:function(e){var i=e.newPanel,s=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,e):(s.hide(),i.show(),this._toggleComplete(e)),s.attr({"aria-hidden":"true"}),s.prev().attr({"aria-selected":"false","aria-expanded":"false"}),i.length&&s.length?s.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===parseInt(t(this).attr("tabIndex"),10)}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(t,e,i){var s,n,o,a=this,r=0,h=t.css("box-sizing"),l=t.length&&(!e.length||t.index()",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(t){t.preventDefault()},"click .ui-menu-item":function(e){var i=t(e.target),s=t(t.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(e),e.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(e):!this.element.is(":focus")&&s.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){if(!this.previousFilter){var i=t(e.target).closest(".ui-menu-item"),s=t(e.currentTarget);i[0]===s[0]&&(this._removeClass(s.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(e,s))}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.find(this.options.items).eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){var i=!t.contains(this.element[0],t.ui.safeActiveElement(this.document[0]));i&&this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){this._closeOnDocumentClick(t)&&this.collapseAll(t),this.mouseHandled=!1}})},_destroy:function(){var e=this.element.find(".ui-menu-item").removeAttr("role aria-disabled"),i=e.children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),i.children().each(function(){var e=t(this);e.data("ui-menu-submenu-caret")&&e.remove()})},_keydown:function(e){var i,s,n,o,a=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:a=!1,s=this.previousFilter||"",o=!1,n=e.keyCode>=96&&105>=e.keyCode?""+(e.keyCode-96):String.fromCharCode(e.keyCode),clearTimeout(this.filterTimer),n===s?o=!0:n=s+n,i=this._filterMenuItems(n),i=o&&-1!==i.index(this.active.next())?this.active.nextAll(".ui-menu-item"):i,i.length||(n=String.fromCharCode(e.keyCode),i=this._filterMenuItems(n)),i.length?(this.focus(e,i),this.previousFilter=n,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}a&&e.preventDefault()},_activate:function(t){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,i,s,n,o,a=this,r=this.options.icons.submenu,h=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),s=h.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),i=e.prev(),s=t("").data("ui-menu-submenu-caret",!0);a._addClass(s,"ui-menu-icon","ui-icon "+r),i.attr("aria-haspopup","true").prepend(s),e.attr("aria-labelledby",i.attr("id"))}),this._addClass(s,"ui-menu","ui-widget ui-widget-content ui-front"),e=h.add(this.element),i=e.find(this.options.items),i.not(".ui-menu-item").each(function(){var e=t(this);a._isDivider(e)&&a._addClass(e,"ui-menu-divider","ui-widget-content")}),n=i.not(".ui-menu-item, .ui-menu-divider"),o=n.children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(n,"ui-menu-item")._addClass(o,"ui-menu-item-wrapper"),i.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){if("icons"===t){var i=this.element.find(".ui-menu-icon");this._removeClass(i,null,this.options.icons.submenu)._addClass(i,null,e.submenu)}this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t+""),this._toggleClass(null,"ui-state-disabled",!!t)},focus:function(t,e){var i,s,n;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children(".ui-menu-item-wrapper"),this._addClass(s,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),n=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(n,null,"ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=e.children(".ui-menu"),i.length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,s,n,o,a,r;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,n=e.offset().top-this.activeMenu.offset().top-i-s,o=this.activeMenu.scrollTop(),a=this.activeMenu.height(),r=e.outerHeight(),0>n?this.activeMenu.scrollTop(o+n):n+r>a&&this.activeMenu.scrollTop(o+n-a+r))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",t,{item:this.active}),this.active=null)},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var i=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(e),this._removeClass(s.find(".ui-state-active"),null,"ui-state-active"),this.activeMenu=s},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false")},_closeOnDocumentClick:function(e){return!t(e.target).closest(".ui-menu").length},_isDivider:function(t){return!/[^\-\u2014\u2013\s]/.test(t.text())},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.find(this.options.items)[e]()),this.focus(i,s)},nextPage:function(e){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=t(this),0>i.offset().top-s-n}),this.focus(e,i)):this.focus(e,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())),void 0):(this.next(e),void 0)},previousPage:function(e){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=t(this),i.offset().top-s+n>0}),this.focus(e,i)):this.focus(e,this.activeMenu.find(this.options.items).first())),void 0):(this.next(e),void 0)},_hasScroll:function(){return this.element.outerHeight()",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var e,i,s,n=this.element[0].nodeName.toLowerCase(),o="textarea"===n,a="input"===n; +this.isMultiLine=o||!a&&this._isContentEditable(this.element),this.valueMethod=this.element[o||a?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return e=!0,s=!0,i=!0,void 0;e=!1,s=!1,i=!1;var o=t.ui.keyCode;switch(n.keyCode){case o.PAGE_UP:e=!0,this._move("previousPage",n);break;case o.PAGE_DOWN:e=!0,this._move("nextPage",n);break;case o.UP:e=!0,this._keyEvent("previous",n);break;case o.DOWN:e=!0,this._keyEvent("next",n);break;case o.ENTER:this.menu.active&&(e=!0,n.preventDefault(),this.menu.select(n));break;case o.TAB:this.menu.active&&this.menu.select(n);break;case o.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(e)return e=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),void 0;if(!i){var n=t.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(t){return s?(s=!1,t.preventDefault(),void 0):(this._searchTimeout(t),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(t),this._change(t),void 0)}}),this._initSource(),this.menu=t("