summaryrefslogtreecommitdiff
path: root/src/third_party
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party')
-rw-r--r--src/third_party/wiredtiger/NEWS100
-rw-r--r--src/third_party/wiredtiger/NEWS.MONGODB1178
-rw-r--r--src/third_party/wiredtiger/README12
-rw-r--r--src/third_party/wiredtiger/RELEASE_INFO4
-rw-r--r--src/third_party/wiredtiger/SConstruct25
-rw-r--r--src/third_party/wiredtiger/bench/wtperf/config.c29
-rw-r--r--src/third_party/wiredtiger/bench/wtperf/wtperf.c85
-rw-r--r--src/third_party/wiredtiger/bench/wtperf/wtperf.h2
-rw-r--r--src/third_party/wiredtiger/bench/wtperf/wtperf_opt.i8
-rw-r--r--src/third_party/wiredtiger/build_posix/Make.subdirs2
-rw-r--r--src/third_party/wiredtiger/build_posix/aclocal/options.m421
-rw-r--r--src/third_party/wiredtiger/build_posix/aclocal/version-set.m48
-rw-r--r--src/third_party/wiredtiger/build_posix/aclocal/version.m42
-rw-r--r--src/third_party/wiredtiger/build_posix/configure.ac.in6
-rw-r--r--src/third_party/wiredtiger/build_win/filelist.win2
-rw-r--r--src/third_party/wiredtiger/build_win/wiredtiger.def1
-rw-r--r--src/third_party/wiredtiger/build_win/wiredtiger_config.h9
-rw-r--r--src/third_party/wiredtiger/dist/api_config.py66
-rw-r--r--src/third_party/wiredtiger/dist/api_data.py94
-rw-r--r--src/third_party/wiredtiger/dist/dist.py4
-rw-r--r--src/third_party/wiredtiger/dist/filelist2
-rw-r--r--src/third_party/wiredtiger/dist/s_define.list1
-rw-r--r--src/third_party/wiredtiger/dist/s_export.list1
-rw-r--r--src/third_party/wiredtiger/dist/s_funcs.list1
-rw-r--r--src/third_party/wiredtiger/dist/s_readme6
-rw-r--r--src/third_party/wiredtiger/dist/s_string31
-rw-r--r--src/third_party/wiredtiger/dist/s_string.ok315
-rw-r--r--src/third_party/wiredtiger/dist/stat.py6
-rw-r--r--src/third_party/wiredtiger/dist/stat_data.py42
-rwxr-xr-xsrc/third_party/wiredtiger/dist/style.py2
-rw-r--r--src/third_party/wiredtiger/ext/datasources/helium/helium.c2
-rw-r--r--src/third_party/wiredtiger/lang/python/wiredtiger.i63
-rw-r--r--src/third_party/wiredtiger/src/async/async_worker.c10
-rw-r--r--src/third_party/wiredtiger/src/block/block_ckpt.c4
-rw-r--r--src/third_party/wiredtiger/src/block/block_ext.c2
-rw-r--r--src/third_party/wiredtiger/src/block/block_open.c2
-rw-r--r--src/third_party/wiredtiger/src/block/block_slvg.c2
-rw-r--r--src/third_party/wiredtiger/src/block/block_vrfy.c2
-rw-r--r--src/third_party/wiredtiger/src/block/block_write.c205
-rw-r--r--src/third_party/wiredtiger/src/bloom/bloom.c2
-rw-r--r--src/third_party/wiredtiger/src/btree/bt_curnext.c48
-rw-r--r--src/third_party/wiredtiger/src/btree/bt_curprev.c47
-rw-r--r--src/third_party/wiredtiger/src/btree/bt_cursor.c125
-rw-r--r--src/third_party/wiredtiger/src/btree/bt_debug.c26
-rw-r--r--src/third_party/wiredtiger/src/btree/bt_discard.c2
-rw-r--r--src/third_party/wiredtiger/src/btree/bt_handle.c17
-rw-r--r--src/third_party/wiredtiger/src/btree/bt_huffman.c7
-rw-r--r--src/third_party/wiredtiger/src/btree/bt_page.c46
-rw-r--r--src/third_party/wiredtiger/src/btree/bt_ret.c20
-rw-r--r--src/third_party/wiredtiger/src/btree/bt_slvg.c4
-rw-r--r--src/third_party/wiredtiger/src/btree/bt_split.c72
-rw-r--r--src/third_party/wiredtiger/src/btree/bt_walk.c2
-rw-r--r--src/third_party/wiredtiger/src/btree/col_srch.c35
-rw-r--r--src/third_party/wiredtiger/src/btree/row_srch.c18
-rw-r--r--src/third_party/wiredtiger/src/config/config.c26
-rw-r--r--src/third_party/wiredtiger/src/config/config_api.c280
-rw-r--r--src/third_party/wiredtiger/src/config/config_check.c263
-rw-r--r--src/third_party/wiredtiger/src/config/config_collapse.c50
-rw-r--r--src/third_party/wiredtiger/src/config/config_def.c1121
-rw-r--r--src/third_party/wiredtiger/src/conn/conn_api.c190
-rw-r--r--src/third_party/wiredtiger/src/conn/conn_cache.c16
-rw-r--r--src/third_party/wiredtiger/src/conn/conn_dhandle.c107
-rw-r--r--src/third_party/wiredtiger/src/conn/conn_log.c24
-rw-r--r--src/third_party/wiredtiger/src/conn/conn_open.c21
-rw-r--r--src/third_party/wiredtiger/src/conn/conn_stat.c17
-rw-r--r--src/third_party/wiredtiger/src/conn/conn_sweep.c224
-rw-r--r--src/third_party/wiredtiger/src/cursor/cur_backup.c8
-rw-r--r--src/third_party/wiredtiger/src/cursor/cur_bulk.c31
-rw-r--r--src/third_party/wiredtiger/src/cursor/cur_dump.c2
-rw-r--r--src/third_party/wiredtiger/src/cursor/cur_file.c13
-rw-r--r--src/third_party/wiredtiger/src/cursor/cur_json.c4
-rw-r--r--src/third_party/wiredtiger/src/cursor/cur_log.c6
-rw-r--r--src/third_party/wiredtiger/src/evict/evict_lru.c113
-rw-r--r--src/third_party/wiredtiger/src/evict/evict_page.c12
-rw-r--r--src/third_party/wiredtiger/src/include/api.h20
-rw-r--r--src/third_party/wiredtiger/src/include/btmem.h23
-rw-r--r--src/third_party/wiredtiger/src/include/btree.h4
-rw-r--r--src/third_party/wiredtiger/src/include/btree.i132
-rw-r--r--src/third_party/wiredtiger/src/include/btree_cmp.i190
-rw-r--r--src/third_party/wiredtiger/src/include/cell.i43
-rw-r--r--src/third_party/wiredtiger/src/include/column.i93
-rw-r--r--src/third_party/wiredtiger/src/include/config.h64
-rw-r--r--src/third_party/wiredtiger/src/include/connection.h25
-rw-r--r--src/third_party/wiredtiger/src/include/cursor.h24
-rw-r--r--src/third_party/wiredtiger/src/include/cursor.i18
-rw-r--r--src/third_party/wiredtiger/src/include/dhandle.h13
-rw-r--r--src/third_party/wiredtiger/src/include/extern.h31
-rw-r--r--src/third_party/wiredtiger/src/include/log.h3
-rw-r--r--src/third_party/wiredtiger/src/include/misc.h38
-rw-r--r--src/third_party/wiredtiger/src/include/mutex.h13
-rw-r--r--src/third_party/wiredtiger/src/include/mutex.i143
-rw-r--r--src/third_party/wiredtiger/src/include/schema.h10
-rw-r--r--src/third_party/wiredtiger/src/include/session.h1
-rw-r--r--src/third_party/wiredtiger/src/include/stat.h2
-rw-r--r--src/third_party/wiredtiger/src/include/txn.i28
-rw-r--r--src/third_party/wiredtiger/src/include/wiredtiger.in176
-rw-r--r--src/third_party/wiredtiger/src/include/wt_internal.h6
-rw-r--r--src/third_party/wiredtiger/src/log/log.c97
-rw-r--r--src/third_party/wiredtiger/src/lsm/lsm_cursor.c54
-rw-r--r--src/third_party/wiredtiger/src/lsm/lsm_manager.c3
-rw-r--r--src/third_party/wiredtiger/src/lsm/lsm_merge.c4
-rw-r--r--src/third_party/wiredtiger/src/lsm/lsm_stat.c4
-rw-r--r--src/third_party/wiredtiger/src/lsm/lsm_tree.c11
-rw-r--r--src/third_party/wiredtiger/src/lsm/lsm_work_unit.c9
-rw-r--r--src/third_party/wiredtiger/src/meta/meta_table.c4
-rw-r--r--src/third_party/wiredtiger/src/meta/meta_track.c29
-rw-r--r--src/third_party/wiredtiger/src/meta/meta_turtle.c4
-rw-r--r--src/third_party/wiredtiger/src/os_posix/os_alloc.c18
-rw-r--r--src/third_party/wiredtiger/src/os_posix/os_ftruncate.c4
-rw-r--r--src/third_party/wiredtiger/src/os_posix/os_open.c9
-rw-r--r--src/third_party/wiredtiger/src/os_posix/os_remove.c2
-rw-r--r--src/third_party/wiredtiger/src/os_posix/os_stdio.c22
-rw-r--r--src/third_party/wiredtiger/src/os_win/os_errno.c2
-rw-r--r--src/third_party/wiredtiger/src/os_win/os_fallocate.c32
-rw-r--r--src/third_party/wiredtiger/src/os_win/os_ftruncate.c4
-rw-r--r--src/third_party/wiredtiger/src/os_win/os_once.c4
-rw-r--r--src/third_party/wiredtiger/src/os_win/os_open.c8
-rw-r--r--src/third_party/wiredtiger/src/os_win/os_remove.c2
-rw-r--r--src/third_party/wiredtiger/src/reconcile/rec_write.c95
-rw-r--r--src/third_party/wiredtiger/src/schema/schema_create.c20
-rw-r--r--src/third_party/wiredtiger/src/schema/schema_open.c9
-rw-r--r--src/third_party/wiredtiger/src/schema/schema_truncate.c2
-rw-r--r--src/third_party/wiredtiger/src/session/session_api.c2
-rw-r--r--src/third_party/wiredtiger/src/session/session_dhandle.c85
-rw-r--r--src/third_party/wiredtiger/src/support/err.c34
-rw-r--r--src/third_party/wiredtiger/src/support/filename.c2
-rw-r--r--src/third_party/wiredtiger/src/support/hazard.c4
-rw-r--r--src/third_party/wiredtiger/src/support/scratch.c2
-rw-r--r--src/third_party/wiredtiger/src/support/stat.c13
-rw-r--r--src/third_party/wiredtiger/src/txn/txn.c22
-rw-r--r--src/third_party/wiredtiger/src/txn/txn_ckpt.c11
-rw-r--r--src/third_party/wiredtiger/src/txn/txn_log.c8
-rw-r--r--src/third_party/wiredtiger/src/txn/txn_recover.c30
-rw-r--r--src/third_party/wiredtiger/src/utilities/util_load.c145
-rw-r--r--src/third_party/wiredtiger/tools/wtstats/stat_data.py2
-rw-r--r--src/third_party/wiredtiger/tools/wtstats/wtstats.html.template33
136 files changed, 4691 insertions, 2610 deletions
diff --git a/src/third_party/wiredtiger/NEWS b/src/third_party/wiredtiger/NEWS
index 806c153a7ec..3705c7bce67 100644
--- a/src/third_party/wiredtiger/NEWS
+++ b/src/third_party/wiredtiger/NEWS
@@ -1,3 +1,95 @@
+WiredTiger release 2.5.3, 2015-04-22
+------------------------------------
+
+The WiredTiger 2.5.3 release contains important bug fixes.
+
+API and behavior changes:
+
+* Update configuration string parsing to always be case sensitive. See
+ upgrading documentation for more information.
+
+* Change the statistics cursor WT_CURSOR.reset method to re-load statistics
+ values. See upgrading documentation for more information.
+ refs WT-1533
+
+* Only align buffers on Linux if direct I/O is configured. See upgrading
+ documentation for more information.
+
+* Fixes to how and when idle handles are closed.
+ refs WT-1808, WT-1811, WT-1814
+
+* Add some new statistics related to cache usage.
+
+* Add new configuration strings to provide control of how often handles are
+ are reviewed for closure, and how long a handle needs to be idle before
+ it is closed. The option is via the wiredtiger_open API,
+ file_manager=(close_idle_time=30,close_scan_interval=10)
+
+* Add support for running WiredTiger command line utilities without logging.
+ refs WT-1732
+
+* Update the async configuration API to allow a minimum of 1. That is change:
+ async=(ops_max=X) so that the minimum value is now 1 the old minimum was 10.
+
+Bug fixes and other significant changes:
+
+* Fixes and improvements to Windows support.
+
+* Fix several bugs that prevent page eviction.
+ refs SERVER-16662, SERVER-17382, WT-1777
+
+* Fix a race when stopping eviction workers on shutdown.
+ refs WT-1698
+
+* Fix a bug where if the system crashes during create the base configuration
+ file could be left in an invalid state.
+ refs WT-1775, WT-1776, SERVER-17571
+
+* Fix cases where WT_SESSSION::truncate could return EBUSY when a schema level
+ operation is running - for example a checkpoint.
+ refs WT-1404, WT-1643
+
+* Fix a bug in logging - where we could fail to update the end of the log
+ when there is a gap in the log records.
+ refs WT-1766, SERVER-17569, SERVER-17613
+
+* Fix how we account for space used in the cache to be more accurate.
+refs SERVER-17424
+
+* Fix a bug where we could leak memory if opening a statistics cursor failed.
+ refs WT-1760
+
+* Fix a bug where a single page could consume a large portion of the cache.
+ Leading to cases where a small cache size could result in a hang.
+ refs WT-1759
+
+* Fix a bug in the eviction server that could cause a WT_PANIC. The issue
+ was encountered when the number of open handles exceeded the configured
+ number of hazard pointers.
+ refs SERVER-17551
+
+* Fix a bug parsing huffman configuration options that could lead to a segfault.
+
+* Fix accounting in btree statistics gathering, so page tracking is accurate.
+ refs WT-1733
+
+* Fix a memory leak in cache management, where a race during page split could
+ leave a key structure allocated.
+ refs WT-1582, WT-1747
+
+* Enhance checkpoint tracking code to allow eviction in files once the
+ checkpoint has finished processing them. This helps reduce the impact of
+ checkpoints on workloads with cache pressure.
+ refs WT-1745
+
+* Fix when aggregation is set on statistics fields. Fixes problems with
+ visualising statistics via wtstats graphs.
+ refs WT-1742
+
+* Change how checkpoints use empty blocks in on-disk files. Use a first-fit
+ algorithm.
+
+
WiredTiger release 2.5.2, 2015-03-23
------------------------------------
@@ -110,7 +202,7 @@ New features and API changes:
* Update the WiredTiger printlog command line utility to generate JSON that
can be parsed by third party tools.
- Refs #1438
+ refs #1438
* Change how we track memory allocation overhead. We used to apply a fixed
size for each allocation (which was difficult to track). The overhead
@@ -134,7 +226,7 @@ Bug fixes for bugs that could cause data inconsistency:
* Fix a bug in recovery where we could lose track of file identifiers and
apply updates to the wrong file.
- Refs SERVER-17142 SERVER-17131
+ refs SERVER-17142 SERVER-17131
* Fix several bugs in data consistency that could cause corruption when
restarting after a hard crash, including:
@@ -186,7 +278,7 @@ Other significant changes:
refs SERVER-16351
* Significant bug fixes when writing pages to disk, including:
- - Stop double count the on-disk header when choosing split points. Refs #1655
+ - Stop double count the on-disk header when choosing split points. refs #1655
- Fill the first and second pages as much as possible when splitting.
refs #1282
- Improve the algorithm for fitting large items onto pages when splitting.
@@ -197,7 +289,7 @@ Other significant changes:
* Fix several cases where WT_SESSION::verify and WT_SESSION::salvage could
return EBUSY unnecessarily.
- Refs #1404 SERVER-16457
+ refs #1404 SERVER-16457
* Fix a bug where racing between discarding and updating a tree returned an
error to the application.
diff --git a/src/third_party/wiredtiger/NEWS.MONGODB b/src/third_party/wiredtiger/NEWS.MONGODB
index 30963fb5558..831237ba149 100644
--- a/src/third_party/wiredtiger/NEWS.MONGODB
+++ b/src/third_party/wiredtiger/NEWS.MONGODB
@@ -1,16 +1,1154 @@
-3.0.1RC1, Mar 9 2015
----------------------
+3.2.0, Date TBA
+------------------
+
+commit 9166bca3d07d6592c1426c2c33bd56b6be0667e0
+Author: Alex Gorrod <alexg@wiredtiger.com>
+Date: Thu Apr 23 05:43:35 2015 +0000
+
+ Fix a deadlock related to handle locking.
+
+ If one thread does a __wt_session_release_btree of a handle at the same time
+ as another thread does a __wt_session_get_btree both wanting exclusive access
+ to the file. It was possible for one thread to get the dhandle list lock and
+ wait on the handle lock, which another thread held the handle lock waiting for
+ the handle list lock.
+
+ Temporarily fix by doing a try-lock on the __wt_session_get_btree path, long term
+ the solution is to get rid of the __conn_dhandle_open_lock method, and split get
+ and lock into two passes.
+
+ Refs BF-716
+
+commit 3e254079484ce35a3cb70c48478c69defdb8f012
+Author: Alex Gorrod <alexg@wiredtiger.com>
+Date: Thu Apr 23 05:42:08 2015 +0000
+
+ Fix a deadlock related to LSM. There are cases where closing a file with
+ an existing checkpoint could self deadlock.
+
+ Check in the meta tracking whether we've already visited a checkpoint handle.
+
+ Refs WT-716
+
+commit 1e80654b284b47b2dd9c302395ba908bf3a9b898
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Wed Apr 22 13:54:03 2015 -0400
+
+ __wt_config_concat() is a special case of __wt_config_merge(), replace
+ the three calls to __wt_config_concat() with __wt_config_merge().
+
+commit 1c412df22489dc3c18aa5390164ff68474293daf
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Wed Apr 22 13:29:05 2015 -0400
+
+ Instead of doing a configuration line merge to remove configuration
+ values we don't included, followed by a call to concatenate additional
+ configuration values, do a single merge call including all of the
+ configuration values we care about.
+
+ This change is slightly more defensive -- if a user tries to change one
+ of the configuration values we don't allow, we'll strip it, rather than
+ failing the load.
+
+ Clean up memory handling a bit so we don't leak memory, someday Coverity
+ will thank me.
+
+commit 6093e42b21d7e947d7bd053f6691aa1fed1a7f99
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Wed Apr 22 11:33:21 2015 -0400
+
+ Instead of rolling our own configuration removal code, use
+ __wt_config_merge(), reference WT-1898.
+
+commit 4322191125284717af1a0c6734b6ea123ca6c50d
+Author: Susan LoVerso <sue@wiredtiger.com>
+Date: Tue Apr 21 15:45:30 2015 -0400
+
+ Run recovery earlier. WT-1897
+
+commit 6155c465a519612e16cec5feb9fcf79fd0121d7f
+Author: Alex Gorrod <alexg@wiredtiger.com>
+Date: Tue Apr 21 13:15:06 2015 +1000
+
+ Revert a change to split large in-memory pages.
+
+ Refs WT-1890 WT-1896
+
+commit 610f629949726b16f938ded85188bb6a21820f7e
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Mon Apr 20 10:40:54 2015 -0400
+
+ Create a "clear a single walk" function and call it from __evict_clear_walks
+ and __evict_clear_all_walks, that way we can use the WT_WITH_DHANDLE macro,
+ and the comment about clearing the eviction reference before releasing the
+ page appears everywhere it should.
+
+commit 6ea949933ff9e68d220738d18fa72eb7a91aab65
+Author: Alex Gorrod <alexg@wiredtiger.com>
+Date: Mon Apr 20 16:50:13 2015 +1000
+
+ Fix coverity reports in test/format code.
+
+ CID 1295092: Integer handling issues (OVERFLOW_BEFORE_WIDEN)
+ /test/format/ops.c: 93
+ CID 1295091: Null pointer dereferences (REVERSE_INULL)
+ /test/format/ops.c: 489
+
+commit 3eceb85ce623dcce9273f7b722bb64f509dbe24d
+Author: Michael Cahill <michael.cahill@mongodb.com>
+Date: Mon Apr 20 16:15:41 2015 +1000
+
+ Clear session->dhandle so that future error messages don't dereference freed memory.
+
+commit 23ce8bae4d6507d6b6d599cb73a26a6c856cce98
+Author: Michael Cahill <michael.cahill@mongodb.com>
+Date: Mon Apr 20 15:48:29 2015 +1000
+
+ Clear eviction walks in all trees before the eviction server exits.
+
+commit a4bce0e0bc05d528f118b645d0d1915db00cdcf3
+Author: Michael Cahill <michael.cahill@mongodb.com>
+Date: Mon Apr 20 14:11:57 2015 +1000
+
+ Move the "cache is empty" check to where the cache is destoyed, not when the eviction server is exiting.
+
+commit c8fdd9c676c4a24bee6328a56cf7fd074cd045e0
+Author: Michael Cahill <michael.cahill@mongodb.com>
+Date: Mon Apr 20 13:25:36 2015 +1000
+
+ Shut down the eviction server before closing file handles to avoid a race.
+
+ refs WT-1893
+
+commit fb4a089fa71876232478e1181d821f29dedc0bd8
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Sun Apr 19 12:43:47 2015 -0400
+
+ Add the version to the configuration stack before reading the base
+ configuration file: that way it's always set, but it's always set
+ to the value of the base configuration file.
+
+commit 7aee6d5dabb7942aeb685e797b103c47c9337186
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Sun Apr 19 11:56:22 2015 -0400
+
+ Add support to the __wt_config_merge() call to remove strings we don't
+ want in the final configuration string, then strip out "create=" and
+ "encryption=(secretkey=)".
+
+commit 071d545f47ff4e4badcf9b8c066a44dac7fa2f20
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Fri Apr 17 11:39:23 2015 -0400
+
+ Instead of explicitly writing the version into the base configuration
+ file, append it to the configuration list.
+
+commit ab5443aa13d62c71423c128853735f699935c01e
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Fri Apr 17 11:35:13 2015 -0400
+
+ There's no reason to loop through each application-specified configuration
+ string separately, there's a call to check them all for the same key.
+
+ This also prevents a value being listed multiple times. Previously, if
+ you set buffer_alignment in the wiredtiger_open() configuration string,
+ but also in the WIREDTIGER_CONFIG environment variable, it would appear
+ twice in the base configuration file, with this change, it only appears
+ once.
+
+commit abb0bb80cc6dce29b8db61c6747c228c2701ae5a
+Author: Susan LoVerso <sue@wiredtiger.com>
+Date: Fri Apr 17 10:49:41 2015 -0400
+
+ Look for any number of non-data-changing log records to determine if we
+ can skip recovery. WT-1892
+
+commit e7f4ecd2055bab4d683eae119f8da95fa7acf21f
+Author: Alex Gorrod <alexg@wiredtiger.com>
+Date: Fri Apr 17 04:32:52 2015 +0000
+
+ Update API documentation to explain session usage.
+
+ This allows users to account for internal WiredTiger session handle
+ usage. We already allocate additional handles for those we use
+ unconditionally. This allows users to do specific calculations based
+ on their session_max setting.
+
+commit ee02428d1fdf1118c482688ec870a9da69bee45a
+Author: Michael Cahill <michael.cahill@mongodb.com>
+Date: Fri Apr 17 12:28:52 2015 +1000
+
+ If an LSM search-near operation lands on a deleted item, make a copy of the key before stepping to the next record.
+
+ refs WT-1891
+
+commit 54e856d57da291c5f84da6d0d0ab56280d9956dc
+Author: Susan LoVerso <sue@wiredtiger.com>
+Date: Thu Apr 16 12:22:31 2015 -0400
+
+ Remove use of unneeded tmp_fh. WT-1872
+
+commit 6a32905c397e57643b15e5a3038dbcb99a8a8dc8
+Author: Alex Gorrod <alexg@wiredtiger.com>
+Date: Thu Apr 16 06:18:31 2015 +0000
+
+ Fix a deadlock in LSM with schema operations.
+
+ There is special code in LSM to co-ordinate schema operations on
+ tables (drop, rename, etc). The code does a dance dropping and
+ acquiring locks, to allow utility operations to drain for the tree
+ while waiting for it to close.
+
+ We were doing the dance with the schema and dhandle list locks. We
+ needed to include the table lock, or parallel cursor opens could block:
+
+ The cursor open is waiting for the table lock:
+ __wt_spin_lock src/include/mutex.i:175
+ __schema_add_table src/schema/schema_list.c:26
+ __wt_schema_get_table src/schema/schema_list.c:98
+ __wt_curtable_open src/third_party/wiredtiger/src/cursor/cur_table.c:875
+ __wt_open_cursor src/session/session_api.c:240
+
+ The LSM table drop is waiting for the schema lock:
+ __wt_spin_lock src/include/mutex.i:175
+ __lsm_tree_close src/lsm/lsm_tree.c:107
+ __wt_lsm_tree_drop src/lsm/lsm_tree.c:943
+ __wt_schema_drop src/schema/schema_drop.c:174
+ __drop_table src/schema/schema_drop.c:124
+ __wt_schema_drop src/schema/schema_drop.c:176
+ __session_drop src/session/session_api.c:528
+
+commit 790646183cc5dd056bbf95c4563c20c51602a808
+Author: Alex Gorrod <alexg@wiredtiger.com>
+Date: Thu Apr 16 04:11:36 2015 +0000
+
+ Fix a bug in LSM where updates with overwrite could be skipped.
+
+ References JIRA BF-829
+
+ The issue was that we were not looking in all chunks of an LSM
+ tree before deciding whether to apply an update (insert or remove).
+
+commit 72ccd267fea9e491fcf3506e85191f71471cf51a
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Wed Apr 15 09:44:13 2015 -0400
+
+ A WT_CURSOR.next operation followed by a WT_CURSOR.search has the same
+ problem as referenced in #1887: the key returned to the application is
+ in WT_CURSOR_BTREE.tmp, and that WT_ITEM is used as temporary storage
+ during the search of a row-store leaf page, so the search can overwrite
+ the search key while it's still in use.
+
+ Change WT_CURSOR.next to return the ey in WT_CURSOR_BTREE.search_key.
+
+ Rename WT_CURSOR_BTREE.search_key to be WT_CURSOR_BTREE.row_key, it's
+ exclusive to row-store, and no longer exclusive to search.
+
+commit 50f8bedf616a4009068516df865374f688c76c70
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Tue Apr 14 12:52:32 2015 -0400
+
+ When row-search builds keys during leaf-page search, the last key built
+ is left in WT_CURSOR_BTREE.search_key, and if it's an exact match, that
+ buffer's contents are returned to the application (or, in the case of
+ cursor, the search key can be overwritten during the search, that is,
+ the searched-for-key, and the temporary buffer where we're building the
+ on-page keys for comparison, are the same.
+
+ Use the WT_CURSOR_BTREE.tmp buffer during the row-search instead of
+ WT_CURSOR_BTREE.search_key, and set WT_CURSOR_BTREE.search_key to the
+ returned key only when we've found an exact match and are returning to
+ our caller.
+
+ Making WT_CURSOR_BTREE.search_key and WT_CURSOR_BTREE.tmp pointers so
+ it's easy to swap back-and-forth makes this change noisy; note the new
+ __wt_btcur_open() function to set things up when a Btree cursor is first
+ created.
+
+ Reference #1887.
+
+commit 4cf1871ca6770b035a3b30aca29fa89dc11bfc18
+Author: Alex Gorrod <alexg@wiredtiger.com>
+Date: Tue Apr 14 06:30:41 2015 +0000
+
+ Make test/thread use WT_TEST not cwd, and add some more logging.
+
+commit b9e2e76511a24505014369aaf0e1ec286e9c473d
+Author: Michael Cahill <michael.cahill@mongodb.com>
+Date: Tue Apr 14 16:30:31 2015 +1000
+
+ Merge bulk cursor close with regular file cursor close: we were missing a decrement that kept bulk-loaded files pinned.
+
+commit a9e6a51f4ace1da5c73dd54c108d9a764fc5d8a4
+Author: Michael Cahill <michael.cahill@mongodb.com>
+Date: Tue Apr 14 14:37:12 2015 +1000
+
+ Fix some 64-to-32-bit conversion warnings.
+
+ include/cell.i|652 col 20| error: implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long long') to 'uint32_t' (aka 'unsigned int')
+ copy.v = unpack->v;
+
+ include/cell.i|705 col 24| error: implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long long') to 'uint32_t' (aka 'unsigned int')
+ copy.v = unpack->v;
+
+ reconcile/rec_write.c|2683 col 17| error: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'uint32_t' (aka 'unsigned int')
+ tmp->size = ((u_int)(28 + (btree)->block_header)) + len;
+
+commit 4528ddaec1d4b3382055e5c1c53fb7b1772133a2
+Author: Don Anderson <dda@ddanderson.com>
+Date: Mon Apr 13 15:05:16 2015 -0400
+
+ Generated tables for config subcategories now contains the name of the
+ method they are applicable for. Refs #1879.
+
+commit 1ac393ca9adce1f6d5e4bec035e7c49b32e5a722
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Mon Apr 13 13:00:57 2015 -0400
+
+ We can't pass the reconfiguration functions the base configuration array
+ because repeated calls will cause us to fallback to the default value.
+
+ For example:
+
+ conn->reconfigure(conn, "file_manager=(close_handle_minimum=37)");
+ conn->reconfigure(conn, "file_manager=(close_handle_minimum=38)");
+ conn->reconfigure(conn, "file_manager=(close_handle_minimum=39)");
+ conn->reconfigure(conn, "eviction=(threads_max=10)");
+
+ The reconfigure call for eviction will reset close_handle_minimum back
+ to its default value, because it will find the base value, not the
+ reconfigured value.
+
+ Try and make sure we don't mess this up again, use "cfg" instead of a
+ separately constructed local variable.
+
+commit ac37b924ac18f15726d3bd1984c61e89fbdd405e
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Mon Apr 13 07:17:18 2015 -0400
+
+ Search the strings in reverse order, that way the first hit wins
+ and we don't search the base set until there's no other choice.
+
+commit 110164271dc688c90a092c0c95d37feed2cec188
+Author: Alex Gorrod <alexg@wiredtiger.com>
+Date: Mon Apr 13 05:48:19 2015 +0000
+
+ Add functionality to drop files at the end of a wtperf run.
+
+ Helps figure out how long a drop takes.
+
+commit ed3158e71f0bd2716269a5771fd162b60b9a1cc0
+Author: daveh86 <howsdav@gmail.com>
+Date: Mon Apr 13 12:59:29 2015 +1000
+
+ Allow forced eviction of pages already queued for eviction
+
+commit 9c83351f63afc2e032e492e3030df4f3b1cd6883
+Author: Mark Benvenuto <mark.benvenuto@mongodb.com>
+Date: Sun Apr 12 19:02:32 2015 -0400
+
+ Disable fallocate on Windows since SetEndofFile does not
+ ignore truncation requests like POSIX fallocate.
+
+commit 61a7d81ad26db1f2bfb65258d9b8ae4a4ca25b34
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Sun Apr 12 12:44:05 2015 -0400
+
+ When using ftruncate as the file-extension call, we must use WT_FH.size
+ as the starting point of the extension (not offset), and we have to read
+ the size value after acquiring the lock that prevents racing with writers.
+
+ Split the extension functionality out into a separate function and
+ try to make it a little simpler to understand.
+
+ Reference #1871.
+
+commit f26f1c1c59d5cbbc8f5f543215d8fc636e7175d2
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Sun Apr 12 10:16:34 2015 -0400
+
+ The OS layer ftruncate() code sets the WT_FH file size, so when
+ ftruncate is used to extend the file, we skip over the bytes added to
+ the file during block allocation, and verify eventually fails because
+ there are unverified blocks in the file.
+
+ Reference #1871.
+
+commit c27c201de9c766aea5249d3eeb85b8103ea6cefc
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Sat Apr 11 09:16:11 2015 -0400
+
+ Possible approach to avoiding lockout when when sweeping files: before
+ closing the file, flush the file from the cache.
+
+ Add a new cache-operation, WT_SYNC_CLOSE_SWEEP, that walks the cache for
+ a handle and discards any clean pages it finds.
+
+ Add call to __wt_txn_update_oldest() before checking if a handle can be
+ swept.
+
+commit d20f20f1ac324030986b3ee23e1edf96486c92b4
+Author: Alex Gorrod <alexg@wiredtiger.com>
+Date: Fri Apr 10 05:59:04 2015 +0000
+
+ Update file_manager=(close_idle_time=,close_scan_interval=) max values.
+
+ The old maximum for both was 1000, the new value is 100 thousand. Setting
+ such large values is not recommended, but there is no internal limitation
+ on them.
+
+commit c36a3308f685d3b85efe9ac6ee0835f0974574b4
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Thu Apr 9 14:32:40 2015 -0400
+
+ Don't ignore sweeping entirely when we reach the open-file-count limit,
+ just ignore the in-use files.
+
+commit 46ef2555bbc51ce6453536e72202782be4949855
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Thu Apr 9 11:06:50 2015 -0400
+
+ Don't keep sweeping once we reach the minimum number of handles.
+
+commit 1fdfcc62726d25a7cceeeefff174a8e1bf9f9e67
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Thu Apr 9 12:39:03 2015 -0400
+
+ const: At condition ret == -1, the value of ret must be equal to -1.
+ CID 72082 (#1 of 1): Redundant test (DEADCODE)
+ dead_error_condition: The condition ret == -1 must be true.
+
+commit d04e3c25d46a5c4426e1c6d4881cd9e250014931
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Thu Apr 9 12:19:24 2015 -0400
+
+ Remove unnecessary atomic operation, fixing CID 69810 along the way.
+
+ CID 69810 (#1 of 1): Parse warning (PW.CONVERSION_TO_POINTER_ADDS_BITS)
+ 1. conversion_to_pointer_adds_bits: conversion from smaller integer to pointer
+
+commit d585bdab980508e590cf70508f053182c556d6f2
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Thu Apr 9 12:00:04 2015 -0400
+
+ CID 72073 (#1 of 1): Redundant test (DEADCODE)
+ dead_error_condition: The condition session != NULL must be true.
+
+commit 21907f9193e30f51a59fcbaddfbc46cb7732d3b7
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Thu Apr 9 11:52:13 2015 -0400
+
+ Remove unnecessary error labels, fixing SERVER-17948 along the way.
+
+ Coverity analysis defect 72088: Redundant test:
+ File: /src/third_party/wiredtiger/src/log/log.c
+ Function __log_decompress
+ /src/third_party/wiredtiger/src/log/log.c, line: 363
+ At condition "ret != 0", the value of "ret" must be equal to 0.
+
+commit a29f4d2f40eee784950147af848fdbf277328b7f
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Thu Apr 9 11:31:11 2015 -0400
+
+ SERVER-17954: Coverity analysis defect 72085: Redundant test
+ At condition "ret != 0", the value of "ret" cannot be equal to 0.
+
+commit 1298fd6db4f0c1d6133b3e547b2e2db51ec4a708
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Wed Apr 8 14:38:49 2015 -0400
+
+ Fix places where we were using the wrong link for traversing hash buckets.
+
+commit 7d0e5fe3dfa39f7ff377a1d4660bc2bc36dc0df8
+Author: Mark Benvenuto <mark.benvenuto@mongodb.com>
+Date: Wed Apr 8 10:19:33 2015 -0400
+
+ Enable test/fops for Windows, and add to CI
+
+ - Added Windows shim for gettimeofday
+
+commit c6270b677499525067d5d729a6fbdce6ad2f533a
+Author: Mark Benvenuto <mark.benvenuto@mongodb.com>
+Date: Wed Apr 8 13:28:41 2015 -0400
+
+ test/format for Windows
+ - Fixed an issue where fallocate was setting fh->size (incorrectly copied from ftruncate implementation)
+
+commit fac74b4665d6dfa3aebecf741c914fd1678fa628
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Wed Apr 8 08:47:06 2015 -0400
+
+ Rename file_manager.open_handles to file_manager.close_handle_minimum,
+ try and match existing naming for file_manager configuration options.
+
+commit 709cc8d7ac85d31aeae2387b192092910e6cf854
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Wed Apr 8 08:09:23 2015 -0400
+
+ Don't sweep unless there's a reason we need to close file handles.
+ Add a new configuration option, file_manager.open_handles that sets
+ a minimum number of file handles that must be open before sweep runs,
+ default is 250. Reference #1856, SERVER-17907.
+
+commit b59dfec2609847bb22bb48f4e7eede8c45312ce9
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Wed Apr 8 07:58:49 2015 -0400
+
+ Fix WT_STAT_ATOMIC_INCR, it didn't get upgraded to the new atomic
+ macros needed for the Windows port.
+
+commit 9f9fbb19ba19f90e4fc52d7568bd66427edb31e6
+Author: Pat Gunn <pgunn@mongodb.com>
+Date: Tue Apr 7 22:56:55 2015 -0400
+
+ Add a Python ex_stat example
+
+commit b79dcdebf0b1987b59fa70e50c8c61e5e0a64e64
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Tue Apr 7 11:52:12 2015 -0400
+
+ If the underlying split buffer grows, existing boundary references may
+ point into freed memory, switch the boundary "first byte" field from a
+ pointer to a buffer offset to avoid the problem, reference #1852.
+
+commit 27b37db17e70ef73432e1fb48c530246fd753670
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Mon Apr 6 07:27:25 2015 -0400
+
+ Fix a broken line, #1846.
+
+commit dbb58f0b8f7b26a70f71f6c67dba93c966b162e0
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Sun Apr 5 12:24:31 2015 -0400
+
+ Search the currently pinned page first in WT_CURSOR::search-near,
+ before descending the tree from the root.
+
+commit 353093e16eb4a955c4f2e2f4245577cd9156955f
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Sun Apr 5 08:36:57 2015 -0400
+
+ WT_CURSOR::search() near current position.
+
+commit 96022e89162f746d8252db637a0305aed1965cd1
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Sat Apr 4 10:09:17 2015 -0400
+
+ Inside wiredtiger_open(), we may have allocated scratch memory when using
+ the dummy session or the subsequently created real session, and we don't
+ want to tie down memory for the rest of the run in either of them.
+
+commit 928409dbb64e222f722c5f6692f1d7638ce9e617
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Fri Apr 3 20:37:45 2015 -0400
+
+ Use scratch buffers in wiredtiger_open(), but clear them out when we're
+ done (we have no idea what other functions are using scratch buffers when
+ called via wiredtiger_open(), so just make them work).
+
+commit d7e2351db8b855af3b5b8860e000528ac99d57a4
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Thu Apr 2 19:44:16 2015 -0400
+
+ Windows doesn't have <x86intrin.h>, it does have <intrin.h> which is
+ included by <msvc.h>.
+
+commit d3dacbffd2a87ea79ec05fa569bdd5d34f90254c
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Thu Apr 2 13:06:19 2015 -0400
+
+ Make --with-spinlock=pthread_logging option compile again.
+
+ Remove the WT_SESSION_IMPL argument to the fprintf, vfprintf, fflush and
+ fclose functions, there are places we want to use it that don't have
+ session handles, and it's not currently needed. Clean up error handling
+ in the vfprintf function.
+
+commit fccb479aa9b97fb22d9ec2827c94ba49faa5ab79
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Thu Apr 2 09:58:52 2015 -0400
+
+ Gcc 4.1 can't figure out that copy.v can't be used uninitialized.
+ Inline a length check in the short-key/value case to avoid it.
+
+commit dca44d7f2762052bf675a5edc0a2f63534c85cf1
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Thu Apr 2 08:55:41 2015 -0400
+
+ Coverity 44262 (#1 of 1): Parse warning (PW.MISSING_INITIALIZER_ON_CONST)
+ 1. missing_initializer_on_const: const variable "__clear" requires an
+ initializer.
+
+ This isn't a bug, but we only use WT_CLEAR_INLINE() in a single place
+ in WiredTiger, and we can probably do better by not clearing the unpack
+ structure at all.
+
+commit 0b60cfdfa3912d3048e3c5dbce56db7745c20964
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Wed Apr 1 17:43:31 2015 -0400
+
+ Do a binary search of the base configuration options when checking
+ configuration at the API layer instead of a linear walk.
+
+commit 078cb46916b55c254abe1a966a2413410a5f6174
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Wed Apr 1 15:57:04 2015 -0400
+
+ Use the existence of the <x86intrin.h> #include file to configure the
+ x86 vector instructions. Some old versions of gcc don't have it, but I
+ believe they're old enough that we don't care.
+
+commit 684fd71475cbc6b15290945af0160fac0313ad6b
+Author: Susan LoVerso <sue@wiredtiger.com>
+Date: Wed Apr 1 15:44:42 2015 -0400
+
+ Reset eol if we continue. Return NOTFOUND if checksum mismatch. #1840
+
+commit 507a3005b3bc4f9cc69153da5acb534702b734b8
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Wed Apr 1 09:40:36 2015 -0400
+
+ Don't #include <x86intrin.h>, gcc 4.1.2 doesn't have it, use
+ <emmintrin.h> instead.
+
+commit 9c29e0f13268c03038704372c069353c81357791
+Author: Susan LoVerso <sue@wiredtiger.com>
+Date: Tue Mar 31 16:49:47 2015 -0400
+
+ Modify log_scan callback args to send in next LSN. #1837
+
+commit 76cba586685828fc3a8598b48e70c7614818859c
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Tue Mar 31 12:11:04 2015 -0400
+
+ Coverity 1199719 (#1 of 1): Dereference after null check (FORWARD_NULL)
+ var_deref_op: Dereferencing null pointer "ref".
+
+commit f9edf738c6075601bb2885cd2aba3ea4a0134b5e
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Tue Mar 31 12:00:50 2015 -0400
+
+ Coverty 1129071 (#1 of 1): Dereference before null check (REVERSE_INULL)
+ check_after_deref: Null-checking "conn" suggests that it may be null,
+ but it has already been dereferenced on all paths leading to the check.
+
+commit 4317a14ffead9029c6524c3a5013e1d91b2f0a02
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Tue Mar 31 11:47:50 2015 -0400
+
+ Coverity 1129018, 1129019, 1129020, 1129021: Side effect in assertion
+ (ASSERT_SIDE_EFFECT).
+
+commit a5bb492b41e4121ff69776ba70072585aef405af
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Tue Mar 31 07:42:01 2015 -0400
+
+ When looking for the next-larger item (__col_insert_search_gt), stay
+ at the same level if the checked record is equal to the searched for
+ record (can't happen in the current use of this code, but it's the
+ correct thing to do in a skiplist).
+
+ When looking for the next-smaller item (__col_insert_search_lt), the
+ search still has to be greater-than, reference #1835.
+
+commit f2055cab87688cbb26da659c8038dbb4f032eb30
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Tue Mar 31 07:41:40 2015 -0400
+
+ Add a __setitem__ to cursors in the Python API.
+
+commit 674170067c4016455e78d14ec24e3641d047f1c4
+Author: Michael Cahill <michael.cahill@wiredtiger.com>
+Date: Tue Mar 31 14:26:00 2015 +1100
+
+ Add a __setitem__ to cursors in the Python API, remove lots of boilerplate c.set_key ... c.set_value ... c.insert code.
+
+commit 4790f13cd8191d834f40c97a0c00d729f91acd1b
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Mon Mar 30 09:52:34 2015 -0400
+
+ async_max_queue: collection statistic, aggregate doesn't apply, don't
+ clear.
+
+ cache_eviction_maximum_page_size: collection statistic, aggregate
+ doesn't apply, don't clear.
+
+ various txn_checkpoint_XXX statistics: collection statistic, aggregate
+ doesn't apply
+
+ various Btree maximum size statistics: aggregate the maximum value,
+ rather than doing no aggregation at all.
+
+ lsm_chunk_count: aggregate the count of LSM chunks.
+
+ Add syntax checking code to stat.py to disallow aggregation flags
+ for connection-level statistics.
+
+ Reference #1742.
+
+commit 0c9f1341e2fdb93d3bd4d3fc58176f6ad169825e
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Sat Mar 28 13:15:53 2015 -0400
+
+ When we find a record in the slot's update skiplist, but then want to
+ jump past the rest of the deleted records, we have to adjust based on
+ the starting record of the slot, use the page's repeat array to find
+ that starting record.
+
+ Another run at the __col_insert_search_gt (the greater-than skiplist
+ search), hopefully it's finally correct.
+
+commit b5edc28c2588a0257daf50f43db7b5bf335c7ef5
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Fri Mar 27 14:40:36 2015 -0400
+
+ Cleanup, fix, simplify the cursor-insert-greater-than search, add a
+ corresponding less-than search and hook it into the WT_CURSOR.prev
+ function. This runs better than before, but there are still problems.
+
+commit c7cdb2e1f1960bc9432185df8fb7b507198889ff
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Fri Mar 27 10:38:17 2015 -0400
+
+ The gaps in column-store tables can be large enough we spend too much
+ time looping through the "deleted" records when writing out the page,
+ skip the boring part. Reference #1807.
+
+commit 488d064b45fb194ea2f3b9e2187214fb44b86a5f
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Fri Mar 27 10:07:16 2015 -0400
+
+ There can be huge gaps in the variable-length column-store name space
+ appearing as deleted records. If more than one deleted record, do the
+ work of finding the next useful record. Reference #1807.
+
+commit e1ee6432fb5a948ebd5cafe2ba9c2b79411458f5
+Author: Mark Benvenuto <mark.benvenuto@mongodb.com>
+Date: Thu Mar 26 11:31:27 2015 -0400
+
+ Revert "Make LZ4 default off in scons builds for now."
+
+ This reverts commit 67b71e1eaad1a5825f99a415d9851976f11dbfee.
+
+commit 003e6c3598408c7670f65a8720622c38fdaf148d
+Author: Mark Benvenuto <mark.benvenuto@mongodb.com>
+Date: Thu Mar 26 11:17:57 2015 -0400
+
+ Use Standard C type uint64_t for zlib
+
+commit e12b9e0b005da7364330f4d3409256ded26ba90d
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Thu Mar 26 18:31:15 2015 -0400
+
+ Add checks for Windows builds: _M_AMD64 and _MSC_VER.
+
+commit 1b1371c83e3e78feab0921c88a63d960288d58e0
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Thu Mar 26 11:09:28 2015 -0400
+
+ __wt_btree_size_overflow uses the page's WT_PAGE_INDEX, wrap the call
+ in WT_ENTER_PAGE_INDEX/WT_LEAVE_PAGE_INDEX.
+
+commit e4c9309756f8bcda4bd7b9be5232887cdea377be
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Thu Mar 26 10:57:33 2015 -0400
+
+ Instead of asserting split-generation is set in WT_INTL_FOREACH_BEGIN,
+ move the test into the WT_INTL_INDEX_COPY macro (which is called by
+ WT_INTL_FOREACH_BEGIN), WT_INTL_INDEX_COPY is the code that reads the
+ actual WT_PAGE_INDEX value: if a page can split, it's not safe to look
+ at anything a WT_PAGE_INDEX references, and we have code that uses a
+ WT_PAGE_INDEX reference outside of the WT_INTL_FOREACH_BEGIN macro.
+
+ Add two versions of the WT_INTL_INDEX_COPY macro, WT_INTL_INDEX_GET
+ which checks the split-generation, and WT_INTL_INDEX_GET_SAFE which
+ doesn't.
+
+commit 8bdb29fed9ef4a124e8c1c3c1a6c031f4ecbe130
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Thu Mar 26 09:34:19 2015 -0400
+
+ Remove safe version of the WT_INTL_FOREACH_BEGIN macro (it was only used
+ in a single non-DIAGNOSTIC code path), wrap child page-index walk during
+ a deepen split with WT_ENTER_PAGE_INDEX/WT_LEAVE_PAGE_INDEX, reference
+ issue #1799.
+
+commit 87326b721a443936e118e72e58e4f51e14845132
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Wed Mar 25 21:44:02 2015 -0400
+
+ Use the size of the vector chunk to decide if we'll execute vector
+ instructions, rather than some specific length.
+
+commit fc4eea6e3eb39cdf1b147d6a7b65af4f0d08f5c1
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Wed Mar 25 18:20:23 2015 -0400
+
+ Instead of using _mm_cmplt_epi8 when we find a mismatch, fall into the
+ slow comparison code.
+
+commit a29b65429f2963bb3e3ff8ca4416f16ae8ca2e52
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Wed Mar 25 16:28:34 2015 -0400
+
+ Cleanup #includes so the whole tree builds.
+
+commit 35b436dfd47895cc19310095f4f4e5f3b9b86501
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Mon Mar 23 17:51:50 2015 -0400
+
+ We don't have to reinitialize userp and treep when falling into the
+ slow/remainder loop, they're correctly positioned.
+
+commit a307a61135394d5006bd3257325bffd82ea80f21
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Mon Mar 23 17:14:30 2015 -0400
+
+ Don't call _mm_cmplt_epi8() until we don't compare equal.
+
+commit a609c82bfa6fbf80cd5fb853e1d97c16878a0180
+Author: Susan LoVerso <sue@wiredtiger.com>
+Date: Mon Mar 23 15:25:23 2015 -0400
+
+ Set checkpoint LSN to existing log record. #1700
+
+commit 076336e9b244664440777cfeab9fe0d925d4c25e
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Mon Mar 23 10:13:37 2015 -0400
+
+ Integrate Sasha's vectorized search code.
+
+
+3.0.2, Mar 26 2015
+------------------
+
+commit 17bd2356a5b17893e626749be399fb8fda23db1e
+Author: Mark Benvenuto <mark.benvenuto@mongodb.com>
+Date: Fri Mar 20 01:07:59 2015 -0400
+
+ Use beginthreadex, and ensure we use the correct C calling conventions in all callbacks
+
+commit 269e847ad64dd12dfcadb58f84f905069e5b8dce
+Author: Michael Cahill <michael.cahill@wiredtiger.com>
+Date: Wed Mar 25 15:47:46 2015 +1100
+
+ Split sweep into two passes: one that walks the handle list without locking and finds candidate handles to close, and a second pass holding the handle list lock that removes dead handles.
+
+ refs #1814, #1811, #1808
+
+commit 065a435f6b1d1b3fcb640d59c3109d0c2e24d308
+Author: Alex Gorrod <alexg@wiredtiger.com>
+Date: Tue Mar 24 16:53:28 2015 +1100
+
+ Add statistics to track internal/overflow/leaf pages in cache.
+
+ It is often useful to know if a cache is full of internal pages. I could have added page count tracking, but byte count tracking seems more useful (enough to justify the extra performance overhead).
+
+commit f4616895f1ac35aaa50fc1a68e0c6dd9e0cf7717
+Author: Michael Cahill <michael.cahill@wiredtiger.com>
+Date: Mon Mar 23 17:00:15 2015 +1100
+
+ If a walk for pages to evict ends on a page requiring forced eviction, don't keep it pinned.
+
+ refs SERVER-16662, SERVER-17382
+
+commit 49ddcca712db3a50c390f48b518f0835f28bc9d4
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Sat Mar 21 16:17:51 2015 -0400
+
+ Separate out the code to flush a file handle and rename the file into place.
+
+commit a0e88c41781c5b7ea0155fb57a58c91a964af4a3
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Fri Mar 20 19:08:45 2015 -0400
+
+ If the underlying FILE was opened for writing, flush and fsync it during close.
+
+commit 8d918f0ef8588056ecf729e72ffdd8bc0a79fd6c
+Author: Michael Cahill <michael.cahill@wiredtiger.com>
+Date: Fri Mar 20 22:54:13 2015 +1100
+
+ Fix a race closing eviction helper threads: close the main eviction thread first, so the number of helper threads can be read safely.
+
+ Partial fix for #1698
+
+commit 294b0bce296bebf9790418e5575f59be5bec000c
+Author: Michael Cahill <michael.cahill@wiredtiger.com>
+Date: Fri Mar 20 17:19:28 2015 +1100
+
+ Only align buffers on Linux if direct I/O is configured. Clarify why we round up the allocation size: it usually won't matter because we allocate multiples of the alignment size anyway.
+
+commit ee7456799277e19ff4771de79ac4eafac43aff9b
+Author: Mark Benvenuto <mark.benvenuto@mongodb.com>
+Date: Thu Mar 19 16:16:15 2015 -0400
+
+ Visual Studio 2015 Preview support
+
+commit 9c60b462a25a36915207dde240579c5aa673f2c7
+Author: Alex Gorrod <alexg@wiredtiger.com>
+Date: Fri Mar 20 00:09:42 2015 +0000
+
+ Update the eviction server to not set stuck if it isn't full.
+
+ When only looking for pages to force out, the cache isn't really stuck. The trouble is that if we set stuck the eviction server doesn't clear walks which can lead to it always holding a reference t othe page we (really) want to evict.
+
+ refs #1777
+
+commit f0138353697d8706bd1f26e83b9fff8f4e83af8d
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Thu Mar 19 13:04:17 2015 -0400
+
+ Create the base configuration file in a temporary file and rename it into place so a crash can't result in a corrupted base configuration file.
+
+ refs #1775, #1776, SERVER-17571
+
+commit 2e15cd6fc322c90c763394c52056bfebd4153aad
+Author: Michael Cahill <michael.cahill@wiredtiger.com>
+Date: Thu Mar 19 10:25:31 2015 +1100
+
+ Avoid EBUSY errors from truncate caused by checkpoints.
+
+ refs #1643
+
+commit 3188352d623de85803db3dd6e5b5188822e2db4f
+Author: Michael Cahill <michael.cahill@wiredtiger.com>
+Date: Wed Mar 18 13:00:53 2015 +1100
+
+ If the session-level attempt to lock a handle gets EBUSY, fall back to the slow path. The sweep server relies on there being a retry loop if an exclusive operation such as verify conflicts with a sweep.
+
+ refs #1404
+
+commit 5d8641568ac27e21d6671cb646a818708eb0aa28
+Author: Susan LoVerso <sue@wiredtiger.com>
+Date: Tue Mar 17 15:38:57 2015 -0400
+
+ Set the end of the log if we find a zero hole.
+
+ refs #1766, SERVER-17569, SERVER-17613
+
+commit f38e325f87d94f178c932328632857361fc3c92c
+Author: Alex Gorrod <alexg@wiredtiger.com>
+Date: Tue Mar 17 04:30:11 2015 +0000
+
+ Implement review feedback. The new configuration strings are:
+
+ file_manager=(close_idle_time=30,close_scan_interval=10)
+
+ Update the sweep test to take advantage of new configurations and
+ shorten the runtime.
+
+commit 87dba78b65bc869c426363d86d02134aa8f8f2ac
+Author: Michael Cahill <michael.cahill@wiredtiger.com>
+Date: Tue Mar 17 14:39:49 2015 +1100
+
+ Round up the "in-memory size" for WT_UPDATEs to a multiple of 32. They are a very common case, and for tiny updates, this seems to to a better job of matching tcmalloc's behavior at least.
+
+ refs SERVER-17424
+
+commit d277a088385401ff6e6664dd688a2fcab2ac4087
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Mon Mar 16 11:42:56 2015 -0400
+
+ Sanity check all splits for at least 100 keys on the page, if there are huge keys and a too-small cache, there's nothing to be done.
+
+commit d4aa136a20c9baf151c3185058ce089679e0de0e
+Author: Alex Gorrod <alexg@wiredtiger.com>
+Date: Mon Mar 16 06:10:12 2015 +0000
+
+ Ensure we free memory when statistics cursor open fails.
+
+ refs #1760
+
+commit 66622ac33357d53212ddfa362fdf3c6b439bf34b
+Author: Alex Gorrod <alexg@wiredtiger.com>
+Date: Mon Mar 16 05:55:45 2015 +0000
+
+ Update the split deepen sanity check. Allow a page that is using more than 1/4 of the cache to be split.
+
+ refs #1759
+
+commit f99114f785985d152ba8ddfa735771574e6bff5d
+Author: Michael Cahill <michael.cahill@wiredtiger.com>
+Date: Mon Mar 16 16:43:27 2015 +1100
+
+ Fix the search for a free hazard pointer slot. Previously, it gave up early once all slots were allocated, even if they weren't all in use.
+
+commit 15fe04460c1f057811e0f3e02feb249c710d05ce
+Author: Michael Cahill <michael.cahill@wiredtiger.com>
+Date: Mon Mar 16 16:40:49 2015 +1100
+
+ Track the number of hazard pointers active in the eviction server. Don't start a new walk if we are close to the limit.
+
+ refs SERVER-17551
+
+commit e6d8c8a56c4dc83f206d43fcaa21902b35b1e4e6
+Author: Alex Gorrod <alexg@wiredtiger.com>
+Date: Mon Mar 16 05:20:22 2015 +0000
+
+ Add a new statistic tracking range of IDs pinned by a transaction.
+
+ refs #1746
+
+commit f954ab6b3fb6a51ecf3cf625cd3f5c5f818e0fde
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Sat Mar 14 12:31:00 2015 -0400
+
+ Pass a allocated memory size to __wt_page_inmem().
+
+commit 308dc500adcde7b62c8dbb9aa0fb401795445546
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Sat Mar 14 10:51:21 2015 -0400
+
+ Don't drop core if duplicate symbols are detected (caller's table gets free'd twice).
+
+commit dc19643859063a03b985d97e2f24b1262ec4b15d
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Fri Mar 13 15:35:28 2015 -0400
+
+ Use SCNxxx #defines in sscanf() calls, not PRIxxx.
+
+ We can't cast a pointer to a WT_LSN.offset to a pointer to a different type, we can't know WT_LSN.offset is the same size as that type.
+
+commit 99a992ed5207822ce2bc2fd69cb5b37408e6080f
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Fri Mar 13 14:17:34 2015 -0400
+
+ Switch sscanf from SCNu46 to SCNi64 so we handle both hexadecimal and integer symbol/frequency values
+
+ Add testing support for out-of-range symbol/frequency values.
+
+ refs #1536
+
+commit 48a6f6e76aafbf7b33dbb22325ddb4e8e27603a1
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Fri Mar 13 10:04:06 2015 -0400
+
+ Fix problems with configuration value parsing, break out the Huffman configuration file parsing code into a single routine.
+
+commit e7ef6d0c3d107f374de9924d981d731fe36fb4ec
+Author: Alex Gorrod <alexg@wiredtiger.com>
+Date: Fri Mar 13 16:32:37 2015 +1100
+
+ Update memory allocation accounting for new pages and realloc.
+
+ They used to not always account for alignment overhead.
+
+commit 1e97f9730a6fd70c03784e292cb0435c8fb82354
+Author: Don Anderson <dda@ddanderson.com>
+Date: Thu Mar 12 14:02:24 2015 -0400
+
+ Fix to track deleted cells. Remove unused vars.
+
+commit 5778e4098862665d4cdaf2cda3ef40d47d951efb
+Author: Alex Gorrod <alexg@wiredtiger.com>
+Date: Thu Mar 12 16:35:27 2015 +1100
+
+ Add ability to configure sweep server timings via API.
+
+ Still needs some test code.
+
+commit a1c9f8f8833482c9773fc30b7b9a7b5f1ab09014
+Author: Don Anderson <dda@ddanderson.com>
+Date: Wed Mar 11 22:48:12 2015 -0400
+
+ Made some adjustments to stats so that the btree entries is an accurate total for row and column stores. Entries that appear in internal pages (pointing to leaf pages or other internal pages) are no longer counted. Added and modified tests to check the number of btree entries reported by stats against the number of KV pairs expected to be in btree.
+
+ refs #1733
+
+commit 6d7c061a8292021195b32260a8b41d3e92e1958f
+Author: Susan LoVerso <sue@wiredtiger.com>
+Date: Wed Mar 11 11:11:57 2015 -0400
+
+ Support no-logging mode in wt command for debug.
+
+ refs #1732
+
+commit 4a802bd592b6c8506b07900bf89a9d9fe53cfc25
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Wed Mar 11 09:30:39 2015 -0400
+
+ If the application only has 1 outstandin async operation at a time, we won't let them specify that. Change the minimum ops_max value to 1, but set the minimum maximum bound in the code to 10 as before.
+
+commit 3a412a2371e80ed9e26e546b6fe3c09d2d4e4091
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Wed Mar 11 09:29:55 2015 -0400
+
+ If the application re-uses a WT_SYNC_OP structure, we assert: return EINVAL instead, it's easier to debug than a core dump.
+
+commit 16119f98fee9525bf1990ccbcc979b9f08a8b000
+Author: Michael Cahill <michael.cahill@wiredtiger.com>
+Date: Wed Mar 11 20:24:20 2015 +1100
+
+ Don't cache an ikey before winning the race to split into a parent.
+
+ refs #1582
+
+commit 4d0b4093e3d3c9fa0be2bbb01467579f05deddc5
+Author: Alex Gorrod <alexg@wiredtiger.com>
+Date: Wed Mar 11 03:44:22 2015 +0000
+
+ Update visibility check to know about checkpoints.
+
+ This should allow us to evict more pages while a checkpoint is in progress. We can evict dirty pages from a file once the checkpoint is finished in that file. Similarly for the row store specific obsolete update check.
+
+ refs #1745
+
+commit 272daddb3734cd196cd303df4271f7e9e8f00cd3
+Author: Alex Gorrod <alexg@wiredtiger.com>
+Date: Wed Mar 11 02:55:56 2015 +0000
+
+ Add a global checkpoint generation and track it per data handle. Not yet used, but will be used to allow more eviction during checkpoints.
+
+ refs #1745
+
+commit 89db28287d7b212efb31203eca253fbf144ea207
+Author: Alex Gorrod <alexg@wiredtiger.com>
+Date: Tue Mar 10 07:19:59 2015 +0000
+
+ Mark statistics with the right aggregation flags (specifically cache dirty tracking and log preallocation). This helps wtstats graph generator.
+
+ refs #1742
+
+commit e51cc35a88ed497f911a25fec9f4bfcc6617d6a2
+Author: Mark Benvenuto <mark.benvenuto@mongodb.com>
+Date: Mon Mar 9 15:40:59 2015 -0400
+
+ SERVER-17471: Use uint64_t instead of long since long is compiler specific
+
+commit 105903c1beb0d16b40e243ed3624417c4fa0702c
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Mon Mar 9 12:19:50 2015 -0400
+
+ Remove pockets of case-sensitivity for configuration strings.
+
+commit 1e8c2b89de09462253231213329674b8769d11fe
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Sun Mar 8 13:05:51 2015 -0400
+
+ Change the statistics cursor WT_CURSOR.reset method to re-load statistics values.
+
+ refs #1533
+
+commit 769dc5976fe0d2448fb4fde511c5bc29eea39bfb
+Author: Keith Bostic <keith@wiredtiger.com>
+Date: Tue Mar 3 16:45:09 2015 -0500
+
+ Change checkpoints to do first-fit allocation when we start writing the actual checkpoint blocks, that way if we delete significant space, the checkpoint blocks won't prevent file truncation.
+
+
+3.0.1, Mar 9 2015
+-----------------
commit d654795bb763b95d14604b9b65d09ae79b8ee5b6
Author: Alex Gorrod <alexg@wiredtiger.com>
Date: Mon Mar 9 05:35:33 2015 +0000
Add a test case for checkpoint consistency.
-
+
We recently fixed a bug where updating a page after the write leaves phase of a checkpoint had completed, then either checkpointed again or closed the database. We would end up with inconsistent data. That was the case because we weren't marking trees dirty all the time.
-
+
This test case reproduces the scenario so we don't reintroduce the failure.
-
+
refs #1735 SUPPORT-1248, SERVER-17506
commit 0315ee75f712ed0ccddca0616339de93b17835a3
@@ -24,7 +1162,7 @@ Author: Michael Cahill <michael.cahill@wiredtiger.com>
Date: Mon Mar 9 08:32:50 2015 +1100
When skipping a dirty page during a checkpoint, make sure the tree is marked dirty.
-
+
refs SUPPORT-1248, SERVER-17506
commit 8382d14f32efc53b19aecd596cab3ba0d682b22d
@@ -46,9 +1184,9 @@ Author: Alex Gorrod <alexg@wiredtiger.com>
Date: Thu Mar 5 05:46:15 2015 +0000
Don't allow LSM bloom create to block waiting for space in the cache.
-
+
We are only accessing one page at a time, and allowing the bloom create to block can lead to LSM not making progress.
-
+
Refs: #1720
commit 5285b768de3237b4379f1526176efdeb55860971
@@ -56,7 +1194,7 @@ Author: Michael Cahill <michael.cahill@wiredtiger.com>
Date: Thu Mar 5 16:15:08 2015 +1100
Remove the special "discard" path for trees marked clean: always go through eviction, which checks page modify flags. This may mean additional writes to internal pages when discarding a tree, but means that if a discard stops part-way through, the remaining in-memory tree has not lost any context.
-
+
refs SUPPORT-1248, SERVER-17510
commit 00edf7a47115923bc9f3eaa7eee84c9f7d6b0d77
@@ -64,7 +1202,7 @@ Author: Michael Cahill <michael.cahill@wiredtiger.com>
Date: Thu Mar 5 16:15:07 2015 +1100
If a page is split by eviction, mark the tree dirty to avoid having dirty pages in a tree marked clean.
-
+
refs SUPPORT-1248
commit 57d3eba53fb91a0287374b9642b7cd4ef644854a
@@ -92,7 +1230,7 @@ Author: Alex Gorrod <alexg@wiredtiger.com>
Date: Tue Mar 3 03:37:18 2015 +0000
Fix a bug in the reconfigure API related to shared cache quotas.
-
+
While fixing the bug simplify the code flow for reconfigure and caches/shared caches.
refs #1712
@@ -110,7 +1248,7 @@ Author: Alex Gorrod <alexg@wiredtiger.com>
Date: Mon Mar 2 14:18:37 2015 +1100
Allow memory_page_max to be at most 1/4 of the cache size not 1/2.
-
+
If we let a single page grow to half the cache size, it's too easy for the cache to get pinned full if it is tiny to start with.
commit b036921625e415bb66ac458922b81a9fae07740b
@@ -138,7 +1276,7 @@ Author: Michael Cahill <michael.cahill@wiredtiger.com>
Date: Fri Feb 27 16:59:35 2015 +1100
If we encounter a dirty page when closing a clean tree, switch to checkpointing.
-
+
refs SERVER-17319, #1643?, #1404?
commit bfcf5987b2b6f08d931d620330aed46837e3a8c2
@@ -146,9 +1284,9 @@ Author: Michael Cahill <michael.cahill@wiredtiger.com>
Date: Thu Feb 26 16:32:09 2015 +1100
Add some paranoia to LSM around transaction checks: make sure we have allocated an ID before using it for anything.
-
+
Recheck switch transactions before doing update checks in old chunks.
-
+
refs #1641, #1701, #1702
commit da0bc67c821282e9fd0da725279811b59b25a675
@@ -156,7 +1294,7 @@ Author: Michael Cahill <michael.cahill@wiredtiger.com>
Date: Thu Feb 26 16:32:09 2015 +1100
Add some paranoia around setting row-store internal keys.
-
+
refs #1582
commit 5ea91f6ed0e0677530c5ab8215f81eb48ea307b8
@@ -164,7 +1302,7 @@ Author: Alex Gorrod <alexg@wiredtiger.com>
Date: Thu Feb 26 04:51:25 2015 +0000
Several optimizations to large page eviction:
-
+
* Don't update the read generation on page in if it's set to oldest.
* Clear the walk positions before the eviction server sleeps.
* If only looking for pages that would block add them all to the queue.
@@ -175,9 +1313,9 @@ Author: Alex Gorrod <alexg@wiredtiger.com>
Date: Thu Feb 26 02:08:36 2015 +0000
Fix a bug in checkpoint, where it could get an EBUSY return.
-
+
The case that could return EBUSY was when checkpointing with a specific target, while that target was open exclusively or for a bulk load.
-
+
Refs #1404 #1589
commit 392a540deec817c5d6738b8e848a68882df3ac8a
@@ -191,7 +1329,7 @@ Author: Alex Gorrod <alexg@wiredtiger.com>
Date: Tue Feb 24 23:55:20 2015 +0000
Handle the case where a large record pushes us over a page boundary and we spill across two pages correctly. The previous fix could let us span additional space.
-
+
Fix another bug in the fixup code - ensure there is enough space in the temporary buffer when fixing up after the fist page is full.
refs #1697
diff --git a/src/third_party/wiredtiger/README b/src/third_party/wiredtiger/README
index f304bade13e..8f05afd0a56 100644
--- a/src/third_party/wiredtiger/README
+++ b/src/third_party/wiredtiger/README
@@ -1,15 +1,21 @@
-WiredTiger 2.5.3: (March 26, 2015)
+WiredTiger 2.6.0: (April 22, 2015)
-This is version 2.5.3 of WiredTiger.
+This is version 2.6.0 of WiredTiger.
WiredTiger release packages and documentation can be found at:
http://source.wiredtiger.com/
+WiredTiger uses JIRA for issue management:
+
+ http://jira.mongodb.org/browse/WT
+
+Please do not report issues through GitHub.
+
Information on configuring, building and installing WiredTiger can be
found at:
- http://source.wiredtiger.com/2.5.3/install.html
+ http://source.wiredtiger.com/2.6.0/install.html
WiredTiger licensing information can be found at:
diff --git a/src/third_party/wiredtiger/RELEASE_INFO b/src/third_party/wiredtiger/RELEASE_INFO
index e19e825e64a..e984a0709fc 100644
--- a/src/third_party/wiredtiger/RELEASE_INFO
+++ b/src/third_party/wiredtiger/RELEASE_INFO
@@ -1,6 +1,6 @@
WIREDTIGER_VERSION_MAJOR=2
-WIREDTIGER_VERSION_MINOR=5
-WIREDTIGER_VERSION_PATCH=3
+WIREDTIGER_VERSION_MINOR=6
+WIREDTIGER_VERSION_PATCH=0
WIREDTIGER_VERSION="$WIREDTIGER_VERSION_MAJOR.$WIREDTIGER_VERSION_MINOR.$WIREDTIGER_VERSION_PATCH"
WIREDTIGER_RELEASE_DATE=`date "+%B %e, %Y"`
diff --git a/src/third_party/wiredtiger/SConstruct b/src/third_party/wiredtiger/SConstruct
index 8e9fae28ac6..1d32cf05a6c 100644
--- a/src/third_party/wiredtiger/SConstruct
+++ b/src/third_party/wiredtiger/SConstruct
@@ -34,6 +34,9 @@ AddOption("--enable-python", dest="lang-python", type="string", nargs=1, action=
AddOption("--enable-snappy", dest="snappy", type="string", nargs=1, action="store",
help="Use snappy compression")
+AddOption("--enable-tcmalloc", dest="tcmalloc", type="string", nargs=1, action="store",
+ help="Use TCMalloc for memory allocation")
+
AddOption("--enable-verbose", dest="verbose", action="store_true", default=False,
help="Configure WiredTiger to support the verbose configuration string to wiredtiger_open")
@@ -113,6 +116,7 @@ useZlib = GetOption("zlib")
useSnappy = GetOption("snappy")
useLz4 = GetOption("lz4")
useBdb = GetOption("bdb")
+useTcmalloc = GetOption("tcmalloc")
wtlibs = []
conf = Configure(env)
@@ -157,6 +161,16 @@ if useBdb:
print 'db.h must be installed!'
Exit(1)
+if useTcmalloc:
+ conf.env.Append(CPPPATH=[useTcmalloc + "/include"])
+ conf.env.Append(LIBPATH=[useTcmalloc + "/lib"])
+ if conf.CheckCHeader('gperftools/tcmalloc.h'):
+ wtlibs.append("libtcmalloc_minimal")
+ conf.env.Append(CPPDEFINES=['HAVE_LIBTCMALLOC'])
+ else:
+ print 'tcmalloc.h must be installed!'
+ Exit(1)
+
env = conf.Finish()
# Configure build environment variables
@@ -338,11 +352,12 @@ t = env.Program("t_huge",
LIBS=[wtlib] + wtlibs)
Default(t)
-#env.Program("t_fops",
- #["test/fops/file.c",
- #"test/fops/fops.c",
- #"test/fops/t.c"],
- #LIBS=[wtlib])
+t = env.Program("t_fops",
+ ["test/fops/file.c",
+ "test/fops/fops.c",
+ "test/fops/t.c"],
+ LIBS=[wtlib, shim] + wtlibs)
+Default(t)
if useBdb:
benv = env.Clone()
diff --git a/src/third_party/wiredtiger/bench/wtperf/config.c b/src/third_party/wiredtiger/bench/wtperf/config.c
index e27b4861bed..3b3308d6fac 100644
--- a/src/third_party/wiredtiger/bench/wtperf/config.c
+++ b/src/third_party/wiredtiger/bench/wtperf/config.c
@@ -589,9 +589,10 @@ config_sanity(CONFIG *cfg)
fprintf(stderr, "interval value longer than the run-time\n");
return (EINVAL);
}
- if (cfg->table_count < 1 || cfg->table_count > 99) {
+ /* The maximum is here to keep file name construction simple. */
+ if (cfg->table_count < 1 || cfg->table_count > 99999) {
fprintf(stderr,
- "invalid table count, less than 1 or greater than 99\n");
+ "invalid table count, less than 1 or greater than 99999\n");
return (EINVAL);
}
if (cfg->database_count < 1 || cfg->database_count > 99) {
@@ -613,26 +614,26 @@ config_print(CONFIG *cfg)
u_int i;
printf("Workload configuration:\n");
- printf("\tHome: %s\n", cfg->home);
- printf("\tTable name: %s\n", cfg->table_name);
- printf("\tConnection configuration: %s\n", cfg->conn_config);
+ printf("\t" "Home: %s\n", cfg->home);
+ printf("\t" "Table name: %s\n", cfg->table_name);
+ printf("\t" "Connection configuration: %s\n", cfg->conn_config);
if (cfg->sess_config != NULL)
- printf("\tSession configuration: %s\n", cfg->sess_config);
+ printf("\t" "Session configuration: %s\n", cfg->sess_config);
printf("\t%s table: %s\n",
cfg->create ? "Creating new" : "Using existing",
cfg->table_config);
- printf("\tKey size: %" PRIu32 ", value size: %" PRIu32 "\n",
+ printf("\t" "Key size: %" PRIu32 ", value size: %" PRIu32 "\n",
cfg->key_sz, cfg->value_sz);
if (cfg->create)
- printf("\tPopulate threads: %" PRIu32 ", inserting %" PRIu32
+ printf("\t" "Populate threads: %" PRIu32 ", inserting %" PRIu32
" rows\n",
cfg->populate_threads, cfg->icount);
- printf("\tWorkload seconds, operations: %" PRIu32 ", %" PRIu32 "\n",
+ printf("\t" "Workload seconds, operations: %" PRIu32 ", %" PRIu32 "\n",
cfg->run_time, cfg->run_ops);
if (cfg->workload != NULL) {
- printf("\tWorkload configuration(s):\n");
+ printf("\t" "Workload configuration(s):\n");
for (i = 0, workp = cfg->workload;
i < cfg->workload_cnt; ++i, ++workp)
printf("\t\t%" PRId64 " threads (inserts=%" PRId64
@@ -641,12 +642,12 @@ config_print(CONFIG *cfg)
workp->insert, workp->read, workp->update);
}
- printf("\tCheckpoint threads, interval: %" PRIu32 ", %" PRIu32 "\n",
+ printf("\t" "Checkpoint threads, interval: %" PRIu32 ", %" PRIu32 "\n",
cfg->checkpoint_threads, cfg->checkpoint_interval);
- printf("\tReporting interval: %" PRIu32 "\n", cfg->report_interval);
- printf("\tSampling interval: %" PRIu32 "\n", cfg->sample_interval);
+ printf("\t" "Reporting interval: %" PRIu32 "\n", cfg->report_interval);
+ printf("\t" "Sampling interval: %" PRIu32 "\n", cfg->sample_interval);
- printf("\tVerbosity: %" PRIu32 "\n", cfg->verbose);
+ printf("\t" "Verbosity: %" PRIu32 "\n", cfg->verbose);
}
/*
diff --git a/src/third_party/wiredtiger/bench/wtperf/wtperf.c b/src/third_party/wiredtiger/bench/wtperf/wtperf.c
index 8780d270664..3c7a867f96f 100644
--- a/src/third_party/wiredtiger/bench/wtperf/wtperf.c
+++ b/src/third_party/wiredtiger/bench/wtperf/wtperf.c
@@ -68,6 +68,7 @@ static const char * const debug_tconfig = "";
static void *checkpoint_worker(void *);
static int create_tables(CONFIG *);
static int create_uris(CONFIG *);
+static int drop_all_tables(CONFIG *);
static int execute_populate(CONFIG *);
static int execute_workload(CONFIG *);
static int find_table_count(CONFIG *);
@@ -229,7 +230,7 @@ track_operation(TRACK *trk, uint64_t usecs)
++trk->us[v];
/*
- * Second buckets: millseconds from 1ms to 1000ms, at 1ms each.
+ * Second buckets: milliseconds from 1ms to 1000ms, at 1ms each.
*/
else if (v < ms_to_us(1000))
++trk->ms[us_to_ms(v)];
@@ -380,7 +381,7 @@ worker(void *arg)
CONFIG_THREAD *thread;
TRACK *trk;
WT_CONNECTION *conn;
- WT_CURSOR **cursors, *cursor;
+ WT_CURSOR **cursors, *cursor, *tmp_cursor;
WT_SESSION *session;
int64_t ops, ops_per_txn, throttle_ops;
size_t i;
@@ -388,6 +389,7 @@ worker(void *arg)
uint8_t *op, *op_end;
int measure_latency, ret;
char *value_buf, *key_buf, *value;
+ char buf[512];
thread = (CONFIG_THREAD *)arg;
cfg = thread->cfg;
@@ -410,6 +412,20 @@ worker(void *arg)
"worker: couldn't allocate cursor array");
goto err;
}
+ for (i = 0; i < cfg->table_count_idle; i++) {
+ snprintf(buf, 512, "%s_idle%05d", cfg->uris[0], (int)i);
+ if ((ret = session->open_cursor(
+ session, buf, NULL, NULL, &tmp_cursor)) != 0) {
+ lprintf(cfg, ret, 0,
+ "Error opening idle table %s", buf);
+ goto err;
+ }
+ if ((ret = tmp_cursor->close(tmp_cursor)) != 0) {
+ lprintf(cfg, ret, 0,
+ "Error closing idle table %s", buf);
+ goto err;
+ }
+ }
for (i = 0; i < cfg->table_count; i++) {
if ((ret = session->open_cursor(session,
cfg->uris[i], NULL, NULL, &cursors[i])) != 0) {
@@ -1513,6 +1529,10 @@ err: cfg->stop = 1;
cfg, (u_int)cfg->workers_cnt, cfg->workers)) != 0 && ret == 0)
ret = t_ret;
+ /* Drop tables if configured to and this isn't an error path */
+ if (ret == 0 && cfg->drop_tables && (ret = drop_all_tables(cfg)) != 0)
+ lprintf(cfg, ret, 0, "Drop tables failed.");
+
/* Report if any worker threads didn't finish. */
if (cfg->error != 0) {
lprintf(cfg, WT_ERROR, 0,
@@ -1602,20 +1622,18 @@ create_uris(CONFIG *cfg)
goto err;
}
for (i = 0; i < cfg->table_count; i++) {
- uri = cfg->uris[i] = calloc(base_uri_len + 3, 1);
+ uri = cfg->uris[i] = calloc(base_uri_len + 5, 1);
if (uri == NULL) {
ret = ENOMEM;
goto err;
}
- memcpy(uri, cfg->base_uri, base_uri_len);
/*
* If there is only one table, just use base name.
*/
- if (cfg->table_count > 1) {
- uri[base_uri_len] = uri[base_uri_len + 1] = '0';
- uri[base_uri_len] = '0' + (i / 10);
- uri[base_uri_len + 1] = '0' + (i % 10);
- }
+ if (cfg->table_count == 1)
+ memcpy(uri, cfg->base_uri, base_uri_len);
+ else
+ sprintf(uri, "%s%05d", cfg->base_uri, i);
}
err: if (ret != 0 && cfg->uris != NULL) {
for (i = 0; i < cfg->table_count; i++)
@@ -1632,6 +1650,7 @@ create_tables(CONFIG *cfg)
WT_SESSION *session;
size_t i;
int ret;
+ char buf[512];
if (cfg->create == 0)
return (0);
@@ -1643,6 +1662,16 @@ create_tables(CONFIG *cfg)
return (ret);
}
+ for (i = 0; i < cfg->table_count_idle; i++) {
+ snprintf(buf, 512, "%s_idle%05d", cfg->uris[0], (int)i);
+ if ((ret = session->create(
+ session, buf, cfg->table_config)) != 0) {
+ lprintf(cfg, ret, 0,
+ "Error creating idle table %s", buf);
+ return (ret);
+ }
+ }
+
for (i = 0; i < cfg->table_count; i++)
if ((ret = session->create(
session, cfg->uris[i], cfg->table_config)) != 0) {
@@ -2026,7 +2055,7 @@ main(int argc, char *argv[])
cfg->async_threads = 2;
if (cfg->async_threads > 0) {
/*
- * The maximum number of async threasd is two digits, so just
+ * The maximum number of async threads is two digits, so just
* use that to compute the space we need. Assume the default
* of 1024 for the max ops. Although we could bump that up
* to 4096 if needed.
@@ -2261,6 +2290,42 @@ worker_throttle(int64_t throttle, int64_t *ops, struct timespec *interval)
*interval = now;
}
+static int
+drop_all_tables(CONFIG *cfg)
+{
+ struct timespec start, stop;
+ WT_SESSION *session;
+ size_t i;
+ uint64_t msecs;
+ int ret, t_ret;
+
+ /* Drop any tables. */
+ if ((ret = cfg->conn->open_session(
+ cfg->conn, NULL, cfg->sess_config, &session)) != 0) {
+ lprintf(cfg, ret, 0,
+ "Error opening a session on %s", cfg->home);
+ return (ret);
+ }
+ (void)__wt_epoch(NULL, &start);
+ for (i = 0; i < cfg->table_count; i++) {
+ if ((ret = session->drop(
+ session, cfg->uris[i], NULL)) != 0) {
+ lprintf(cfg, ret, 0,
+ "Error dropping table %s", cfg->uris[i]);
+ goto err;
+ }
+ }
+ (void)__wt_epoch(NULL, &stop);
+ msecs = ns_to_ms(WT_TIMEDIFF(stop, start));
+ lprintf(cfg, 0, 1,
+ "Executed %" PRIu32 " drop operations average time %" PRIu64 "ms",
+ cfg->table_count, msecs / cfg->table_count);
+
+err: if ((t_ret = session->close(session, NULL)) != 0 && ret == 0)
+ ret = t_ret;
+ return (ret);
+}
+
static uint64_t
wtperf_value_range(CONFIG *cfg)
{
diff --git a/src/third_party/wiredtiger/bench/wtperf/wtperf.h b/src/third_party/wiredtiger/bench/wtperf/wtperf.h
index 201623c7859..f176f62320e 100644
--- a/src/third_party/wiredtiger/bench/wtperf/wtperf.h
+++ b/src/third_party/wiredtiger/bench/wtperf/wtperf.h
@@ -102,7 +102,7 @@ typedef struct {
* NOTE: If you add any fields to this structure here, you must also add
* an initialization in wtperf.c in the default_cfg.
*/
-struct __config { /* Configuration struction */
+struct __config { /* Configuration structure */
const char *home; /* WiredTiger home */
const char *monitor_dir; /* Monitor output dir */
char *base_uri; /* Object URI */
diff --git a/src/third_party/wiredtiger/bench/wtperf/wtperf_opt.i b/src/third_party/wiredtiger/bench/wtperf/wtperf_opt.i
index 705b95a7450..cfc39933517 100644
--- a/src/third_party/wiredtiger/bench/wtperf/wtperf_opt.i
+++ b/src/third_party/wiredtiger/bench/wtperf/wtperf_opt.i
@@ -104,6 +104,9 @@ DEF_OPT_AS_UINT32(database_count, 1,
"number of WiredTiger databases to use. Each database will execute the"
" workload using a separate home directory and complete set of worker"
" threads")
+DEF_OPT_AS_UINT32(drop_tables, 0,
+ "Whether to drop all tables at the end of the run, and report time taken"
+ " to do the drop.")
DEF_OPT_AS_UINT32(icount, 5000,
"number of records to initially populate. If multiple tables are "
"configured the count is spread evenly across all tables.")
@@ -145,7 +148,10 @@ DEF_OPT_AS_CONFIG_STRING(table_config,
"table configuration string")
DEF_OPT_AS_UINT32(table_count, 1,
"number of tables to run operations over. Keys are divided evenly "
- "over the tables. Default 1, maximum 99.")
+ "over the tables. Cursors are held open on all tables. Default 1, maximum "
+ "99999.")
+DEF_OPT_AS_UINT32(table_count_idle, 0,
+ "number of tables to create, that won't be populated. Default 0.")
DEF_OPT_AS_STRING(threads, "", "workload configuration: each 'count' "
"entry is the total number of threads, and the 'insert', 'read' and "
"'update' entries are the ratios of insert, read and update operations "
diff --git a/src/third_party/wiredtiger/build_posix/Make.subdirs b/src/third_party/wiredtiger/build_posix/Make.subdirs
index 8f8614a7016..161fcd88fb4 100644
--- a/src/third_party/wiredtiger/build_posix/Make.subdirs
+++ b/src/third_party/wiredtiger/build_posix/Make.subdirs
@@ -23,7 +23,7 @@ lang/python PYTHON
test/bloom
test/checkpoint
test/fops
-test/format HAVE_BERKELEY_DB
+test/format
test/huge
test/packing
test/salvage
diff --git a/src/third_party/wiredtiger/build_posix/aclocal/options.m4 b/src/third_party/wiredtiger/build_posix/aclocal/options.m4
index a5ad50416ed..d2cdbf65dce 100644
--- a/src/third_party/wiredtiger/build_posix/aclocal/options.m4
+++ b/src/third_party/wiredtiger/build_posix/aclocal/options.m4
@@ -202,6 +202,25 @@ if test "$wt_cv_enable_lz4" = "yes"; then
fi
AM_CONDITIONAL([LZ4], [test "$wt_cv_enable_lz4" = "yes"])
+AC_MSG_CHECKING(if --enable-tcmalloc option specified)
+AC_ARG_ENABLE(tcmalloc,
+ [AS_HELP_STRING([--enable-tcmalloc],
+ [Build WiredTiger with tcmalloc.])], r=$enableval, r=no)
+case "$r" in
+no) wt_cv_enable_tcmalloc=no;;
+*) wt_cv_enable_tcmalloc=yes;;
+esac
+AC_MSG_RESULT($wt_cv_enable_tcmalloc)
+if test "$wt_cv_enable_tcmalloc" = "yes"; then
+ AC_LANG_PUSH([C++])
+ AC_CHECK_HEADER(gperftools/tcmalloc.h,,
+ [AC_MSG_ERROR([--enable-tcmalloc requires gperftools/tcmalloc.h])])
+ AC_LANG_POP([C++])
+ AC_CHECK_LIB(tcmalloc, tc_calloc,,
+ [AC_MSG_ERROR([--enable-tcmalloc requires tcmalloc library])])
+fi
+AM_CONDITIONAL([TCMalloc], [test "$wt_cv_enable_tcmalloc" = "yes"])
+
AH_TEMPLATE(SPINLOCK_TYPE, [Spinlock type from mutex.h.])
AC_MSG_CHECKING(if --with-spinlock option specified)
AC_ARG_WITH(spinlock,
@@ -215,8 +234,6 @@ pthread|pthreads)
AC_DEFINE(SPINLOCK_TYPE, SPINLOCK_PTHREAD_MUTEX);;
pthread_adaptive|pthreads_adaptive)
AC_DEFINE(SPINLOCK_TYPE, SPINLOCK_PTHREAD_MUTEX_ADAPTIVE);;
-pthread_logging|pthreads_logging)
- AC_DEFINE(SPINLOCK_TYPE, SPINLOCK_PTHREAD_MUTEX_LOGGING);;
*) AC_MSG_ERROR([Unknown spinlock type "$with_spinlock"]);;
esac
AC_MSG_RESULT($with_spinlock)
diff --git a/src/third_party/wiredtiger/build_posix/aclocal/version-set.m4 b/src/third_party/wiredtiger/build_posix/aclocal/version-set.m4
index b19418fc29d..af888b66468 100644
--- a/src/third_party/wiredtiger/build_posix/aclocal/version-set.m4
+++ b/src/third_party/wiredtiger/build_posix/aclocal/version-set.m4
@@ -1,14 +1,14 @@
dnl build by dist/s_version
VERSION_MAJOR=2
-VERSION_MINOR=5
-VERSION_PATCH=3
-VERSION_STRING='"WiredTiger 2.5.3: (March 26, 2015)"'
+VERSION_MINOR=6
+VERSION_PATCH=0
+VERSION_STRING='"WiredTiger 2.6.0: (April 22, 2015)"'
AC_SUBST(VERSION_MAJOR)
AC_SUBST(VERSION_MINOR)
AC_SUBST(VERSION_PATCH)
AC_SUBST(VERSION_STRING)
-VERSION_NOPATCH=2.5
+VERSION_NOPATCH=2.6
AC_SUBST(VERSION_NOPATCH)
diff --git a/src/third_party/wiredtiger/build_posix/aclocal/version.m4 b/src/third_party/wiredtiger/build_posix/aclocal/version.m4
index 94a84e72955..773cd0742cb 100644
--- a/src/third_party/wiredtiger/build_posix/aclocal/version.m4
+++ b/src/third_party/wiredtiger/build_posix/aclocal/version.m4
@@ -1,2 +1,2 @@
dnl WiredTiger product version for AC_INIT. Maintained by dist/s_version
-2.5.3
+2.6.0
diff --git a/src/third_party/wiredtiger/build_posix/configure.ac.in b/src/third_party/wiredtiger/build_posix/configure.ac.in
index feade27ae1b..d93793a997b 100644
--- a/src/third_party/wiredtiger/build_posix/configure.ac.in
+++ b/src/third_party/wiredtiger/build_posix/configure.ac.in
@@ -19,7 +19,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([no])])
# Configure options. The AM_OPTIONS and the libtool configuration
# need to stay here. Moving them below the compiler and other
# configurations causes -Wcast_align warnings and other warnings
-# on MacOS.
+# on OS X.
AM_OPTIONS
define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
@@ -73,7 +73,7 @@ AM_TYPES
AC_PROG_INSTALL
-AC_CHECK_HEADERS([pthread_np.h])
+AC_CHECK_HEADERS([x86intrin.h])
AC_CHECK_LIB(pthread, pthread_create)
AC_CHECK_LIB(dl, dlopen)
AC_CHECK_LIB(rt, sched_yield)
@@ -107,7 +107,7 @@ AC_DEFINE_UNQUOTED(WT_BUFFER_ALIGNMENT_DEFAULT, $BUFFER_ALIGNMENT,
AC_SUBST(AM_CFLAGS)
-# test/format requires an installed Oracle Berkeley DB release tree.
+# test/format optionally uses a Oracle Berkeley DB release for verification.
AC_MSG_CHECKING([if --with-berkeleydb=DIR option specified])
AC_ARG_WITH(berkeleydb,
[AS_HELP_STRING([--with-berkeleydb=DIR],
diff --git a/src/third_party/wiredtiger/build_win/filelist.win b/src/third_party/wiredtiger/build_win/filelist.win
index e297ca16b06..d1b43bd8348 100644
--- a/src/third_party/wiredtiger/build_win/filelist.win
+++ b/src/third_party/wiredtiger/build_win/filelist.win
@@ -49,7 +49,6 @@ src/config/config.c
src/config/config_api.c
src/config/config_check.c
src/config/config_collapse.c
-src/config/config_concat.c
src/config/config_def.c
src/config/config_ext.c
src/config/config_upgrade.c
@@ -159,7 +158,6 @@ src/support/hash_fnv.c
src/support/hazard.c
src/support/hex.c
src/support/huffman.c
-src/support/mutex.c
src/support/pow.c
src/support/rand.c
src/support/scratch.c
diff --git a/src/third_party/wiredtiger/build_win/wiredtiger.def b/src/third_party/wiredtiger/build_win/wiredtiger.def
index 86096fb778d..25e7a01e0d9 100644
--- a/src/third_party/wiredtiger/build_win/wiredtiger.def
+++ b/src/third_party/wiredtiger/build_win/wiredtiger.def
@@ -1,6 +1,7 @@
LIBRARY WIREDTIGER
EXPORTS
wiredtiger_config_parser_open
+ wiredtiger_config_validate
wiredtiger_open
wiredtiger_pack_close
wiredtiger_pack_int
diff --git a/src/third_party/wiredtiger/build_win/wiredtiger_config.h b/src/third_party/wiredtiger/build_win/wiredtiger_config.h
index d52b3b3ae33..d1ed307cb85 100644
--- a/src/third_party/wiredtiger/build_win/wiredtiger_config.h
+++ b/src/third_party/wiredtiger/build_win/wiredtiger_config.h
@@ -70,6 +70,9 @@
/* Define to 1 if you have the `snappy' library (-lsnappy). */
/* #undef HAVE_LIBSNAPPY */
+/* Define to 1 if you have the `tcmalloc' library (-ltcmalloc). */
+/* #undef HAVE_LIBTCMALLOC */
+
/* Define to 1 if you have the `z' library (-lz). */
/* #undef HAVE_LIBZ */
@@ -88,9 +91,6 @@
/* Define to 1 if you have the `posix_memalign' function. */
/* #undef HAVE_POSIX_MEMALIGN */
-/* Define to 1 if you have the <pthread_np.h> header file. */
-/* #undef HAVE_PTHREAD_NP_H */
-
/* Build the LevelDB API with RocksDB support. */
/* #undef HAVE_ROCKSDB */
@@ -124,6 +124,9 @@
/* Enable verbose message configuration. */
/* #undef HAVE_VERBOSE */
+/* Define to 1 if you have the <x86intrin.h> header file. */
+#define HAVE_X86INTRIN_H 1
+
/* Spinlock type from mutex.h. */
#define SPINLOCK_TYPE SPINLOCK_MSVC
diff --git a/src/third_party/wiredtiger/dist/api_config.py b/src/third_party/wiredtiger/dist/api_config.py
index 5608933defb..b451e939ef3 100644
--- a/src/third_party/wiredtiger/dist/api_config.py
+++ b/src/third_party/wiredtiger/dist/api_config.py
@@ -54,7 +54,8 @@ def typedesc(c):
desc += ' of strings'
return desc
-def parseconfig(c, name_indent=''):
+def parseconfig(c, method_name, name_indent=''):
+ c.method_name = method_name
ctype = gettype(c)
desc = whitespace_re.sub(' ', c.desc.strip())
desc = desc.strip('.') + '.'
@@ -73,7 +74,8 @@ def parseconfig(c, name_indent=''):
output = '@config{' + ', '.join((name, desc, tdesc)) + '}\n'
if ctype == 'category':
for subc in sorted(c.subconfig):
- output += parseconfig(subc, name_indent + ('&nbsp;' * 4))
+ output += parseconfig(subc, method_name, \
+ name_indent + ('&nbsp;' * 4))
output += '@config{ ),,}\n'
return output
@@ -140,7 +142,7 @@ for line in open(f, 'r'):
lastname = name
if 'undoc' in c.flags:
continue
- output = parseconfig(c)
+ output = parseconfig(c, config_name)
for l in w.wrap(output):
tfile.write(prefix + l.replace('\n', '\n' + prefix) + '\n')
@@ -160,10 +162,13 @@ tfile.write('''/* DO NOT EDIT: automatically built by dist/api_config.py. */
#include "wt_internal.h"
''')
-# Make a TextWrapper that can wrap at commas.
+# Make a TextWrapper that wraps at commas.
w = textwrap.TextWrapper(width=64, break_on_hyphens=False)
w.wordsep_re = w.wordsep_simple_re = re.compile(r'(,)')
+# TextWrapper that wraps at whitespace.
+ws = textwrap.TextWrapper(width=64, break_on_hyphens=False)
+
def checkstr(c):
'''Generate the function reference and JSON string used by __wt_config_check
to validate the config string'''
@@ -202,28 +207,36 @@ def get_default(c):
return ''
created_subconfigs=set()
-def add_subconfig(c):
- if c.name in created_subconfigs:
+def add_subconfig(c, cname):
+ if cname in created_subconfigs:
return
- created_subconfigs.add(c.name)
+ created_subconfigs.add(cname)
tfile.write('''
-static const WT_CONFIG_CHECK confchk_%(name)s_subconfigs[] = {
+%(name)s[] = {
\t%(check)s
-\t{ NULL, NULL, NULL, NULL, NULL }
+\t{ NULL, NULL, NULL, NULL, NULL, 0 }
};
''' % {
- 'name' : c.name,
+ 'name' : '\n '.join(ws.wrap(\
+ 'static const WT_CONFIG_CHECK confchk_' + cname + '_subconfigs')),
'check' : '\n\t'.join(getconfcheck(subc) for subc in sorted(c.subconfig)),
})
+def getcname(c):
+ '''Return the C name of a sub configuration'''
+ prefix = c.method_name.replace('.', '_') + '_' \
+ if hasattr(c, 'method_name') else ''
+ return prefix + c.name
+
def getsubconfigstr(c):
'''Return a string indicating if an item has sub configuration'''
ctype = gettype(c)
if ctype == 'category':
- add_subconfig(c)
- return 'confchk_' + c.name + '_subconfigs'
+ cname = getcname(c)
+ add_subconfig(c, cname)
+ return 'confchk_' + cname + '_subconfigs, ' + str(len(c.subconfig))
else:
- return 'NULL'
+ return 'NULL, 0'
# Write structures of arrays of allowable configuration options, including a
# NULL as a terminator for iteration.
@@ -233,7 +246,7 @@ for name in sorted(api_data.methods.keys()):
tfile.write('''
static const WT_CONFIG_CHECK confchk_%(name)s[] = {
\t%(check)s
-\t{ NULL, NULL, NULL, NULL, NULL }
+\t{ NULL, NULL, NULL, NULL, NULL, 0 }
};
''' % {
'name' : name.replace('.', '_'),
@@ -270,14 +283,15 @@ for name in sorted(api_data.methods.keys()):
# Write the checks reference, or NULL if no related checks structure.
tfile.write('\n\t ')
if ctype:
- tfile.write('confchk_' + name.replace('.', '_'))
+ tfile.write(
+ 'confchk_' + name.replace('.', '_') + ', ' + str(len(ctype)))
else:
- tfile.write('NULL')
+ tfile.write('NULL, 0')
tfile.write('\n\t},')
# Write a NULL as a terminator for iteration.
-tfile.write('\n\t{ NULL, NULL, NULL }')
+tfile.write('\n\t{ NULL, NULL, NULL, 0 }')
tfile.write('\n};\n')
# Write the routine that connects the WT_CONNECTION_IMPL structure to the list
@@ -292,8 +306,7 @@ __wt_conn_config_init(WT_SESSION_IMPL *session)
\tconn = S2C(session);
\t/* Build a list of pointers to the configuration information. */
-\tWT_RET(__wt_calloc_def(session,
-\t sizeof(config_entries) / sizeof(config_entries[0]), &epp));
+\tWT_RET(__wt_calloc_def(session, WT_ELEMENTS(config_entries), &epp));
\tconn->config_entries = epp;
\t/* Fill in the list to reference the default information. */
@@ -314,6 +327,21 @@ __wt_conn_config_discard(WT_SESSION_IMPL *session)
\t__wt_free(session, conn->config_entries);
}
+
+/*
+ * __wt_conn_config_match --
+ * Return the static configuration entry for a method.
+ */
+const WT_CONFIG_ENTRY *
+__wt_conn_config_match(const char *method)
+{
+\tconst WT_CONFIG_ENTRY *ep;
+
+\tfor (ep = config_entries; ep->method != NULL; ++ep)
+\t\tif (strcmp(method, ep->method) == 0)
+\t\t\treturn (ep);
+\treturn (NULL);
+}
''')
tfile.close()
diff --git a/src/third_party/wiredtiger/dist/api_data.py b/src/third_party/wiredtiger/dist/api_data.py
index a31e5e5ed10..48bbee6cdde 100644
--- a/src/third_party/wiredtiger/dist/api_data.py
+++ b/src/third_party/wiredtiger/dist/api_data.py
@@ -1,9 +1,8 @@
# This file is a python script that describes the WiredTiger API.
class Method:
- def __init__(self, config, **flags):
+ def __init__(self, config):
self.config = config
- self.flags = flags
class Config:
def __init__(self, name, default, desc, subconfig=None, **flags):
@@ -320,8 +319,9 @@ connection_runtime_config = [
maximum number of expected simultaneous asynchronous
operations''', min='1', max='4096'),
Config('threads', '2', r'''
- the number of worker threads to service asynchronous
- requests''',
+ the number of worker threads to service asynchronous requests.
+ Each worker thread uses a session from the configured
+ session_max.''',
min='1', max='20'), # !!! Must match WT_ASYNC_MAX_WORKERS
]),
Config('cache_size', '100MB', r'''
@@ -339,7 +339,8 @@ connection_runtime_config = [
workloads''',
min='0', max='30'),
Config('checkpoint', '', r'''
- periodically checkpoint the database''',
+ periodically checkpoint the database. Enabling the checkpoint server
+ uses a session from the configured session_max''',
type='category', subconfig=[
Config('name', '"WiredTigerCheckpoint"', r'''
the checkpoint name'''),
@@ -372,19 +373,25 @@ connection_runtime_config = [
Config('file_manager', '', r'''
control how file handles are managed''',
type='category', subconfig=[
+ Config('close_handle_minimum', '250', r'''
+ number of handles open before the file manager will look for handles
+ to close''', min=0),
Config('close_idle_time', '30', r'''
amount of time in seconds a file handle needs to be idle
- before attempting to close it''', min=1, max=1000),
+ before attempting to close it''', min=1, max=100000),
Config('close_scan_interval', '10', r'''
interval in seconds at which to check for files that are
- inactive and close them''', min=1, max=1000)
+ inactive and close them''', min=1, max=100000),
]),
Config('lsm_manager', '', r'''
- configure database wide options for LSM tree management''',
+ configure database wide options for LSM tree management. The LSM
+ manager is started automatically the first time an LSM tree is opened.
+ The LSM manager uses a session from the configured session_max.''',
type='category', subconfig=[
Config('worker_thread_max', '4', r'''
Configure a set of threads to manage merging LSM trees in
- the database.''',
+ the database. Each worker thread uses a session handle from
+ the configured session_max''',
min='3', # !!! Must match WT_LSM_MIN_WORKERS
max='20'), # !!! Must match WT_LSM_MAX_WORKERS
Config('merge', 'true', r'''
@@ -400,7 +407,8 @@ connection_runtime_config = [
Config('threads_max', '1', r'''
maximum number of threads WiredTiger will start to help evict
pages from cache. The number of threads started will vary
- depending on the current eviction load''',
+ depending on the current eviction load. Each eviction worker
+ thread uses a session from the configured session_max''',
min=1, max=20),
Config('threads_min', '1', r'''
minimum number of threads WiredTiger will start to help evict
@@ -410,7 +418,8 @@ connection_runtime_config = [
]),
Config('shared_cache', '', r'''
shared cache configuration options. A database should configure
- either a cache_size or a shared_cache not both''',
+ either a cache_size or a shared_cache not both. Enabling a
+ shared cache uses a session from the configured session_max''',
type='category', subconfig=[
Config('chunk', '10MB', r'''
the granularity that a shared cache is redistributed''',
@@ -443,7 +452,9 @@ connection_runtime_config = [
type='list', choices=['all', 'fast', 'none', 'clear']),
Config('statistics_log', '', r'''
log any statistics the database is configured to maintain,
- to a file. See @ref statistics for more information''',
+ to a file. See @ref statistics for more information. Enabling
+ the statistics log server uses a session from the configured
+ session_max''',
type='category', subconfig=[
Config('on_close', 'false', r'''log statistics on database close''',
type='boolean'),
@@ -543,7 +554,8 @@ common_wiredtiger_open = [
handle''',
min='15'),
Config('log', '', r'''
- enable logging''',
+ enable logging. Enabling logging uses three sessions from the
+ configured session_max''',
type='category', subconfig=[
Config('archive', 'true', r'''
automatically archive unneeded log files''',
@@ -626,13 +638,13 @@ methods = {
'table.meta' : Method(table_meta),
-'cursor.close' : Method([]),
+'WT_CURSOR.close' : Method([]),
-'cursor.reconfigure' : Method(cursor_runtime_config),
+'WT_CURSOR.reconfigure' : Method(cursor_runtime_config),
-'session.close' : Method([]),
+'WT_SESSION.close' : Method([]),
-'session.compact' : Method([
+'WT_SESSION.compact' : Method([
Config('timeout', '1200', r'''
maximum amount of time to allow for compact in seconds. The
actual amount of time spent in compact may exceed the configured
@@ -640,7 +652,7 @@ methods = {
type='int'),
]),
-'session.create' : Method(file_config + lsm_config + source_meta +
+'WT_SESSION.create' : Method(file_config + lsm_config + source_meta +
index_only_config + table_only_config + [
Config('exclusive', 'false', r'''
fail if the object exists. When false (the default), if the
@@ -649,7 +661,7 @@ methods = {
type='boolean'),
]),
-'session.drop' : Method([
+'WT_SESSION.drop' : Method([
Config('force', 'false', r'''
return success if the object does not exist''',
type='boolean'),
@@ -658,9 +670,9 @@ methods = {
type='boolean'),
]),
-'session.log_printf' : Method([]),
+'WT_SESSION.log_printf' : Method([]),
-'session.open_cursor' : Method(cursor_runtime_config + [
+'WT_SESSION.open_cursor' : Method(cursor_runtime_config + [
Config('bulk', 'false', r'''
configure the cursor for bulk-loading, a fast, initial load
path (see @ref tune_bulk_load for more information). Bulk-load
@@ -734,17 +746,17 @@ methods = {
type='list'),
]),
-'session.rename' : Method([]),
-'session.salvage' : Method([
+'WT_SESSION.rename' : Method([]),
+'WT_SESSION.salvage' : Method([
Config('force', 'false', r'''
force salvage even of files that do not appear to be WiredTiger
files''',
type='boolean'),
]),
-'session.strerror' : Method([]),
-'session.truncate' : Method([]),
-'session.upgrade' : Method([]),
-'session.verify' : Method([
+'WT_SESSION.strerror' : Method([]),
+'WT_SESSION.truncate' : Method([]),
+'WT_SESSION.upgrade' : Method([]),
+'WT_SESSION.verify' : Method([
Config('dump_address', 'false', r'''
Display addresses and page types as pages are verified,
using the application's message handler, intended for debugging''',
@@ -767,7 +779,7 @@ methods = {
type='boolean')
]),
-'session.begin_transaction' : Method([
+'WT_SESSION.begin_transaction' : Method([
Config('isolation', '', r'''
the isolation level for this transaction; defaults to the
session's isolation level''',
@@ -784,10 +796,10 @@ methods = {
type='boolean'),
]),
-'session.commit_transaction' : Method([]),
-'session.rollback_transaction' : Method([]),
+'WT_SESSION.commit_transaction' : Method([]),
+'WT_SESSION.rollback_transaction' : Method([]),
-'session.checkpoint' : Method([
+'WT_SESSION.checkpoint' : Method([
Config('drop', '', r'''
specify a list of checkpoints to drop.
The list may additionally contain one of the following keys:
@@ -809,11 +821,11 @@ methods = {
if non-empty, checkpoint the list of objects''', type='list'),
]),
-'connection.add_collator' : Method([]),
-'connection.add_compressor' : Method([]),
-'connection.add_data_source' : Method([]),
-'connection.add_extractor' : Method([]),
-'connection.async_new_op' : Method([
+'WT_CONNECTION.add_collator' : Method([]),
+'WT_CONNECTION.add_compressor' : Method([]),
+'WT_CONNECTION.add_data_source' : Method([]),
+'WT_CONNECTION.add_extractor' : Method([]),
+'WT_CONNECTION.async_new_op' : Method([
Config('append', 'false', r'''
append the value as a new record, creating a new record
number key; valid only for operations with record number keys''',
@@ -835,14 +847,14 @@ methods = {
value. A value of zero disables the timeout''',
type='int'),
]),
-'connection.close' : Method([
+'WT_CONNECTION.close' : Method([
Config('leak_memory', 'false', r'''
don't free memory during close''',
type='boolean'),
]),
-'connection.reconfigure' : Method(connection_runtime_config),
+'WT_CONNECTION.reconfigure' : Method(connection_runtime_config),
-'connection.load_extension' : Method([
+'WT_CONNECTION.load_extension' : Method([
Config('config', '', r'''
configuration string passed to the entry point of the
extension as its WT_CONFIG_ARG argument'''),
@@ -857,9 +869,9 @@ methods = {
::wiredtiger_extension_terminate'''),
]),
-'connection.open_session' : Method(session_config),
+'WT_CONNECTION.open_session' : Method(session_config),
-'session.reconfigure' : Method(session_config),
+'WT_SESSION.reconfigure' : Method(session_config),
# There are 4 variants of the wiredtiger_open configurations.
# wiredtiger_open:
diff --git a/src/third_party/wiredtiger/dist/dist.py b/src/third_party/wiredtiger/dist/dist.py
index 2ea088ba3f1..1b3ad828dfb 100644
--- a/src/third_party/wiredtiger/dist/dist.py
+++ b/src/third_party/wiredtiger/dist/dist.py
@@ -10,6 +10,10 @@ def source_files(skip_includes=False):
for line in open('filelist', 'r'):
if file_re.match(line):
yield os.path.join('..', line.rstrip())
+ # Return only the Windows-specific files in the Windows filelist
+ for line in open('../build_win/filelist.win', 'r'):
+ if 'os_win' in line and file_re.match(line):
+ yield os.path.join('..', line.rstrip())
for line in open('extlist', 'r'):
if file_re.match(line):
yield os.path.join('..', line.rstrip())
diff --git a/src/third_party/wiredtiger/dist/filelist b/src/third_party/wiredtiger/dist/filelist
index ee70ccf765e..7d57864a788 100644
--- a/src/third_party/wiredtiger/dist/filelist
+++ b/src/third_party/wiredtiger/dist/filelist
@@ -49,7 +49,6 @@ src/config/config.c
src/config/config_api.c
src/config/config_check.c
src/config/config_collapse.c
-src/config/config_concat.c
src/config/config_def.c
src/config/config_ext.c
src/config/config_upgrade.c
@@ -157,7 +156,6 @@ src/support/hash_fnv.c
src/support/hazard.c
src/support/hex.c
src/support/huffman.c
-src/support/mutex.c
src/support/pow.c
src/support/rand.c
src/support/scratch.c
diff --git a/src/third_party/wiredtiger/dist/s_define.list b/src/third_party/wiredtiger/dist/s_define.list
index 4924a1935ae..2a6581cf880 100644
--- a/src/third_party/wiredtiger/dist/s_define.list
+++ b/src/third_party/wiredtiger/dist/s_define.list
@@ -44,7 +44,6 @@ WT_PACKED_STRUCT_BEGIN
WT_PACKED_STRUCT_END
WT_READ_BARRIER
WT_REF_SIZE
-WT_SPINLOCK_MAX
WT_STAT_ATOMIC_DECR
WT_STAT_ATOMIC_DECRV
WT_STAT_ATOMIC_INCR
diff --git a/src/third_party/wiredtiger/dist/s_export.list b/src/third_party/wiredtiger/dist/s_export.list
index d3803bc3afa..c7f088bc2d5 100644
--- a/src/third_party/wiredtiger/dist/s_export.list
+++ b/src/third_party/wiredtiger/dist/s_export.list
@@ -1,5 +1,6 @@
# List of OK external symbols.
wiredtiger_config_parser_open
+wiredtiger_config_validate
wiredtiger_open
wiredtiger_pack_close
wiredtiger_pack_int
diff --git a/src/third_party/wiredtiger/dist/s_funcs.list b/src/third_party/wiredtiger/dist/s_funcs.list
index 4bb9796c11f..9b343e21507 100644
--- a/src/third_party/wiredtiger/dist/s_funcs.list
+++ b/src/third_party/wiredtiger/dist/s_funcs.list
@@ -30,6 +30,7 @@ __wt_nlpo2_round
__wt_print_huffman_code
__wt_try_readlock
wiredtiger_config_parser_open
+wiredtiger_config_validate
wiredtiger_pack_int
wiredtiger_pack_item
wiredtiger_pack_str
diff --git a/src/third_party/wiredtiger/dist/s_readme b/src/third_party/wiredtiger/dist/s_readme
index 0a2cce16e41..f497a04fa1d 100644
--- a/src/third_party/wiredtiger/dist/s_readme
+++ b/src/third_party/wiredtiger/dist/s_readme
@@ -35,6 +35,12 @@ WiredTiger release packages and documentation can be found at:
http://source.wiredtiger.com/
+WiredTiger uses JIRA for issue management:
+
+ http://jira.mongodb.org/browse/WT
+
+Please do not report issues through GitHub.
+
Information on configuring, building and installing WiredTiger can be
found at:
diff --git a/src/third_party/wiredtiger/dist/s_string b/src/third_party/wiredtiger/dist/s_string
index 89ba5b130d0..2e226b21094 100644
--- a/src/third_party/wiredtiger/dist/s_string
+++ b/src/third_party/wiredtiger/dist/s_string
@@ -15,6 +15,16 @@ type aspell > /dev/null 2>&1 || {
exit 0
}
+# replace:
+# Create a replacement list of spelling words.
+replace() {
+ aspell --mode=ccpp --lang=en list < ../$1 |
+ sort -u |
+ comm -12 /dev/stdin s_string.ok
+}
+
+# check:
+# Check the spelling of an individual file.
check() {
aspell --mode=ccpp --lang=en list < ../$1 |
sort -u |
@@ -27,9 +37,28 @@ check() {
# List of files to spellchk.
l=`(cd .. &&
- find examples ext src test -name '*.[chisy]' &&
+ find bench examples ext src test -name '*.[chisy]' &&
find src -name '*.in')`
+usage()
+{
+ echo 'usage: s_string [-r]' >&2
+ exit 1
+}
+while :
+ do case "$1" in
+ -r) # -r builds replacement list of OK words
+ for f in $l; do
+ replace $f
+ done | sort -u > $t
+ cp $t s_string.ok
+ shift;;
+ *)
+ test "$#" -eq 0 || usage
+ break;;
+ esac
+done
+
for f in $l; do
check $f
done
diff --git a/src/third_party/wiredtiger/dist/s_string.ok b/src/third_party/wiredtiger/dist/s_string.ok
index e2c6380660d..a014dc5414f 100644
--- a/src/third_party/wiredtiger/dist/s_string.ok
+++ b/src/third_party/wiredtiger/dist/s_string.ok
@@ -6,7 +6,6 @@ AAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAA
ABCDEFGHIJKLMNOPQRSTUVWXYZ
ADDR
-AIX
AJ
API
APIs
@@ -20,7 +19,6 @@ Alloc
Async
Athanassoulis
Athlon
-BASHOLEVELDB
BBBBB
BBBBBB
BBBBBBBBBB
@@ -33,11 +31,7 @@ BIGENDIAN
BOOL
BSR
BTREE
-BUF
-BUFs
-BUILTIN
BZ
-BZIP
Barack
Bitfield
Bitwise
@@ -49,13 +43,9 @@ CELL's
CELLs
CHECKKEY
CKPT
-CLMPRSTdehikrsuv
-CLR
CMP
-COL's
CONCAT
CONFIG
-CPUID
CPUs
CRC
CURSORs
@@ -68,24 +58,19 @@ CloseHandle
Comparator
Config
CreateFileMapping
-CreateThread
Crummey
CustomersPhone
-DATAITEMs
DECL
DECR
DESC
DHANDLE
-DLFCN
DNE
DOI
-DSRC
DUPLICATEV
DbCursor
DbEnv
Decrement
EAGAIN
-EB
EBUSY
EINTR
EINVAL
@@ -93,36 +78,23 @@ EMSG
EMail
ENOENT
ENOMEM
-ENOSYS
ENOTSUP
-ENV
EOF
ERET
ESET
ETIME
ETIMEDOUT
-EXLOG
EXTLIST
Enqueue
-Env
Eron
-FADVISE
-FALLOCATE
FALLTHROUGH
-FCNTL
-FDATASYNC
FH
FLD
-FLS
+FLSv
FNV
FORALL
FOREACH
-FREAD
-FREELIST
-FTRUNCATE
FULLFSYNC
-Fasttrack
-Filesystems
FindFirstFile
Fk
FlushFileBuffers
@@ -130,13 +102,8 @@ Fprintf
FreeBSD
FreeBSD's
FreeLibrary
-Freelist
-Fsync
-Ftruncate
Fuerst
GCC
-GETTIME
-GETTIMEOFDAY
GIDs
Gcc
Geoff
@@ -146,30 +113,20 @@ GetFileSizeEx
GetLastError
GetModuleHandleEx
GetProcAddress
-Givargis
Google
HFS
HHHH
HHHHLL
HHHLL
-HYPERLEVELDB
-HyperLevelDB
IEC
IEEE
-IFF
IKEY
IMPL
-IMPL's
INCR
-INDX
INIT
INITIALIZER
INMEM
-INODE
-INSERT's
INTL
-INUSE
-ISSET
ITEMs
Inline
Intra
@@ -184,17 +141,9 @@ KVS
Kanowski's
Kounavis
LANGID
-LEX
LF
-LIBBZ
-LIBDL
-LIBPTHREAD
-LIBRT
-LIBSNAPPY
-LIBZ
LLLLLL
LLLLLLL
-LNO
LOGREC
LOGSCAN
LRU
@@ -203,26 +152,21 @@ LSB
LSM
LSN
LSNs
+LTE
LZ
LZO
LeafGreen
-LevelDB
Levyx
Llqr
Llqrt
-LoadLoad
LockFile
Lookup
-MADVISE
MALLOC
-MAXID
-MBUF
MEM
MEMALIGN
MERCHANTABILITY
MSVC
MUTEX
-MVCC
Manos
MapViewOfFile
Marsaglia's
@@ -232,10 +176,8 @@ Mewhort
Mitzenmacher
MongoDB
MoveFile
-Multi
Multithreaded
Mutex
-Mutexes
NEEDKEY
NEEDVALUE
NOLL
@@ -243,29 +185,20 @@ NONINFRINGEMENT
NOTFOUND
NOTREACHED
NOVALUE
-NOWRITE
-NRECS
NUL
-NULLs
NetBSD
NoAddr
Noll
Nul
-ONPAGE
OPTYPE
OUTBUFF
OVFL
Obama
-PADDR
-PAGE's
PARAM
POSIX
PRIu
-PRIu64
-PSIZE
PTHREAD
PTR
-Pagesize
Pandis
Phong
PlatformSDK
@@ -274,43 +207,29 @@ Pre
Prepend
Qsort
RCS
-READONLY
-RECNO
REF's
REFs
-REQ
RET
RHEL
RLE
+RLEs
RNG
-ROCKSDB
RPC
RUNDIR
-RVv
Radu
-Recno
-Recurse
RedHat
Redistributions
-Relock
Resize
-RocksDB
-SCHED
SIMD
SLIST
SLVG
-SML
SOURCE's
-SPARC
SPINLOCK
SQL
-SSD
SSHH
SSq
STAILQ
-STRTOUQ
STRUCT
-SYS
Scalability
Scalable
Seigh
@@ -325,18 +244,12 @@ Spinlock
Spinlocks
Split's
Stoica
-StoreLoad
-Strsep
-Subtree
-Subtrees
TAILQ
+TCMalloc
TODO
-TOOSMALL
TORTIOUS
-TRK
TXN
TXNC
-TXNID
Timespec
Timestamp
TryCV
@@ -346,9 +259,6 @@ UID
UIDs
UINT
ULINE
-UNISTD
-UPD
-UPDATEs
URI
URIs
UTF
@@ -356,11 +266,9 @@ UnixLib
Unmap
UnmapViewOfFile
Unmarshall
-Unregister
VARCHAR
VLDB
VMSG
-Vanishingly
Vc
Vfprintf
Vixie
@@ -368,7 +276,7 @@ Vo
Vv
VxWorks
WIREDTIGER
-WaitForSingleObject
+WRLSN
WakeAllConditionVariable
Wconditional
WeakHashLen
@@ -378,26 +286,19 @@ WinNT
WiredTiger
WiredTiger's
WiredTigerCheckpoint
-WiredTigerHome
WiredTigerInit
WiredTigerLog
WiredTigerPreplog
-WiredTigerStat
WiredTigerTmplog
WiredTigerTxn
WithSeeds
-Wmissing
Wuninitialized
+Wunused
XP
-ZLIB
-Zlib
-__wt_epoch
abcdef
abcdefghijklmnopqrstuvwxyz
-addfrag
addl
addr
-addrs
af
agc
alfred
@@ -408,18 +309,15 @@ allocfile
allocsize
amd
ao
-ap
api
-apip
arg
argc
args
argv
async
asyncopp
-autockpt
+asyncops
autocommit
-autoheader
bInheritHandle
basecfg
bdb
@@ -429,31 +327,26 @@ bitcnt
bitfield
bitfields
bitpos
-bitstr
bitstring
bitwise
+blk
bm
bnd
bool
boolean
br
breakpoint
-bsearch
bt
btcur
-btdsk
btmem
btree
btrees
buf
-buflen
-bufs
bufsz
builtin
builtins
bytelock
bytestring
-bz
bzCompressEnd
bzCompressInit
bzDecompress
@@ -464,13 +357,11 @@ bzfree
bzip
calloc
catfmt
-cb
cd
centric
cfg
cfkos
change's
-checkfrag
checkpointed
checkpointer
checkpointing
@@ -479,12 +370,10 @@ checksums
chk
chongo
cip
-cityhash
ckpt
ckptfrag
ckptlist
cksum
-clr
clsm
cmd
cmp
@@ -510,11 +399,8 @@ copyout
cp
cpuid
crc
-cref
ctime
-ctype
curbackup
-curbtree
curbulk
curconfig
curdump
@@ -546,9 +432,7 @@ decrementing
deflateCopy
deflateEnd
deflateInit
-defno
del
-delfmt
dequeue
dequeued
der
@@ -560,42 +444,34 @@ dhandle
dhandles
dir
dirlist
-dl
dlclose
-dlfcn
dlh
dll
dlopen
dlsym
dmsg
+doxgen
+doxygen
ds
dsk
dsrc
dst
dstlen
dsync
-dt
-dtype
-dumpable
dumpcmp
-dumpfile
dup
eg
emp
encodings
endian
-endif
english
enqueue
enqueued
-enum's
env
eof
-eop
equalp
errhandler
errno
-errv
errx
esc
eventv
@@ -606,20 +482,16 @@ exe
execop
extern
extlist
-extlists
fadvise
fallocate
fblocks
fclose
fcntl
-fdatasync
-feof
ffc
fflush
ffs
fgetln
fh
-fileID
filefrag
fileid
filename
@@ -632,37 +504,26 @@ filesystems
fillms
firstfit
fixup
-flcs
floatnum
fmt
fmterr
fnv
foc
fopen
-fotxn
fp
fprintf
-fread
free'd
-freelist
-fs
-fsm
fstat
fsync
fsyncs
ftruncate
func
-funcs
gcc
gdb
getenv
-getfiles
-getid
getline
getone
-getoneraw
getones
-getonesn
getopt
getraw
gettime
@@ -677,8 +538,6 @@ hashval
havesize
hdr
highjack
-hin
-hrow
html
huffman
hval
@@ -689,33 +548,27 @@ ibackup
icount
idx
ifdef's
-ifndef
ikey
-imref
incr
incrementing
-incrv
indices
indirects
indx
infeasible
-inflateEnd
inflateInit
init
initn
initsize
+initval
inline
-inlined
inmem
-inode
insertK
insertV
instantiation
intl
intnum
intpack
-ints
-inttypes
+intrin
inuse
io
ip
@@ -725,22 +578,15 @@ jnr
jrx
json
kb
-kcell
keycmp
-keygen
-keyname
keyv
kv
kvraw
kvs
kvsbdb
lang
-latencies
lbrace
lbracket
-lbz
-ld
-ldl
len
lenp
level's
@@ -751,31 +597,26 @@ lfence
libdatasource
libs
libwiredtiger
-lld
llll
llu
-lno
loadtext
localtime
-lockdown
logf
logmgr
lognum
-logput
logread
logrec
logsize
logtest
lookup
lookups
-lpthread
-lr
-lrt
+lossy
lru
lseek
lsm
lsn
lsnappy
+lt
lu
lz
lzo
@@ -784,65 +625,48 @@ majorp
malloc
marshall
marshalled
-maxid
-maxintlitem
-maxintlpage
-maxleafitem
-maxleafpage
-mb
mem
memalign
-memalloc
membar
memcpy
-memfree
memmove
memset
memsize
-mergeable
metaconf
metadata
metafile
mfence
minorp
-minprefix
mkdir
mmap
mnt
msecs
msg
-msgv
msvc
-mtx
multi
multiblock
multicore
multiprocess
multisocket
-multithread
multithreaded
munmap
mutex
mutexes
-myfile
mytable
mytxn
namespace
namespaces
nbits
-nbsp
nchunks
nclr
nd
negint
newbar
newfile
-newname
newuri
nextprev
nfilename
nhex
-nl
nlpo
nocase
nonliteral
@@ -850,43 +674,34 @@ noop
nop
noraw
notfound
-notset
notsup
-notyet
-nowrite
-np
-nr
nset
-nthread
nul
nuls
numSymbols
numbare
-oc
offpage
-oindex
ok
-oldname
ondisk
onint
onpage
oo
opendir
openfile
-opsq
optype
os
ovfl
ownp
packv
parens
+pareto
parserp
patchp
pathname
pathnames
-perf
pfx
poptable
+popthreads
pos
posint
posix
@@ -904,7 +719,6 @@ printlog
priv
progname
ps
-pse
psp
pthread
pushms
@@ -912,10 +726,8 @@ putK
putV
pv
py
-qSS
qdown
qrrSS
-qs
qsort
quartile
qup
@@ -923,14 +735,9 @@ rS
rb
rbrace
rbracket
-rdlock
rduppo
readlock
-readnear
-readnext
readonly
-readprev
-readserver
readunlock
realloc
recno
@@ -942,39 +749,24 @@ rectype
recurse
refp
reinitialization
-req
-rescan
resize
resizing
-resultp
ret
retp
rf
rle
+rmw
rng
rpc
-rref
run's
-runlength
runtime
rwlock
-rwlocks
-rwunlock
-rx
sH
sHQ
-savepoints
-sb
-scanp
sched
-schemas
-schematab
scr
sd
-searchable
sed
-seqno
-serializable
sessionp
setstr
setv
@@ -985,7 +777,6 @@ sizep
sizev
skiplist
skiplists
-sl
slotsp
slvg
snaplen
@@ -996,35 +787,22 @@ spinlocks
sprintf
src
srch
-srvr
-sset
ssize
startup
statlog
-stbar
-stdarg
stderr
stdin
-stdint
-stdlib
stdout
-stepinit
-stepkv
-stepnext
stepp
-steprec
str
strcmp
strdup
strerror
strftime
-strget
-stringin
strlen
-strncmp
strncpy
strndup
-strsep
+strtok
strtoll
strtouq
struct
@@ -1035,79 +813,39 @@ subgets
subinit
sublicense
subtree
-subtrees
sunique
superset
sw
sys
-syserr
-sz
t's
tV
tablename
-tbackup
-tblock
-tcopyright
-tcreate
-tcursors
-tdatabase
-tdisplay
-tdrop
-tdump
-tdumpfile
-tempty
th
-thazard
tid
timestamp
-tinsert
-tlist
-tload
tmp
-toffpage
tokenizer
toklen
tokname
tokstart
toktype
-toverflow
-tparent
-tprintlog
+totalsec
transactional
transactionally
trecno
-treeconfig
-trename
-trepeat
-treplacement
trk
trk's
-troot
-trun
trunc
trylock
-trywrlock
-tsalvage
-tsplit
-tstat
-tstate
-tt
-ttracking
tupdate
-tupgrade
tvalue
-tverbose
-tverify
-twiredtiger
-twrite
txn
txnc
txnid
-txnidp
txnmin
typedef
uB
-uid
+uS
uint
uintmax
unbare
@@ -1118,9 +856,6 @@ unesc
unescaped
uninstantiated
unistd
-unix
-unjams
-unlinked
unmap
unmarshall
unmarshalled
@@ -1137,6 +872,7 @@ update's
upg
uri
uri's
+uris
usecs
usedp
usercfg
@@ -1144,27 +880,24 @@ usr
utf
util
uu
+vW
va
valuep
valuev
vanishingly
variable's
-vcell
-verrx
+vectorized
versa
vfprintf
-vlcs
-vmsg
vpack
vprintf
vrfy
vsize
-vslot
vsnprintf
vtype
vunpack
-vupdate
walk's
+warmup
wb
wiredtiger
workFactor
diff --git a/src/third_party/wiredtiger/dist/stat.py b/src/third_party/wiredtiger/dist/stat.py
index 53cbf30cf16..2a87d4425e6 100644
--- a/src/third_party/wiredtiger/dist/stat.py
+++ b/src/third_party/wiredtiger/dist/stat.py
@@ -123,7 +123,13 @@ __wt_stat_refresh_''' + name + '''_stats(void *stats_arg)
f.write('}\n')
# Aggregation is only interesting for data-source statistics.
+ # Complain if any aggregation flags are set.
if name == 'connection':
+ for l in sorted(list):
+ if 'no_aggregate' in l.flags or 'max_aggregate' in l.flags:
+ print >>sys.stdout,\
+ "Aggregation configuration for " +\
+ name + "." + l.name + " statistics not supported"
return;
f.write('''
diff --git a/src/third_party/wiredtiger/dist/stat_data.py b/src/third_party/wiredtiger/dist/stat_data.py
index f133ab899ea..ba6e7ec2459 100644
--- a/src/third_party/wiredtiger/dist/stat_data.py
+++ b/src/third_party/wiredtiger/dist/stat_data.py
@@ -9,9 +9,12 @@
#
# Optional configuration flags:
# no_clear Value not cleared when statistics cleared
+# no_scale Don't scale value per second in the logging tool script
+#
+# Data-source statistics are normally aggregated across the set of underlying
+# objects. Additional optionaly configuration flags are available:
# no_aggregate Ignore the value when aggregating statistics
# max_aggregate Take the maximum value when aggregating statistics
-# no_scale Don't scale value per second in the logging tool script
from operator import attrgetter
import sys
@@ -121,7 +124,7 @@ connection_stats = [
AsyncStat('async_full', 'number of times operation allocation failed'),
AsyncStat('async_cur_queue', 'current work queue length'),
AsyncStat('async_max_queue',
- 'maximum work queue length', 'max_aggregate,no_scale'),
+ 'maximum work queue length', 'no_clear,no_scale'),
AsyncStat('async_nowork', 'number of times worker found no work'),
AsyncStat('async_op_alloc', 'total allocations'),
AsyncStat('async_op_compact', 'total compact calls'),
@@ -178,7 +181,7 @@ connection_stats = [
CacheStat('cache_eviction_hazard', 'hazard pointer blocked page eviction'),
CacheStat('cache_eviction_internal', 'internal pages evicted'),
CacheStat('cache_eviction_maximum_page_size',
- 'maximum page size at eviction', 'max_aggregate,no_scale'),
+ 'maximum page size at eviction', 'no_clear,no_scale'),
CacheStat('cache_eviction_queue_empty',
'eviction server candidate queue empty when topping up'),
CacheStat('cache_eviction_queue_not_empty',
@@ -269,26 +272,20 @@ connection_stats = [
TxnStat('txn_checkpoint_generation',
'transaction checkpoint generation', 'no_clear,no_scale'),
TxnStat('txn_checkpoint_time_max',
- 'transaction checkpoint max time (msecs)',
- 'no_aggregate,no_clear,no_scale'),
+ 'transaction checkpoint max time (msecs)', 'no_clear,no_scale'),
TxnStat('txn_checkpoint_time_min',
- 'transaction checkpoint min time (msecs)',
- 'max_aggregate,no_clear,no_scale'),
+ 'transaction checkpoint min time (msecs)', 'no_clear,no_scale'),
TxnStat('txn_checkpoint_time_recent',
- 'transaction checkpoint most recent time (msecs)',
- 'no_aggregate,no_clear,no_scale'),
+ 'transaction checkpoint most recent time (msecs)', 'no_clear,no_scale'),
TxnStat('txn_checkpoint_time_total',
- 'transaction checkpoint total time (msecs)',
- 'no_aggregate,no_clear,no_scale'),
+ 'transaction checkpoint total time (msecs)', 'no_clear,no_scale'),
TxnStat('txn_checkpoint_running',
- 'transaction checkpoint currently running',
- 'no_aggregate,no_clear,no_scale'),
+ 'transaction checkpoint currently running', 'no_clear,no_scale'),
TxnStat('txn_pinned_checkpoint_range',
'transaction range of IDs currently pinned by a checkpoint',
- 'no_aggregate,no_clear,no_scale'),
+ 'no_clear,no_scale'),
TxnStat('txn_pinned_range',
- 'transaction range of IDs currently pinned',
- 'no_aggregate,no_clear,no_scale'),
+ 'transaction range of IDs currently pinned', 'no_clear,no_scale'),
TxnStat('txn_commit', 'transactions committed'),
TxnStat('txn_fail_cache', 'transaction failures due to cache overflow'),
TxnStat('txn_rollback', 'transactions rolled back'),
@@ -391,15 +388,15 @@ dsrc_stats = [
BtreeStat('btree_maximum_depth',
'maximum tree depth', 'max_aggregate,no_scale'),
BtreeStat('btree_maxintlkey',
- 'maximum internal page key size', 'no_aggregate,no_scale'),
+ 'maximum internal page key size', 'max_aggregate,no_scale'),
BtreeStat('btree_maxintlpage',
- 'maximum internal page size', 'no_aggregate,no_scale'),
+ 'maximum internal page size', 'max_aggregate,no_scale'),
BtreeStat('btree_maxleafkey',
- 'maximum leaf page key size', 'no_aggregate,no_scale'),
+ 'maximum leaf page key size', 'max_aggregate,no_scale'),
BtreeStat('btree_maxleafpage',
- 'maximum leaf page size', 'no_aggregate,no_scale'),
+ 'maximum leaf page size', 'max_aggregate,no_scale'),
BtreeStat('btree_maxleafvalue',
- 'maximum leaf page value size', 'no_aggregate,no_scale'),
+ 'maximum leaf page value size', 'max_aggregate,no_scale'),
BtreeStat('btree_overflow', 'overflow pages', 'no_scale'),
BtreeStat('btree_row_internal', 'row-store internal pages', 'no_scale'),
BtreeStat('btree_row_leaf', 'row-store leaf pages', 'no_scale'),
@@ -415,8 +412,7 @@ dsrc_stats = [
LSMStat('bloom_page_read', 'bloom filter pages read into cache'),
LSMStat('bloom_size', 'total size of bloom filters', 'no_scale'),
LSMStat('lsm_checkpoint_throttle', 'sleep for LSM checkpoint throttle'),
- LSMStat('lsm_chunk_count',
- 'chunks in the LSM tree', 'no_aggregate,no_scale'),
+ LSMStat('lsm_chunk_count', 'chunks in the LSM tree', 'no_scale'),
LSMStat('lsm_generation_max',
'highest merge generation in the LSM tree', 'max_aggregate,no_scale'),
LSMStat('lsm_lookup_no_bloom',
diff --git a/src/third_party/wiredtiger/dist/style.py b/src/third_party/wiredtiger/dist/style.py
index 70eb7fb19ab..ecb24d756e8 100755
--- a/src/third_party/wiredtiger/dist/style.py
+++ b/src/third_party/wiredtiger/dist/style.py
@@ -9,7 +9,7 @@ def missing_comment():
for f in source_files():
skip_re = re.compile(r'DO NOT EDIT: automatically built')
func_re = re.compile(
- r'(/\*(?:[^\*]|\*[^/])*\*/)?\n\w[\w ]+\n(\w+)', re.DOTALL)
+ r'(/\*(?:[^\*]|\*[^/])*\*/)?\n\w[\w \*]+\n(\w+)', re.DOTALL)
s = open(f, 'r').read()
if skip_re.search(s):
continue
diff --git a/src/third_party/wiredtiger/ext/datasources/helium/helium.c b/src/third_party/wiredtiger/ext/datasources/helium/helium.c
index 3fc521d93b2..2b7cb5f7d4c 100644
--- a/src/third_party/wiredtiger/ext/datasources/helium/helium.c
+++ b/src/third_party/wiredtiger/ext/datasources/helium/helium.c
@@ -3427,7 +3427,7 @@ wiredtiger_extension_init(WT_CONNECTION *connection, WT_CONFIG_ARG *config)
/* Add Helium-specific WT_SESSION.create configuration options. */
for (p = session_create_opts; *p != NULL; ++p)
if ((ret = connection->configure_method(connection,
- "session.create", "helium:", *p, "boolean", NULL)) != 0)
+ "WT_SESSION.create", "helium:", *p, "boolean", NULL)) != 0)
EMSG_ERR(wtext, NULL, ret,
"WT_CONNECTION.configure_method: session.create: "
"%s: %s",
diff --git a/src/third_party/wiredtiger/lang/python/wiredtiger.i b/src/third_party/wiredtiger/lang/python/wiredtiger.i
index d35d7d5c456..f9218d7529c 100644
--- a/src/third_party/wiredtiger/lang/python/wiredtiger.i
+++ b/src/third_party/wiredtiger/lang/python/wiredtiger.i
@@ -31,10 +31,16 @@
* The SWIG interface file defining the wiredtiger python API.
*/
%define DOCSTRING
-"@defgroup wt_python WiredTiger Python API
-Python wrappers aroung the WiredTiger C API.
-@{
-@cond IGNORE"
+"Python wrappers around the WiredTiger C API
+
+This provides an API similar to the C API, with the following modifications:
+ - Many C functions are exposed as OO methods. See the Python examples and test suite
+ - Errors are handled in a Pythonic way; wrap calls in try/except blocks
+ - Cursors have extra accessor methods and iterators that are higher-level than the C API
+ - Statistics cursors behave a little differently and are best handled using the C-like functions
+ - C Constants starting with WT_STAT_DSRC are instead exposed under wiredtiger.stat.dsrc
+ - C Constants starting with WT_STAT_CONN are instead exposed under wiredtiger.stat.conn
+"
%enddef
%module(docstring=DOCSTRING) wiredtiger
@@ -358,12 +364,12 @@ retry:
$action
if (result != 0 && result != EBUSY)
SWIG_ERROR_IF_NOT_SET(result);
- else if (result == EBUSY) {
+ else if (result == EBUSY) {
SWIG_PYTHON_THREAD_BEGIN_ALLOW;
- __wt_sleep(0, 10000);
+ __wt_sleep(0, 10000);
SWIG_PYTHON_THREAD_END_ALLOW;
- goto retry;
- }
+ goto retry;
+ }
}
%enddef
@@ -745,8 +751,8 @@ typedef int int_void;
}
else {
ret = $self->equals($self, other, &cmp);
- if (ret == 0)
- ret = cmp;
+ if (ret == 0)
+ ret = cmp;
}
return (ret);
}
@@ -842,12 +848,25 @@ typedef int int_void;
self._iterable = IterableCursor(self)
return self._iterable
+ def __delitem__(self, key):
+ '''Python convenience for removing'''
+ self.set_key(key)
+ if self.remove() != 0:
+ raise KeyError
+
def __getitem__(self, key):
'''Python convenience for searching'''
self.set_key(key)
if self.search() != 0:
raise KeyError
return self.get_value()
+
+ def __setitem__(self, key, value):
+ '''Python convenience for inserting'''
+ self.set_key(key)
+ self.set_value(value)
+ if self.insert() != 0:
+ raise KeyError
%}
};
@@ -870,17 +889,17 @@ typedef int int_void;
%{
int diagnostic_build() {
#ifdef HAVE_DIAGNOSTIC
- return 1;
+ return 1;
#else
- return 0;
+ return 0;
#endif
}
int verbose_build() {
#ifdef HAVE_VERBOSE
- return 1;
+ return 1;
#else
- return 0;
+ return 0;
#endif
}
%}
@@ -1127,8 +1146,8 @@ pythonAsyncCallback(WT_ASYNC_CALLBACK *cb, WT_ASYNC_OP *asyncop, int opret,
int ret, t_ret;
PY_CALLBACK *pcb;
PyObject *arglist, *notify_method, *pyresult;
- WT_ASYNC_OP_IMPL *op;
- WT_SESSION_IMPL *session;
+ WT_ASYNC_OP_IMPL *op;
+ WT_SESSION_IMPL *session;
/*
* Ensure the global interpreter lock is held since we'll be
@@ -1136,8 +1155,8 @@ pythonAsyncCallback(WT_ASYNC_CALLBACK *cb, WT_ASYNC_OP *asyncop, int opret,
*/
SWIG_PYTHON_THREAD_BEGIN_BLOCK;
- op = (WT_ASYNC_OP_IMPL *)asyncop;
- session = O2S(op);
+ op = (WT_ASYNC_OP_IMPL *)asyncop;
+ session = O2S(op);
pcb = (PY_CALLBACK *)asyncop->c.lang_private;
asyncop->c.lang_private = NULL;
ret = 0;
@@ -1172,10 +1191,10 @@ err: __wt_err(session, ret, "python async callback error");
}
__wt_free(session, pcb);
- if (ret == 0 && (opret == 0 || opret == WT_NOTFOUND))
- return (0);
- else
- return (1);
+ if (ret == 0 && (opret == 0 || opret == WT_NOTFOUND))
+ return (0);
+ else
+ return (1);
}
static WT_ASYNC_CALLBACK pyApiAsyncCallback = { pythonAsyncCallback };
diff --git a/src/third_party/wiredtiger/src/async/async_worker.c b/src/third_party/wiredtiger/src/async/async_worker.c
index 543046f7a0c..4f372d05d19 100644
--- a/src/third_party/wiredtiger/src/async/async_worker.c
+++ b/src/third_party/wiredtiger/src/async/async_worker.c
@@ -75,8 +75,8 @@ retry:
*/
my_slot = my_consume % async->async_qsize;
prev_slot = last_consume % async->async_qsize;
- *op = (WT_ASYNC_OP_IMPL*)WT_ATOMIC_STORE8(
- async->async_queue[my_slot], NULL);
+ *op = async->async_queue[my_slot];
+ async->async_queue[my_slot] = NULL;
WT_ASSERT(session, async->cur_queue > 0);
WT_ASSERT(session, *op != NULL);
@@ -105,12 +105,10 @@ retry:
static int
__async_flush_wait(WT_SESSION_IMPL *session, WT_ASYNC *async, uint64_t my_gen)
{
- WT_DECL_RET;
-
while (async->flush_state == WT_ASYNC_FLUSHING &&
async->flush_gen == my_gen)
- WT_ERR(__wt_cond_wait(session, async->flush_cond, 10000));
-err: return (ret);
+ WT_RET(__wt_cond_wait(session, async->flush_cond, 10000));
+ return (0);
}
/*
diff --git a/src/third_party/wiredtiger/src/block/block_ckpt.c b/src/third_party/wiredtiger/src/block/block_ckpt.c
index 61f8a90bac5..18c3978c90f 100644
--- a/src/third_party/wiredtiger/src/block/block_ckpt.c
+++ b/src/third_party/wiredtiger/src/block/block_ckpt.c
@@ -137,7 +137,7 @@ __wt_block_checkpoint_load(WT_SESSION_IMPL *session, WT_BLOCK *block,
WT_ERR(__wt_verbose(session, WT_VERB_CHECKPOINT,
"truncate file to %" PRIuMAX, (uintmax_t)ci->file_size));
WT_ERR_BUSY_OK(
- __wt_ftruncate(session, block->fh, ci->file_size));
+ __wt_block_truncate(session, block->fh, ci->file_size));
}
if (0) {
@@ -185,7 +185,7 @@ __wt_block_checkpoint_unload(
* an open checkpoint on the file), that's OK.
*/
WT_TRET_BUSY_OK(
- __wt_ftruncate(session, block->fh, block->fh->size));
+ __wt_block_truncate(session, block->fh, block->fh->size));
__wt_spin_lock(session, &block->live_lock);
__wt_block_ckpt_destroy(session, &block->live);
diff --git a/src/third_party/wiredtiger/src/block/block_ext.c b/src/third_party/wiredtiger/src/block/block_ext.c
index e5b3a9e5d98..e89c70060f3 100644
--- a/src/third_party/wiredtiger/src/block/block_ext.c
+++ b/src/third_party/wiredtiger/src/block/block_ext.c
@@ -1342,7 +1342,7 @@ __wt_block_extlist_truncate(
WT_RET(__wt_verbose(session, WT_VERB_BLOCK,
"truncate file from %" PRIdMAX " to %" PRIdMAX,
(intmax_t)orig, (intmax_t)size));
- WT_RET_BUSY_OK(__wt_ftruncate(session, block->fh, size));
+ WT_RET_BUSY_OK(__wt_block_truncate(session, block->fh, size));
return (0);
}
diff --git a/src/third_party/wiredtiger/src/block/block_open.c b/src/third_party/wiredtiger/src/block/block_open.c
index 83df5556ac4..64bd86294f2 100644
--- a/src/third_party/wiredtiger/src/block/block_open.c
+++ b/src/third_party/wiredtiger/src/block/block_open.c
@@ -25,7 +25,7 @@ __wt_block_manager_truncate(
WT_RET(__wt_open(session, filename, 0, 0, WT_FILE_TYPE_DATA, &fh));
/* Truncate the file. */
- WT_ERR(__wt_ftruncate(session, fh, (wt_off_t)0));
+ WT_ERR(__wt_block_truncate(session, fh, (wt_off_t)0));
/* Write out the file's meta-data. */
WT_ERR(__wt_desc_init(session, fh, allocsize));
diff --git a/src/third_party/wiredtiger/src/block/block_slvg.c b/src/third_party/wiredtiger/src/block/block_slvg.c
index 98722a83178..517fb92491e 100644
--- a/src/third_party/wiredtiger/src/block/block_slvg.c
+++ b/src/third_party/wiredtiger/src/block/block_slvg.c
@@ -36,7 +36,7 @@ __wt_block_salvage_start(WT_SESSION_IMPL *session, WT_BLOCK *block)
if (block->fh->size > allocsize) {
len = (block->fh->size / allocsize) * allocsize;
if (len != block->fh->size)
- WT_RET(__wt_ftruncate(session, block->fh, len));
+ WT_RET(__wt_block_truncate(session, block->fh, len));
} else
len = allocsize;
block->live.file_size = len;
diff --git a/src/third_party/wiredtiger/src/block/block_vrfy.c b/src/third_party/wiredtiger/src/block/block_vrfy.c
index ac49f24553b..1e341aff77a 100644
--- a/src/third_party/wiredtiger/src/block/block_vrfy.c
+++ b/src/third_party/wiredtiger/src/block/block_vrfy.c
@@ -146,7 +146,7 @@ __verify_last_truncate(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_CKPT *ckpt)
ci = &_ci;
WT_RET(__wt_block_ckpt_init(session, ci, ckpt->name));
WT_ERR(__wt_block_buffer_to_ckpt(session, block, ckpt->raw.data, ci));
- WT_ERR(__wt_ftruncate(session, block->fh, ci->file_size));
+ WT_ERR(__wt_block_truncate(session, block->fh, ci->file_size));
err: __wt_block_ckpt_destroy(session, ci);
return (ret);
diff --git a/src/third_party/wiredtiger/src/block/block_write.c b/src/third_party/wiredtiger/src/block/block_write.c
index aafe18615c6..d712d525752 100644
--- a/src/third_party/wiredtiger/src/block/block_write.c
+++ b/src/third_party/wiredtiger/src/block/block_write.c
@@ -21,6 +21,127 @@ __wt_block_header(WT_BLOCK *block)
}
/*
+ * __wt_block_truncate --
+ * Truncate the file.
+ */
+int
+__wt_block_truncate(WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t len)
+{
+ WT_RET(__wt_ftruncate(session, fh, len));
+
+ fh->size = fh->extend_size = len;
+
+ return (0);
+}
+
+/*
+ * __wt_block_extend --
+ * Extend the file.
+ */
+static inline int
+__wt_block_extend(WT_SESSION_IMPL *session, WT_BLOCK *block,
+ WT_FH *fh, wt_off_t offset, size_t align_size, int *release_lockp)
+{
+ WT_DECL_RET;
+ int locked;
+
+ /*
+ * The locking in this function is messy: by definition, the live system
+ * is locked when we're called, but that lock may have been acquired by
+ * our caller or our caller's caller. If our caller's lock, release_lock
+ * comes in set, indicating this function can unlock it before returning
+ * (either before extending the file or afterward, depending on the call
+ * used). If it is our caller's caller, then release_lock comes in not
+ * set, indicating it cannot be released here.
+ *
+ * If we unlock here, we clear release_lock. But if we then find out we
+ * need a lock after all, we re-acquire the lock and set release_lock so
+ * our caller knows to release it.
+ */
+ locked = 1;
+
+ /* If not configured to extend the file, we're done. */
+ if (fh->extend_len == 0)
+ return (0);
+
+ /*
+ * Extend the file in chunks. We want to limit the number of threads
+ * extending the file at the same time, so choose the one thread that's
+ * crossing the extended boundary. We don't extend newly created files,
+ * and it's theoretically possible we might wait so long our extension
+ * of the file is passed by another thread writing single blocks, that's
+ * why there's a check in case the extended file size becomes too small:
+ * if the file size catches up, every thread tries to extend it.
+ */
+ if (fh->extend_size > fh->size &&
+ (offset > fh->extend_size ||
+ offset + fh->extend_len + (wt_off_t)align_size < fh->extend_size))
+ return (0);
+
+ /*
+ * File extension may require locking: some variants of the system call
+ * used to extend the file initialize the extended space. If a writing
+ * thread races with the extending thread, the extending thread might
+ * overwrite already written data, and that would be very, very bad.
+ *
+ * Some variants of the system call to extend the file fail at run-time
+ * based on the filesystem type, fall back to ftruncate in that case,
+ * and remember that ftruncate requires locking.
+ */
+ if (fh->fallocate_available != WT_FALLOCATE_NOT_AVAILABLE) {
+ /*
+ * Release any locally acquired lock if not needed to extend the
+ * file, extending the file may require updating on-disk file's
+ * metadata, which can be slow. (It may be a bad idea to
+ * configure for file extension on systems that require locking
+ * over the extend call.)
+ */
+ if (!fh->fallocate_requires_locking && *release_lockp) {
+ *release_lockp = locked = 0;
+ __wt_spin_unlock(session, &block->live_lock);
+ }
+
+ /*
+ * Extend the file: there's a race between setting the value of
+ * extend_size and doing the extension, but it should err on the
+ * side of extend_size being smaller than the actual file size,
+ * and that's OK, we simply may do another extension sooner than
+ * otherwise.
+ */
+ fh->extend_size = fh->size + fh->extend_len * 2;
+ if ((ret = __wt_fallocate(
+ session, fh, fh->size, fh->extend_len * 2)) == 0)
+ return (0);
+ if (ret != ENOTSUP)
+ return (ret);
+ }
+
+ /*
+ * We may have a caller lock or a locally acquired lock, but we need a
+ * lock to call ftruncate.
+ */
+ if (!locked) {
+ __wt_spin_lock(session, &block->live_lock);
+ *release_lockp = 1;
+ }
+
+ /*
+ * The underlying truncate call initializes allocated space, reset the
+ * extend length after locking so we don't overwrite already-written
+ * blocks.
+ */
+ fh->extend_size = fh->size + fh->extend_len * 2;
+
+ /*
+ * The truncate might fail if there's a mapped file (in other words, if
+ * there's an open checkpoint on the file), that's OK.
+ */
+ if ((ret = __wt_ftruncate(session, fh, fh->extend_size)) == EBUSY)
+ ret = 0;
+ return (ret);
+}
+
+/*
* __wt_block_write_size --
* Return the buffer size required to write a block.
*/
@@ -86,7 +207,6 @@ __wt_block_write_off(WT_SESSION_IMPL *session, WT_BLOCK *block,
blk = WT_BLOCK_HEADER_REF(buf->mem);
fh = block->fh;
- local_locked = 0;
/* Buffers should be aligned for writing. */
if (!F_ISSET(buf, WT_ITEM_ALIGNED)) {
@@ -143,81 +263,26 @@ __wt_block_write_off(WT_SESSION_IMPL *session, WT_BLOCK *block,
blk->cksum = __wt_cksum(
buf->mem, data_cksum ? align_size : WT_BLOCK_COMPRESS_SKIP);
+ /* Pre-allocate some number of extension structures. */
+ WT_RET(__wt_block_ext_prealloc(session, 5));
+
+ /*
+ * Acquire a lock, if we don't already hold one.
+ * Allocate space for the write, and optionally extend the file (note
+ * the block-extend function may release the lock).
+ * Release any locally acquired lock.
+ */
+ local_locked = 0;
if (!caller_locked) {
- WT_RET(__wt_block_ext_prealloc(session, 5));
__wt_spin_lock(session, &block->live_lock);
local_locked = 1;
}
ret = __wt_block_alloc(session, block, &offset, (wt_off_t)align_size);
-
- /*
- * Extend the file in chunks. We want to limit the number of threads
- * extending the file at the same time, so choose the one thread that's
- * crossing the extended boundary. We don't extend newly created files,
- * and it's theoretically possible we might wait so long our extension
- * of the file is passed by another thread writing single blocks, that's
- * why there's a check in case the extended file size becomes too small:
- * if the file size catches up, every thread tries to extend it.
- *
- * File extension may require locking: some variants of the system call
- * used to extend the file initialize the extended space. If a writing
- * thread races with the extending thread, the extending thread might
- * overwrite already written data, and that would be very, very bad.
- *
- * Some variants of the system call to extend the file fail at run-time
- * based on the filesystem type, fall back to ftruncate in that case,
- * and remember that ftruncate requires locking.
- */
- if (ret == 0 &&
- fh->extend_len != 0 &&
- (fh->extend_size <= fh->size ||
- (offset + fh->extend_len <= fh->extend_size &&
- offset +
- fh->extend_len + (wt_off_t)align_size >= fh->extend_size))) {
- fh->extend_size = offset + fh->extend_len * 2;
- if (fh->fallocate_available != WT_FALLOCATE_NOT_AVAILABLE) {
- /*
- * Release any locally acquired lock if it's not needed
- * to extend the file, extending the file might require
- * updating file metadata, which can be slow. (It may be
- * a bad idea to configure for file extension on systems
- * that require locking over the extend call.)
- */
- if (!fh->fallocate_requires_locking && local_locked) {
- __wt_spin_unlock(session, &block->live_lock);
- local_locked = 0;
- }
-
- /* Extend the file. */
- if ((ret = __wt_fallocate(session,
- fh, offset, fh->extend_len * 2)) == ENOTSUP) {
- ret = 0;
- goto extend_truncate;
- }
- } else {
-extend_truncate: /*
- * We may have a caller lock or a locally acquired lock,
- * but we need a lock to call ftruncate.
- */
- if (!caller_locked && local_locked == 0) {
- __wt_spin_lock(session, &block->live_lock);
- local_locked = 1;
- }
- /*
- * The truncate might fail if there's a file mapping
- * (if there's an open checkpoint on the file), that's
- * OK.
- */
- if ((ret = __wt_ftruncate(
- session, fh, offset + fh->extend_len * 2)) == EBUSY)
- ret = 0;
- }
- }
- /* Release any locally acquired lock. */
- if (local_locked) {
+ if (ret == 0)
+ ret = __wt_block_extend(
+ session, block, fh, offset, align_size, &local_locked);
+ if (local_locked)
__wt_spin_unlock(session, &block->live_lock);
- local_locked = 0;
- }
WT_RET(ret);
/* Write the block. */
diff --git a/src/third_party/wiredtiger/src/bloom/bloom.c b/src/third_party/wiredtiger/src/bloom/bloom.c
index 06d0b7478dd..9225b9fe3b5 100644
--- a/src/third_party/wiredtiger/src/bloom/bloom.c
+++ b/src/third_party/wiredtiger/src/bloom/bloom.c
@@ -124,7 +124,7 @@ __bloom_open_cursor(WT_BLOOM *bloom, WT_CURSOR *owner)
return (0);
session = bloom->session;
- cfg[0] = WT_CONFIG_BASE(session, session_open_cursor);
+ cfg[0] = WT_CONFIG_BASE(session, WT_SESSION_open_cursor);
cfg[1] = bloom->config;
cfg[2] = NULL;
c = NULL;
diff --git a/src/third_party/wiredtiger/src/btree/bt_curnext.c b/src/third_party/wiredtiger/src/btree/bt_curnext.c
index d80a5f4740d..c4cbde25d12 100644
--- a/src/third_party/wiredtiger/src/btree/bt_curnext.c
+++ b/src/third_party/wiredtiger/src/btree/bt_curnext.c
@@ -165,14 +165,18 @@ __cursor_var_next(WT_CURSOR_BTREE *cbt, int newpage)
WT_CELL_UNPACK unpack;
WT_COL *cip;
WT_ITEM *val;
+ WT_INSERT *ins;
WT_PAGE *page;
WT_SESSION_IMPL *session;
WT_UPDATE *upd;
+ uint64_t rle, rle_start;
session = (WT_SESSION_IMPL *)cbt->iface.session;
page = cbt->ref->page;
val = &cbt->iface.value;
+ rle_start = 0; /* -Werror=maybe-uninitialized */
+
/* Initialize for each new page. */
if (newpage) {
cbt->last_standard_recno = __col_var_last_recno(page);
@@ -189,7 +193,8 @@ __cursor_var_next(WT_CURSOR_BTREE *cbt, int newpage)
__cursor_set_recno(cbt, cbt->recno + 1);
new_page: /* Find the matching WT_COL slot. */
- if ((cip = __col_var_search(page, cbt->recno)) == NULL)
+ if ((cip =
+ __col_var_search(page, cbt->recno, &rle_start)) == NULL)
return (WT_NOTFOUND);
cbt->slot = WT_COL_SLOT(page, cip);
@@ -220,15 +225,48 @@ new_page: /* Find the matching WT_COL slot. */
if ((cell = WT_COL_PTR(page, cip)) == NULL)
continue;
__wt_cell_unpack(cell, &unpack);
- if (unpack.type == WT_CELL_DEL)
+ if (unpack.type == WT_CELL_DEL) {
+ if ((rle = __wt_cell_rle(&unpack)) == 1)
+ continue;
+
+ /*
+ * There can be huge gaps in the variable-length
+ * column-store name space appearing as deleted
+ * records. If more than one deleted record, do
+ * the work of finding the next record to return
+ * instead of looping through the records.
+ *
+ * First, find the smallest record in the update
+ * list that's larger than the current record.
+ */
+ ins = __col_insert_search_gt(
+ cbt->ins_head, cbt->recno);
+
+ /*
+ * Second, for records with RLEs greater than 1,
+ * the above call to __col_var_search located
+ * this record in the page's list of repeating
+ * records, and returned the starting record.
+ * The starting record plus the RLE is the
+ * record to which we could skip, if there was
+ * no smaller record in the update list.
+ */
+ cbt->recno = rle_start + rle;
+ if (ins != NULL &&
+ WT_INSERT_RECNO(ins) < cbt->recno)
+ cbt->recno = WT_INSERT_RECNO(ins);
+
+ /* Adjust for the outer loop increment. */
+ --cbt->recno;
continue;
+ }
WT_RET(__wt_page_cell_data_ref(
- session, page, &unpack, &cbt->tmp));
+ session, page, &unpack, cbt->tmp));
cbt->cip_saved = cip;
}
- val->data = cbt->tmp.data;
- val->size = cbt->tmp.size;
+ val->data = cbt->tmp->data;
+ val->size = cbt->tmp->size;
return (0);
}
/* NOTREACHED */
diff --git a/src/third_party/wiredtiger/src/btree/bt_curprev.c b/src/third_party/wiredtiger/src/btree/bt_curprev.c
index f1ca81ee145..3ff020510f9 100644
--- a/src/third_party/wiredtiger/src/btree/bt_curprev.c
+++ b/src/third_party/wiredtiger/src/btree/bt_curprev.c
@@ -301,15 +301,19 @@ __cursor_var_prev(WT_CURSOR_BTREE *cbt, int newpage)
WT_CELL *cell;
WT_CELL_UNPACK unpack;
WT_COL *cip;
+ WT_INSERT *ins;
WT_ITEM *val;
WT_PAGE *page;
WT_SESSION_IMPL *session;
WT_UPDATE *upd;
+ uint64_t rle_start;
session = (WT_SESSION_IMPL *)cbt->iface.session;
page = cbt->ref->page;
val = &cbt->iface.value;
+ rle_start = 0; /* -Werror=maybe-uninitialized */
+
/* Initialize for each new page. */
if (newpage) {
cbt->last_standard_recno = __col_var_last_recno(page);
@@ -327,7 +331,8 @@ new_page: if (cbt->recno < page->pg_var_recno)
return (WT_NOTFOUND);
/* Find the matching WT_COL slot. */
- if ((cip = __col_var_search(page, cbt->recno)) == NULL)
+ if ((cip =
+ __col_var_search(page, cbt->recno, &rle_start)) == NULL)
return (WT_NOTFOUND);
cbt->slot = WT_COL_SLOT(page, cip);
@@ -358,15 +363,47 @@ new_page: if (cbt->recno < page->pg_var_recno)
if ((cell = WT_COL_PTR(page, cip)) == NULL)
continue;
__wt_cell_unpack(cell, &unpack);
- if (unpack.type == WT_CELL_DEL)
+ if (unpack.type == WT_CELL_DEL) {
+ if (__wt_cell_rle(&unpack) == 1)
+ continue;
+ /*
+ * There can be huge gaps in the variable-length
+ * column-store name space appearing as deleted
+ * records. If more than one deleted record, do
+ * the work of finding the next record to return
+ * instead of looping through the records.
+ *
+ * First, find the largest record in the update
+ * list that's smaller than the current record.
+ */
+ ins = __col_insert_search_lt(
+ cbt->ins_head, cbt->recno);
+
+ /*
+ * Second, for records with RLEs greater than 1,
+ * the above call to __col_var_search located
+ * this record in the page's list of repeating
+ * records, and returned the starting record.
+ * The starting record - 1 is the record to
+ * which we could skip, if there was no larger
+ * record in the update list.
+ */
+ cbt->recno = rle_start - 1;
+ if (ins != NULL &&
+ WT_INSERT_RECNO(ins) > cbt->recno)
+ cbt->recno = WT_INSERT_RECNO(ins);
+
+ /* Adjust for the outer loop decrement. */
+ ++cbt->recno;
continue;
+ }
WT_RET(__wt_page_cell_data_ref(
- session, page, &unpack, &cbt->tmp));
+ session, page, &unpack, cbt->tmp));
cbt->cip_saved = cip;
}
- val->data = cbt->tmp.data;
- val->size = cbt->tmp.size;
+ val->data = cbt->tmp->data;
+ val->size = cbt->tmp->size;
return (0);
}
/* NOTREACHED */
diff --git a/src/third_party/wiredtiger/src/btree/bt_cursor.c b/src/third_party/wiredtiger/src/btree/bt_cursor.c
index 8409b0cd6a2..7c894effacd 100644
--- a/src/third_party/wiredtiger/src/btree/bt_cursor.c
+++ b/src/third_party/wiredtiger/src/btree/bt_cursor.c
@@ -218,12 +218,13 @@ __cursor_valid(WT_CURSOR_BTREE *cbt, WT_UPDATE **updp)
* Column-store search from an application cursor.
*/
static inline int
-__cursor_col_search(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt)
+__cursor_col_search(
+ WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, WT_REF *leaf)
{
WT_DECL_RET;
WT_WITH_PAGE_INDEX(session,
- ret = __wt_col_search(session, cbt->iface.recno, NULL, cbt));
+ ret = __wt_col_search(session, cbt->iface.recno, leaf, cbt));
return (ret);
}
@@ -232,12 +233,13 @@ __cursor_col_search(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt)
* Row-store search from an application cursor.
*/
static inline int
-__cursor_row_search(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, int insert)
+__cursor_row_search(
+ WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, WT_REF *leaf, int insert)
{
WT_DECL_RET;
WT_WITH_PAGE_INDEX(session,
- ret = __wt_row_search(session, &cbt->iface.key, NULL, cbt, insert));
+ ret = __wt_row_search(session, &cbt->iface.key, leaf, cbt, insert));
return (ret);
}
@@ -294,10 +296,12 @@ __wt_btcur_search(WT_CURSOR_BTREE *cbt)
WT_DECL_RET;
WT_SESSION_IMPL *session;
WT_UPDATE *upd;
+ int valid;
btree = cbt->btree;
cursor = &cbt->iface;
session = (WT_SESSION_IMPL *)cursor->session;
+ upd = NULL; /* -Wuninitialized */
WT_STAT_FAST_CONN_INCR(session, cursor_search);
WT_STAT_FAST_DATA_INCR(session, cursor_search);
@@ -305,12 +309,31 @@ __wt_btcur_search(WT_CURSOR_BTREE *cbt)
if (btree->type == BTREE_ROW)
WT_RET(__cursor_size_chk(session, &cursor->key));
- WT_RET(__cursor_func_init(cbt, 1));
+ /*
+ * If we have a page pinned, search it; if we don't have a page pinned,
+ * or the search of the pinned page doesn't find an exact match, search
+ * from the root.
+ */
+ valid = 0;
+ if (F_ISSET(cbt, WT_CBT_ACTIVE) &&
+ cbt->ref->page->read_gen != WT_READGEN_OLDEST) {
+ __wt_txn_cursor_op(session);
+
+ WT_ERR(btree->type == BTREE_ROW ?
+ __cursor_row_search(session, cbt, cbt->ref, 0) :
+ __cursor_col_search(session, cbt, cbt->ref));
+ valid = cbt->compare == 0 && __cursor_valid(cbt, &upd);
+ }
+ if (!valid) {
+ WT_ERR(__cursor_func_init(cbt, 1));
- WT_ERR(btree->type == BTREE_ROW ?
- __cursor_row_search(session, cbt, 0) :
- __cursor_col_search(session, cbt));
- if (cbt->compare == 0 && __cursor_valid(cbt, &upd))
+ WT_ERR(btree->type == BTREE_ROW ?
+ __cursor_row_search(session, cbt, NULL, 0) :
+ __cursor_col_search(session, cbt, NULL));
+ valid = cbt->compare == 0 && __cursor_valid(cbt, &upd);
+ }
+
+ if (valid)
ret = __wt_kv_return(session, cbt, upd);
else if (__cursor_fix_implicit(btree, cbt)) {
/*
@@ -341,11 +364,12 @@ __wt_btcur_search_near(WT_CURSOR_BTREE *cbt, int *exactp)
WT_DECL_RET;
WT_SESSION_IMPL *session;
WT_UPDATE *upd;
- int exact;
+ int exact, valid;
btree = cbt->btree;
cursor = &cbt->iface;
session = (WT_SESSION_IMPL *)cursor->session;
+ upd = NULL; /* -Wuninitialized */
exact = 0;
WT_STAT_FAST_CONN_INCR(session, cursor_search_near);
@@ -354,19 +378,49 @@ __wt_btcur_search_near(WT_CURSOR_BTREE *cbt, int *exactp)
if (btree->type == BTREE_ROW)
WT_RET(__cursor_size_chk(session, &cursor->key));
- WT_RET(__cursor_func_init(cbt, 1));
-
/*
+ * If we have a row-store page pinned, search it; if we don't have a
+ * page pinned, or the search of the pinned page doesn't find an exact
+ * match, search from the root. Unlike WT_CURSOR.search, ignore pinned
+ * pages in the case of column-store, search-near isn't an interesting
+ * enough case for column-store to add the complexity needed to avoid
+ * the tree search.
+ *
* Set the "insert" flag for the btree row-store search; we may intend
- * to position our cursor at the end of the tree, rather than match an
+ * to position the cursor at the end of the tree, rather than match an
* existing record.
*/
- WT_ERR(btree->type == BTREE_ROW ?
- __cursor_row_search(session, cbt, 1) :
- __cursor_col_search(session, cbt));
+ valid = 0;
+ if (btree->type == BTREE_ROW &&
+ F_ISSET(cbt, WT_CBT_ACTIVE) &&
+ cbt->ref->page->read_gen != WT_READGEN_OLDEST) {
+ __wt_txn_cursor_op(session);
+
+ WT_ERR(__cursor_row_search(session, cbt, cbt->ref, 1));
+
+ /*
+ * Search-near is trickier than search when searching an already
+ * pinned page. If search returns the first or last page slots,
+ * discard the results and search the full tree as the neighbor
+ * pages might offer better matches. This test is simplistic as
+ * we're ignoring append lists (there may be no page slots or we
+ * might be legitimately positioned after the last page slot).
+ * Ignore those cases, it makes things too complicated.
+ */
+ if (cbt->slot != 0 &&
+ cbt->slot != cbt->ref->page->pg_row_entries - 1)
+ valid = __cursor_valid(cbt, &upd);
+ }
+ if (!valid) {
+ WT_ERR(__cursor_func_init(cbt, 1));
+ WT_ERR(btree->type == BTREE_ROW ?
+ __cursor_row_search(session, cbt, NULL, 1) :
+ __cursor_col_search(session, cbt, NULL));
+ valid = __cursor_valid(cbt, &upd);
+ }
/*
- * If we find an valid key, return it.
+ * If we find a valid key, return it.
*
* Else, creating a record past the end of the tree in a fixed-length
* column-store implicitly fills the gap with empty records. In this
@@ -382,7 +436,7 @@ __wt_btcur_search_near(WT_CURSOR_BTREE *cbt, int *exactp)
*
* If that fails, quit, there's no record to return.
*/
- if (__cursor_valid(cbt, &upd)) {
+ if (valid) {
exact = cbt->compare;
ret = __wt_kv_return(session, cbt, upd);
} else if (__cursor_fix_implicit(btree, cbt)) {
@@ -395,8 +449,8 @@ __wt_btcur_search_near(WT_CURSOR_BTREE *cbt, int *exactp)
exact = 1;
else {
WT_ERR(btree->type == BTREE_ROW ?
- __cursor_row_search(session, cbt, 1) :
- __cursor_col_search(session, cbt));
+ __cursor_row_search(session, cbt, NULL, 1) :
+ __cursor_col_search(session, cbt, NULL));
if (__cursor_valid(cbt, &upd)) {
exact = cbt->compare;
ret = __wt_kv_return(session, cbt, upd);
@@ -460,7 +514,7 @@ retry: WT_RET(__cursor_func_init(cbt, 1));
if (F_ISSET(cursor, WT_CURSTD_APPEND))
cbt->iface.recno = UINT64_MAX;
- WT_ERR(__cursor_col_search(session, cbt));
+ WT_ERR(__cursor_col_search(session, cbt, NULL));
if (F_ISSET(cursor, WT_CURSTD_APPEND))
cbt->iface.recno = 0;
@@ -481,7 +535,7 @@ retry: WT_RET(__cursor_func_init(cbt, 1));
cbt->iface.recno = cbt->recno;
break;
case BTREE_ROW:
- WT_ERR(__cursor_row_search(session, cbt, 1));
+ WT_ERR(__cursor_row_search(session, cbt, NULL, 1));
/*
* If not overwriting, fail if the key exists, else insert the
* key/value pair.
@@ -558,7 +612,7 @@ retry: WT_RET(__cursor_func_init(cbt, 1));
switch (btree->type) {
case BTREE_ROW:
- WT_ERR(__cursor_row_search(session, cbt, 1));
+ WT_ERR(__cursor_row_search(session, cbt, NULL, 1));
/*
* Just check for conflicts.
@@ -606,7 +660,7 @@ retry: WT_RET(__cursor_func_init(cbt, 1));
switch (btree->type) {
case BTREE_COL_FIX:
case BTREE_COL_VAR:
- WT_ERR(__cursor_col_search(session, cbt));
+ WT_ERR(__cursor_col_search(session, cbt, NULL));
/*
* If we find a matching record, check whether an update would
@@ -635,7 +689,7 @@ retry: WT_RET(__cursor_func_init(cbt, 1));
break;
case BTREE_ROW:
/* Remove the record if it exists. */
- WT_ERR(__cursor_row_search(session, cbt, 0));
+ WT_ERR(__cursor_row_search(session, cbt, NULL, 0));
/* Check whether an update would conflict. */
WT_ERR(__curfile_update_check(cbt));
@@ -702,7 +756,7 @@ retry: WT_RET(__cursor_func_init(cbt, 1));
switch (btree->type) {
case BTREE_COL_FIX:
case BTREE_COL_VAR:
- WT_ERR(__cursor_col_search(session, cbt));
+ WT_ERR(__cursor_col_search(session, cbt, NULL));
/*
* If not overwriting, fail if the key doesn't exist. If we
@@ -721,7 +775,7 @@ retry: WT_RET(__cursor_func_init(cbt, 1));
ret = __cursor_col_modify(session, cbt, 0);
break;
case BTREE_ROW:
- WT_ERR(__cursor_row_search(session, cbt, 1));
+ WT_ERR(__cursor_row_search(session, cbt, NULL, 1));
/*
* If not overwriting, check for conflicts and fail if the key
* does not exist.
@@ -788,7 +842,7 @@ __wt_btcur_next_random(WT_CURSOR_BTREE *cbt)
if (__cursor_valid(cbt, &upd))
WT_ERR(__wt_kv_return(session, cbt, upd));
else
- WT_ERR(__wt_btcur_search_near(cbt, 0));
+ WT_ERR(__wt_btcur_search_near(cbt, NULL));
err: if (ret != 0)
WT_TRET(__cursor_reset(cbt));
@@ -1075,6 +1129,17 @@ err: if (FLD_ISSET(S2C(session)->log_flags, WT_CONN_LOG_ENABLED))
}
/*
+ * __wt_btcur_open --
+ * Open a btree cursor.
+ */
+void
+__wt_btcur_open(WT_CURSOR_BTREE *cbt)
+{
+ cbt->row_key = &cbt->_row_key;
+ cbt->tmp = &cbt->_tmp;
+}
+
+/*
* __wt_btcur_close --
* Close a btree cursor.
*/
@@ -1087,8 +1152,8 @@ __wt_btcur_close(WT_CURSOR_BTREE *cbt)
session = (WT_SESSION_IMPL *)cbt->iface.session;
ret = __curfile_leave(cbt);
- __wt_buf_free(session, &cbt->search_key);
- __wt_buf_free(session, &cbt->tmp);
+ __wt_buf_free(session, &cbt->_row_key);
+ __wt_buf_free(session, &cbt->_tmp);
return (ret);
}
diff --git a/src/third_party/wiredtiger/src/btree/bt_debug.c b/src/third_party/wiredtiger/src/btree/bt_debug.c
index fa7cff35e5f..9cc7cd2a824 100644
--- a/src/third_party/wiredtiger/src/btree/bt_debug.c
+++ b/src/third_party/wiredtiger/src/btree/bt_debug.c
@@ -131,7 +131,7 @@ __dmsg_wrapup(WT_DBG *ds)
}
/* Close any file we opened. */
- (void)__wt_fclose(session, &ds->fp, WT_FHANDLE_WRITE);
+ (void)__wt_fclose(&ds->fp, WT_FHANDLE_WRITE);
}
/*
@@ -323,14 +323,23 @@ __wt_debug_disk(
/* FALLTHROUGH */
case WT_PAGE_ROW_INT:
case WT_PAGE_ROW_LEAF:
- __dmsg(ds, ", entries %" PRIu32 "\n", dsk->u.entries);
+ __dmsg(ds, ", entries %" PRIu32, dsk->u.entries);
break;
case WT_PAGE_OVFL:
- __dmsg(ds, ", datalen %" PRIu32 "\n", dsk->u.datalen);
+ __dmsg(ds, ", datalen %" PRIu32, dsk->u.datalen);
break;
WT_ILLEGAL_VALUE(session);
}
+ if (F_ISSET(dsk, WT_PAGE_COMPRESSED))
+ __dmsg(ds, ", compressed");
+ if (F_ISSET(dsk, WT_PAGE_EMPTY_V_ALL))
+ __dmsg(ds, ", empty-all");
+ if (F_ISSET(dsk, WT_PAGE_EMPTY_V_NONE))
+ __dmsg(ds, ", empty-none");
+
+ __dmsg(ds, ", generation %" PRIu64 "\n", dsk->write_gen);
+
switch (dsk->type) {
case WT_PAGE_BLOCK_MANAGER:
break;
@@ -395,7 +404,7 @@ __debug_dsk_cell(WT_DBG *ds, const WT_PAGE_HEADER *dsk)
}
/*
- * __debug_shape_info --
+ * __debug_tree_shape_info --
* Pretty-print information about a page.
*/
static char *
@@ -546,8 +555,7 @@ __debug_page(WT_DBG *ds, WT_PAGE *page, uint32_t flags)
session = ds->session;
/* Dump the page metadata. */
- WT_WITH_PAGE_INDEX(session,
- ret = __debug_page_metadata(ds, page));
+ WT_WITH_PAGE_INDEX(session, ret = __debug_page_metadata(ds, page));
WT_RET(ret);
/* Dump the page. */
@@ -600,7 +608,7 @@ __debug_page_metadata(WT_DBG *ds, WT_PAGE *page)
switch (page->type) {
case WT_PAGE_COL_INT:
__dmsg(ds, " recno %" PRIu64, page->pg_intl_recno);
- pindex = WT_INTL_INDEX_COPY(page);
+ WT_INTL_INDEX_GET(session, page, pindex);
entries = pindex->entries;
break;
case WT_PAGE_COL_FIX:
@@ -612,7 +620,7 @@ __debug_page_metadata(WT_DBG *ds, WT_PAGE *page)
entries = page->pg_var_entries;
break;
case WT_PAGE_ROW_INT:
- pindex = WT_INTL_INDEX_COPY(page);
+ WT_INTL_INDEX_GET(session, page, pindex);
entries = pindex->entries;
break;
case WT_PAGE_ROW_LEAF:
@@ -789,7 +797,7 @@ __debug_page_row_int(WT_DBG *ds, WT_PAGE *page, uint32_t flags)
WT_REF *ref;
WT_SESSION_IMPL *session;
size_t len;
- uint8_t *p;
+ void *p;
session = ds->session;
diff --git a/src/third_party/wiredtiger/src/btree/bt_discard.c b/src/third_party/wiredtiger/src/btree/bt_discard.c
index 05a54ad643e..f43e936eeda 100644
--- a/src/third_party/wiredtiger/src/btree/bt_discard.c
+++ b/src/third_party/wiredtiger/src/btree/bt_discard.c
@@ -209,7 +209,7 @@ __free_page_modify(WT_SESSION_IMPL *session, WT_PAGE *page)
static void
__free_page_int(WT_SESSION_IMPL *session, WT_PAGE *page)
{
- __wt_free_ref_index(session, page, WT_INTL_INDEX_COPY(page), 0);
+ __wt_free_ref_index(session, page, WT_INTL_INDEX_GET_SAFE(page), 0);
}
/*
diff --git a/src/third_party/wiredtiger/src/btree/bt_handle.c b/src/third_party/wiredtiger/src/btree/bt_handle.c
index 1e0f95d3131..e249f997d87 100644
--- a/src/third_party/wiredtiger/src/btree/bt_handle.c
+++ b/src/third_party/wiredtiger/src/btree/bt_handle.c
@@ -254,13 +254,13 @@ __btree_conf(WT_SESSION_IMPL *session, WT_CKPT *ckpt)
/* Eviction; the metadata file is never evicted. */
if (WT_IS_METADATA(btree->dhandle))
- F_SET(btree, WT_BTREE_NO_EVICTION | WT_BTREE_NO_HAZARD);
+ F_SET(btree, WT_BTREE_IN_MEMORY | WT_BTREE_NO_EVICTION);
else {
WT_RET(__wt_config_gets(session, cfg, "cache_resident", &cval));
if (cval.val)
- F_SET(btree, WT_BTREE_NO_EVICTION | WT_BTREE_NO_HAZARD);
+ F_SET(btree, WT_BTREE_IN_MEMORY | WT_BTREE_NO_EVICTION);
else
- F_CLR(btree, WT_BTREE_NO_EVICTION);
+ F_CLR(btree, WT_BTREE_IN_MEMORY | WT_BTREE_NO_EVICTION);
}
/* Checksums */
@@ -422,7 +422,7 @@ __btree_tree_open_empty(WT_SESSION_IMPL *session, int creation)
__wt_page_alloc(session, WT_PAGE_COL_INT, 1, 1, 1, &root));
root->pg_intl_parent_ref = &btree->root;
- pindex = WT_INTL_INDEX_COPY(root);
+ pindex = WT_INTL_INDEX_GET_SAFE(root);
ref = pindex->index[0];
ref->home = root;
ref->page = NULL;
@@ -435,7 +435,7 @@ __btree_tree_open_empty(WT_SESSION_IMPL *session, int creation)
__wt_page_alloc(session, WT_PAGE_ROW_INT, 0, 1, 1, &root));
root->pg_intl_parent_ref = &btree->root;
- pindex = WT_INTL_INDEX_COPY(root);
+ pindex = WT_INTL_INDEX_GET_SAFE(root);
ref = pindex->index[0];
ref->home = root;
ref->page = NULL;
@@ -507,8 +507,11 @@ __wt_btree_evictable(WT_SESSION_IMPL *session, int on)
btree = S2BT(session);
- /* The metadata file is never evicted. */
- if (on && !WT_IS_METADATA(btree->dhandle))
+ /* Permanently cache-resident files can never be evicted. */
+ if (F_ISSET(btree, WT_BTREE_IN_MEMORY))
+ return;
+
+ if (on)
F_CLR(btree, WT_BTREE_NO_EVICTION);
else
F_SET(btree, WT_BTREE_NO_EVICTION);
diff --git a/src/third_party/wiredtiger/src/btree/bt_huffman.c b/src/third_party/wiredtiger/src/btree/bt_huffman.c
index 6604bd9c9e1..b671fdcb137 100644
--- a/src/third_party/wiredtiger/src/btree/bt_huffman.c
+++ b/src/third_party/wiredtiger/src/btree/bt_huffman.c
@@ -162,7 +162,7 @@ __huffman_confchk_file(
/* Optionally return the file handle. */
if (fpp == NULL)
- (void)__wt_fclose(session, &fp, WT_FHANDLE_READ);
+ (void)__wt_fclose(&fp, WT_FHANDLE_READ);
else
*fpp = fp;
@@ -359,16 +359,15 @@ __wt_huffman_read(WT_SESSION_IMPL *session, WT_CONFIG_ITEM *ip,
tp->symbol = (uint32_t)symbol;
tp->frequency = (uint32_t)frequency;
}
+ ret = ferror(fp) ? WT_ERROR : 0;
- if (ret == EOF)
- ret = 0;
*entriesp = lineno - 1;
*tablep = table;
if (0) {
err: __wt_free(session, table);
}
- (void)__wt_fclose(session, &fp, WT_FHANDLE_READ);
+ (void)__wt_fclose(&fp, WT_FHANDLE_READ);
return (ret);
}
diff --git a/src/third_party/wiredtiger/src/btree/bt_page.c b/src/third_party/wiredtiger/src/btree/bt_page.c
index 0b93cc981d7..8086806b3a4 100644
--- a/src/third_party/wiredtiger/src/btree/bt_page.c
+++ b/src/third_party/wiredtiger/src/btree/bt_page.c
@@ -102,10 +102,18 @@ __wt_page_in_func(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t flags
return (WT_RESTART);
case WT_REF_MEM:
/*
- * The page is in memory: get a hazard pointer, update
- * the page's LRU and return. The expected reason we
- * can't get a hazard pointer is because the page is
- * being evicted; yield and try again.
+ * The page is in memory.
+ *
+ * Get a hazard pointer if one is required. We cannot
+ * be evicting if no hazard pointer is required, we're
+ * done.
+ */
+ if (F_ISSET(S2BT(session), WT_BTREE_IN_MEMORY))
+ goto skip_evict;
+
+ /*
+ * The expected reason we can't get a hazard pointer is
+ * because the page is being evicted, yield, try again.
*/
#ifdef HAVE_DIAGNOSTIC
WT_RET(
@@ -119,12 +127,19 @@ __wt_page_in_func(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t flags
break;
}
- page = ref->page;
- WT_ASSERT(session, page != NULL);
+ /*
+ * If eviction is configured for this file, check to see
+ * if the page qualifies for forced eviction and update
+ * the page's generation number. If eviction isn't being
+ * done on this file, we're done.
+ */
+ if (F_ISSET(S2BT(session), WT_BTREE_NO_EVICTION))
+ goto skip_evict;
/*
* Forcibly evict pages that are too big.
*/
+ page = ref->page;
if (force_attempts < 10 &&
__evict_force_check(session, page, flags)) {
++force_attempts;
@@ -149,12 +164,6 @@ __wt_page_in_func(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t flags
continue;
}
- /* Check if we need an autocommit transaction. */
- if ((ret = __wt_txn_autocommit_check(session)) != 0) {
- WT_TRET(__wt_hazard_clear(session, page));
- return (ret);
- }
-
/*
* If we read the page and we are configured to not
* trash the cache, set the oldest read generation so
@@ -169,8 +178,11 @@ __wt_page_in_func(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t flags
page->read_gen < __wt_cache_read_gen(session))
page->read_gen =
__wt_cache_read_gen_set(session);
-
- return (0);
+skip_evict:
+ /*
+ * Check if we need an autocommit transaction.
+ */
+ return (__wt_txn_autocommit_check(session));
WT_ILLEGAL_VALUE(session);
}
@@ -269,7 +281,7 @@ __wt_page_alloc(WT_SESSION_IMPL *session, uint8_t type,
size += sizeof(WT_REF);
}
if (0) {
-err: if ((pindex = WT_INTL_INDEX_COPY(page)) != NULL) {
+err: if ((pindex = WT_INTL_INDEX_GET_SAFE(page)) != NULL) {
for (i = 0; i < pindex->entries; ++i)
__wt_free(session, pindex->index[i]);
__wt_free(session, pindex);
@@ -456,7 +468,7 @@ __inmem_col_int(WT_SESSION_IMPL *session, WT_PAGE *page)
* Walk the page, building references: the page contains value items.
* The value items are on-page items (WT_CELL_VALUE).
*/
- pindex = WT_INTL_INDEX_COPY(page);
+ pindex = WT_INTL_INDEX_GET_SAFE(page);
refp = pindex->index;
WT_CELL_FOREACH(btree, dsk, cell, unpack, i) {
ref = *refp++;
@@ -591,7 +603,7 @@ __inmem_row_int(WT_SESSION_IMPL *session, WT_PAGE *page, size_t *sizep)
* location cookie pairs. Keys are on-page/overflow items and location
* cookies are WT_CELL_ADDR_XXX items.
*/
- pindex = WT_INTL_INDEX_COPY(page);
+ pindex = WT_INTL_INDEX_GET_SAFE(page);
refp = pindex->index;
WT_CELL_FOREACH(btree, dsk, cell, unpack, i) {
ref = *refp;
diff --git a/src/third_party/wiredtiger/src/btree/bt_ret.c b/src/third_party/wiredtiger/src/btree/bt_ret.c
index c37ff6dc809..5009a2096be 100644
--- a/src/third_party/wiredtiger/src/btree/bt_ret.c
+++ b/src/third_party/wiredtiger/src/btree/bt_ret.c
@@ -19,6 +19,7 @@ __wt_kv_return(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, WT_UPDATE *upd)
WT_CELL *cell;
WT_CELL_UNPACK unpack;
WT_CURSOR *cursor;
+ WT_ITEM *tmp;
WT_PAGE *page;
WT_ROW *rip;
uint8_t v;
@@ -79,8 +80,23 @@ __wt_kv_return(WT_SESSION_IMPL *session, WT_CURSOR_BTREE *cbt, WT_UPDATE *upd)
cursor->key.data = WT_INSERT_KEY(cbt->ins);
cursor->key.size = WT_INSERT_KEY_SIZE(cbt->ins);
} else if (cbt->compare == 0) {
- cursor->key.data = cbt->search_key.data;
- cursor->key.size = cbt->search_key.size;
+ /*
+ * If not in an insert list and there's an exact match,
+ * the row-store search function built the key we want
+ * to return in the cursor's temporary buffer. Swap the
+ * cursor's search-key and temporary buffers so we can
+ * return it (it's unsafe to return the temporary buffer
+ * itself because our caller might do another search in
+ * this table using the key we return, and we'd corrupt
+ * the search key during any subsequent search that used
+ * the temporary buffer.
+ */
+ tmp = cbt->row_key;
+ cbt->row_key = cbt->tmp;
+ cbt->tmp = tmp;
+
+ cursor->key.data = cbt->row_key->data;
+ cursor->key.size = cbt->row_key->size;
} else
WT_RET(__wt_row_leaf_key(
session, page, rip, &cursor->key, 0));
diff --git a/src/third_party/wiredtiger/src/btree/bt_slvg.c b/src/third_party/wiredtiger/src/btree/bt_slvg.c
index ba1802116d0..896ab23f1c2 100644
--- a/src/third_party/wiredtiger/src/btree/bt_slvg.c
+++ b/src/third_party/wiredtiger/src/btree/bt_slvg.c
@@ -1175,7 +1175,7 @@ __slvg_col_build_internal(
__wt_page_alloc(session, WT_PAGE_COL_INT, 1, leaf_cnt, 1, &page));
WT_ERR(__slvg_modify_init(session, page));
- pindex = WT_INTL_INDEX_COPY(page);
+ pindex = WT_INTL_INDEX_GET_SAFE(page);
for (refp = pindex->index, i = 0; i < ss->pages_next; ++i) {
if ((trk = ss->pages[i]) == NULL)
continue;
@@ -1820,7 +1820,7 @@ __slvg_row_build_internal(
__wt_page_alloc(session, WT_PAGE_ROW_INT, 0, leaf_cnt, 1, &page));
WT_ERR(__slvg_modify_init(session, page));
- pindex = WT_INTL_INDEX_COPY(page);
+ pindex = WT_INTL_INDEX_GET_SAFE(page);
for (refp = pindex->index, i = 0; i < ss->pages_next; ++i) {
if ((trk = ss->pages[i]) == NULL)
continue;
diff --git a/src/third_party/wiredtiger/src/btree/bt_split.c b/src/third_party/wiredtiger/src/btree/bt_split.c
index 9fc567f02c1..59ad7abb221 100644
--- a/src/third_party/wiredtiger/src/btree/bt_split.c
+++ b/src/third_party/wiredtiger/src/btree/bt_split.c
@@ -147,6 +147,9 @@ static int
__split_safe_free(WT_SESSION_IMPL *session,
uint64_t split_gen, int exclusive, void *p, size_t s)
{
+ /* We should only call safe free if we aren't pinning the memory. */
+ WT_ASSERT(session, session->split_gen != split_gen);
+
/*
* We have swapped something in a page: if we don't have exclusive
* access, check whether there are other threads in the same tree.
@@ -178,7 +181,13 @@ __split_should_deepen(
btree = S2BT(session);
page = ref->page;
- pindex = WT_INTL_INDEX_COPY(page);
+
+ /*
+ * Our caller is holding the parent page locked to single-thread splits,
+ * which means we can safely look at the page's index without setting a
+ * split generation.
+ */
+ pindex = WT_INTL_INDEX_GET_SAFE(page);
/*
* Deepen the tree if the page's memory footprint is larger than the
@@ -338,7 +347,7 @@ __split_verify_intl_key_order(WT_SESSION_IMPL *session, WT_PAGE *page)
switch (page->type) {
case WT_PAGE_COL_INT:
recno = 0;
- WT_INTL_FOREACH_BEGIN_SAFE(session, page, ref) {
+ WT_INTL_FOREACH_BEGIN(session, page, ref) {
WT_ASSERT(session, ref->key.recno > recno);
recno = ref->key.recno;
} WT_INTL_FOREACH_END;
@@ -350,7 +359,7 @@ __split_verify_intl_key_order(WT_SESSION_IMPL *session, WT_PAGE *page)
WT_CLEAR(_last);
first = 1;
- WT_INTL_FOREACH_BEGIN_SAFE(session, page, ref) {
+ WT_INTL_FOREACH_BEGIN(session, page, ref) {
__wt_ref_key(page, ref, &next->data, &next->size);
if (last->size == 0) {
if (first)
@@ -393,7 +402,12 @@ __split_deepen(WT_SESSION_IMPL *session, WT_PAGE *parent, uint32_t children)
parent_incr = parent_decr = 0;
panic = 0;
- pindex = WT_INTL_INDEX_COPY(parent);
+ /*
+ * Our caller is holding the parent page locked to single-thread splits,
+ * which means we can safely look at the page's index without setting a
+ * split generation.
+ */
+ pindex = WT_INTL_INDEX_GET_SAFE(parent);
WT_STAT_FAST_CONN_INCR(session, cache_eviction_deepen);
WT_STAT_FAST_DATA_INCR(session, cache_eviction_deepen);
@@ -491,7 +505,7 @@ __split_deepen(WT_SESSION_IMPL *session, WT_PAGE *parent, uint32_t children)
* to change.
*/
child_incr = 0;
- child_pindex = WT_INTL_INDEX_COPY(child);
+ child_pindex = WT_INTL_INDEX_GET_SAFE(child);
for (child_refp = child_pindex->index, j = 0; j < slots; ++j) {
WT_ERR(__split_ref_deepen_move(session,
parent, *parent_refp, &parent_decr, &child_incr));
@@ -505,11 +519,11 @@ __split_deepen(WT_SESSION_IMPL *session, WT_PAGE *parent, uint32_t children)
parent_refp - pindex->index == pindex->entries - SPLIT_CORRECT_1);
/*
- * Update the parent's index; this is the update which splits the page,
- * making the change visible to threads descending the tree. From now
- * on, we're committed to the split. If any subsequent work fails, we
- * have to panic because we potentially have threads of control using
- * the new page index we just swapped in.
+ * Confirm the parent page's index hasn't moved, then update it, which
+ * makes the split visible to threads descending the tree. From this
+ * point on, we're committed to the split. If subsequent work fails,
+ * we have to panic because we may have threads of control using the
+ * new page index we swap in.
*
* A note on error handling: until this point, there's no problem with
* unwinding on error. We allocated a new page index, a new set of
@@ -518,13 +532,14 @@ __split_deepen(WT_SESSION_IMPL *session, WT_PAGE *parent, uint32_t children)
* footprint. From now on we've modified the parent page, attention
* needs to be paid.
*/
- WT_ASSERT(session, WT_INTL_INDEX_COPY(parent) == pindex);
+ WT_ASSERT(session, WT_INTL_INDEX_GET_SAFE(parent) == pindex);
WT_INTL_INDEX_SET(parent, alloc_index);
split_gen = WT_ATOMIC_ADD8(S2C(session)->split_gen, 1);
panic = 1;
#ifdef HAVE_DIAGNOSTIC
- __split_verify_intl_key_order(session, parent);
+ WT_WITH_PAGE_INDEX(session,
+ __split_verify_intl_key_order(session, parent));
#endif
/*
@@ -555,9 +570,16 @@ __split_deepen(WT_SESSION_IMPL *session, WT_PAGE *parent, uint32_t children)
if (!WT_PAGE_IS_INTERNAL(child))
continue;
#ifdef HAVE_DIAGNOSTIC
- __split_verify_intl_key_order(session, child);
+ WT_WITH_PAGE_INDEX(session,
+ __split_verify_intl_key_order(session, child));
#endif
- WT_INTL_FOREACH_BEGIN_SAFE(session, child, child_ref) {
+ /*
+ * We have the parent locked, but there's nothing to prevent
+ * this child from splitting beneath us; ensure that reading
+ * the child's page index structure is safe.
+ */
+ WT_ENTER_PAGE_INDEX(session);
+ WT_INTL_FOREACH_BEGIN(session, child, child_ref) {
/*
* The page's parent reference may not be wrong, as we
* opened up access from the top of the tree already,
@@ -570,6 +592,7 @@ __split_deepen(WT_SESSION_IMPL *session, WT_PAGE *parent, uint32_t children)
child_ref->ref_hint = 0;
}
} WT_INTL_FOREACH_END;
+ WT_LEAVE_PAGE_INDEX(session);
}
/*
@@ -635,6 +658,7 @@ __split_multi_inmem(
WT_CLEAR(cbt);
cbt.iface.session = &session->iface;
cbt.btree = S2BT(session);
+ __wt_btcur_open(&cbt);
/*
* We can find unresolved updates when attempting to evict a page, which
@@ -731,9 +755,8 @@ __wt_multi_to_ref(WT_SESSION_IMPL *session,
addr = NULL;
incr = 0;
- /* In some cases, the underlying WT_REF has not yet been allocated. */
- if (*refp == NULL)
- WT_RET(__wt_calloc_one(session, refp));
+ /* Allocate an underlying WT_REF. */
+ WT_RET(__wt_calloc_one(session, refp));
ref = *refp;
incr += sizeof(WT_REF);
@@ -848,7 +871,11 @@ __split_parent(WT_SESSION_IMPL *session, WT_REF *ref,
hazard = 1;
}
- pindex = WT_INTL_INDEX_COPY(parent);
+ /*
+ * We've locked the parent above, which means it cannot split (which is
+ * the only reason to worry about split generation values).
+ */
+ pindex = WT_INTL_INDEX_GET_SAFE(parent);
parent_entries = pindex->entries;
/*
@@ -904,16 +931,17 @@ __split_parent(WT_SESSION_IMPL *session, WT_REF *ref,
}
/*
- * Update the parent page's index: this update makes the split visible
- * to threads descending the tree.
+ * Confirm the parent page's index hasn't moved then update it, which
+ * makes the split visible to threads descending the tree.
*/
- WT_ASSERT(session, WT_INTL_INDEX_COPY(parent) == pindex);
+ WT_ASSERT(session, WT_INTL_INDEX_GET_SAFE(parent) == pindex);
WT_INTL_INDEX_SET(parent, alloc_index);
split_gen = WT_ATOMIC_ADD8(S2C(session)->split_gen, 1);
alloc_index = NULL;
#ifdef HAVE_DIAGNOSTIC
- __split_verify_intl_key_order(session, parent);
+ WT_WITH_PAGE_INDEX(session,
+ __split_verify_intl_key_order(session, parent));
#endif
/*
diff --git a/src/third_party/wiredtiger/src/btree/bt_walk.c b/src/third_party/wiredtiger/src/btree/bt_walk.c
index 98411ce548d..fd25efec97e 100644
--- a/src/third_party/wiredtiger/src/btree/bt_walk.c
+++ b/src/third_party/wiredtiger/src/btree/bt_walk.c
@@ -272,7 +272,7 @@ descend: couple = ref;
page = ref->page;
if (page->type == WT_PAGE_ROW_INT ||
page->type == WT_PAGE_COL_INT) {
- pindex = WT_INTL_INDEX_COPY(page);
+ WT_INTL_INDEX_GET(session, page, pindex);
slot = prev ? pindex->entries - 1 : 0;
} else {
*refp = ref;
diff --git a/src/third_party/wiredtiger/src/btree/col_srch.c b/src/third_party/wiredtiger/src/btree/col_srch.c
index db1b565b439..d02f23ed164 100644
--- a/src/third_party/wiredtiger/src/btree/col_srch.c
+++ b/src/third_party/wiredtiger/src/btree/col_srch.c
@@ -31,10 +31,7 @@ __wt_col_search(WT_SESSION_IMPL *session,
__cursor_pos_clear(cbt);
- /*
- * In the service of eviction splits, we're only searching a single leaf
- * page, not a full tree.
- */
+ /* We may only be searching a single leaf page, not the full tree. */
if (leaf != NULL) {
current = leaf;
goto leaf_only;
@@ -49,8 +46,7 @@ restart: page = current->page;
WT_ASSERT(session, current->key.recno == page->pg_intl_recno);
- WT_ASSERT(session, session->split_gen != 0);
- pindex = WT_INTL_INDEX_COPY(page);
+ WT_INTL_INDEX_GET(session, page, pindex);
base = pindex->entries;
descent = pindex->index[base - 1];
@@ -123,24 +119,41 @@ leaf_only:
cbt->slot = UINT32_MAX;
/*
- * Search the leaf page. We do not check in the search path for a
- * record greater than the maximum record in the tree; in that case,
- * we arrive here with a record that's impossibly large for the page.
+ * Search the leaf page.
+ *
+ * Search after a page is pinned does a search of the pinned page before
+ * doing a full tree search, in which case we might be searching for a
+ * record logically before the page. Return failure, and there's nothing
+ * else to do, the record isn't going to be on this page.
+ *
+ * We don't check inside the search path for a record greater than the
+ * maximum record in the tree; in that case, we get here with a record
+ * that's impossibly large for the page. We do have additional setup to
+ * do in that case, the record may be appended to the page.
*/
if (page->type == WT_PAGE_COL_FIX) {
+ if (recno < page->pg_fix_recno) {
+ cbt->compare = 1;
+ return (0);
+ }
if (recno >= page->pg_fix_recno + page->pg_fix_entries) {
cbt->recno = page->pg_fix_recno + page->pg_fix_entries;
goto past_end;
} else
ins_head = WT_COL_UPDATE_SINGLE(page);
- } else
- if ((cip = __col_var_search(page, recno)) == NULL) {
+ } else {
+ if (recno < page->pg_var_recno) {
+ cbt->compare = 1;
+ return (0);
+ }
+ if ((cip = __col_var_search(page, recno, NULL)) == NULL) {
cbt->recno = __col_var_last_recno(page);
goto past_end;
} else {
cbt->slot = WT_COL_SLOT(page, cip);
ins_head = WT_COL_UPDATE_SLOT(page, cbt->slot);
}
+ }
/*
* We have a match on the page, check for an update. Check the page's
diff --git a/src/third_party/wiredtiger/src/btree/row_srch.c b/src/third_party/wiredtiger/src/btree/row_srch.c
index 9967c5ecb0c..6d65a89c15a 100644
--- a/src/third_party/wiredtiger/src/btree/row_srch.c
+++ b/src/third_party/wiredtiger/src/btree/row_srch.c
@@ -153,7 +153,7 @@ __wt_row_search(WT_SESSION_IMPL *session,
btree = S2BT(session);
collator = btree->collator;
- item = &cbt->search_key;
+ item = cbt->tmp;
__cursor_pos_clear(cbt);
@@ -178,10 +178,7 @@ __wt_row_search(WT_SESSION_IMPL *session,
append_check = insert && cbt->append_tree;
descend_right = 1;
- /*
- * In the service of eviction splits, we're only searching a single leaf
- * page, not a full tree.
- */
+ /* We may only be searching a single leaf page, not the full tree. */
if (leaf != NULL) {
current = leaf;
goto leaf_only;
@@ -195,8 +192,7 @@ restart: page = current->page;
if (page->type != WT_PAGE_ROW_INT)
break;
- WT_ASSERT(session, session->split_gen != 0);
- pindex = WT_INTL_INDEX_COPY(page);
+ WT_INTL_INDEX_GET(session, page, pindex);
/*
* Fast-path internal pages with one child, a common case for
@@ -488,8 +484,7 @@ restart:
if (page->type != WT_PAGE_ROW_INT)
break;
- WT_ASSERT(session, session->split_gen != 0);
- pindex = WT_INTL_INDEX_COPY(page);
+ WT_INTL_INDEX_GET(session, page, pindex);
descent = pindex->index[
__wt_random(session->rnd) % pindex->entries];
@@ -523,13 +518,12 @@ restart:
*/
cbt->ref = current;
cbt->compare = 0;
- WT_ASSERT(session, session->split_gen != 0);
- pindex = WT_INTL_INDEX_COPY(btree->root.page);
+ WT_INTL_INDEX_GET(session, btree->root.page, pindex);
cbt->slot = pindex->entries < 2 ?
__wt_random(session->rnd) % page->pg_row_entries : 0;
return (__wt_row_leaf_key(session,
- page, page->pg_row_d + cbt->slot, &cbt->search_key, 0));
+ page, page->pg_row_d + cbt->slot, cbt->tmp, 0));
}
/*
diff --git a/src/third_party/wiredtiger/src/config/config.c b/src/third_party/wiredtiger/src/config/config.c
index fbb5a528ec7..2b3b9e6ca4b 100644
--- a/src/third_party/wiredtiger/src/config/config.c
+++ b/src/third_party/wiredtiger/src/config/config.c
@@ -621,21 +621,31 @@ __config_getraw(
*/
int
__wt_config_get(WT_SESSION_IMPL *session,
- const char **cfg, WT_CONFIG_ITEM *key, WT_CONFIG_ITEM *value)
+ const char **cfg_arg, WT_CONFIG_ITEM *key, WT_CONFIG_ITEM *value)
{
WT_CONFIG cparser;
WT_DECL_RET;
- int found;
+ const char **cfg;
+
+ if (cfg_arg[0] == NULL)
+ return (WT_NOTFOUND);
+
+ /*
+ * Search the strings in reverse order, that way the first hit wins
+ * and we don't search the base set until there's no other choice.
+ */
+ for (cfg = cfg_arg; *cfg != NULL; ++cfg)
+ ;
+ do {
+ --cfg;
- for (found = 0; *cfg != NULL; cfg++) {
WT_RET(__wt_config_init(session, &cparser, *cfg));
if ((ret = __config_getraw(&cparser, key, value, 1)) == 0)
- found = 1;
- else if (ret != WT_NOTFOUND)
- return (ret);
- }
+ return (0);
+ WT_RET_NOTFOUND_OK(ret);
+ } while (cfg != cfg_arg);
- return (found ? 0 : WT_NOTFOUND);
+ return (WT_NOTFOUND);
}
/*
diff --git a/src/third_party/wiredtiger/src/config/config_api.c b/src/third_party/wiredtiger/src/config/config_api.c
index d956b2d677d..deff33a10bd 100644
--- a/src/third_party/wiredtiger/src/config/config_api.c
+++ b/src/third_party/wiredtiger/src/config/config_api.c
@@ -94,8 +94,7 @@ wiredtiger_config_parser_open(WT_SESSION *wt_session,
* structure for iterations through the configuration string.
*/
memcpy(&config_parser->config_item, &config_item, sizeof(config_item));
- WT_ERR(__wt_config_initn(
- session, &config_parser->config, config, len));
+ WT_ERR(__wt_config_initn(session, &config_parser->config, config, len));
if (ret == 0)
*config_parserp = (WT_CONFIG_PARSER *)config_parser;
@@ -104,3 +103,280 @@ err: __wt_free(session, config_parser);
return (ret);
}
+
+/*
+ * wiredtiger_config_validate --
+ * Validate a configuration string.
+ */
+int
+wiredtiger_config_validate(WT_SESSION *wt_session,
+ WT_EVENT_HANDLER *handler, const char *name, const char *config)
+{
+ WT_CONNECTION_IMPL *conn, dummy_conn;
+ WT_SESSION_IMPL *session;
+ const WT_CONFIG_ENTRY *ep, **epp;
+
+ session = (WT_SESSION_IMPL *)wt_session;
+
+ /*
+ * It's a logic error to specify both a session and an event handler.
+ */
+ if (session != NULL && handler != NULL)
+ WT_RET_MSG(session, EINVAL,
+ "wiredtiger_config_validate error handler ignored when "
+ "a session also specified");
+
+ /*
+ * If we're not given a session, but we do have an event handler, build
+ * a fake session/connection pair and configure the event handler.
+ */
+ conn = NULL;
+ if (session == NULL && handler != NULL) {
+ WT_CLEAR(dummy_conn);
+ conn = &dummy_conn;
+ session = conn->default_session = &conn->dummy_session;
+ session->iface.connection = &conn->iface;
+ session->name = "wiredtiger_config_validate";
+ __wt_event_handler_set(session, handler);
+ }
+ if (session != NULL)
+ conn = S2C(session);
+
+ if (name == NULL)
+ WT_RET_MSG(session, EINVAL, "no name specified");
+ if (config == NULL)
+ WT_RET_MSG(session, EINVAL, "no configuration specified");
+
+ /*
+ * If we don't have a real connection, look for a matching name in the
+ * static list, otherwise look in the configuration list (which has any
+ * configuration information the application has added).
+ */
+ if (session == NULL || conn == NULL || conn->config_entries == NULL)
+ ep = __wt_conn_config_match(name);
+ else {
+ ep = NULL;
+ for (epp = conn->config_entries;
+ *epp != NULL && (*epp)->method != NULL; ++epp)
+ if (strcmp((*epp)->method, name) == 0) {
+ ep = *epp;
+ break;
+ }
+ }
+ if (ep == NULL)
+ WT_RET_MSG(session, EINVAL,
+ "unknown or unsupported configuration API: %s",
+ name);
+
+ return (__wt_config_check(session, ep, config, 0));
+}
+
+/*
+ * __conn_foc_add --
+ * Add a new entry into the connection's free-on-close list.
+ */
+static int
+__conn_foc_add(WT_SESSION_IMPL *session, const void *p)
+{
+ WT_CONNECTION_IMPL *conn;
+
+ conn = S2C(session);
+
+ /*
+ * Our caller is expected to be holding any locks we need.
+ */
+ WT_RET(__wt_realloc_def(
+ session, &conn->foc_size, conn->foc_cnt + 1, &conn->foc));
+
+ conn->foc[conn->foc_cnt++] = (void *)p;
+ return (0);
+}
+
+/*
+ * __wt_conn_foc_discard --
+ * Discard any memory the connection accumulated.
+ */
+void
+__wt_conn_foc_discard(WT_SESSION_IMPL *session)
+{
+ WT_CONNECTION_IMPL *conn;
+ size_t i;
+
+ conn = S2C(session);
+
+ /*
+ * If we have a list of chunks to free, run through the list, then
+ * free the list itself.
+ */
+ for (i = 0; i < conn->foc_cnt; ++i)
+ __wt_free(session, conn->foc[i]);
+ __wt_free(session, conn->foc);
+}
+
+/*
+ * __wt_configure_method --
+ * WT_CONNECTION.configure_method.
+ */
+int
+__wt_configure_method(WT_SESSION_IMPL *session,
+ const char *method, const char *uri,
+ const char *config, const char *type, const char *check)
+{
+ const WT_CONFIG_CHECK *cp;
+ WT_CONFIG_CHECK *checks, *newcheck;
+ const WT_CONFIG_ENTRY **epp;
+ WT_CONFIG_ENTRY *entry;
+ WT_CONNECTION_IMPL *conn;
+ WT_DECL_RET;
+ size_t cnt;
+ char *newcheck_name, *p;
+
+ /*
+ * !!!
+ * We ignore the specified uri, that is, all new configuration options
+ * will be valid for all data sources. That shouldn't be too bad
+ * as the worst that can happen is an application might specify some
+ * configuration option and not get an error -- the option should be
+ * ignored by the underlying implementation since it's unexpected, so
+ * there shouldn't be any real problems. Eventually I expect we will
+ * get the whole data-source thing sorted, at which time there may be
+ * configuration arrays for each data source, and that's when the uri
+ * will matter.
+ */
+ WT_UNUSED(uri);
+
+ conn = S2C(session);
+ checks = newcheck = NULL;
+ entry = NULL;
+ newcheck_name = NULL;
+
+ /* Argument checking; we only support a limited number of types. */
+ if (config == NULL)
+ WT_RET_MSG(session, EINVAL, "no configuration specified");
+ if (type == NULL)
+ WT_RET_MSG(session, EINVAL, "no configuration type specified");
+ if (strcmp(type, "boolean") != 0 && strcmp(type, "int") != 0 &&
+ strcmp(type, "list") != 0 && strcmp(type, "string") != 0)
+ WT_RET_MSG(session, EINVAL,
+ "type must be one of \"boolean\", \"int\", \"list\" or "
+ "\"string\"");
+
+ /*
+ * Translate the method name to our configuration names, then find a
+ * match.
+ */
+ for (epp = conn->config_entries;
+ *epp != NULL && (*epp)->method != NULL; ++epp)
+ if (strcmp((*epp)->method, method) == 0)
+ break;
+ if (*epp == NULL || (*epp)->method == NULL)
+ WT_RET_MSG(session,
+ WT_NOTFOUND, "no method matching %s found", method);
+
+ /*
+ * Technically possible for threads to race, lock the connection while
+ * adding the new configuration information. We're holding the lock
+ * for an extended period of time, but configuration changes should be
+ * rare and only happen during startup.
+ */
+ __wt_spin_lock(session, &conn->api_lock);
+
+ /*
+ * Allocate new configuration entry and fill it in.
+ *
+ * The new base value is the previous base value, a separator and the
+ * new configuration string.
+ */
+ WT_ERR(__wt_calloc_one(session, &entry));
+ entry->method = (*epp)->method;
+ WT_ERR(__wt_calloc_def(session,
+ strlen((*epp)->base) + strlen(",") + strlen(config) + 1, &p));
+ (void)strcpy(p, (*epp)->base);
+ (void)strcat(p, ",");
+ (void)strcat(p, config);
+ entry->base = p;
+
+ /*
+ * There may be a default value in the config argument passed in (for
+ * example, (kvs_parallelism=64"). The default value isn't part of the
+ * name, build a new one.
+ */
+ WT_ERR(__wt_strdup(session, config, &newcheck_name));
+ if ((p = strchr(newcheck_name, '=')) != NULL)
+ *p = '\0';
+
+ /*
+ * The new configuration name may replace an existing check with new
+ * information, in that case skip the old version.
+ */
+ cnt = 0;
+ if ((*epp)->checks != NULL)
+ for (cp = (*epp)->checks; cp->name != NULL; ++cp)
+ ++cnt;
+ WT_ERR(__wt_calloc_def(session, cnt + 2, &checks));
+ cnt = 0;
+ if ((*epp)->checks != NULL)
+ for (cp = (*epp)->checks; cp->name != NULL; ++cp)
+ if (strcmp(newcheck_name, cp->name) != 0)
+ checks[cnt++] = *cp;
+ newcheck = &checks[cnt];
+ newcheck->name = newcheck_name;
+ WT_ERR(__wt_strdup(session, type, &newcheck->type));
+ if (check != NULL)
+ WT_ERR(__wt_strdup(session, check, &newcheck->checks));
+ entry->checks = checks;
+ entry->checks_entries = 0;
+
+ /*
+ * Confirm the configuration string passes the new set of
+ * checks.
+ */
+ WT_ERR(__wt_config_check(session, entry, config, 0));
+
+ /*
+ * The next time this configuration is updated, we don't want to figure
+ * out which of these pieces of memory were allocated and will need to
+ * be free'd on close (this isn't a heavily used API and it's too much
+ * work); add them all to the free-on-close list now. We don't check
+ * for errors deliberately, we'd have to figure out which elements have
+ * already been added to the free-on-close array and which have not in
+ * order to avoid freeing chunks of memory twice. Again, this isn't a
+ * commonly used API and it shouldn't ever happen, just leak it.
+ */
+ (void)__conn_foc_add(session, entry->base);
+ (void)__conn_foc_add(session, entry);
+ (void)__conn_foc_add(session, checks);
+ (void)__conn_foc_add(session, newcheck->type);
+ (void)__conn_foc_add(session, newcheck->checks);
+ (void)__conn_foc_add(session, newcheck_name);
+
+ /*
+ * Instead of using locks to protect configuration information, assume
+ * we can atomically update a pointer to a chunk of memory, and because
+ * a pointer is never partially written, readers will correctly see the
+ * original or new versions of the memory. Readers might be using the
+ * old version as it's being updated, though, which means we cannot free
+ * the old chunk of memory until all possible readers have finished.
+ * Currently, that's on connection close: in other words, we can use
+ * this because it's small amounts of memory, and we really, really do
+ * not want to acquire locks every time we access configuration strings,
+ * since that's done on every API call.
+ */
+ WT_PUBLISH(*epp, entry);
+
+ if (0) {
+err: if (entry != NULL) {
+ __wt_free(session, entry->base);
+ __wt_free(session, entry);
+ }
+ __wt_free(session, checks);
+ if (newcheck != NULL) {
+ __wt_free(session, newcheck->type);
+ __wt_free(session, newcheck->checks);
+ }
+ __wt_free(session, newcheck_name);
+ }
+
+ __wt_spin_unlock(session, &conn->api_lock);
+ return (ret);
+}
diff --git a/src/third_party/wiredtiger/src/config/config_check.c b/src/third_party/wiredtiger/src/config/config_check.c
index 391209104c7..b09a1a10a85 100644
--- a/src/third_party/wiredtiger/src/config/config_check.c
+++ b/src/third_party/wiredtiger/src/config/config_check.c
@@ -9,228 +9,65 @@
#include "wt_internal.h"
static int config_check(
- WT_SESSION_IMPL *, const WT_CONFIG_CHECK *, const char *, size_t);
+ WT_SESSION_IMPL *, const WT_CONFIG_CHECK *, u_int, const char *, size_t);
/*
- * __conn_foc_add --
- * Add a new entry into the connection's free-on-close list.
- */
-static int
-__conn_foc_add(WT_SESSION_IMPL *session, const void *p)
-{
- WT_CONNECTION_IMPL *conn;
-
- conn = S2C(session);
-
- /*
- * Our caller is expected to be holding any locks we need.
- */
- WT_RET(__wt_realloc_def(
- session, &conn->foc_size, conn->foc_cnt + 1, &conn->foc));
-
- conn->foc[conn->foc_cnt++] = (void *)p;
- return (0);
-}
-
-/*
- * __wt_conn_foc_discard --
- * Discard any memory the connection accumulated.
+ * __wt_config_check --
+ * Check the keys in an application-supplied config string match what is
+ * specified in an array of check strings.
*/
-void
-__wt_conn_foc_discard(WT_SESSION_IMPL *session)
+int
+__wt_config_check(WT_SESSION_IMPL *session,
+ const WT_CONFIG_ENTRY *entry, const char *config, size_t config_len)
{
- WT_CONNECTION_IMPL *conn;
- size_t i;
-
- conn = S2C(session);
-
/*
- * If we have a list of chunks to free, run through the list, then
- * free the list itself.
+ * Callers don't check, it's a fast call without a configuration or
+ * check array.
*/
- for (i = 0; i < conn->foc_cnt; ++i)
- __wt_free(session, conn->foc[i]);
- __wt_free(session, conn->foc);
+ return (config == NULL || entry->checks == NULL ? 0 :
+ config_check(session,
+ entry->checks, entry->checks_entries, config, config_len));
}
/*
- * __wt_configure_method --
- * WT_CONNECTION.configure_method.
+ * config_check_search --
+ * Search a set of checks for a matching name.
*/
-int
-__wt_configure_method(WT_SESSION_IMPL *session,
- const char *method, const char *uri,
- const char *config, const char *type, const char *check)
+static inline int
+config_check_search(WT_SESSION_IMPL *session,
+ const WT_CONFIG_CHECK *checks, u_int entries,
+ const char *str, size_t len, int *ip)
{
- const WT_CONFIG_CHECK *cp;
- WT_CONFIG_CHECK *checks, *newcheck;
- const WT_CONFIG_ENTRY **epp;
- WT_CONFIG_ENTRY *entry;
- WT_CONNECTION_IMPL *conn;
- WT_DECL_RET;
- size_t cnt;
- char *newcheck_name, *p;
-
- /*
- * !!!
- * We ignore the specified uri, that is, all new configuration options
- * will be valid for all data sources. That shouldn't be too bad
- * as the worst that can happen is an application might specify some
- * configuration option and not get an error -- the option should be
- * ignored by the underlying implementation since it's unexpected, so
- * there shouldn't be any real problems. Eventually I expect we will
- * get the whole data-source thing sorted, at which time there may be
- * configuration arrays for each data source, and that's when the uri
- * will matter.
- */
- WT_UNUSED(uri);
-
- conn = S2C(session);
- checks = newcheck = NULL;
- entry = NULL;
- newcheck_name = NULL;
-
- /* Argument checking; we only support a limited number of types. */
- if (config == NULL)
- WT_RET_MSG(session, EINVAL, "no configuration specified");
- if (type == NULL)
- WT_RET_MSG(session, EINVAL, "no configuration type specified");
- if (strcmp(type, "boolean") != 0 && strcmp(type, "int") != 0 &&
- strcmp(type, "list") != 0 && strcmp(type, "string") != 0)
- WT_RET_MSG(session, EINVAL,
- "type must be one of \"boolean\", \"int\", \"list\" or "
- "\"string\"");
-
- /* Find a match for the method name. */
- for (epp = conn->config_entries; (*epp)->method != NULL; ++epp)
- if (strcmp((*epp)->method, method) == 0)
- break;
- if ((*epp)->method == NULL)
- WT_RET_MSG(session,
- WT_NOTFOUND, "no method matching %s found", method);
-
- /*
- * Technically possible for threads to race, lock the connection while
- * adding the new configuration information. We're holding the lock
- * for an extended period of time, but configuration changes should be
- * rare and only happen during startup.
- */
- __wt_spin_lock(session, &conn->api_lock);
-
- /*
- * Allocate new configuration entry and fill it in.
- *
- * The new base value is the previous base value, a separator and the
- * new configuration string.
- */
- WT_ERR(__wt_calloc_one(session, &entry));
- entry->method = (*epp)->method;
- WT_ERR(__wt_calloc_def(session,
- strlen((*epp)->base) + strlen(",") + strlen(config) + 1, &p));
- (void)strcpy(p, (*epp)->base);
- (void)strcat(p, ",");
- (void)strcat(p, config);
- entry->base = p;
+ u_int base, indx, limit;
+ int cmp;
/*
- * There may be a default value in the config argument passed in (for
- * example, (kvs_parallelism=64"). The default value isn't part of the
- * name, build a new one.
+ * For standard sets of configuration information, we know how many
+ * entries and that they're sorted, do a binary search. Else, do it
+ * the slow way.
*/
- WT_ERR(__wt_strdup(session, config, &newcheck_name));
- if ((p = strchr(newcheck_name, '=')) != NULL)
- *p = '\0';
-
- /*
- * The new configuration name may replace an existing check with new
- * information, in that case skip the old version.
- */
- cnt = 0;
- if ((*epp)->checks != NULL)
- for (cp = (*epp)->checks; cp->name != NULL; ++cp)
- ++cnt;
- WT_ERR(__wt_calloc_def(session, cnt + 2, &checks));
- cnt = 0;
- if ((*epp)->checks != NULL)
- for (cp = (*epp)->checks; cp->name != NULL; ++cp)
- if (strcmp(newcheck_name, cp->name) != 0)
- checks[cnt++] = *cp;
- newcheck = &checks[cnt];
- newcheck->name = newcheck_name;
- WT_ERR(__wt_strdup(session, type, &newcheck->type));
- if (check != NULL)
- WT_ERR(__wt_strdup(session, check, &newcheck->checks));
- entry->checks = checks;
-
- /*
- * Confirm the configuration string passes the new set of
- * checks.
- */
- WT_ERR(config_check(session, entry->checks, config, 0));
-
- /*
- * The next time this configuration is updated, we don't want to figure
- * out which of these pieces of memory were allocated and will need to
- * be free'd on close (this isn't a heavily used API and it's too much
- * work); add them all to the free-on-close list now. We don't check
- * for errors deliberately, we'd have to figure out which elements have
- * already been added to the free-on-close array and which have not in
- * order to avoid freeing chunks of memory twice. Again, this isn't a
- * commonly used API and it shouldn't ever happen, just leak it.
- */
- (void)__conn_foc_add(session, entry->base);
- (void)__conn_foc_add(session, entry);
- (void)__conn_foc_add(session, checks);
- (void)__conn_foc_add(session, newcheck->type);
- (void)__conn_foc_add(session, newcheck->checks);
- (void)__conn_foc_add(session, newcheck_name);
-
- /*
- * Instead of using locks to protect configuration information, assume
- * we can atomically update a pointer to a chunk of memory, and because
- * a pointer is never partially written, readers will correctly see the
- * original or new versions of the memory. Readers might be using the
- * old version as it's being updated, though, which means we cannot free
- * the old chunk of memory until all possible readers have finished.
- * Currently, that's on connection close: in other words, we can use
- * this because it's small amounts of memory, and we really, really do
- * not want to acquire locks every time we access configuration strings,
- * since that's done on every API call.
- */
- WT_PUBLISH(*epp, entry);
-
- if (0) {
-err: if (entry != NULL) {
- __wt_free(session, entry->base);
- __wt_free(session, entry);
- }
- __wt_free(session, checks);
- if (newcheck != NULL) {
- __wt_free(session, newcheck->type);
- __wt_free(session, newcheck->checks);
+ if (entries == 0) {
+ for (indx = 0; checks[indx].name != NULL; indx++)
+ if (WT_STRING_MATCH(checks[indx].name, str, len)) {
+ *ip = (int)indx;
+ return (0);
+ }
+ } else
+ for (base = 0, limit = entries; limit != 0; limit >>= 1) {
+ indx = base + (limit >> 1);
+ cmp = strncmp(checks[indx].name, str, len);
+ if (cmp == 0 && checks[indx].name[len] == '\0') {
+ *ip = (int)indx;
+ return (0);
+ }
+ if (cmp < 0) {
+ base = indx + 1;
+ --limit;
+ }
}
- __wt_free(session, newcheck_name);
- }
-
- __wt_spin_unlock(session, &conn->api_lock);
- return (ret);
-}
-/*
- * __wt_config_check --
- * Check the keys in an application-supplied config string match what is
- * specified in an array of check strings.
- */
-int
-__wt_config_check(WT_SESSION_IMPL *session,
- const WT_CONFIG_ENTRY *entry, const char *config, size_t config_len)
-{
- /*
- * Callers don't check, it's a fast call without a configuration or
- * check array.
- */
- return (config == NULL || entry->checks == NULL ?
- 0 : config_check(session, entry->checks, config, config_len));
+ WT_RET_MSG(session, EINVAL,
+ "unknown configuration key: '%.*s'", (int)len, str);
}
/*
@@ -240,7 +77,8 @@ __wt_config_check(WT_SESSION_IMPL *session,
*/
static int
config_check(WT_SESSION_IMPL *session,
- const WT_CONFIG_CHECK *checks, const char *config, size_t config_len)
+ const WT_CONFIG_CHECK *checks, u_int checks_entries,
+ const char *config, size_t config_len)
{
WT_CONFIG parser, cparser, sparser;
WT_CONFIG_ITEM k, v, ck, cv, dummy;
@@ -263,13 +101,8 @@ config_check(WT_SESSION_IMPL *session,
(int)k.len, k.str);
/* Search for a matching entry. */
- for (i = 0; checks[i].name != NULL; i++)
- if (WT_STRING_MATCH(checks[i].name, k.str, k.len))
- break;
- if (checks[i].name == NULL)
- WT_RET_MSG(session, EINVAL,
- "unknown configuration key: '%.*s'",
- (int)k.len, k.str);
+ WT_RET(config_check_search(
+ session, checks, checks_entries, k.str, k.len, &i));
if (strcmp(checks[i].type, "boolean") == 0) {
badtype = (v.type != WT_CONFIG_ITEM_BOOL &&
@@ -278,7 +111,7 @@ config_check(WT_SESSION_IMPL *session,
} else if (strcmp(checks[i].type, "category") == 0) {
/* Deal with categories of the form: XXX=(XXX=blah). */
ret = config_check(session,
- checks[i].subconfigs,
+ checks[i].subconfigs, checks[i].subconfigs_entries,
k.str + strlen(checks[i].name) + 1, v.len);
if (ret != EINVAL)
badtype = 0;
diff --git a/src/third_party/wiredtiger/src/config/config_collapse.c b/src/third_party/wiredtiger/src/config/config_collapse.c
index 23cb03c9b3a..564798ecc42 100644
--- a/src/third_party/wiredtiger/src/config/config_collapse.c
+++ b/src/third_party/wiredtiger/src/config/config_collapse.c
@@ -92,6 +92,7 @@ err: __wt_scr_free(session, &tmp);
typedef struct {
char *k, *v; /* key, value */
size_t gen; /* generation */
+ int strip; /* remove the value */
} WT_CONFIG_MERGE_ENTRY;
/*
@@ -110,7 +111,7 @@ typedef struct {
*/
static int
__config_merge_scan(WT_SESSION_IMPL *session,
- const char *key, const char *value, WT_CONFIG_MERGE *cp)
+ const char *key, const char *value, int strip, WT_CONFIG_MERGE *cp)
{
WT_CONFIG cparser;
WT_CONFIG_ITEM k, v;
@@ -180,7 +181,7 @@ __config_merge_scan(WT_SESSION_IMPL *session,
if (v.type == WT_CONFIG_ITEM_STRUCT &&
strchr(vb->data, '=') != NULL) {
WT_ERR(__config_merge_scan(
- session, kb->data, vb->data, cp));
+ session, kb->data, vb->data, strip, cp));
continue;
}
@@ -193,6 +194,7 @@ __config_merge_scan(WT_SESSION_IMPL *session,
WT_ERR(__wt_strndup(session,
vb->data, vb->size, &cp->entries[cp->entries_next].v));
cp->entries[cp->entries_next].gen = cp->entries_next;
+ cp->entries[cp->entries_next].strip = strip;
++cp->entries_next;
}
WT_ERR_NOTFOUND_OK(ret);
@@ -222,8 +224,8 @@ __config_merge_format_next(WT_SESSION_IMPL *session, const char *prefix,
size_t plen, size_t *enp, WT_CONFIG_MERGE *cp, WT_ITEM *build)
{
WT_CONFIG_MERGE_ENTRY *ep;
- size_t len1, len2, next;
- char *p;
+ size_t len1, len2, next, saved_len;
+ const char *p;
for (; *enp < cp->entries_next; ++*enp) {
ep = &cp->entries[*enp];
@@ -267,6 +269,9 @@ __config_merge_format_next(WT_SESSION_IMPL *session, const char *prefix,
* new level.
*/
if ((p = strchr(ep->k + plen, SEPC)) != NULL) {
+ /* Save the start location of the new level. */
+ saved_len = build->size;
+
next = WT_PTRDIFF(p, ep->k);
WT_RET(__wt_buf_catfmt(session,
build, "%.*s=(", (int)(next - plen), ep->k + plen));
@@ -274,9 +279,22 @@ __config_merge_format_next(WT_SESSION_IMPL *session, const char *prefix,
session, ep->k, next + 1, enp, cp, build));
__strip_comma(build);
WT_RET(__wt_buf_catfmt(session, build, "),"));
+
+ /*
+ * It's possible the level contained nothing, check and
+ * discard empty levels.
+ */
+ p = build->data;
+ if (p[build->size - 3] == '(')
+ build->size = saved_len;
+
continue;
}
+ /* Discard flagged entries. */
+ if (ep->strip)
+ continue;
+
/* Append the entry to the buffer. */
WT_RET(__wt_buf_catfmt(
session, build, "%s=%s,", ep->k + plen, ep->v));
@@ -330,23 +348,26 @@ __config_merge_cmp(const void *a, const void *b)
/*
* __wt_config_merge --
- * Merge a set of configuration strings into newly allocated memory.
+ * Merge a set of configuration strings into newly allocated memory,
+ * optionally discarding configuration items.
*
* This function takes a NULL-terminated list of configuration strings (where
* the values are in order from least to most preferred), and merges them into
* newly allocated memory. The algorithm is to walk the configuration strings
* and build a table of each key/value pair. The pairs are sorted based on the
* name and the configuration string in which they were found, and a final
- * configuration string is built from the result.
+ * configuration string is built from the result. Additionally, a configuration
+ * string can be specified and those configuration values are removed from the
+ * final string.
*
* Note:
- * Nested structures are parsed and merge. For example, if configuration
+ * Nested structures are parsed and merged. For example, if configuration
* strings "key=(k1=v1,k2=v2)" and "key=(k1=v2)" appear, the result will
* be "key=(k1=v2,k2=v2)" because the nested values are merged.
*/
int
-__wt_config_merge(
- WT_SESSION_IMPL *session, const char **cfg, const char **config_ret)
+__wt_config_merge(WT_SESSION_IMPL *session,
+ const char **cfg, const char *cfg_strip, const char **config_ret)
{
WT_CONFIG_MERGE merge;
WT_DECL_RET;
@@ -358,9 +379,16 @@ __wt_config_merge(
WT_RET(__wt_realloc_def(
session, &merge.entries_allocated, 100, &merge.entries));
- /* Scan the configuration strings, entering them into the array. */
+ /*
+ * Scan the configuration strings, entering them into the array. The
+ * list of configuration values to be removed must be scanned last
+ * so their generation numbers are the highest.
+ */
for (; *cfg != NULL; ++cfg)
- WT_ERR(__config_merge_scan(session, NULL, *cfg, &merge));
+ WT_ERR(__config_merge_scan(session, NULL, *cfg, 0, &merge));
+ if (cfg_strip != NULL)
+ WT_ERR(
+ __config_merge_scan(session, NULL, cfg_strip, 1, &merge));
/*
* Sort the array by key and, in the case of identical keys, by
diff --git a/src/third_party/wiredtiger/src/config/config_def.c b/src/third_party/wiredtiger/src/config/config_def.c
index 57b5b25ce36..3b043d69c2e 100644
--- a/src/third_party/wiredtiger/src/config/config_def.c
+++ b/src/third_party/wiredtiger/src/config/config_def.c
@@ -2,722 +2,762 @@
#include "wt_internal.h"
-static const WT_CONFIG_CHECK confchk_colgroup_meta[] = {
- { "app_metadata", "string", NULL, NULL, NULL },
- { "collator", "string", __wt_collator_confchk, NULL, NULL },
- { "columns", "list", NULL, NULL, NULL },
- { "source", "string", NULL, NULL, NULL },
- { "type", "string", NULL, NULL, NULL },
- { NULL, NULL, NULL, NULL, NULL }
-};
-
-static const WT_CONFIG_CHECK confchk_connection_async_new_op[] = {
- { "append", "boolean", NULL, NULL, NULL },
- { "overwrite", "boolean", NULL, NULL, NULL },
- { "raw", "boolean", NULL, NULL, NULL },
- { "timeout", "int", NULL, NULL, NULL },
- { NULL, NULL, NULL, NULL, NULL }
+static const WT_CONFIG_CHECK confchk_WT_CONNECTION_async_new_op[] = {
+ { "append", "boolean", NULL, NULL, NULL, 0 },
+ { "overwrite", "boolean", NULL, NULL, NULL, 0 },
+ { "raw", "boolean", NULL, NULL, NULL, 0 },
+ { "timeout", "int", NULL, NULL, NULL, 0 },
+ { NULL, NULL, NULL, NULL, NULL, 0 }
};
-static const WT_CONFIG_CHECK confchk_connection_close[] = {
- { "leak_memory", "boolean", NULL, NULL, NULL },
- { NULL, NULL, NULL, NULL, NULL }
+static const WT_CONFIG_CHECK confchk_WT_CONNECTION_close[] = {
+ { "leak_memory", "boolean", NULL, NULL, NULL, 0 },
+ { NULL, NULL, NULL, NULL, NULL, 0 }
};
-static const WT_CONFIG_CHECK confchk_connection_load_extension[] = {
- { "config", "string", NULL, NULL, NULL },
- { "entry", "string", NULL, NULL, NULL },
- { "terminate", "string", NULL, NULL, NULL },
- { NULL, NULL, NULL, NULL, NULL }
+static const WT_CONFIG_CHECK confchk_WT_CONNECTION_load_extension[] = {
+ { "config", "string", NULL, NULL, NULL, 0 },
+ { "entry", "string", NULL, NULL, NULL, 0 },
+ { "terminate", "string", NULL, NULL, NULL, 0 },
+ { NULL, NULL, NULL, NULL, NULL, 0 }
};
-static const WT_CONFIG_CHECK confchk_connection_open_session[] = {
+static const WT_CONFIG_CHECK confchk_WT_CONNECTION_open_session[] = {
{ "isolation", "string",
NULL, "choices=[\"read-uncommitted\",\"read-committed\","
"\"snapshot\"]",
- NULL },
- { NULL, NULL, NULL, NULL, NULL }
+ NULL, 0 },
+ { NULL, NULL, NULL, NULL, NULL, 0 }
};
-static const WT_CONFIG_CHECK confchk_async_subconfigs[] = {
- { "enabled", "boolean", NULL, NULL, NULL },
- { "ops_max", "int", NULL, "min=1,max=4096", NULL },
- { "threads", "int", NULL, "min=1,max=20", NULL },
- { NULL, NULL, NULL, NULL, NULL }
+static const WT_CONFIG_CHECK
+ confchk_wiredtiger_open_async_subconfigs[] = {
+ { "enabled", "boolean", NULL, NULL, NULL, 0 },
+ { "ops_max", "int", NULL, "min=1,max=4096", NULL, 0 },
+ { "threads", "int", NULL, "min=1,max=20", NULL, 0 },
+ { NULL, NULL, NULL, NULL, NULL, 0 }
};
-static const WT_CONFIG_CHECK confchk_checkpoint_subconfigs[] = {
- { "log_size", "int", NULL, "min=0,max=2GB", NULL },
- { "name", "string", NULL, NULL, NULL },
- { "wait", "int", NULL, "min=0,max=100000", NULL },
- { NULL, NULL, NULL, NULL, NULL }
+static const WT_CONFIG_CHECK
+ confchk_wiredtiger_open_checkpoint_subconfigs[] = {
+ { "log_size", "int", NULL, "min=0,max=2GB", NULL, 0 },
+ { "name", "string", NULL, NULL, NULL, 0 },
+ { "wait", "int", NULL, "min=0,max=100000", NULL, 0 },
+ { NULL, NULL, NULL, NULL, NULL, 0 }
};
-static const WT_CONFIG_CHECK confchk_eviction_subconfigs[] = {
- { "threads_max", "int", NULL, "min=1,max=20", NULL },
- { "threads_min", "int", NULL, "min=1,max=20", NULL },
- { NULL, NULL, NULL, NULL, NULL }
+static const WT_CONFIG_CHECK
+ confchk_wiredtiger_open_eviction_subconfigs[] = {
+ { "threads_max", "int", NULL, "min=1,max=20", NULL, 0 },
+ { "threads_min", "int", NULL, "min=1,max=20", NULL, 0 },
+ { NULL, NULL, NULL, NULL, NULL, 0 }
};
-static const WT_CONFIG_CHECK confchk_file_manager_subconfigs[] = {
- { "close_idle_time", "int", NULL, "min=1,max=1000", NULL },
- { "close_scan_interval", "int", NULL, "min=1,max=1000", NULL },
- { NULL, NULL, NULL, NULL, NULL }
+static const WT_CONFIG_CHECK
+ confchk_wiredtiger_open_file_manager_subconfigs[] = {
+ { "close_handle_minimum", "int", NULL, "min=0", NULL, 0 },
+ { "close_idle_time", "int",
+ NULL, "min=1,max=100000",
+ NULL, 0 },
+ { "close_scan_interval", "int",
+ NULL, "min=1,max=100000",
+ NULL, 0 },
+ { NULL, NULL, NULL, NULL, NULL, 0 }
};
-static const WT_CONFIG_CHECK confchk_lsm_manager_subconfigs[] = {
- { "merge", "boolean", NULL, NULL, NULL },
- { "worker_thread_max", "int", NULL, "min=3,max=20", NULL },
- { NULL, NULL, NULL, NULL, NULL }
+static const WT_CONFIG_CHECK
+ confchk_wiredtiger_open_lsm_manager_subconfigs[] = {
+ { "merge", "boolean", NULL, NULL, NULL, 0 },
+ { "worker_thread_max", "int", NULL, "min=3,max=20", NULL, 0 },
+ { NULL, NULL, NULL, NULL, NULL, 0 }
};
-static const WT_CONFIG_CHECK confchk_shared_cache_subconfigs[] = {
- { "chunk", "int", NULL, "min=1MB,max=10TB", NULL },
- { "name", "string", NULL, NULL, NULL },
- { "reserve", "int", NULL, NULL, NULL },
- { "size", "int", NULL, "min=1MB,max=10TB", NULL },
- { NULL, NULL, NULL, NULL, NULL }
+static const WT_CONFIG_CHECK
+ confchk_wiredtiger_open_shared_cache_subconfigs[] = {
+ { "chunk", "int", NULL, "min=1MB,max=10TB", NULL, 0 },
+ { "name", "string", NULL, NULL, NULL, 0 },
+ { "reserve", "int", NULL, NULL, NULL, 0 },
+ { "size", "int", NULL, "min=1MB,max=10TB", NULL, 0 },
+ { NULL, NULL, NULL, NULL, NULL, 0 }
};
-static const WT_CONFIG_CHECK confchk_statistics_log_subconfigs[] = {
- { "on_close", "boolean", NULL, NULL, NULL },
- { "path", "string", NULL, NULL, NULL },
- { "sources", "list", NULL, NULL, NULL },
- { "timestamp", "string", NULL, NULL, NULL },
- { "wait", "int", NULL, "min=0,max=100000", NULL },
- { NULL, NULL, NULL, NULL, NULL }
+static const WT_CONFIG_CHECK
+ confchk_wiredtiger_open_statistics_log_subconfigs[] = {
+ { "on_close", "boolean", NULL, NULL, NULL, 0 },
+ { "path", "string", NULL, NULL, NULL, 0 },
+ { "sources", "list", NULL, NULL, NULL, 0 },
+ { "timestamp", "string", NULL, NULL, NULL, 0 },
+ { "wait", "int", NULL, "min=0,max=100000", NULL, 0 },
+ { NULL, NULL, NULL, NULL, NULL, 0 }
};
-static const WT_CONFIG_CHECK confchk_connection_reconfigure[] = {
- { "async", "category", NULL, NULL, confchk_async_subconfigs },
- { "cache_overhead", "int", NULL, "min=0,max=30", NULL },
- { "cache_size", "int", NULL, "min=1MB,max=10TB", NULL },
+static const WT_CONFIG_CHECK confchk_WT_CONNECTION_reconfigure[] = {
+ { "async", "category",
+ NULL, NULL,
+ confchk_wiredtiger_open_async_subconfigs, 3 },
+ { "cache_overhead", "int", NULL, "min=0,max=30", NULL, 0 },
+ { "cache_size", "int", NULL, "min=1MB,max=10TB", NULL, 0 },
{ "checkpoint", "category",
NULL, NULL,
- confchk_checkpoint_subconfigs },
- { "error_prefix", "string", NULL, NULL, NULL },
+ confchk_wiredtiger_open_checkpoint_subconfigs, 3 },
+ { "error_prefix", "string", NULL, NULL, NULL, 0 },
{ "eviction", "category",
NULL, NULL,
- confchk_eviction_subconfigs },
+ confchk_wiredtiger_open_eviction_subconfigs, 2 },
{ "eviction_dirty_target", "int",
NULL, "min=10,max=99",
- NULL },
- { "eviction_target", "int", NULL, "min=10,max=99", NULL },
- { "eviction_trigger", "int", NULL, "min=10,max=99", NULL },
+ NULL, 0 },
+ { "eviction_target", "int", NULL, "min=10,max=99", NULL, 0 },
+ { "eviction_trigger", "int", NULL, "min=10,max=99", NULL, 0 },
{ "file_manager", "category",
NULL, NULL,
- confchk_file_manager_subconfigs },
+ confchk_wiredtiger_open_file_manager_subconfigs, 3 },
{ "lsm_manager", "category",
NULL, NULL,
- confchk_lsm_manager_subconfigs },
- { "lsm_merge", "boolean", NULL, NULL, NULL },
+ confchk_wiredtiger_open_lsm_manager_subconfigs, 2 },
+ { "lsm_merge", "boolean", NULL, NULL, NULL, 0 },
{ "shared_cache", "category",
NULL, NULL,
- confchk_shared_cache_subconfigs },
+ confchk_wiredtiger_open_shared_cache_subconfigs, 4 },
{ "statistics", "list",
NULL, "choices=[\"all\",\"fast\",\"none\",\"clear\"]",
- NULL },
+ NULL, 0 },
{ "statistics_log", "category",
NULL, NULL,
- confchk_statistics_log_subconfigs },
+ confchk_wiredtiger_open_statistics_log_subconfigs, 5 },
{ "verbose", "list",
NULL, "choices=[\"api\",\"block\",\"checkpoint\",\"compact\","
"\"evict\",\"evictserver\",\"fileops\",\"log\",\"lsm\","
"\"metadata\",\"mutex\",\"overflow\",\"read\",\"reconcile\","
"\"recovery\",\"salvage\",\"shared_cache\",\"split\","
"\"temporary\",\"transaction\",\"verify\",\"version\",\"write\"]",
- NULL },
- { NULL, NULL, NULL, NULL, NULL }
+ NULL, 0 },
+ { NULL, NULL, NULL, NULL, NULL, 0 }
};
-static const WT_CONFIG_CHECK confchk_cursor_reconfigure[] = {
- { "append", "boolean", NULL, NULL, NULL },
- { "overwrite", "boolean", NULL, NULL, NULL },
- { NULL, NULL, NULL, NULL, NULL }
+static const WT_CONFIG_CHECK confchk_WT_CURSOR_reconfigure[] = {
+ { "append", "boolean", NULL, NULL, NULL, 0 },
+ { "overwrite", "boolean", NULL, NULL, NULL, 0 },
+ { NULL, NULL, NULL, NULL, NULL, 0 }
};
-static const WT_CONFIG_CHECK confchk_file_meta[] = {
- { "allocation_size", "int", NULL, "min=512B,max=128MB", NULL },
- { "app_metadata", "string", NULL, NULL, NULL },
+static const WT_CONFIG_CHECK confchk_WT_SESSION_begin_transaction[] = {
+ { "isolation", "string",
+ NULL, "choices=[\"read-uncommitted\",\"read-committed\","
+ "\"snapshot\"]",
+ NULL, 0 },
+ { "name", "string", NULL, NULL, NULL, 0 },
+ { "priority", "int", NULL, "min=-100,max=100", NULL, 0 },
+ { "sync", "boolean", NULL, NULL, NULL, 0 },
+ { NULL, NULL, NULL, NULL, NULL, 0 }
+};
+
+static const WT_CONFIG_CHECK confchk_WT_SESSION_checkpoint[] = {
+ { "drop", "list", NULL, NULL, NULL, 0 },
+ { "force", "boolean", NULL, NULL, NULL, 0 },
+ { "name", "string", NULL, NULL, NULL, 0 },
+ { "target", "list", NULL, NULL, NULL, 0 },
+ { NULL, NULL, NULL, NULL, NULL, 0 }
+};
+
+static const WT_CONFIG_CHECK confchk_WT_SESSION_compact[] = {
+ { "timeout", "int", NULL, NULL, NULL, 0 },
+ { NULL, NULL, NULL, NULL, NULL, 0 }
+};
+
+static const WT_CONFIG_CHECK
+ confchk_WT_SESSION_create_lsm_subconfigs[] = {
+ { "auto_throttle", "boolean", NULL, NULL, NULL, 0 },
+ { "bloom", "boolean", NULL, NULL, NULL, 0 },
+ { "bloom_bit_count", "int", NULL, "min=2,max=1000", NULL, 0 },
+ { "bloom_config", "string", NULL, NULL, NULL, 0 },
+ { "bloom_hash_count", "int", NULL, "min=2,max=100", NULL, 0 },
+ { "bloom_oldest", "boolean", NULL, NULL, NULL, 0 },
+ { "chunk_count_limit", "int", NULL, NULL, NULL, 0 },
+ { "chunk_max", "int", NULL, "min=100MB,max=10TB", NULL, 0 },
+ { "chunk_size", "int", NULL, "min=512K,max=500MB", NULL, 0 },
+ { "merge_max", "int", NULL, "min=2,max=100", NULL, 0 },
+ { "merge_min", "int", NULL, "max=100", NULL, 0 },
+ { NULL, NULL, NULL, NULL, NULL, 0 }
+};
+
+static const WT_CONFIG_CHECK confchk_WT_SESSION_create[] = {
+ { "allocation_size", "int",
+ NULL, "min=512B,max=128MB",
+ NULL, 0 },
+ { "app_metadata", "string", NULL, NULL, NULL, 0 },
{ "block_allocation", "string",
NULL, "choices=[\"first\",\"best\"]",
- NULL },
+ NULL, 0 },
{ "block_compressor", "string",
__wt_compressor_confchk, NULL,
- NULL },
- { "cache_resident", "boolean", NULL, NULL, NULL },
- { "checkpoint", "string", NULL, NULL, NULL },
- { "checkpoint_lsn", "string", NULL, NULL, NULL },
+ NULL, 0 },
+ { "cache_resident", "boolean", NULL, NULL, NULL, 0 },
{ "checksum", "string",
NULL, "choices=[\"on\",\"off\",\"uncompressed\"]",
- NULL },
- { "collator", "string", __wt_collator_confchk, NULL, NULL },
- { "columns", "list", NULL, NULL, NULL },
- { "dictionary", "int", NULL, "min=0", NULL },
- { "format", "string", NULL, "choices=[\"btree\"]", NULL },
- { "huffman_key", "string", __wt_huffman_confchk, NULL, NULL },
+ NULL, 0 },
+ { "colgroups", "list", NULL, NULL, NULL, 0 },
+ { "collator", "string", __wt_collator_confchk, NULL, NULL, 0 },
+ { "columns", "list", NULL, NULL, NULL, 0 },
+ { "dictionary", "int", NULL, "min=0", NULL, 0 },
+ { "exclusive", "boolean", NULL, NULL, NULL, 0 },
+ { "extractor", "string",
+ __wt_extractor_confchk, NULL,
+ NULL, 0 },
+ { "format", "string", NULL, "choices=[\"btree\"]", NULL, 0 },
+ { "huffman_key", "string",
+ __wt_huffman_confchk, NULL,
+ NULL, 0 },
{ "huffman_value", "string",
__wt_huffman_confchk, NULL,
- NULL },
- { "id", "string", NULL, NULL, NULL },
- { "internal_item_max", "int", NULL, "min=0", NULL },
- { "internal_key_max", "int", NULL, "min=0", NULL },
- { "internal_key_truncate", "boolean", NULL, NULL, NULL },
+ NULL, 0 },
+ { "immutable", "boolean", NULL, NULL, NULL, 0 },
+ { "internal_item_max", "int", NULL, "min=0", NULL, 0 },
+ { "internal_key_max", "int", NULL, "min=0", NULL, 0 },
+ { "internal_key_truncate", "boolean", NULL, NULL, NULL, 0 },
{ "internal_page_max", "int",
NULL, "min=512B,max=512MB",
- NULL },
- { "key_format", "format", __wt_struct_confchk, NULL, NULL },
- { "key_gap", "int", NULL, "min=0", NULL },
- { "leaf_item_max", "int", NULL, "min=0", NULL },
- { "leaf_key_max", "int", NULL, "min=0", NULL },
- { "leaf_page_max", "int", NULL, "min=512B,max=512MB", NULL },
- { "leaf_value_max", "int", NULL, "min=0", NULL },
- { "memory_page_max", "int", NULL, "min=512B,max=10TB", NULL },
- { "os_cache_dirty_max", "int", NULL, "min=0", NULL },
- { "os_cache_max", "int", NULL, "min=0", NULL },
- { "prefix_compression", "boolean", NULL, NULL, NULL },
- { "prefix_compression_min", "int", NULL, "min=0", NULL },
- { "split_deepen_min_child", "int", NULL, NULL, NULL },
- { "split_deepen_per_child", "int", NULL, NULL, NULL },
- { "split_pct", "int", NULL, "min=25,max=100", NULL },
- { "value_format", "format", __wt_struct_confchk, NULL, NULL },
- { "version", "string", NULL, NULL, NULL },
- { NULL, NULL, NULL, NULL, NULL }
+ NULL, 0 },
+ { "key_format", "format", __wt_struct_confchk, NULL, NULL, 0 },
+ { "key_gap", "int", NULL, "min=0", NULL, 0 },
+ { "leaf_item_max", "int", NULL, "min=0", NULL, 0 },
+ { "leaf_key_max", "int", NULL, "min=0", NULL, 0 },
+ { "leaf_page_max", "int",
+ NULL, "min=512B,max=512MB",
+ NULL, 0 },
+ { "leaf_value_max", "int", NULL, "min=0", NULL, 0 },
+ { "lsm", "category",
+ NULL, NULL,
+ confchk_WT_SESSION_create_lsm_subconfigs, 11 },
+ { "memory_page_max", "int",
+ NULL, "min=512B,max=10TB",
+ NULL, 0 },
+ { "os_cache_dirty_max", "int", NULL, "min=0", NULL, 0 },
+ { "os_cache_max", "int", NULL, "min=0", NULL, 0 },
+ { "prefix_compression", "boolean", NULL, NULL, NULL, 0 },
+ { "prefix_compression_min", "int", NULL, "min=0", NULL, 0 },
+ { "source", "string", NULL, NULL, NULL, 0 },
+ { "split_deepen_min_child", "int", NULL, NULL, NULL, 0 },
+ { "split_deepen_per_child", "int", NULL, NULL, NULL, 0 },
+ { "split_pct", "int", NULL, "min=25,max=100", NULL, 0 },
+ { "type", "string", NULL, NULL, NULL, 0 },
+ { "value_format", "format",
+ __wt_struct_confchk, NULL,
+ NULL, 0 },
+ { NULL, NULL, NULL, NULL, NULL, 0 }
+};
+
+static const WT_CONFIG_CHECK confchk_WT_SESSION_drop[] = {
+ { "force", "boolean", NULL, NULL, NULL, 0 },
+ { "remove_files", "boolean", NULL, NULL, NULL, 0 },
+ { NULL, NULL, NULL, NULL, NULL, 0 }
+};
+
+static const WT_CONFIG_CHECK confchk_WT_SESSION_open_cursor[] = {
+ { "append", "boolean", NULL, NULL, NULL, 0 },
+ { "bulk", "string", NULL, NULL, NULL, 0 },
+ { "checkpoint", "string", NULL, NULL, NULL, 0 },
+ { "dump", "string",
+ NULL, "choices=[\"hex\",\"json\",\"print\"]",
+ NULL, 0 },
+ { "next_random", "boolean", NULL, NULL, NULL, 0 },
+ { "overwrite", "boolean", NULL, NULL, NULL, 0 },
+ { "raw", "boolean", NULL, NULL, NULL, 0 },
+ { "readonly", "boolean", NULL, NULL, NULL, 0 },
+ { "skip_sort_check", "boolean", NULL, NULL, NULL, 0 },
+ { "statistics", "list",
+ NULL, "choices=[\"all\",\"fast\",\"clear\"]",
+ NULL, 0 },
+ { "target", "list", NULL, NULL, NULL, 0 },
+ { NULL, NULL, NULL, NULL, NULL, 0 }
};
-static const WT_CONFIG_CHECK confchk_index_meta[] = {
- { "app_metadata", "string", NULL, NULL, NULL },
- { "collator", "string", __wt_collator_confchk, NULL, NULL },
- { "columns", "list", NULL, NULL, NULL },
- { "extractor", "string", __wt_extractor_confchk, NULL, NULL },
- { "immutable", "boolean", NULL, NULL, NULL },
- { "index_key_columns", "int", NULL, NULL, NULL },
- { "key_format", "format", __wt_struct_confchk, NULL, NULL },
- { "source", "string", NULL, NULL, NULL },
- { "type", "string", NULL, NULL, NULL },
- { "value_format", "format", __wt_struct_confchk, NULL, NULL },
- { NULL, NULL, NULL, NULL, NULL }
-};
-
-static const WT_CONFIG_CHECK confchk_session_begin_transaction[] = {
+static const WT_CONFIG_CHECK confchk_WT_SESSION_reconfigure[] = {
{ "isolation", "string",
NULL, "choices=[\"read-uncommitted\",\"read-committed\","
"\"snapshot\"]",
- NULL },
- { "name", "string", NULL, NULL, NULL },
- { "priority", "int", NULL, "min=-100,max=100", NULL },
- { "sync", "boolean", NULL, NULL, NULL },
- { NULL, NULL, NULL, NULL, NULL }
-};
-
-static const WT_CONFIG_CHECK confchk_session_checkpoint[] = {
- { "drop", "list", NULL, NULL, NULL },
- { "force", "boolean", NULL, NULL, NULL },
- { "name", "string", NULL, NULL, NULL },
- { "target", "list", NULL, NULL, NULL },
- { NULL, NULL, NULL, NULL, NULL }
-};
-
-static const WT_CONFIG_CHECK confchk_session_compact[] = {
- { "timeout", "int", NULL, NULL, NULL },
- { NULL, NULL, NULL, NULL, NULL }
-};
-
-static const WT_CONFIG_CHECK confchk_lsm_subconfigs[] = {
- { "auto_throttle", "boolean", NULL, NULL, NULL },
- { "bloom", "boolean", NULL, NULL, NULL },
- { "bloom_bit_count", "int", NULL, "min=2,max=1000", NULL },
- { "bloom_config", "string", NULL, NULL, NULL },
- { "bloom_hash_count", "int", NULL, "min=2,max=100", NULL },
- { "bloom_oldest", "boolean", NULL, NULL, NULL },
- { "chunk_count_limit", "int", NULL, NULL, NULL },
- { "chunk_max", "int", NULL, "min=100MB,max=10TB", NULL },
- { "chunk_size", "int", NULL, "min=512K,max=500MB", NULL },
- { "merge_max", "int", NULL, "min=2,max=100", NULL },
- { "merge_min", "int", NULL, "max=100", NULL },
- { NULL, NULL, NULL, NULL, NULL }
-};
-
-static const WT_CONFIG_CHECK confchk_session_create[] = {
- { "allocation_size", "int", NULL, "min=512B,max=128MB", NULL },
- { "app_metadata", "string", NULL, NULL, NULL },
+ NULL, 0 },
+ { NULL, NULL, NULL, NULL, NULL, 0 }
+};
+
+static const WT_CONFIG_CHECK confchk_WT_SESSION_salvage[] = {
+ { "force", "boolean", NULL, NULL, NULL, 0 },
+ { NULL, NULL, NULL, NULL, NULL, 0 }
+};
+
+static const WT_CONFIG_CHECK confchk_WT_SESSION_verify[] = {
+ { "dump_address", "boolean", NULL, NULL, NULL, 0 },
+ { "dump_blocks", "boolean", NULL, NULL, NULL, 0 },
+ { "dump_offsets", "list", NULL, NULL, NULL, 0 },
+ { "dump_pages", "boolean", NULL, NULL, NULL, 0 },
+ { "dump_shape", "boolean", NULL, NULL, NULL, 0 },
+ { NULL, NULL, NULL, NULL, NULL, 0 }
+};
+
+static const WT_CONFIG_CHECK confchk_colgroup_meta[] = {
+ { "app_metadata", "string", NULL, NULL, NULL, 0 },
+ { "collator", "string", __wt_collator_confchk, NULL, NULL, 0 },
+ { "columns", "list", NULL, NULL, NULL, 0 },
+ { "source", "string", NULL, NULL, NULL, 0 },
+ { "type", "string", NULL, NULL, NULL, 0 },
+ { NULL, NULL, NULL, NULL, NULL, 0 }
+};
+
+static const WT_CONFIG_CHECK confchk_file_meta[] = {
+ { "allocation_size", "int",
+ NULL, "min=512B,max=128MB",
+ NULL, 0 },
+ { "app_metadata", "string", NULL, NULL, NULL, 0 },
{ "block_allocation", "string",
NULL, "choices=[\"first\",\"best\"]",
- NULL },
+ NULL, 0 },
{ "block_compressor", "string",
__wt_compressor_confchk, NULL,
- NULL },
- { "cache_resident", "boolean", NULL, NULL, NULL },
+ NULL, 0 },
+ { "cache_resident", "boolean", NULL, NULL, NULL, 0 },
+ { "checkpoint", "string", NULL, NULL, NULL, 0 },
+ { "checkpoint_lsn", "string", NULL, NULL, NULL, 0 },
{ "checksum", "string",
NULL, "choices=[\"on\",\"off\",\"uncompressed\"]",
- NULL },
- { "colgroups", "list", NULL, NULL, NULL },
- { "collator", "string", __wt_collator_confchk, NULL, NULL },
- { "columns", "list", NULL, NULL, NULL },
- { "dictionary", "int", NULL, "min=0", NULL },
- { "exclusive", "boolean", NULL, NULL, NULL },
- { "extractor", "string", __wt_extractor_confchk, NULL, NULL },
- { "format", "string", NULL, "choices=[\"btree\"]", NULL },
- { "huffman_key", "string", __wt_huffman_confchk, NULL, NULL },
+ NULL, 0 },
+ { "collator", "string", __wt_collator_confchk, NULL, NULL, 0 },
+ { "columns", "list", NULL, NULL, NULL, 0 },
+ { "dictionary", "int", NULL, "min=0", NULL, 0 },
+ { "format", "string", NULL, "choices=[\"btree\"]", NULL, 0 },
+ { "huffman_key", "string",
+ __wt_huffman_confchk, NULL,
+ NULL, 0 },
{ "huffman_value", "string",
__wt_huffman_confchk, NULL,
- NULL },
- { "immutable", "boolean", NULL, NULL, NULL },
- { "internal_item_max", "int", NULL, "min=0", NULL },
- { "internal_key_max", "int", NULL, "min=0", NULL },
- { "internal_key_truncate", "boolean", NULL, NULL, NULL },
+ NULL, 0 },
+ { "id", "string", NULL, NULL, NULL, 0 },
+ { "internal_item_max", "int", NULL, "min=0", NULL, 0 },
+ { "internal_key_max", "int", NULL, "min=0", NULL, 0 },
+ { "internal_key_truncate", "boolean", NULL, NULL, NULL, 0 },
{ "internal_page_max", "int",
NULL, "min=512B,max=512MB",
- NULL },
- { "key_format", "format", __wt_struct_confchk, NULL, NULL },
- { "key_gap", "int", NULL, "min=0", NULL },
- { "leaf_item_max", "int", NULL, "min=0", NULL },
- { "leaf_key_max", "int", NULL, "min=0", NULL },
- { "leaf_page_max", "int", NULL, "min=512B,max=512MB", NULL },
- { "leaf_value_max", "int", NULL, "min=0", NULL },
- { "lsm", "category", NULL, NULL, confchk_lsm_subconfigs },
- { "memory_page_max", "int", NULL, "min=512B,max=10TB", NULL },
- { "os_cache_dirty_max", "int", NULL, "min=0", NULL },
- { "os_cache_max", "int", NULL, "min=0", NULL },
- { "prefix_compression", "boolean", NULL, NULL, NULL },
- { "prefix_compression_min", "int", NULL, "min=0", NULL },
- { "source", "string", NULL, NULL, NULL },
- { "split_deepen_min_child", "int", NULL, NULL, NULL },
- { "split_deepen_per_child", "int", NULL, NULL, NULL },
- { "split_pct", "int", NULL, "min=25,max=100", NULL },
- { "type", "string", NULL, NULL, NULL },
- { "value_format", "format", __wt_struct_confchk, NULL, NULL },
- { NULL, NULL, NULL, NULL, NULL }
-};
-
-static const WT_CONFIG_CHECK confchk_session_drop[] = {
- { "force", "boolean", NULL, NULL, NULL },
- { "remove_files", "boolean", NULL, NULL, NULL },
- { NULL, NULL, NULL, NULL, NULL }
-};
-
-static const WT_CONFIG_CHECK confchk_session_open_cursor[] = {
- { "append", "boolean", NULL, NULL, NULL },
- { "bulk", "string", NULL, NULL, NULL },
- { "checkpoint", "string", NULL, NULL, NULL },
- { "dump", "string",
- NULL, "choices=[\"hex\",\"json\",\"print\"]",
- NULL },
- { "next_random", "boolean", NULL, NULL, NULL },
- { "overwrite", "boolean", NULL, NULL, NULL },
- { "raw", "boolean", NULL, NULL, NULL },
- { "readonly", "boolean", NULL, NULL, NULL },
- { "skip_sort_check", "boolean", NULL, NULL, NULL },
- { "statistics", "list",
- NULL, "choices=[\"all\",\"fast\",\"clear\"]",
- NULL },
- { "target", "list", NULL, NULL, NULL },
- { NULL, NULL, NULL, NULL, NULL }
-};
-
-static const WT_CONFIG_CHECK confchk_session_reconfigure[] = {
- { "isolation", "string",
- NULL, "choices=[\"read-uncommitted\",\"read-committed\","
- "\"snapshot\"]",
- NULL },
- { NULL, NULL, NULL, NULL, NULL }
-};
-
-static const WT_CONFIG_CHECK confchk_session_salvage[] = {
- { "force", "boolean", NULL, NULL, NULL },
- { NULL, NULL, NULL, NULL, NULL }
+ NULL, 0 },
+ { "key_format", "format", __wt_struct_confchk, NULL, NULL, 0 },
+ { "key_gap", "int", NULL, "min=0", NULL, 0 },
+ { "leaf_item_max", "int", NULL, "min=0", NULL, 0 },
+ { "leaf_key_max", "int", NULL, "min=0", NULL, 0 },
+ { "leaf_page_max", "int",
+ NULL, "min=512B,max=512MB",
+ NULL, 0 },
+ { "leaf_value_max", "int", NULL, "min=0", NULL, 0 },
+ { "memory_page_max", "int",
+ NULL, "min=512B,max=10TB",
+ NULL, 0 },
+ { "os_cache_dirty_max", "int", NULL, "min=0", NULL, 0 },
+ { "os_cache_max", "int", NULL, "min=0", NULL, 0 },
+ { "prefix_compression", "boolean", NULL, NULL, NULL, 0 },
+ { "prefix_compression_min", "int", NULL, "min=0", NULL, 0 },
+ { "split_deepen_min_child", "int", NULL, NULL, NULL, 0 },
+ { "split_deepen_per_child", "int", NULL, NULL, NULL, 0 },
+ { "split_pct", "int", NULL, "min=25,max=100", NULL, 0 },
+ { "value_format", "format",
+ __wt_struct_confchk, NULL,
+ NULL, 0 },
+ { "version", "string", NULL, NULL, NULL, 0 },
+ { NULL, NULL, NULL, NULL, NULL, 0 }
};
-static const WT_CONFIG_CHECK confchk_session_verify[] = {
- { "dump_address", "boolean", NULL, NULL, NULL },
- { "dump_blocks", "boolean", NULL, NULL, NULL },
- { "dump_offsets", "list", NULL, NULL, NULL },
- { "dump_pages", "boolean", NULL, NULL, NULL },
- { "dump_shape", "boolean", NULL, NULL, NULL },
- { NULL, NULL, NULL, NULL, NULL }
+static const WT_CONFIG_CHECK confchk_index_meta[] = {
+ { "app_metadata", "string", NULL, NULL, NULL, 0 },
+ { "collator", "string", __wt_collator_confchk, NULL, NULL, 0 },
+ { "columns", "list", NULL, NULL, NULL, 0 },
+ { "extractor", "string",
+ __wt_extractor_confchk, NULL,
+ NULL, 0 },
+ { "immutable", "boolean", NULL, NULL, NULL, 0 },
+ { "index_key_columns", "int", NULL, NULL, NULL, 0 },
+ { "key_format", "format", __wt_struct_confchk, NULL, NULL, 0 },
+ { "source", "string", NULL, NULL, NULL, 0 },
+ { "type", "string", NULL, NULL, NULL, 0 },
+ { "value_format", "format",
+ __wt_struct_confchk, NULL,
+ NULL, 0 },
+ { NULL, NULL, NULL, NULL, NULL, 0 }
};
static const WT_CONFIG_CHECK confchk_table_meta[] = {
- { "app_metadata", "string", NULL, NULL, NULL },
- { "colgroups", "list", NULL, NULL, NULL },
- { "collator", "string", __wt_collator_confchk, NULL, NULL },
- { "columns", "list", NULL, NULL, NULL },
- { "key_format", "format", __wt_struct_confchk, NULL, NULL },
- { "value_format", "format", __wt_struct_confchk, NULL, NULL },
- { NULL, NULL, NULL, NULL, NULL }
-};
-
-static const WT_CONFIG_CHECK confchk_log_subconfigs[] = {
- { "archive", "boolean", NULL, NULL, NULL },
- { "compressor", "string", NULL, NULL, NULL },
- { "enabled", "boolean", NULL, NULL, NULL },
- { "file_max", "int", NULL, "min=100KB,max=2GB", NULL },
- { "path", "string", NULL, NULL, NULL },
- { "prealloc", "boolean", NULL, NULL, NULL },
+ { "app_metadata", "string", NULL, NULL, NULL, 0 },
+ { "colgroups", "list", NULL, NULL, NULL, 0 },
+ { "collator", "string", __wt_collator_confchk, NULL, NULL, 0 },
+ { "columns", "list", NULL, NULL, NULL, 0 },
+ { "key_format", "format", __wt_struct_confchk, NULL, NULL, 0 },
+ { "value_format", "format",
+ __wt_struct_confchk, NULL,
+ NULL, 0 },
+ { NULL, NULL, NULL, NULL, NULL, 0 }
+};
+
+static const WT_CONFIG_CHECK
+ confchk_wiredtiger_open_log_subconfigs[] = {
+ { "archive", "boolean", NULL, NULL, NULL, 0 },
+ { "compressor", "string", NULL, NULL, NULL, 0 },
+ { "enabled", "boolean", NULL, NULL, NULL, 0 },
+ { "file_max", "int", NULL, "min=100KB,max=2GB", NULL, 0 },
+ { "path", "string", NULL, NULL, NULL, 0 },
+ { "prealloc", "boolean", NULL, NULL, NULL, 0 },
{ "recover", "string",
NULL, "choices=[\"error\",\"on\"]",
- NULL },
- { NULL, NULL, NULL, NULL, NULL }
+ NULL, 0 },
+ { NULL, NULL, NULL, NULL, NULL, 0 }
};
-static const WT_CONFIG_CHECK confchk_transaction_sync_subconfigs[] = {
- { "enabled", "boolean", NULL, NULL, NULL },
+static const WT_CONFIG_CHECK
+ confchk_wiredtiger_open_transaction_sync_subconfigs[] = {
+ { "enabled", "boolean", NULL, NULL, NULL, 0 },
{ "method", "string",
NULL, "choices=[\"dsync\",\"fsync\",\"none\"]",
- NULL },
- { NULL, NULL, NULL, NULL, NULL }
+ NULL, 0 },
+ { NULL, NULL, NULL, NULL, NULL, 0 }
};
static const WT_CONFIG_CHECK confchk_wiredtiger_open[] = {
- { "async", "category", NULL, NULL, confchk_async_subconfigs },
- { "buffer_alignment", "int", NULL, "min=-1,max=1MB", NULL },
- { "cache_overhead", "int", NULL, "min=0,max=30", NULL },
- { "cache_size", "int", NULL, "min=1MB,max=10TB", NULL },
+ { "async", "category",
+ NULL, NULL,
+ confchk_wiredtiger_open_async_subconfigs, 3 },
+ { "buffer_alignment", "int", NULL, "min=-1,max=1MB", NULL, 0 },
+ { "cache_overhead", "int", NULL, "min=0,max=30", NULL, 0 },
+ { "cache_size", "int", NULL, "min=1MB,max=10TB", NULL, 0 },
{ "checkpoint", "category",
NULL, NULL,
- confchk_checkpoint_subconfigs },
- { "checkpoint_sync", "boolean", NULL, NULL, NULL },
- { "config_base", "boolean", NULL, NULL, NULL },
- { "create", "boolean", NULL, NULL, NULL },
+ confchk_wiredtiger_open_checkpoint_subconfigs, 3 },
+ { "checkpoint_sync", "boolean", NULL, NULL, NULL, 0 },
+ { "config_base", "boolean", NULL, NULL, NULL, 0 },
+ { "create", "boolean", NULL, NULL, NULL, 0 },
{ "direct_io", "list",
NULL, "choices=[\"checkpoint\",\"data\",\"log\"]",
- NULL },
- { "error_prefix", "string", NULL, NULL, NULL },
+ NULL, 0 },
+ { "error_prefix", "string", NULL, NULL, NULL, 0 },
{ "eviction", "category",
NULL, NULL,
- confchk_eviction_subconfigs },
+ confchk_wiredtiger_open_eviction_subconfigs, 2 },
{ "eviction_dirty_target", "int",
NULL, "min=10,max=99",
- NULL },
- { "eviction_target", "int", NULL, "min=10,max=99", NULL },
- { "eviction_trigger", "int", NULL, "min=10,max=99", NULL },
- { "exclusive", "boolean", NULL, NULL, NULL },
- { "extensions", "list", NULL, NULL, NULL },
+ NULL, 0 },
+ { "eviction_target", "int", NULL, "min=10,max=99", NULL, 0 },
+ { "eviction_trigger", "int", NULL, "min=10,max=99", NULL, 0 },
+ { "exclusive", "boolean", NULL, NULL, NULL, 0 },
+ { "extensions", "list", NULL, NULL, NULL, 0 },
{ "file_extend", "list",
NULL, "choices=[\"data\",\"log\"]",
- NULL },
+ NULL, 0 },
{ "file_manager", "category",
NULL, NULL,
- confchk_file_manager_subconfigs },
- { "hazard_max", "int", NULL, "min=15", NULL },
- { "log", "category", NULL, NULL, confchk_log_subconfigs },
+ confchk_wiredtiger_open_file_manager_subconfigs, 3 },
+ { "hazard_max", "int", NULL, "min=15", NULL, 0 },
+ { "log", "category",
+ NULL, NULL,
+ confchk_wiredtiger_open_log_subconfigs, 7 },
{ "lsm_manager", "category",
NULL, NULL,
- confchk_lsm_manager_subconfigs },
- { "lsm_merge", "boolean", NULL, NULL, NULL },
- { "mmap", "boolean", NULL, NULL, NULL },
- { "multiprocess", "boolean", NULL, NULL, NULL },
- { "session_max", "int", NULL, "min=1", NULL },
- { "session_scratch_max", "int", NULL, NULL, NULL },
+ confchk_wiredtiger_open_lsm_manager_subconfigs, 2 },
+ { "lsm_merge", "boolean", NULL, NULL, NULL, 0 },
+ { "mmap", "boolean", NULL, NULL, NULL, 0 },
+ { "multiprocess", "boolean", NULL, NULL, NULL, 0 },
+ { "session_max", "int", NULL, "min=1", NULL, 0 },
+ { "session_scratch_max", "int", NULL, NULL, NULL, 0 },
{ "shared_cache", "category",
NULL, NULL,
- confchk_shared_cache_subconfigs },
+ confchk_wiredtiger_open_shared_cache_subconfigs, 4 },
{ "statistics", "list",
NULL, "choices=[\"all\",\"fast\",\"none\",\"clear\"]",
- NULL },
+ NULL, 0 },
{ "statistics_log", "category",
NULL, NULL,
- confchk_statistics_log_subconfigs },
+ confchk_wiredtiger_open_statistics_log_subconfigs, 5 },
{ "transaction_sync", "category",
NULL, NULL,
- confchk_transaction_sync_subconfigs },
- { "use_environment_priv", "boolean", NULL, NULL, NULL },
+ confchk_wiredtiger_open_transaction_sync_subconfigs, 2 },
+ { "use_environment_priv", "boolean", NULL, NULL, NULL, 0 },
{ "verbose", "list",
NULL, "choices=[\"api\",\"block\",\"checkpoint\",\"compact\","
"\"evict\",\"evictserver\",\"fileops\",\"log\",\"lsm\","
"\"metadata\",\"mutex\",\"overflow\",\"read\",\"reconcile\","
"\"recovery\",\"salvage\",\"shared_cache\",\"split\","
"\"temporary\",\"transaction\",\"verify\",\"version\",\"write\"]",
- NULL },
- { NULL, NULL, NULL, NULL, NULL }
+ NULL, 0 },
+ { NULL, NULL, NULL, NULL, NULL, 0 }
};
static const WT_CONFIG_CHECK confchk_wiredtiger_open_all[] = {
- { "async", "category", NULL, NULL, confchk_async_subconfigs },
- { "buffer_alignment", "int", NULL, "min=-1,max=1MB", NULL },
- { "cache_overhead", "int", NULL, "min=0,max=30", NULL },
- { "cache_size", "int", NULL, "min=1MB,max=10TB", NULL },
+ { "async", "category",
+ NULL, NULL,
+ confchk_wiredtiger_open_async_subconfigs, 3 },
+ { "buffer_alignment", "int", NULL, "min=-1,max=1MB", NULL, 0 },
+ { "cache_overhead", "int", NULL, "min=0,max=30", NULL, 0 },
+ { "cache_size", "int", NULL, "min=1MB,max=10TB", NULL, 0 },
{ "checkpoint", "category",
NULL, NULL,
- confchk_checkpoint_subconfigs },
- { "checkpoint_sync", "boolean", NULL, NULL, NULL },
- { "config_base", "boolean", NULL, NULL, NULL },
- { "create", "boolean", NULL, NULL, NULL },
+ confchk_wiredtiger_open_checkpoint_subconfigs, 3 },
+ { "checkpoint_sync", "boolean", NULL, NULL, NULL, 0 },
+ { "config_base", "boolean", NULL, NULL, NULL, 0 },
+ { "create", "boolean", NULL, NULL, NULL, 0 },
{ "direct_io", "list",
NULL, "choices=[\"checkpoint\",\"data\",\"log\"]",
- NULL },
- { "error_prefix", "string", NULL, NULL, NULL },
+ NULL, 0 },
+ { "error_prefix", "string", NULL, NULL, NULL, 0 },
{ "eviction", "category",
NULL, NULL,
- confchk_eviction_subconfigs },
+ confchk_wiredtiger_open_eviction_subconfigs, 2 },
{ "eviction_dirty_target", "int",
NULL, "min=10,max=99",
- NULL },
- { "eviction_target", "int", NULL, "min=10,max=99", NULL },
- { "eviction_trigger", "int", NULL, "min=10,max=99", NULL },
- { "exclusive", "boolean", NULL, NULL, NULL },
- { "extensions", "list", NULL, NULL, NULL },
+ NULL, 0 },
+ { "eviction_target", "int", NULL, "min=10,max=99", NULL, 0 },
+ { "eviction_trigger", "int", NULL, "min=10,max=99", NULL, 0 },
+ { "exclusive", "boolean", NULL, NULL, NULL, 0 },
+ { "extensions", "list", NULL, NULL, NULL, 0 },
{ "file_extend", "list",
NULL, "choices=[\"data\",\"log\"]",
- NULL },
+ NULL, 0 },
{ "file_manager", "category",
NULL, NULL,
- confchk_file_manager_subconfigs },
- { "hazard_max", "int", NULL, "min=15", NULL },
- { "log", "category", NULL, NULL, confchk_log_subconfigs },
+ confchk_wiredtiger_open_file_manager_subconfigs, 3 },
+ { "hazard_max", "int", NULL, "min=15", NULL, 0 },
+ { "log", "category",
+ NULL, NULL,
+ confchk_wiredtiger_open_log_subconfigs, 7 },
{ "lsm_manager", "category",
NULL, NULL,
- confchk_lsm_manager_subconfigs },
- { "lsm_merge", "boolean", NULL, NULL, NULL },
- { "mmap", "boolean", NULL, NULL, NULL },
- { "multiprocess", "boolean", NULL, NULL, NULL },
- { "session_max", "int", NULL, "min=1", NULL },
- { "session_scratch_max", "int", NULL, NULL, NULL },
+ confchk_wiredtiger_open_lsm_manager_subconfigs, 2 },
+ { "lsm_merge", "boolean", NULL, NULL, NULL, 0 },
+ { "mmap", "boolean", NULL, NULL, NULL, 0 },
+ { "multiprocess", "boolean", NULL, NULL, NULL, 0 },
+ { "session_max", "int", NULL, "min=1", NULL, 0 },
+ { "session_scratch_max", "int", NULL, NULL, NULL, 0 },
{ "shared_cache", "category",
NULL, NULL,
- confchk_shared_cache_subconfigs },
+ confchk_wiredtiger_open_shared_cache_subconfigs, 4 },
{ "statistics", "list",
NULL, "choices=[\"all\",\"fast\",\"none\",\"clear\"]",
- NULL },
+ NULL, 0 },
{ "statistics_log", "category",
NULL, NULL,
- confchk_statistics_log_subconfigs },
+ confchk_wiredtiger_open_statistics_log_subconfigs, 5 },
{ "transaction_sync", "category",
NULL, NULL,
- confchk_transaction_sync_subconfigs },
- { "use_environment_priv", "boolean", NULL, NULL, NULL },
+ confchk_wiredtiger_open_transaction_sync_subconfigs, 2 },
+ { "use_environment_priv", "boolean", NULL, NULL, NULL, 0 },
{ "verbose", "list",
NULL, "choices=[\"api\",\"block\",\"checkpoint\",\"compact\","
"\"evict\",\"evictserver\",\"fileops\",\"log\",\"lsm\","
"\"metadata\",\"mutex\",\"overflow\",\"read\",\"reconcile\","
"\"recovery\",\"salvage\",\"shared_cache\",\"split\","
"\"temporary\",\"transaction\",\"verify\",\"version\",\"write\"]",
- NULL },
- { "version", "string", NULL, NULL, NULL },
- { NULL, NULL, NULL, NULL, NULL }
+ NULL, 0 },
+ { "version", "string", NULL, NULL, NULL, 0 },
+ { NULL, NULL, NULL, NULL, NULL, 0 }
};
static const WT_CONFIG_CHECK confchk_wiredtiger_open_basecfg[] = {
- { "async", "category", NULL, NULL, confchk_async_subconfigs },
- { "buffer_alignment", "int", NULL, "min=-1,max=1MB", NULL },
- { "cache_overhead", "int", NULL, "min=0,max=30", NULL },
- { "cache_size", "int", NULL, "min=1MB,max=10TB", NULL },
+ { "async", "category",
+ NULL, NULL,
+ confchk_wiredtiger_open_async_subconfigs, 3 },
+ { "buffer_alignment", "int", NULL, "min=-1,max=1MB", NULL, 0 },
+ { "cache_overhead", "int", NULL, "min=0,max=30", NULL, 0 },
+ { "cache_size", "int", NULL, "min=1MB,max=10TB", NULL, 0 },
{ "checkpoint", "category",
NULL, NULL,
- confchk_checkpoint_subconfigs },
- { "checkpoint_sync", "boolean", NULL, NULL, NULL },
+ confchk_wiredtiger_open_checkpoint_subconfigs, 3 },
+ { "checkpoint_sync", "boolean", NULL, NULL, NULL, 0 },
{ "direct_io", "list",
NULL, "choices=[\"checkpoint\",\"data\",\"log\"]",
- NULL },
- { "error_prefix", "string", NULL, NULL, NULL },
+ NULL, 0 },
+ { "error_prefix", "string", NULL, NULL, NULL, 0 },
{ "eviction", "category",
NULL, NULL,
- confchk_eviction_subconfigs },
+ confchk_wiredtiger_open_eviction_subconfigs, 2 },
{ "eviction_dirty_target", "int",
NULL, "min=10,max=99",
- NULL },
- { "eviction_target", "int", NULL, "min=10,max=99", NULL },
- { "eviction_trigger", "int", NULL, "min=10,max=99", NULL },
- { "extensions", "list", NULL, NULL, NULL },
+ NULL, 0 },
+ { "eviction_target", "int", NULL, "min=10,max=99", NULL, 0 },
+ { "eviction_trigger", "int", NULL, "min=10,max=99", NULL, 0 },
+ { "extensions", "list", NULL, NULL, NULL, 0 },
{ "file_extend", "list",
NULL, "choices=[\"data\",\"log\"]",
- NULL },
+ NULL, 0 },
{ "file_manager", "category",
NULL, NULL,
- confchk_file_manager_subconfigs },
- { "hazard_max", "int", NULL, "min=15", NULL },
- { "log", "category", NULL, NULL, confchk_log_subconfigs },
+ confchk_wiredtiger_open_file_manager_subconfigs, 3 },
+ { "hazard_max", "int", NULL, "min=15", NULL, 0 },
+ { "log", "category",
+ NULL, NULL,
+ confchk_wiredtiger_open_log_subconfigs, 7 },
{ "lsm_manager", "category",
NULL, NULL,
- confchk_lsm_manager_subconfigs },
- { "lsm_merge", "boolean", NULL, NULL, NULL },
- { "mmap", "boolean", NULL, NULL, NULL },
- { "multiprocess", "boolean", NULL, NULL, NULL },
- { "session_max", "int", NULL, "min=1", NULL },
- { "session_scratch_max", "int", NULL, NULL, NULL },
+ confchk_wiredtiger_open_lsm_manager_subconfigs, 2 },
+ { "lsm_merge", "boolean", NULL, NULL, NULL, 0 },
+ { "mmap", "boolean", NULL, NULL, NULL, 0 },
+ { "multiprocess", "boolean", NULL, NULL, NULL, 0 },
+ { "session_max", "int", NULL, "min=1", NULL, 0 },
+ { "session_scratch_max", "int", NULL, NULL, NULL, 0 },
{ "shared_cache", "category",
NULL, NULL,
- confchk_shared_cache_subconfigs },
+ confchk_wiredtiger_open_shared_cache_subconfigs, 4 },
{ "statistics", "list",
NULL, "choices=[\"all\",\"fast\",\"none\",\"clear\"]",
- NULL },
+ NULL, 0 },
{ "statistics_log", "category",
NULL, NULL,
- confchk_statistics_log_subconfigs },
+ confchk_wiredtiger_open_statistics_log_subconfigs, 5 },
{ "transaction_sync", "category",
NULL, NULL,
- confchk_transaction_sync_subconfigs },
+ confchk_wiredtiger_open_transaction_sync_subconfigs, 2 },
{ "verbose", "list",
NULL, "choices=[\"api\",\"block\",\"checkpoint\",\"compact\","
"\"evict\",\"evictserver\",\"fileops\",\"log\",\"lsm\","
"\"metadata\",\"mutex\",\"overflow\",\"read\",\"reconcile\","
"\"recovery\",\"salvage\",\"shared_cache\",\"split\","
"\"temporary\",\"transaction\",\"verify\",\"version\",\"write\"]",
- NULL },
- { "version", "string", NULL, NULL, NULL },
- { NULL, NULL, NULL, NULL, NULL }
+ NULL, 0 },
+ { "version", "string", NULL, NULL, NULL, 0 },
+ { NULL, NULL, NULL, NULL, NULL, 0 }
};
static const WT_CONFIG_CHECK confchk_wiredtiger_open_usercfg[] = {
- { "async", "category", NULL, NULL, confchk_async_subconfigs },
- { "buffer_alignment", "int", NULL, "min=-1,max=1MB", NULL },
- { "cache_overhead", "int", NULL, "min=0,max=30", NULL },
- { "cache_size", "int", NULL, "min=1MB,max=10TB", NULL },
+ { "async", "category",
+ NULL, NULL,
+ confchk_wiredtiger_open_async_subconfigs, 3 },
+ { "buffer_alignment", "int", NULL, "min=-1,max=1MB", NULL, 0 },
+ { "cache_overhead", "int", NULL, "min=0,max=30", NULL, 0 },
+ { "cache_size", "int", NULL, "min=1MB,max=10TB", NULL, 0 },
{ "checkpoint", "category",
NULL, NULL,
- confchk_checkpoint_subconfigs },
- { "checkpoint_sync", "boolean", NULL, NULL, NULL },
+ confchk_wiredtiger_open_checkpoint_subconfigs, 3 },
+ { "checkpoint_sync", "boolean", NULL, NULL, NULL, 0 },
{ "direct_io", "list",
NULL, "choices=[\"checkpoint\",\"data\",\"log\"]",
- NULL },
- { "error_prefix", "string", NULL, NULL, NULL },
+ NULL, 0 },
+ { "error_prefix", "string", NULL, NULL, NULL, 0 },
{ "eviction", "category",
NULL, NULL,
- confchk_eviction_subconfigs },
+ confchk_wiredtiger_open_eviction_subconfigs, 2 },
{ "eviction_dirty_target", "int",
NULL, "min=10,max=99",
- NULL },
- { "eviction_target", "int", NULL, "min=10,max=99", NULL },
- { "eviction_trigger", "int", NULL, "min=10,max=99", NULL },
- { "extensions", "list", NULL, NULL, NULL },
+ NULL, 0 },
+ { "eviction_target", "int", NULL, "min=10,max=99", NULL, 0 },
+ { "eviction_trigger", "int", NULL, "min=10,max=99", NULL, 0 },
+ { "extensions", "list", NULL, NULL, NULL, 0 },
{ "file_extend", "list",
NULL, "choices=[\"data\",\"log\"]",
- NULL },
+ NULL, 0 },
{ "file_manager", "category",
NULL, NULL,
- confchk_file_manager_subconfigs },
- { "hazard_max", "int", NULL, "min=15", NULL },
- { "log", "category", NULL, NULL, confchk_log_subconfigs },
+ confchk_wiredtiger_open_file_manager_subconfigs, 3 },
+ { "hazard_max", "int", NULL, "min=15", NULL, 0 },
+ { "log", "category",
+ NULL, NULL,
+ confchk_wiredtiger_open_log_subconfigs, 7 },
{ "lsm_manager", "category",
NULL, NULL,
- confchk_lsm_manager_subconfigs },
- { "lsm_merge", "boolean", NULL, NULL, NULL },
- { "mmap", "boolean", NULL, NULL, NULL },
- { "multiprocess", "boolean", NULL, NULL, NULL },
- { "session_max", "int", NULL, "min=1", NULL },
- { "session_scratch_max", "int", NULL, NULL, NULL },
+ confchk_wiredtiger_open_lsm_manager_subconfigs, 2 },
+ { "lsm_merge", "boolean", NULL, NULL, NULL, 0 },
+ { "mmap", "boolean", NULL, NULL, NULL, 0 },
+ { "multiprocess", "boolean", NULL, NULL, NULL, 0 },
+ { "session_max", "int", NULL, "min=1", NULL, 0 },
+ { "session_scratch_max", "int", NULL, NULL, NULL, 0 },
{ "shared_cache", "category",
NULL, NULL,
- confchk_shared_cache_subconfigs },
+ confchk_wiredtiger_open_shared_cache_subconfigs, 4 },
{ "statistics", "list",
NULL, "choices=[\"all\",\"fast\",\"none\",\"clear\"]",
- NULL },
+ NULL, 0 },
{ "statistics_log", "category",
NULL, NULL,
- confchk_statistics_log_subconfigs },
+ confchk_wiredtiger_open_statistics_log_subconfigs, 5 },
{ "transaction_sync", "category",
NULL, NULL,
- confchk_transaction_sync_subconfigs },
+ confchk_wiredtiger_open_transaction_sync_subconfigs, 2 },
{ "verbose", "list",
NULL, "choices=[\"api\",\"block\",\"checkpoint\",\"compact\","
"\"evict\",\"evictserver\",\"fileops\",\"log\",\"lsm\","
"\"metadata\",\"mutex\",\"overflow\",\"read\",\"reconcile\","
"\"recovery\",\"salvage\",\"shared_cache\",\"split\","
"\"temporary\",\"transaction\",\"verify\",\"version\",\"write\"]",
- NULL },
- { NULL, NULL, NULL, NULL, NULL }
+ NULL, 0 },
+ { NULL, NULL, NULL, NULL, NULL, 0 }
};
static const WT_CONFIG_ENTRY config_entries[] = {
- { "colgroup.meta",
- "app_metadata=,collator=,columns=,source=,type=file",
- confchk_colgroup_meta
- },
- { "connection.add_collator",
+ { "WT_CONNECTION.add_collator",
"",
- NULL
+ NULL, 0
},
- { "connection.add_compressor",
+ { "WT_CONNECTION.add_compressor",
"",
- NULL
+ NULL, 0
},
- { "connection.add_data_source",
+ { "WT_CONNECTION.add_data_source",
"",
- NULL
+ NULL, 0
},
- { "connection.add_extractor",
+ { "WT_CONNECTION.add_extractor",
"",
- NULL
+ NULL, 0
},
- { "connection.async_new_op",
+ { "WT_CONNECTION.async_new_op",
"append=0,overwrite=,raw=0,timeout=1200",
- confchk_connection_async_new_op
+ confchk_WT_CONNECTION_async_new_op, 4
},
- { "connection.close",
+ { "WT_CONNECTION.close",
"leak_memory=0",
- confchk_connection_close
+ confchk_WT_CONNECTION_close, 1
},
- { "connection.load_extension",
+ { "WT_CONNECTION.load_extension",
"config=,entry=wiredtiger_extension_init,"
"terminate=wiredtiger_extension_terminate",
- confchk_connection_load_extension
+ confchk_WT_CONNECTION_load_extension, 3
},
- { "connection.open_session",
+ { "WT_CONNECTION.open_session",
"isolation=read-committed",
- confchk_connection_open_session
+ confchk_WT_CONNECTION_open_session, 1
},
- { "connection.reconfigure",
+ { "WT_CONNECTION.reconfigure",
"async=(enabled=0,ops_max=1024,threads=2),cache_overhead=8,"
"cache_size=100MB,checkpoint=(log_size=0,"
"name=\"WiredTigerCheckpoint\",wait=0),error_prefix=,"
"eviction=(threads_max=1,threads_min=1),eviction_dirty_target=80,"
"eviction_target=80,eviction_trigger=95,"
- "file_manager=(close_idle_time=30,close_scan_interval=10),"
- "lsm_manager=(merge=,worker_thread_max=4),lsm_merge=,"
- "shared_cache=(chunk=10MB,name=,reserve=0,size=500MB),"
- "statistics=none,statistics_log=(on_close=0,"
+ "file_manager=(close_handle_minimum=250,close_idle_time=30,"
+ "close_scan_interval=10),lsm_manager=(merge=,worker_thread_max=4)"
+ ",lsm_merge=,shared_cache=(chunk=10MB,name=,reserve=0,size=500MB)"
+ ",statistics=none,statistics_log=(on_close=0,"
"path=\"WiredTigerStat.%d.%H\",sources=,"
"timestamp=\"%b %d %H:%M:%S\",wait=0),verbose=",
- confchk_connection_reconfigure
+ confchk_WT_CONNECTION_reconfigure, 16
},
- { "cursor.close",
+ { "WT_CURSOR.close",
"",
- NULL
+ NULL, 0
},
- { "cursor.reconfigure",
+ { "WT_CURSOR.reconfigure",
"append=0,overwrite=",
- confchk_cursor_reconfigure
+ confchk_WT_CURSOR_reconfigure, 2
},
- { "file.meta",
- "allocation_size=4KB,app_metadata=,block_allocation=best,"
- "block_compressor=,cache_resident=0,checkpoint=,checkpoint_lsn=,"
- "checksum=uncompressed,collator=,columns=,dictionary=0,"
- "format=btree,huffman_key=,huffman_value=,id=,internal_item_max=0"
- ",internal_key_max=0,internal_key_truncate=,internal_page_max=4KB"
- ",key_format=u,key_gap=10,leaf_item_max=0,leaf_key_max=0,"
- "leaf_page_max=32KB,leaf_value_max=0,memory_page_max=5MB,"
- "os_cache_dirty_max=0,os_cache_max=0,prefix_compression=0,"
- "prefix_compression_min=4,split_deepen_min_child=0,"
- "split_deepen_per_child=0,split_pct=75,value_format=u,"
- "version=(major=0,minor=0)",
- confchk_file_meta
- },
- { "index.meta",
- "app_metadata=,collator=,columns=,extractor=,immutable=0,"
- "index_key_columns=,key_format=u,source=,type=file,value_format=u",
- confchk_index_meta
- },
- { "session.begin_transaction",
+ { "WT_SESSION.begin_transaction",
"isolation=,name=,priority=0,sync=",
- confchk_session_begin_transaction
+ confchk_WT_SESSION_begin_transaction, 4
},
- { "session.checkpoint",
+ { "WT_SESSION.checkpoint",
"drop=,force=0,name=,target=",
- confchk_session_checkpoint
+ confchk_WT_SESSION_checkpoint, 4
},
- { "session.close",
+ { "WT_SESSION.close",
"",
- NULL
+ NULL, 0
},
- { "session.commit_transaction",
+ { "WT_SESSION.commit_transaction",
"",
- NULL
+ NULL, 0
},
- { "session.compact",
+ { "WT_SESSION.compact",
"timeout=1200",
- confchk_session_compact
+ confchk_WT_SESSION_compact, 1
},
- { "session.create",
+ { "WT_SESSION.create",
"allocation_size=4KB,app_metadata=,block_allocation=best,"
"block_compressor=,cache_resident=0,checksum=uncompressed,"
"colgroups=,collator=,columns=,dictionary=0,exclusive=0,"
@@ -732,58 +772,81 @@ static const WT_CONFIG_ENTRY config_entries[] = {
"prefix_compression=0,prefix_compression_min=4,source=,"
"split_deepen_min_child=0,split_deepen_per_child=0,split_pct=75,"
"type=file,value_format=u",
- confchk_session_create
+ confchk_WT_SESSION_create, 38
},
- { "session.drop",
+ { "WT_SESSION.drop",
"force=0,remove_files=",
- confchk_session_drop
+ confchk_WT_SESSION_drop, 2
},
- { "session.log_printf",
+ { "WT_SESSION.log_printf",
"",
- NULL
+ NULL, 0
},
- { "session.open_cursor",
+ { "WT_SESSION.open_cursor",
"append=0,bulk=0,checkpoint=,dump=,next_random=0,overwrite=,raw=0"
",readonly=0,skip_sort_check=0,statistics=,target=",
- confchk_session_open_cursor
+ confchk_WT_SESSION_open_cursor, 11
},
- { "session.reconfigure",
+ { "WT_SESSION.reconfigure",
"isolation=read-committed",
- confchk_session_reconfigure
+ confchk_WT_SESSION_reconfigure, 1
},
- { "session.rename",
+ { "WT_SESSION.rename",
"",
- NULL
+ NULL, 0
},
- { "session.rollback_transaction",
+ { "WT_SESSION.rollback_transaction",
"",
- NULL
+ NULL, 0
},
- { "session.salvage",
+ { "WT_SESSION.salvage",
"force=0",
- confchk_session_salvage
+ confchk_WT_SESSION_salvage, 1
},
- { "session.strerror",
+ { "WT_SESSION.strerror",
"",
- NULL
+ NULL, 0
},
- { "session.truncate",
+ { "WT_SESSION.truncate",
"",
- NULL
+ NULL, 0
},
- { "session.upgrade",
+ { "WT_SESSION.upgrade",
"",
- NULL
+ NULL, 0
},
- { "session.verify",
+ { "WT_SESSION.verify",
"dump_address=0,dump_blocks=0,dump_offsets=,dump_pages=0,"
"dump_shape=0",
- confchk_session_verify
+ confchk_WT_SESSION_verify, 5
+ },
+ { "colgroup.meta",
+ "app_metadata=,collator=,columns=,source=,type=file",
+ confchk_colgroup_meta, 5
+ },
+ { "file.meta",
+ "allocation_size=4KB,app_metadata=,block_allocation=best,"
+ "block_compressor=,cache_resident=0,checkpoint=,checkpoint_lsn=,"
+ "checksum=uncompressed,collator=,columns=,dictionary=0,"
+ "format=btree,huffman_key=,huffman_value=,id=,internal_item_max=0"
+ ",internal_key_max=0,internal_key_truncate=,internal_page_max=4KB"
+ ",key_format=u,key_gap=10,leaf_item_max=0,leaf_key_max=0,"
+ "leaf_page_max=32KB,leaf_value_max=0,memory_page_max=5MB,"
+ "os_cache_dirty_max=0,os_cache_max=0,prefix_compression=0,"
+ "prefix_compression_min=4,split_deepen_min_child=0,"
+ "split_deepen_per_child=0,split_pct=75,value_format=u,"
+ "version=(major=0,minor=0)",
+ confchk_file_meta, 35
+ },
+ { "index.meta",
+ "app_metadata=,collator=,columns=,extractor=,immutable=0,"
+ "index_key_columns=,key_format=u,source=,type=file,value_format=u",
+ confchk_index_meta, 10
},
{ "table.meta",
"app_metadata=,colgroups=,collator=,columns=,key_format=u,"
"value_format=u",
- confchk_table_meta
+ confchk_table_meta, 6
},
{ "wiredtiger_open",
"async=(enabled=0,ops_max=1024,threads=2),buffer_alignment=-1,"
@@ -792,17 +855,17 @@ static const WT_CONFIG_ENTRY config_entries[] = {
"config_base=,create=0,direct_io=,error_prefix=,"
"eviction=(threads_max=1,threads_min=1),eviction_dirty_target=80,"
"eviction_target=80,eviction_trigger=95,exclusive=0,extensions=,"
- "file_extend=,file_manager=(close_idle_time=30,"
- "close_scan_interval=10),hazard_max=1000,log=(archive=,"
- "compressor=,enabled=0,file_max=100MB,path=,prealloc=,recover=on)"
- ",lsm_manager=(merge=,worker_thread_max=4),lsm_merge=,mmap=,"
- "multiprocess=0,session_max=100,session_scratch_max=2MB,"
- "shared_cache=(chunk=10MB,name=,reserve=0,size=500MB),"
- "statistics=none,statistics_log=(on_close=0,"
+ "file_extend=,file_manager=(close_handle_minimum=250,"
+ "close_idle_time=30,close_scan_interval=10),hazard_max=1000,"
+ "log=(archive=,compressor=,enabled=0,file_max=100MB,path=,"
+ "prealloc=,recover=on),lsm_manager=(merge=,worker_thread_max=4),"
+ "lsm_merge=,mmap=,multiprocess=0,session_max=100,"
+ "session_scratch_max=2MB,shared_cache=(chunk=10MB,name=,reserve=0"
+ ",size=500MB),statistics=none,statistics_log=(on_close=0,"
"path=\"WiredTigerStat.%d.%H\",sources=,"
"timestamp=\"%b %d %H:%M:%S\",wait=0),transaction_sync=(enabled=0"
",method=fsync),use_environment_priv=0,verbose=",
- confchk_wiredtiger_open
+ confchk_wiredtiger_open, 32
},
{ "wiredtiger_open_all",
"async=(enabled=0,ops_max=1024,threads=2),buffer_alignment=-1,"
@@ -811,18 +874,18 @@ static const WT_CONFIG_ENTRY config_entries[] = {
"config_base=,create=0,direct_io=,error_prefix=,"
"eviction=(threads_max=1,threads_min=1),eviction_dirty_target=80,"
"eviction_target=80,eviction_trigger=95,exclusive=0,extensions=,"
- "file_extend=,file_manager=(close_idle_time=30,"
- "close_scan_interval=10),hazard_max=1000,log=(archive=,"
- "compressor=,enabled=0,file_max=100MB,path=,prealloc=,recover=on)"
- ",lsm_manager=(merge=,worker_thread_max=4),lsm_merge=,mmap=,"
- "multiprocess=0,session_max=100,session_scratch_max=2MB,"
- "shared_cache=(chunk=10MB,name=,reserve=0,size=500MB),"
- "statistics=none,statistics_log=(on_close=0,"
+ "file_extend=,file_manager=(close_handle_minimum=250,"
+ "close_idle_time=30,close_scan_interval=10),hazard_max=1000,"
+ "log=(archive=,compressor=,enabled=0,file_max=100MB,path=,"
+ "prealloc=,recover=on),lsm_manager=(merge=,worker_thread_max=4),"
+ "lsm_merge=,mmap=,multiprocess=0,session_max=100,"
+ "session_scratch_max=2MB,shared_cache=(chunk=10MB,name=,reserve=0"
+ ",size=500MB),statistics=none,statistics_log=(on_close=0,"
"path=\"WiredTigerStat.%d.%H\",sources=,"
"timestamp=\"%b %d %H:%M:%S\",wait=0),transaction_sync=(enabled=0"
",method=fsync),use_environment_priv=0,verbose=,version=(major=0,"
"minor=0)",
- confchk_wiredtiger_open_all
+ confchk_wiredtiger_open_all, 33
},
{ "wiredtiger_open_basecfg",
"async=(enabled=0,ops_max=1024,threads=2),buffer_alignment=-1,"
@@ -830,17 +893,17 @@ static const WT_CONFIG_ENTRY config_entries[] = {
"name=\"WiredTigerCheckpoint\",wait=0),checkpoint_sync=,"
"direct_io=,error_prefix=,eviction=(threads_max=1,threads_min=1),"
"eviction_dirty_target=80,eviction_target=80,eviction_trigger=95,"
- "extensions=,file_extend=,file_manager=(close_idle_time=30,"
- "close_scan_interval=10),hazard_max=1000,log=(archive=,"
- "compressor=,enabled=0,file_max=100MB,path=,prealloc=,recover=on)"
- ",lsm_manager=(merge=,worker_thread_max=4),lsm_merge=,mmap=,"
- "multiprocess=0,session_max=100,session_scratch_max=2MB,"
- "shared_cache=(chunk=10MB,name=,reserve=0,size=500MB),"
- "statistics=none,statistics_log=(on_close=0,"
+ "extensions=,file_extend=,file_manager=(close_handle_minimum=250,"
+ "close_idle_time=30,close_scan_interval=10),hazard_max=1000,"
+ "log=(archive=,compressor=,enabled=0,file_max=100MB,path=,"
+ "prealloc=,recover=on),lsm_manager=(merge=,worker_thread_max=4),"
+ "lsm_merge=,mmap=,multiprocess=0,session_max=100,"
+ "session_scratch_max=2MB,shared_cache=(chunk=10MB,name=,reserve=0"
+ ",size=500MB),statistics=none,statistics_log=(on_close=0,"
"path=\"WiredTigerStat.%d.%H\",sources=,"
"timestamp=\"%b %d %H:%M:%S\",wait=0),transaction_sync=(enabled=0"
",method=fsync),verbose=,version=(major=0,minor=0)",
- confchk_wiredtiger_open_basecfg
+ confchk_wiredtiger_open_basecfg, 29
},
{ "wiredtiger_open_usercfg",
"async=(enabled=0,ops_max=1024,threads=2),buffer_alignment=-1,"
@@ -848,19 +911,19 @@ static const WT_CONFIG_ENTRY config_entries[] = {
"name=\"WiredTigerCheckpoint\",wait=0),checkpoint_sync=,"
"direct_io=,error_prefix=,eviction=(threads_max=1,threads_min=1),"
"eviction_dirty_target=80,eviction_target=80,eviction_trigger=95,"
- "extensions=,file_extend=,file_manager=(close_idle_time=30,"
- "close_scan_interval=10),hazard_max=1000,log=(archive=,"
- "compressor=,enabled=0,file_max=100MB,path=,prealloc=,recover=on)"
- ",lsm_manager=(merge=,worker_thread_max=4),lsm_merge=,mmap=,"
- "multiprocess=0,session_max=100,session_scratch_max=2MB,"
- "shared_cache=(chunk=10MB,name=,reserve=0,size=500MB),"
- "statistics=none,statistics_log=(on_close=0,"
+ "extensions=,file_extend=,file_manager=(close_handle_minimum=250,"
+ "close_idle_time=30,close_scan_interval=10),hazard_max=1000,"
+ "log=(archive=,compressor=,enabled=0,file_max=100MB,path=,"
+ "prealloc=,recover=on),lsm_manager=(merge=,worker_thread_max=4),"
+ "lsm_merge=,mmap=,multiprocess=0,session_max=100,"
+ "session_scratch_max=2MB,shared_cache=(chunk=10MB,name=,reserve=0"
+ ",size=500MB),statistics=none,statistics_log=(on_close=0,"
"path=\"WiredTigerStat.%d.%H\",sources=,"
"timestamp=\"%b %d %H:%M:%S\",wait=0),transaction_sync=(enabled=0"
",method=fsync),verbose=",
- confchk_wiredtiger_open_usercfg
+ confchk_wiredtiger_open_usercfg, 28
},
- { NULL, NULL, NULL }
+ { NULL, NULL, NULL, 0 }
};
int
@@ -872,8 +935,7 @@ __wt_conn_config_init(WT_SESSION_IMPL *session)
conn = S2C(session);
/* Build a list of pointers to the configuration information. */
- WT_RET(__wt_calloc_def(session,
- sizeof(config_entries) / sizeof(config_entries[0]), &epp));
+ WT_RET(__wt_calloc_def(session, WT_ELEMENTS(config_entries), &epp));
conn->config_entries = epp;
/* Fill in the list to reference the default information. */
@@ -894,3 +956,18 @@ __wt_conn_config_discard(WT_SESSION_IMPL *session)
__wt_free(session, conn->config_entries);
}
+
+/*
+ * __wt_conn_config_match --
+ * Return the static configuration entry for a method.
+ */
+const WT_CONFIG_ENTRY *
+__wt_conn_config_match(const char *method)
+{
+ const WT_CONFIG_ENTRY *ep;
+
+ for (ep = config_entries; ep->method != NULL; ++ep)
+ if (strcmp(method, ep->method) == 0)
+ return (ep);
+ return (NULL);
+}
diff --git a/src/third_party/wiredtiger/src/conn/conn_api.c b/src/third_party/wiredtiger/src/conn/conn_api.c
index b41cad25914..3214926bcf1 100644
--- a/src/third_party/wiredtiger/src/conn/conn_api.c
+++ b/src/third_party/wiredtiger/src/conn/conn_api.c
@@ -852,38 +852,44 @@ __conn_reconfigure(WT_CONNECTION *wt_conn, const char *config)
WT_CONNECTION_IMPL *conn;
WT_DECL_RET;
WT_SESSION_IMPL *session;
- const char *p, *config_cfg[] = { NULL, NULL, NULL };
+ const char *p;
conn = (WT_CONNECTION_IMPL *)wt_conn;
CONNECTION_API_CALL(conn, session, reconfigure, config, cfg);
- WT_UNUSED(cfg);
/* Serialize reconfiguration. */
__wt_spin_lock(session, &conn->reconfig_lock);
/*
- * The configuration argument has been checked for validity, replace the
+ * The configuration argument has been checked for validity, update the
* previous connection configuration.
*
* DO NOT merge the configuration before the reconfigure calls. Some
* of the underlying reconfiguration functions do explicit checks with
* the second element of the configuration array, knowing the defaults
* are in slot #1 and the application's modifications are in slot #2.
+ *
+ * First, replace the base configuration set up by CONNECTION_API_CALL
+ * with the current connection configuration, otherwise reconfiguration
+ * functions will find the base value instead of previously configured
+ * value.
*/
- config_cfg[0] = conn->cfg;
- config_cfg[1] = config;
-
- WT_ERR(__conn_statistics_config(session, config_cfg));
- WT_ERR(__wt_async_reconfig(session, config_cfg));
- WT_ERR(__wt_cache_config(session, 1, config_cfg));
- WT_ERR(__wt_checkpoint_server_create(session, config_cfg));
- WT_ERR(__wt_lsm_manager_reconfig(session, config_cfg));
- WT_ERR(__wt_statlog_create(session, config_cfg));
+ cfg[0] = conn->cfg;
+ cfg[1] = config;
+
+ /* Second, reconfigure the system. */
+ WT_ERR(__conn_statistics_config(session, cfg));
+ WT_ERR(__wt_async_reconfig(session, cfg));
+ WT_ERR(__wt_cache_config(session, 1, cfg));
+ WT_ERR(__wt_checkpoint_server_create(session, cfg));
+ WT_ERR(__wt_lsm_manager_reconfig(session, cfg));
+ WT_ERR(__wt_statlog_create(session, cfg));
WT_ERR(__wt_sweep_config(session, cfg));
- WT_ERR(__wt_verbose_config(session, config_cfg));
+ WT_ERR(__wt_verbose_config(session, cfg));
- WT_ERR(__wt_config_merge(session, config_cfg, &p));
+ /* Third, merge everything together, creating a new connection state. */
+ WT_ERR(__wt_config_merge(session, cfg, NULL, &p));
__wt_free(session, conn->cfg);
conn->cfg = p;
@@ -1460,7 +1466,8 @@ __wt_verbose_config(WT_SESSION_IMPL *session, const char *cfg[])
* Save the base configuration used to create a database.
*/
static int
-__conn_write_base_config(WT_SESSION_IMPL *session, const char *cfg[])
+__conn_write_base_config(
+ WT_SESSION_IMPL *session, const char *cfg[], const char *config)
{
FILE *fp;
WT_CONFIG parser;
@@ -1505,54 +1512,40 @@ __conn_write_base_config(WT_SESSION_IMPL *session, const char *cfg[])
"# these settings, set a WIREDTIGER_CONFIG environment variable\n"
"# or create a WiredTiger.config file to override them.");
- fprintf(fp, "version=(major=%d,minor=%d)\n\n",
- WIREDTIGER_VERSION_MAJOR, WIREDTIGER_VERSION_MINOR);
-
/*
- * We were passed an array of configuration strings where slot 0 is all
- * possible values and the second and subsequent slots are changes
- * specified by the application during open (using the wiredtiger_open
- * configuration string, an environment variable, or user-configuration
- * file). The base configuration file contains all changes to default
- * settings made at create, and we include the user-configuration file
- * in that list, even though we don't expect it to change. Of course,
- * an application could leave that file as it is right now and not
- * remove a configuration we need, but applications can also guarantee
- * all database users specify consistent environment variables and
- * wiredtiger_open configuration arguments, and if we protect against
+ * The base configuration file contains all changes to default settings
+ * made at create, and we include the user-configuration file in that
+ * list, even though we don't expect it to change. Of course, an
+ * application could leave that file as it is right now and not remove
+ * a configuration we need, but applications can also guarantee all
+ * database users specify consistent environment variables and
+ * wiredtiger_open configuration arguments -- if we protect against
* those problems, might as well include the application's configuration
- * file as well.
+ * file in that protection.
*
- * We want the list of defaults that have been changed, that is, if the
- * application didn't somehow configure a setting, we don't write out a
- * default value, so future releases may silently migrate to new default
- * values.
+ * We were passed the configuration items specified by the application.
+ * That list includes configuring the default setting, presumably if
+ * the application configured it explicitly, that setting should survive
+ * even if the default changes.
*/
- while (*++cfg != NULL) {
- WT_ERR(__wt_config_init( session,
- &parser, WT_CONFIG_BASE(session, wiredtiger_open_basecfg)));
- while ((ret = __wt_config_next(&parser, &k, &v)) == 0) {
- if ((ret =
- __wt_config_getone(session, *cfg, &k, &v)) == 0) {
- /* Fix quoting for non-trivial settings. */
- if (v.type == WT_CONFIG_ITEM_STRING) {
- --v.str;
- v.len += 2;
- }
- fprintf(fp, "%.*s=%.*s\n",
- (int)k.len, k.str, (int)v.len, v.str);
- }
- WT_ERR_NOTFOUND_OK(ret);
+ WT_ERR(__wt_config_init(session, &parser, config));
+ while ((ret = __wt_config_next(&parser, &k, &v)) == 0) {
+ /* Fix quoting for non-trivial settings. */
+ if (v.type == WT_CONFIG_ITEM_STRING) {
+ --v.str;
+ v.len += 2;
}
- WT_ERR_NOTFOUND_OK(ret);
+ fprintf(fp,
+ "%.*s=%.*s\n", (int)k.len, k.str, (int)v.len, v.str);
}
+ WT_ERR_NOTFOUND_OK(ret);
/* Flush the handle and rename the file into place. */
return (__wt_sync_and_rename_fp(
session, &fp, WT_BASECONFIG_SET, WT_BASECONFIG));
/* Close any file handle left open, remove any temporary file. */
-err: WT_TRET(__wt_fclose(session, &fp, WT_FHANDLE_WRITE));
+err: WT_TRET(__wt_fclose(&fp, WT_FHANDLE_WRITE));
WT_TRET(__wt_remove_if_exists(session, WT_BASECONFIG_SET));
return (ret);
@@ -1592,26 +1585,24 @@ wiredtiger_open(const char *home, WT_EVENT_HANDLER *event_handler,
WT_CONFIG_ITEM cval, sval;
WT_CONNECTION_IMPL *conn;
+ WT_DECL_ITEM(i1);
+ WT_DECL_ITEM(i2);
+ WT_DECL_ITEM(i3);
WT_DECL_RET;
- WT_ITEM i1, i2, i3;
const WT_NAME_FLAG *ft;
WT_SESSION_IMPL *session;
+ const char *base_merge;
+ char version[64];
- /* Leave space for optional additional configuration. */
- const char *cfg[] = { NULL, NULL, NULL, NULL, NULL, NULL };
+ /* Leave lots of space for optional additional configuration. */
+ const char *cfg[] = {
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL };
*wt_connp = NULL;
conn = NULL;
session = NULL;
-
- /*
- * We could use scratch buffers, but I'd rather the default session
- * not tie down chunks of memory past the open call.
- */
- WT_CLEAR(i1);
- WT_CLEAR(i2);
- WT_CLEAR(i3);
+ base_merge = NULL;
WT_RET(__wt_library_init());
@@ -1659,20 +1650,55 @@ wiredtiger_open(const char *home, WT_EVENT_HANDLER *event_handler,
* entries override earlier entries):
*
* 1. all possible wiredtiger_open configurations
- * 2. base configuration file, created with the database (optional)
- * 3. the config passed in by the application.
- * 4. user configuration file (optional)
- * 5. environment variable settings (optional)
+ * 2. the WiredTiger compilation version (expected to be overridden by
+ * any value in the base configuration file)
+ * 3. base configuration file, created with the database (optional)
+ * 4. the config passed in by the application
+ * 5. user configuration file (optional)
+ * 6. environment variable settings (optional)
*
* Clear the entries we added to the stack, we're going to build it in
* order.
*/
+ WT_ERR(__wt_scr_alloc(session, 0, &i1));
+ WT_ERR(__wt_scr_alloc(session, 0, &i2));
+ WT_ERR(__wt_scr_alloc(session, 0, &i3));
cfg[0] = WT_CONFIG_BASE(session, wiredtiger_open_all);
cfg[1] = NULL;
- WT_ERR(__conn_config_file(session, WT_BASECONFIG, 0, cfg, &i1));
+ WT_ERR_TEST(snprintf(version, sizeof(version),
+ "version=(major=%d,minor=%d)",
+ WIREDTIGER_VERSION_MAJOR, WIREDTIGER_VERSION_MINOR) >=
+ (int)sizeof(version), ENOMEM);
+ __conn_config_append(cfg, version);
+ WT_ERR(__conn_config_file(session, WT_BASECONFIG, 0, cfg, i1));
__conn_config_append(cfg, config);
- WT_ERR(__conn_config_file(session, WT_USERCONFIG, 1, cfg, &i2));
- WT_ERR(__conn_config_env(session, cfg, &i3));
+ WT_ERR(__conn_config_file(session, WT_USERCONFIG, 1, cfg, i2));
+ WT_ERR(__conn_config_env(session, cfg, i3));
+
+ /*
+ * Merge the full configuration stack and save it for reconfiguration.
+ */
+ WT_ERR(__wt_config_merge(session, cfg, NULL, &conn->cfg));
+
+ /*
+ * When writing the base configuration file, we write the version and
+ * any configuration information set by the application (in other words,
+ * the stack except for cfg[0]). However, some configuration values need
+ * to be stripped out from the base configuration file; do that now, and
+ * merge the rest to be written.
+ */
+ WT_ERR(__wt_config_merge(session, cfg + 1, "create=", &base_merge));
+
+ /*
+ * Reset cfg to the configuration stack we're going to use for the rest
+ * of the open.
+ *
+ * Underlying code distinguishes the base values from the user-specified
+ * information by ignoring cfg[0]. Make that work by leaving base values
+ * in cfg[0], and the collapsed user-specified values in cfg[1].
+ */
+ cfg[1] = base_merge;
+ cfg[2] = NULL;
/*
* Configuration ...
@@ -1785,25 +1811,33 @@ wiredtiger_open(const char *home, WT_EVENT_HANDLER *event_handler,
* Configuration completed; optionally write the base configuration file
* if it doesn't already exist.
*/
- WT_ERR(__conn_write_base_config(session, cfg));
+ WT_ERR(__conn_write_base_config(session, cfg, base_merge));
/*
* Start the worker threads last.
*/
WT_ERR(__wt_connection_workers(session, cfg));
- /* Merge the final configuration for later reconfiguration. */
- WT_ERR(__wt_config_merge(session, cfg, &conn->cfg));
-
WT_STATIC_ASSERT(offsetof(WT_CONNECTION_IMPL, iface) == 0);
*wt_connp = &conn->iface;
-err: /* Discard the configuration strings. */
- __wt_buf_free(session, &i1);
- __wt_buf_free(session, &i2);
- __wt_buf_free(session, &i3);
+err: /* Discard the scratch buffers. */
+ __wt_scr_free(session, &i1);
+ __wt_scr_free(session, &i2);
+ __wt_scr_free(session, &i3);
- if (ret != 0 && conn != NULL)
+ __wt_free(session, base_merge);
+
+ /*
+ * We may have allocated scratch memory when using the dummy session or
+ * the subsequently created real session, and we don't want to tie down
+ * memory for the rest of the run in either of them.
+ */
+ if (session != &conn->dummy_session)
+ __wt_scr_discard(session);
+ __wt_scr_discard(&conn->dummy_session);
+
+ if (ret != 0)
WT_TRET(__wt_connection_close(conn));
return (ret);
diff --git a/src/third_party/wiredtiger/src/conn/conn_cache.c b/src/third_party/wiredtiger/src/conn/conn_cache.c
index a99e6d3ad20..8de8cd3f8bc 100644
--- a/src/third_party/wiredtiger/src/conn/conn_cache.c
+++ b/src/third_party/wiredtiger/src/conn/conn_cache.c
@@ -215,6 +215,22 @@ __wt_cache_destroy(WT_SESSION_IMPL *session)
if (cache == NULL)
return (0);
+ /* The cache should be empty at this point. Complain if not. */
+ if (cache->pages_inmem != cache->pages_evict)
+ __wt_errx(session,
+ "cache server: exiting with %" PRIu64 " pages in "
+ "memory and %" PRIu64 " pages evicted",
+ cache->pages_inmem, cache->pages_evict);
+ if (cache->bytes_inmem != 0)
+ __wt_errx(session,
+ "cache server: exiting with %" PRIu64 " bytes in memory",
+ cache->bytes_inmem);
+ if (cache->bytes_dirty != 0 || cache->pages_dirty != 0)
+ __wt_errx(session,
+ "cache server: exiting with %" PRIu64
+ " bytes dirty and %" PRIu64 " pages dirty",
+ cache->bytes_dirty, cache->pages_dirty);
+
WT_TRET(__wt_cond_destroy(session, &cache->evict_cond));
WT_TRET(__wt_cond_destroy(session, &cache->evict_waiter_cond));
__wt_spin_destroy(session, &cache->evict_lock);
diff --git a/src/third_party/wiredtiger/src/conn/conn_dhandle.c b/src/third_party/wiredtiger/src/conn/conn_dhandle.c
index 63180d64019..60e7c41f76d 100644
--- a/src/third_party/wiredtiger/src/conn/conn_dhandle.c
+++ b/src/third_party/wiredtiger/src/conn/conn_dhandle.c
@@ -74,16 +74,19 @@ __conn_dhandle_open_lock(
*
* Wait for a read lock if we want exclusive access and failed
* to get it: the sweep server may be closing this handle, and
- * we need to wait for it to complete. If we want exclusive
- * access and find the handle open once we get the read lock,
- * give up: some other thread has it locked for real.
+ * we need to wait for it to release its lock. If we want
+ * exclusive access and find the handle open once we get the
+ * read lock, give up: some other thread has it locked for real.
*/
if (F_ISSET(dhandle, WT_DHANDLE_OPEN) &&
(!want_exclusive || lock_busy)) {
WT_RET(__wt_readlock(session, dhandle->rwlock));
is_open = F_ISSET(dhandle, WT_DHANDLE_OPEN) ? 1 : 0;
- if (is_open && !want_exclusive)
+ if (is_open && !want_exclusive) {
+ WT_ASSERT(session,
+ !F_ISSET(dhandle, WT_DHANDLE_DEAD));
return (0);
+ }
WT_RET(__wt_readunlock(session, dhandle->rwlock));
} else
is_open = 0;
@@ -109,6 +112,7 @@ __conn_dhandle_open_lock(
/* We have an exclusive lock, we're done. */
F_SET(dhandle, WT_DHANDLE_EXCLUSIVE);
+ WT_ASSERT(session, !F_ISSET(dhandle, WT_DHANDLE_DEAD));
return (0);
} else if (ret != EBUSY || (is_open && want_exclusive))
return (ret);
@@ -132,22 +136,36 @@ __wt_conn_dhandle_find(WT_SESSION_IMPL *session,
WT_DATA_HANDLE *dhandle;
uint64_t bucket;
- WT_UNUSED(flags); /* Only used in diagnostic builds */
conn = S2C(session);
- /* We must be holding the handle list lock at a higher level. */
+ /*
+ * We must be holding the handle list lock at a higher level, and not
+ * have a reference.
+ */
WT_ASSERT(session, F_ISSET(session, WT_SESSION_HANDLE_LIST_LOCKED) &&
!LF_ISSET(WT_DHANDLE_HAVE_REF));
- /* Increment the reference count if we already have the btree open. */
bucket = __wt_hash_city64(name, strlen(name)) % WT_HASH_ARRAY_SIZE;
- SLIST_FOREACH(dhandle, &conn->dhhash[bucket], hashl)
- if (strcmp(name, dhandle->name) == 0 &&
- ((ckpt == NULL && dhandle->checkpoint == NULL) ||
- (ckpt != NULL && dhandle->checkpoint != NULL &&
- strcmp(ckpt, dhandle->checkpoint) == 0))) {
- session->dhandle = dhandle;
- return (0);
+ if (ckpt == NULL) {
+ SLIST_FOREACH(dhandle, &conn->dhhash[bucket], hashl) {
+ if (F_ISSET(dhandle, WT_DHANDLE_DEAD))
+ continue;
+ if (dhandle->checkpoint == NULL &&
+ strcmp(name, dhandle->name) == 0) {
+ session->dhandle = dhandle;
+ return (0);
+ }
+ }
+ } else
+ SLIST_FOREACH(dhandle, &conn->dhhash[bucket], hashl) {
+ if (F_ISSET(dhandle, WT_DHANDLE_DEAD))
+ continue;
+ if (dhandle->checkpoint != NULL &&
+ strcmp(name, dhandle->name) == 0 &&
+ strcmp(ckpt, dhandle->checkpoint) == 0) {
+ session->dhandle = dhandle;
+ return (0);
+ }
}
return (WT_NOTFOUND);
@@ -230,6 +248,30 @@ err: WT_TRET(__wt_rwlock_destroy(session, &dhandle->rwlock));
}
/*
+ * __conn_dhandle_mark_dead --
+ * Mark a data handle dead.
+ */
+static int
+__conn_dhandle_mark_dead(WT_SESSION_IMPL *session)
+{
+ int evict_reset;
+
+ WT_ASSERT(session, F_ISSET(session, WT_SESSION_HANDLE_LIST_LOCKED));
+
+ /*
+ * Handle forced discard (e.g., when dropping a file).
+ *
+ * We need exclusive access to the file -- disable ordinary
+ * eviction and drain any blocks already queued.
+ */
+ WT_RET(__wt_evict_file_exclusive_on(session, &evict_reset));
+ F_SET(session->dhandle, WT_DHANDLE_DEAD);
+ if (evict_reset)
+ __wt_evict_file_exclusive_off(session);
+ return (0);
+}
+
+/*
* __wt_conn_btree_sync_and_close --
* Sync and close the underlying btree handle.
*/
@@ -270,16 +312,25 @@ __wt_conn_btree_sync_and_close(WT_SESSION_IMPL *session, int final, int force)
/*
* The close can fail if an update cannot be written, return the EBUSY
* error to our caller for eventual retry.
+ *
+ * If we are forcing the close, just mark the handle dead and the tree
+ * will be discarded later. Don't do this for memory-mapped trees: we
+ * have to close the file handle to allow the file to be removed, but
+ * memory mapped trees contain pointers into memory that will become
+ * invalid if the mapping is closed.
*/
if (!F_ISSET(btree,
WT_BTREE_SALVAGE | WT_BTREE_UPGRADE | WT_BTREE_VERIFY))
- WT_ERR(__wt_checkpoint_close(session, final, force));
-
- if (dhandle->checkpoint == NULL)
- --S2C(session)->open_btree_count;
+ WT_ERR(force && (btree->bm == NULL || btree->bm->map == NULL) ?
+ __conn_dhandle_mark_dead(session) :
+ __wt_checkpoint_close(session, final));
WT_TRET(__wt_btree_close(session));
- F_CLR(dhandle, WT_DHANDLE_OPEN);
+ if (!force || final) {
+ F_CLR(dhandle, WT_DHANDLE_OPEN);
+ if (dhandle->checkpoint == NULL)
+ --S2C(session)->open_btree_count;
+ }
F_CLR(btree, WT_BTREE_SPECIAL_FLAGS);
err: __wt_spin_unlock(session, &dhandle->close_lock);
@@ -521,6 +572,7 @@ __wt_conn_btree_apply(WT_SESSION_IMPL *session,
__wt_hash_city64(uri, strlen(uri)) % WT_HASH_ARRAY_SIZE;
SLIST_FOREACH(dhandle, &conn->dhhash[bucket], hashl)
if (F_ISSET(dhandle, WT_DHANDLE_OPEN) &&
+ !F_ISSET(dhandle, WT_DHANDLE_DEAD) &&
strcmp(uri, dhandle->name) == 0 &&
(apply_checkpoints || dhandle->checkpoint == NULL))
WT_RET(__conn_btree_apply_internal(
@@ -528,6 +580,7 @@ __wt_conn_btree_apply(WT_SESSION_IMPL *session,
} else {
SLIST_FOREACH(dhandle, &conn->dhlh, l)
if (F_ISSET(dhandle, WT_DHANDLE_OPEN) &&
+ !F_ISSET(dhandle, WT_DHANDLE_DEAD) &&
(apply_checkpoints ||
dhandle->checkpoint == NULL) &&
WT_PREFIX_MATCH(dhandle->name, "file:") &&
@@ -649,8 +702,9 @@ __wt_conn_dhandle_close_all(
WT_ASSERT(session, session->dhandle == NULL);
bucket = __wt_hash_city64(name, strlen(name)) % WT_HASH_ARRAY_SIZE;
- SLIST_FOREACH(dhandle, &conn->dhhash[bucket], l) {
- if (strcmp(dhandle->name, name) != 0)
+ SLIST_FOREACH(dhandle, &conn->dhhash[bucket], hashl) {
+ if (strcmp(dhandle->name, name) != 0 ||
+ F_ISSET(dhandle, WT_DHANDLE_DEAD))
continue;
session->dhandle = dhandle;
@@ -722,7 +776,7 @@ __conn_dhandle_remove(WT_SESSION_IMPL *session, int final)
* Close/discard a single data handle.
*/
int
-__wt_conn_dhandle_discard_single(WT_SESSION_IMPL *session, int final)
+__wt_conn_dhandle_discard_single(WT_SESSION_IMPL *session, int final, int force)
{
WT_DATA_HANDLE *dhandle;
WT_DECL_RET;
@@ -730,8 +784,9 @@ __wt_conn_dhandle_discard_single(WT_SESSION_IMPL *session, int final)
dhandle = session->dhandle;
- if (F_ISSET(dhandle, WT_DHANDLE_OPEN)) {
- tret = __wt_conn_btree_sync_and_close(session, final, 0);
+ if (F_ISSET(dhandle, WT_DHANDLE_OPEN) ||
+ (final && F_ISSET(dhandle, WT_DHANDLE_DEAD))) {
+ tret = __wt_conn_btree_sync_and_close(session, final, force);
if (final && tret != 0) {
__wt_err(session, tret,
"Final close of %s failed", dhandle->name);
@@ -795,7 +850,7 @@ restart:
continue;
WT_WITH_DHANDLE(session, dhandle,
- WT_TRET(__wt_conn_dhandle_discard_single(session, 1)));
+ WT_TRET(__wt_conn_dhandle_discard_single(session, 1, 0)));
goto restart;
}
@@ -811,7 +866,7 @@ restart:
/* Close the metadata file handle. */
while ((dhandle = SLIST_FIRST(&conn->dhlh)) != NULL)
WT_WITH_DHANDLE(session, dhandle,
- WT_TRET(__wt_conn_dhandle_discard_single(session, 1)));
+ WT_TRET(__wt_conn_dhandle_discard_single(session, 1, 0)));
return (ret);
}
diff --git a/src/third_party/wiredtiger/src/conn/conn_log.c b/src/third_party/wiredtiger/src/conn/conn_log.c
index a6d53134ec2..f2d50e09561 100644
--- a/src/third_party/wiredtiger/src/conn/conn_log.c
+++ b/src/third_party/wiredtiger/src/conn/conn_log.c
@@ -344,18 +344,13 @@ typedef struct {
} WT_LOG_WRLSN_ENTRY;
/*
- * __log_wrlsn_cmp --
- * The log wrlsn comparison function for qsort.
+ * WT_WRLSN_ENTRY_CMP_LT --
+ * Return comparison of a written slot pair by LSN.
*/
-static int WT_CDECL
-__log_wrlsn_cmp(const void *a, const void *b)
-{
- WT_LOG_WRLSN_ENTRY *ae, *be;
-
- ae = (WT_LOG_WRLSN_ENTRY *)a;
- be = (WT_LOG_WRLSN_ENTRY *)b;
- return (LOG_CMP(&ae->lsn, &be->lsn));
-}
+#define WT_WRLSN_ENTRY_CMP_LT(entry1, entry2) \
+ ((entry1).lsn.file < (entry2).lsn.file || \
+ ((entry1).lsn.file == (entry2).lsn.file && \
+ (entry1).lsn.offset < (entry2).lsn.offset))
/*
* __log_wrlsn_server --
@@ -404,8 +399,9 @@ __log_wrlsn_server(void *arg)
*/
if (written_i > 0) {
yield = 0;
- qsort(written, written_i, sizeof(WT_LOG_WRLSN_ENTRY),
- __log_wrlsn_cmp);
+ WT_INSERTION_SORT(written, written_i,
+ WT_LOG_WRLSN_ENTRY, WT_WRLSN_ENTRY_CMP_LT);
+
/*
* We know the written array is sorted by LSN. Go
* through them either advancing write_lsn or stop
@@ -422,6 +418,7 @@ __log_wrlsn_server(void *arg)
slot = &log->slot_pool[written[i].slot_index];
WT_ASSERT(session, LOG_CMP(&written[i].lsn,
&slot->slot_release_lsn) == 0);
+ log->write_start_lsn = slot->slot_start_lsn;
log->write_lsn = slot->slot_end_lsn;
WT_ERR(__wt_cond_signal(session,
log->log_write_cond));
@@ -552,6 +549,7 @@ __wt_logmgr_create(WT_SESSION_IMPL *session, const char *cfg[])
WT_ZERO_LSN(&log->sync_dir_lsn);
WT_INIT_LSN(&log->trunc_lsn);
WT_INIT_LSN(&log->write_lsn);
+ WT_INIT_LSN(&log->write_start_lsn);
log->fileid = 0;
WT_RET(__wt_cond_alloc(session, "log sync", 0, &log->log_sync_cond));
WT_RET(__wt_cond_alloc(session, "log write", 0, &log->log_write_cond));
diff --git a/src/third_party/wiredtiger/src/conn/conn_open.c b/src/third_party/wiredtiger/src/conn/conn_open.c
index 86f62e176ad..bf363e81215 100644
--- a/src/third_party/wiredtiger/src/conn/conn_open.c
+++ b/src/third_party/wiredtiger/src/conn/conn_open.c
@@ -116,6 +116,7 @@ __wt_connection_close(WT_CONNECTION_IMPL *conn)
WT_TRET(__wt_checkpoint_server_destroy(session));
WT_TRET(__wt_statlog_destroy(session, 1));
WT_TRET(__wt_sweep_destroy(session));
+ WT_TRET(__wt_evict_destroy(session));
/* Close open data handles. */
WT_TRET(__wt_conn_dhandle_discard(session));
@@ -153,9 +154,6 @@ __wt_connection_close(WT_CONNECTION_IMPL *conn)
fh = SLIST_FIRST(&conn->fhlh);
}
- /* Shut down the eviction server thread. */
- WT_TRET(__wt_evict_destroy(session));
-
/* Disconnect from shared cache - must be before cache destroy. */
WT_TRET(__wt_conn_cache_pool_destroy(session));
@@ -230,25 +228,24 @@ __wt_connection_workers(WT_SESSION_IMPL *session, const char *cfg[])
WT_RET(__wt_evict_create(session));
/*
- * Start the handle sweep thread.
- */
- WT_RET(__wt_sweep_create(session));
-
- /*
* Start the optional statistics thread. Start statistics first so that
* other optional threads can know if statistics are enabled or not.
*/
WT_RET(__wt_statlog_create(session, cfg));
-
- /* Start the optional async threads. */
- WT_RET(__wt_async_create(session, cfg));
-
WT_RET(__wt_logmgr_create(session, cfg));
/* Run recovery. */
WT_RET(__wt_txn_recover(session));
/*
+ * Start the handle sweep thread.
+ */
+ WT_RET(__wt_sweep_create(session));
+
+ /* Start the optional async threads. */
+ WT_RET(__wt_async_create(session, cfg));
+
+ /*
* Start the optional logging/archive thread.
* NOTE: The log manager must be started before checkpoints so that the
* checkpoint server knows if logging is enabled.
diff --git a/src/third_party/wiredtiger/src/conn/conn_stat.c b/src/third_party/wiredtiger/src/conn/conn_stat.c
index 0d008939d8c..647e4b02abb 100644
--- a/src/third_party/wiredtiger/src/conn/conn_stat.c
+++ b/src/third_party/wiredtiger/src/conn/conn_stat.c
@@ -45,6 +45,8 @@ __wt_conn_stat_init(WT_SESSION_IMPL *session)
__wt_async_stats_update(session);
__wt_cache_stats_update(session);
__wt_txn_stats_update(session);
+
+ WT_CONN_STAT(session, file_open) = S2C(session)->open_file_count;
}
/*
@@ -140,7 +142,7 @@ __statlog_dump(WT_SESSION_IMPL *session, const char *name, int conn_stats)
uint64_t max;
const char *uri;
const char *cfg[] = {
- WT_CONFIG_BASE(session, session_open_cursor), NULL };
+ WT_CONFIG_BASE(session, WT_SESSION_open_cursor), NULL };
conn = S2C(session);
@@ -166,7 +168,7 @@ __statlog_dump(WT_SESSION_IMPL *session, const char *name, int conn_stats)
sizeof(WT_DSRC_STATS) / sizeof(WT_STATS);
for (i = 0,
stats = WT_CURSOR_STATS(cursor); i < max; ++i, ++stats)
- WT_ERR(__wt_fprintf(session, conn->stat_fp,
+ WT_ERR(__wt_fprintf(conn->stat_fp,
"%s %" PRIu64 " %s %s\n",
conn->stat_stamp,
stats->v, name, stats->desc));
@@ -300,7 +302,7 @@ __statlog_log_one(WT_SESSION_IMPL *session, WT_ITEM *path, WT_ITEM *tmp)
if ((log_file = conn->stat_fp) == NULL ||
path == NULL || strcmp(tmp->mem, path->mem) != 0) {
conn->stat_fp = NULL;
- WT_RET(__wt_fclose(session, &log_file, WT_FHANDLE_APPEND));
+ WT_RET(__wt_fclose(&log_file, WT_FHANDLE_APPEND));
if (path != NULL)
(void)strcpy(path->mem, tmp->mem);
WT_RET(__wt_fopen(session,
@@ -316,11 +318,6 @@ __statlog_log_one(WT_SESSION_IMPL *session, WT_ITEM *path, WT_ITEM *tmp)
/* Dump the connection statistics. */
WT_RET(__statlog_dump(session, conn->home, 1));
-#if SPINLOCK_TYPE == SPINLOCK_PTHREAD_MUTEX_LOGGING
- /* Dump the spinlock statistics. */
- WT_RET(__wt_statlog_dump_spinlock(conn, conn->home));
-#endif
-
/*
* Lock the schema and walk the list of open handles, dumping
* any that match the list of object sources.
@@ -344,7 +341,7 @@ __statlog_log_one(WT_SESSION_IMPL *session, WT_ITEM *path, WT_ITEM *tmp)
WT_RET(__statlog_lsm_apply(session));
/* Flush. */
- return (__wt_fflush(session, conn->stat_fp));
+ return (__wt_fflush(conn->stat_fp));
}
/*
@@ -529,7 +526,7 @@ __wt_statlog_destroy(WT_SESSION_IMPL *session, int is_close)
conn->stat_session = NULL;
conn->stat_tid_set = 0;
conn->stat_format = NULL;
- WT_TRET(__wt_fclose(session, &conn->stat_fp, WT_FHANDLE_APPEND));
+ WT_TRET(__wt_fclose(&conn->stat_fp, WT_FHANDLE_APPEND));
conn->stat_path = NULL;
conn->stat_sources = NULL;
conn->stat_stamp = NULL;
diff --git a/src/third_party/wiredtiger/src/conn/conn_sweep.c b/src/third_party/wiredtiger/src/conn/conn_sweep.c
index 90773a621e2..fc29e0b2e15 100644
--- a/src/third_party/wiredtiger/src/conn/conn_sweep.c
+++ b/src/third_party/wiredtiger/src/conn/conn_sweep.c
@@ -9,96 +9,87 @@
#include "wt_internal.h"
/*
- * __sweep_remove_handles --
- * Remove closed dhandles from the connection list.
+ * __sweep_mark --
+ * Mark idle handles with a time of death, and note if we see dead
+ * handles.
*/
static int
-__sweep_remove_handles(WT_SESSION_IMPL *session)
+__sweep_mark(WT_SESSION_IMPL *session, int *dead_handlesp)
{
WT_CONNECTION_IMPL *conn;
- WT_DATA_HANDLE *dhandle, *dhandle_next;
- WT_DECL_RET;
+ WT_DATA_HANDLE *dhandle;
+ time_t now;
conn = S2C(session);
- dhandle = SLIST_FIRST(&conn->dhlh);
+ *dead_handlesp = 0;
- for (; dhandle != NULL; dhandle = dhandle_next) {
- dhandle_next = SLIST_NEXT(dhandle, l);
+ /* Don't discard handles that have been open recently. */
+ WT_RET(__wt_seconds(session, &now));
+
+ WT_STAT_FAST_CONN_INCR(session, dh_conn_sweeps);
+ SLIST_FOREACH(dhandle, &conn->dhlh, l) {
if (WT_IS_METADATA(dhandle))
continue;
- if (F_ISSET(dhandle, WT_DHANDLE_OPEN))
+ if (F_ISSET(dhandle, WT_DHANDLE_DEAD)) {
+ ++*dead_handlesp;
continue;
-
- /* Make sure we get exclusive access. */
- if ((ret =
- __wt_try_writelock(session, dhandle->rwlock)) == EBUSY)
+ }
+ if (dhandle->session_inuse != 0 ||
+ now <= dhandle->timeofdeath + conn->sweep_idle_time)
continue;
- WT_RET(ret);
-
- /*
- * If there are no longer any references to the handle in any
- * sessions, attempt to discard it.
- */
- if (F_ISSET(dhandle, WT_DHANDLE_OPEN) ||
- dhandle->session_inuse != 0 || dhandle->session_ref != 0) {
- WT_RET(__wt_writeunlock(session, dhandle->rwlock));
+ if (dhandle->timeofdeath == 0) {
+ dhandle->timeofdeath = now;
+ WT_STAT_FAST_CONN_INCR(session, dh_conn_tod);
continue;
}
- WT_WITH_DHANDLE(session, dhandle,
- ret = __wt_conn_dhandle_discard_single(session, 0));
-
- /* If the handle was not successfully discarded, unlock it. */
- if (ret != 0)
- WT_TRET(__wt_writeunlock(session, dhandle->rwlock));
- WT_RET_BUSY_OK(ret);
- WT_STAT_FAST_CONN_INCR(session, dh_conn_ref);
+ /* We now have a candidate to close. */
+ ++*dead_handlesp;
}
- return (ret == EBUSY ? 0 : ret);
+ return (0);
}
/*
- * __sweep --
- * Close unused dhandles on the connection dhandle list.
+ * __sweep_expire --
+ * Mark trees dead if they are clean and haven't been accessed recently,
+ * until we have reached the configured minimum number of handles.
*/
static int
-__sweep(WT_SESSION_IMPL *session)
+__sweep_expire(WT_SESSION_IMPL *session)
{
WT_BTREE *btree;
WT_CONNECTION_IMPL *conn;
WT_DATA_HANDLE *dhandle;
WT_DECL_RET;
time_t now;
- int closed_handles;
conn = S2C(session);
- closed_handles = 0;
/* Don't discard handles that have been open recently. */
WT_RET(__wt_seconds(session, &now));
WT_STAT_FAST_CONN_INCR(session, dh_conn_sweeps);
SLIST_FOREACH(dhandle, &conn->dhlh, l) {
+ /*
+ * Ignore open files once the open file count reaches the
+ * minimum number of handles.
+ */
+ if (conn->open_file_count < conn->sweep_handles_min)
+ break;
+
if (WT_IS_METADATA(dhandle))
continue;
- if (!F_ISSET(dhandle, WT_DHANDLE_OPEN) &&
- dhandle->session_inuse == 0 && dhandle->session_ref == 0) {
- ++closed_handles;
+ if (!F_ISSET(dhandle, WT_DHANDLE_OPEN) ||
+ F_ISSET(dhandle, WT_DHANDLE_DEAD))
continue;
- }
if (dhandle->session_inuse != 0 ||
now <= dhandle->timeofdeath + conn->sweep_idle_time)
continue;
- if (dhandle->timeofdeath == 0) {
- dhandle->timeofdeath = now;
- WT_STAT_FAST_CONN_INCR(session, dh_conn_tod);
- continue;
- }
/*
* We have a candidate for closing; if it's open, acquire an
- * exclusive lock on the handle and close it.
+ * exclusive lock on the handle and mark it dead.
*
* The close would require I/O if an update cannot be written
* (updates in a no-longer-referenced file might not yet be
@@ -107,8 +98,10 @@ __sweep(WT_SESSION_IMPL *session)
* next time, after the transaction state has progressed.
*
* We don't set WT_DHANDLE_EXCLUSIVE deliberately, we want
- * opens to block on us rather than returning an EBUSY error to
- * the application.
+ * opens to block on us and then retry rather than returning an
+ * EBUSY error to the application. This is done holding the
+ * handle list lock so that connection-level handle searches
+ * never need to retry.
*/
if ((ret =
__wt_try_writelock(session, dhandle->rwlock)) == EBUSY)
@@ -121,31 +114,103 @@ __sweep(WT_SESSION_IMPL *session)
!__wt_txn_visible_all(session, btree->rec_max_txn))
goto unlock;
- /* If the handle is open, try to close it. */
- if (F_ISSET(dhandle, WT_DHANDLE_OPEN)) {
- WT_WITH_DHANDLE(session, dhandle, ret =
- __wt_conn_btree_sync_and_close(session, 0, 0));
+ /*
+ * Mark the handle as dead and close the underlying file
+ * handle. Closing the handle decrements the open file count,
+ * meaning the close loop won't overrun the configured minimum.
+ */
+ WT_WITH_DHANDLE(session, dhandle, ret =
+ __wt_conn_btree_sync_and_close(session, 0, 1));
- /* We closed the btree handle, bump the statistic. */
- if (ret == 0)
- WT_STAT_FAST_CONN_INCR(
- session, dh_conn_handles);
- }
+unlock: WT_TRET(__wt_writeunlock(session, dhandle->rwlock));
+ WT_RET_BUSY_OK(ret);
+ }
- if (dhandle->session_inuse == 0 && dhandle->session_ref == 0)
- ++closed_handles;
+ return (0);
+}
+/*
+ * __sweep_flush --
+ * Flush pages from dead trees.
+ */
+static int
+__sweep_flush(WT_SESSION_IMPL *session)
+{
+ WT_CONNECTION_IMPL *conn;
+ WT_DATA_HANDLE *dhandle;
+ WT_DECL_RET;
+
+ conn = S2C(session);
+
+ WT_STAT_FAST_CONN_INCR(session, dh_conn_sweeps);
+ SLIST_FOREACH(dhandle, &conn->dhlh, l) {
+ if (!F_ISSET(dhandle, WT_DHANDLE_OPEN) ||
+ !F_ISSET(dhandle, WT_DHANDLE_DEAD))
+ continue;
+
+ /* If the handle is marked "dead", flush it from cache. */
+ WT_WITH_DHANDLE(session, dhandle, ret =
+ __wt_conn_btree_sync_and_close(session, 0, 0));
+
+ /* We closed the btree handle, bump the statistic. */
+ if (ret == 0)
+ WT_STAT_FAST_CONN_INCR(session, dh_conn_handles);
-unlock: WT_TRET(__wt_writeunlock(session, dhandle->rwlock));
WT_RET_BUSY_OK(ret);
}
- if (closed_handles) {
- WT_WITH_DHANDLE_LOCK(session,
- ret = __sweep_remove_handles(session));
+ return (0);
+}
+
+/*
+ * __sweep_remove_handles --
+ * Remove closed dhandles from the connection list.
+ */
+static int
+__sweep_remove_handles(WT_SESSION_IMPL *session)
+{
+ WT_CONNECTION_IMPL *conn;
+ WT_DATA_HANDLE *dhandle, *dhandle_next;
+ WT_DECL_RET;
+
+ conn = S2C(session);
+ dhandle = SLIST_FIRST(&conn->dhlh);
+
+ for (; dhandle != NULL; dhandle = dhandle_next) {
+ dhandle_next = SLIST_NEXT(dhandle, l);
+ if (WT_IS_METADATA(dhandle))
+ continue;
+ if (F_ISSET(dhandle, WT_DHANDLE_OPEN) ||
+ dhandle->session_inuse != 0 ||
+ dhandle->session_ref != 0)
+ continue;
+
+ /* Make sure we get exclusive access. */
+ if ((ret =
+ __wt_try_writelock(session, dhandle->rwlock)) == EBUSY)
+ continue;
WT_RET(ret);
+
+ /*
+ * If there are no longer any references to the handle in any
+ * sessions, attempt to discard it.
+ */
+ if (F_ISSET(dhandle, WT_DHANDLE_OPEN) ||
+ dhandle->session_inuse != 0 || dhandle->session_ref != 0) {
+ WT_RET(__wt_writeunlock(session, dhandle->rwlock));
+ continue;
+ }
+
+ WT_WITH_DHANDLE(session, dhandle,
+ ret = __wt_conn_dhandle_discard_single(session, 0, 1));
+
+ /* If the handle was not successfully discarded, unlock it. */
+ if (ret != 0)
+ WT_TRET(__wt_writeunlock(session, dhandle->rwlock));
+ WT_RET_BUSY_OK(ret);
+ WT_STAT_FAST_CONN_INCR(session, dh_conn_ref);
}
- return (0);
+ return (ret == EBUSY ? 0 : ret);
}
/*
@@ -158,12 +223,13 @@ __sweep_server(void *arg)
WT_CONNECTION_IMPL *conn;
WT_DECL_RET;
WT_SESSION_IMPL *session;
+ int dead_handles;
session = arg;
conn = S2C(session);
/*
- * Sweep for dead handles.
+ * Sweep for dead and excess handles.
*/
while (F_ISSET(conn, WT_CONN_SERVER_RUN) &&
F_ISSET(conn, WT_CONN_SERVER_SWEEP)) {
@@ -171,8 +237,28 @@ __sweep_server(void *arg)
WT_ERR(__wt_cond_wait(session, conn->sweep_cond,
(uint64_t)conn->sweep_interval * WT_MILLION));
- /* Sweep the handles. */
- WT_ERR(__sweep(session));
+ /*
+ * Mark handles with a time of death, and report whether any
+ * handles are marked dead.
+ */
+ WT_ERR(__sweep_mark(session, &dead_handles));
+
+ if (dead_handles == 0 &&
+ conn->open_file_count < conn->sweep_handles_min)
+ continue;
+
+ /* Close handles if we have reached the configured limit */
+ if (conn->open_file_count >= conn->sweep_handles_min) {
+ WT_WITH_DHANDLE_LOCK(session,
+ ret = __sweep_expire(session));
+ WT_ERR(ret);
+ }
+
+ WT_ERR(__sweep_flush(session));
+
+ WT_WITH_DHANDLE_LOCK(session,
+ ret = __sweep_remove_handles(session));
+ WT_ERR(ret);
}
if (0) {
@@ -202,6 +288,10 @@ __wt_sweep_config(WT_SESSION_IMPL *session, const char *cfg[])
cfg, "file_manager.close_scan_interval", &cval));
conn->sweep_interval = (time_t)cval.val;
+ WT_RET(__wt_config_gets(session,
+ cfg, "file_manager.close_handle_minimum", &cval));
+ conn->sweep_handles_min = (u_int)cval.val;
+
return (0);
}
diff --git a/src/third_party/wiredtiger/src/cursor/cur_backup.c b/src/third_party/wiredtiger/src/cursor/cur_backup.c
index 5b47c2c1a73..a201477abe3 100644
--- a/src/third_party/wiredtiger/src/cursor/cur_backup.c
+++ b/src/third_party/wiredtiger/src/cursor/cur_backup.c
@@ -248,7 +248,7 @@ __backup_start(
* Close any hot backup file.
* We're about to open the incremental backup file.
*/
- WT_TRET(__wt_fclose(session, &cb->bfp, WT_FHANDLE_WRITE));
+ WT_TRET(__wt_fclose(&cb->bfp, WT_FHANDLE_WRITE));
WT_ERR(__backup_file_create(session, cb, log_only));
WT_ERR(__backup_list_append(
session, cb, WT_INCREMENTAL_BACKUP));
@@ -266,7 +266,7 @@ __backup_start(
}
err: /* Close the hot backup file. */
- WT_TRET(__wt_fclose(session, &cb->bfp, WT_FHANDLE_WRITE));
+ WT_TRET(__wt_fclose(&cb->bfp, WT_FHANDLE_WRITE));
if (ret != 0) {
WT_TRET(__backup_cleanup_handles(session, cb));
WT_TRET(__backup_stop(session));
@@ -347,7 +347,7 @@ __backup_all(WT_SESSION_IMPL *session, WT_CURSOR_BACKUP *cb)
while ((ret = cursor->next(cursor)) == 0) {
WT_ERR(cursor->get_key(cursor, &key));
WT_ERR(cursor->get_value(cursor, &value));
- WT_ERR(__wt_fprintf(session, cb->bfp, "%s\n%s\n", key, value));
+ WT_ERR(__wt_fprintf(cb->bfp, "%s\n%s\n", key, value));
/*
* While reading the metadata file, check there are no "sources"
@@ -495,7 +495,7 @@ __wt_backup_list_uri_append(
/* Add the metadata entry to the backup file. */
WT_RET(__wt_metadata_search(session, name, &value));
- WT_RET(__wt_fprintf(session, cb->bfp, "%s\n%s\n", name, value));
+ WT_RET(__wt_fprintf(cb->bfp, "%s\n%s\n", name, value));
__wt_free(session, value);
/* Add file type objects to the list of files to be copied. */
diff --git a/src/third_party/wiredtiger/src/cursor/cur_bulk.c b/src/third_party/wiredtiger/src/cursor/cur_bulk.c
index b38821f99ff..df7048d4b82 100644
--- a/src/third_party/wiredtiger/src/cursor/cur_bulk.c
+++ b/src/third_party/wiredtiger/src/cursor/cur_bulk.c
@@ -220,36 +220,6 @@ err: API_END_RET(session, ret);
}
/*
- * __curbulk_close --
- * WT_CURSOR->close for the bulk cursor type.
- */
-static int
-__curbulk_close(WT_CURSOR *cursor)
-{
- WT_BTREE *btree;
- WT_CURSOR_BULK *cbulk;
- WT_DECL_RET;
- WT_SESSION_IMPL *session;
-
- cbulk = (WT_CURSOR_BULK *)cursor;
- btree = cbulk->cbt.btree;
-
- CURSOR_API_CALL(cursor, session, close, btree);
-
- WT_TRET(__wt_bulk_wrapup(session, cbulk));
- __wt_buf_free(session, &cbulk->last);
-
- WT_TRET(__wt_session_release_btree(session));
-
- /* The URI is owned by the btree handle. */
- cursor->internal_uri = NULL;
-
- WT_TRET(__wt_cursor_close(cursor));
-
-err: API_END_RET(session, ret);
-}
-
-/*
* __wt_curbulk_init --
* Initialize a bulk cursor.
*/
@@ -278,7 +248,6 @@ __wt_curbulk_init(WT_SESSION_IMPL *session,
break;
WT_ILLEGAL_VALUE(session);
}
- c->close = __curbulk_close;
cbulk->bitmap = bitmap;
if (bitmap)
diff --git a/src/third_party/wiredtiger/src/cursor/cur_dump.c b/src/third_party/wiredtiger/src/cursor/cur_dump.c
index 00281054d22..ae608959f15 100644
--- a/src/third_party/wiredtiger/src/cursor/cur_dump.c
+++ b/src/third_party/wiredtiger/src/cursor/cur_dump.c
@@ -392,7 +392,7 @@ __wt_curdump_create(WT_CURSOR *child, WT_CURSOR *owner, WT_CURSOR **cursorp)
}
/* __wt_cursor_init is last so we don't have to clean up on error. */
- cfg[0] = WT_CONFIG_BASE(session, session_open_cursor);
+ cfg[0] = WT_CONFIG_BASE(session, WT_SESSION_open_cursor);
cfg[1] = NULL;
WT_ERR(__wt_cursor_init(cursor, NULL, owner, cfg, cursorp));
diff --git a/src/third_party/wiredtiger/src/cursor/cur_file.c b/src/third_party/wiredtiger/src/cursor/cur_file.c
index 2f24d8ed59a..44a00d4d192 100644
--- a/src/third_party/wiredtiger/src/cursor/cur_file.c
+++ b/src/third_party/wiredtiger/src/cursor/cur_file.c
@@ -356,11 +356,19 @@ static int
__curfile_close(WT_CURSOR *cursor)
{
WT_CURSOR_BTREE *cbt;
+ WT_CURSOR_BULK *cbulk;
WT_DECL_RET;
WT_SESSION_IMPL *session;
cbt = (WT_CURSOR_BTREE *)cursor;
CURSOR_API_CALL(cursor, session, close, cbt->btree);
+ if (F_ISSET(cursor, WT_CURSTD_BULK)) {
+ /* Free the bulk-specific resources. */
+ cbulk = (WT_CURSOR_BULK *)cbt;
+ WT_TRET(__wt_bulk_wrapup(session, cbulk));
+ __wt_buf_free(session, &cbulk->last);
+ }
+
WT_TRET(__wt_btcur_close(cbt));
if (cbt->btree != NULL) {
/* Increment the data-source's in-use counter. */
@@ -424,8 +432,8 @@ __wt_curfile_create(WT_SESSION_IMPL *session,
cursor->internal_uri = btree->dhandle->name;
cursor->key_format = btree->key_format;
cursor->value_format = btree->value_format;
-
cbt->btree = btree;
+
if (bulk) {
F_SET(cursor, WT_CURSTD_BULK);
@@ -449,6 +457,9 @@ __wt_curfile_create(WT_SESSION_IMPL *session,
cursor->reset = __curfile_reset;
}
+ /* Underlying btree initialization. */
+ __wt_btcur_open(cbt);
+
/* __wt_cursor_init is last so we don't have to clean up on error. */
WT_ERR(__wt_cursor_init(
cursor, cursor->internal_uri, owner, cfg, cursorp));
diff --git a/src/third_party/wiredtiger/src/cursor/cur_json.c b/src/third_party/wiredtiger/src/cursor/cur_json.c
index 67daf377f88..d793db778c6 100644
--- a/src/third_party/wiredtiger/src/cursor/cur_json.c
+++ b/src/third_party/wiredtiger/src/cursor/cur_json.c
@@ -577,9 +577,9 @@ __wt_json_token(WT_SESSION *wt_session, const char *src, int *toktype,
}
/*
- * __wt_json_tokname
+ * __wt_json_tokname --
* Return a descriptive name from the token type returned by
- * __wt_json_token
+ * __wt_json_token.
*/
const char *
__wt_json_tokname(int toktype)
diff --git a/src/third_party/wiredtiger/src/cursor/cur_log.c b/src/third_party/wiredtiger/src/cursor/cur_log.c
index 5de3762217f..b7f11576425 100644
--- a/src/third_party/wiredtiger/src/cursor/cur_log.c
+++ b/src/third_party/wiredtiger/src/cursor/cur_log.c
@@ -14,7 +14,8 @@
*/
static int
__curlog_logrec(WT_SESSION_IMPL *session,
- WT_ITEM *logrec, WT_LSN *lsnp, void *cookie, int firstrecord)
+ WT_ITEM *logrec, WT_LSN *lsnp, WT_LSN *next_lsnp,
+ void *cookie, int firstrecord)
{
WT_CURSOR_LOG *cl;
@@ -23,8 +24,7 @@ __curlog_logrec(WT_SESSION_IMPL *session,
/* Set up the LSNs and take a copy of the log record for the cursor. */
*cl->cur_lsn = *lsnp;
- *cl->next_lsn = *lsnp;
- cl->next_lsn->offset += (wt_off_t)logrec->size;
+ *cl->next_lsn = *next_lsnp;
WT_RET(__wt_buf_set(session, cl->logrec, logrec->data, logrec->size));
/*
diff --git a/src/third_party/wiredtiger/src/evict/evict_lru.c b/src/third_party/wiredtiger/src/evict/evict_lru.c
index 62326015d2c..a22531277dd 100644
--- a/src/third_party/wiredtiger/src/evict/evict_lru.c
+++ b/src/third_party/wiredtiger/src/evict/evict_lru.c
@@ -8,6 +8,7 @@
#include "wt_internal.h"
+static int __evict_clear_all_walks(WT_SESSION_IMPL *);
static int __evict_clear_walks(WT_SESSION_IMPL *);
static int __evict_has_work(WT_SESSION_IMPL *, uint32_t *);
static int WT_CDECL __evict_lru_cmp(const void *, const void *);
@@ -211,24 +212,15 @@ __evict_server(void *arg)
WT_ERR(__wt_verbose(session, WT_VERB_EVICTSERVER, "waking"));
}
+ /*
+ * The eviction server is shutting down: in case any trees are still
+ * open, clear all walks now so that they can be closed.
+ */
+ WT_ERR(__evict_clear_all_walks(session));
+
WT_ERR(__wt_verbose(
session, WT_VERB_EVICTSERVER, "cache eviction server exiting"));
- if (cache->pages_inmem != cache->pages_evict)
- __wt_errx(session,
- "cache server: exiting with %" PRIu64 " pages in "
- "memory and %" PRIu64 " pages evicted",
- cache->pages_inmem, cache->pages_evict);
- if (cache->bytes_inmem != 0)
- __wt_errx(session,
- "cache server: exiting with %" PRIu64 " bytes in memory",
- cache->bytes_inmem);
- if (cache->bytes_dirty != 0 || cache->pages_dirty != 0)
- __wt_errx(session,
- "cache server: exiting with %" PRIu64
- " bytes dirty and %" PRIu64 " pages dirty",
- cache->bytes_dirty, cache->pages_dirty);
-
if (0) {
err: WT_PANIC_MSG(session, ret, "cache eviction server error");
}
@@ -322,7 +314,7 @@ __wt_evict_create(WT_SESSION_IMPL *session)
/*
* __wt_evict_destroy --
- * Destroy the eviction server thread.
+ * Destroy the eviction threads.
*/
int
__wt_evict_destroy(WT_SESSION_IMPL *session)
@@ -571,17 +563,38 @@ __evict_pass(WT_SESSION_IMPL *session)
}
/*
+ * __evict_clear_walk --
+ * Clear a single walk point.
+ */
+static int
+__evict_clear_walk(WT_SESSION_IMPL *session)
+{
+ WT_BTREE *btree;
+ WT_REF *ref;
+
+ btree = S2BT(session);
+
+ if ((ref = btree->evict_ref) == NULL)
+ return (0);
+
+ /*
+ * Clear evict_ref first, in case releasing it forces eviction (we
+ * assert we never try to evict the current eviction walk point).
+ */
+ btree->evict_ref = NULL;
+ return (__wt_page_release(session, ref, 0));
+}
+
+/*
* __evict_clear_walks --
* Clear the eviction walk points for any file a session is waiting on.
*/
static int
__evict_clear_walks(WT_SESSION_IMPL *session)
{
- WT_BTREE *btree;
WT_CACHE *cache;
WT_CONNECTION_IMPL *conn;
WT_DECL_RET;
- WT_REF *ref;
WT_SESSION_IMPL *s;
u_int i, session_cnt;
@@ -594,30 +607,19 @@ __evict_clear_walks(WT_SESSION_IMPL *session)
continue;
if (s->dhandle == cache->evict_file_next)
cache->evict_file_next = NULL;
-
- session->dhandle = s->dhandle;
- btree = s->dhandle->handle;
- if ((ref = btree->evict_ref) != NULL) {
- /*
- * Clear evict_ref first, in case releasing it forces
- * eviction (we assert that we never try to evict the
- * current eviction walk point).
- */
- btree->evict_ref = NULL;
- WT_TRET(__wt_page_release(session, ref, 0));
- }
- session->dhandle = NULL;
+ WT_WITH_DHANDLE(
+ session, s->dhandle, WT_TRET(__evict_clear_walk(session)));
}
-
return (ret);
}
/*
- * __evict_tree_walk_clear --
- * Clear the tree's current eviction point, acquiring the eviction lock.
+ * __evict_request_walk_clear --
+ * Request that the eviction server clear the tree's current eviction
+ * point.
*/
static int
-__evict_tree_walk_clear(WT_SESSION_IMPL *session)
+__evict_request_walk_clear(WT_SESSION_IMPL *session)
{
WT_BTREE *btree;
WT_CACHE *cache;
@@ -640,6 +642,26 @@ __evict_tree_walk_clear(WT_SESSION_IMPL *session)
}
/*
+ * __evict_clear_all_walks --
+ * Clear the eviction walk points for all files a session is waiting on.
+ */
+static int
+__evict_clear_all_walks(WT_SESSION_IMPL *session)
+{
+ WT_CONNECTION_IMPL *conn;
+ WT_DATA_HANDLE *dhandle;
+ WT_DECL_RET;
+
+ conn = S2C(session);
+
+ SLIST_FOREACH(dhandle, &conn->dhlh, l)
+ if (WT_PREFIX_MATCH(dhandle->name, "file:"))
+ WT_WITH_DHANDLE(session,
+ dhandle, WT_TRET(__evict_clear_walk(session)));
+ return (ret);
+}
+
+/*
* __wt_evict_page --
* Evict a given page.
*/
@@ -711,7 +733,7 @@ __wt_evict_file_exclusive_on(WT_SESSION_IMPL *session, int *evict_resetp)
__wt_spin_unlock(session, &cache->evict_walk_lock);
/* Clear any existing LRU eviction walk for the file. */
- WT_RET(__evict_tree_walk_clear(session));
+ WT_RET(__evict_request_walk_clear(session));
/* Hold the evict lock to remove any queued pages from this file. */
__wt_spin_lock(session, &cache->evict_lock);
@@ -903,7 +925,6 @@ __evict_walk(WT_SESSION_IMPL *session, uint32_t flags)
WT_DECL_RET;
u_int max_entries, prev_slot, retries, slot, start_slot, spins;
int incr, dhandle_locked;
- WT_DECL_SPINLOCK_ID(id);
conn = S2C(session);
cache = S2C(session)->cache;
@@ -948,7 +969,7 @@ retry: while (slot < max_entries && ret == 0) {
*/
if (!dhandle_locked) {
for (spins = 0; (ret = __wt_spin_trylock(
- session, &conn->dhandle_lock, &id)) == EBUSY &&
+ session, &conn->dhandle_lock)) == EBUSY &&
!F_ISSET(cache, WT_CACHE_CLEAR_WALKS);
spins++) {
if (spins < 1000)
@@ -1288,7 +1309,6 @@ __evict_get_ref(
WT_CACHE *cache;
WT_EVICT_ENTRY *evict;
uint32_t candidates;
- WT_DECL_SPINLOCK_ID(id); /* Must appear last */
cache = S2C(session)->cache;
*btreep = NULL;
@@ -1304,7 +1324,7 @@ __evict_get_ref(
for (;;) {
if (cache->evict_current == NULL)
return (WT_NOTFOUND);
- if (__wt_spin_trylock(session, &cache->evict_lock, &id) == 0)
+ if (__wt_spin_trylock(session, &cache->evict_lock) == 0)
break;
__wt_yield();
}
@@ -1404,6 +1424,19 @@ __wt_evict_lru_page(WT_SESSION_IMPL *session, int is_server)
if (page->read_gen != WT_READGEN_OLDEST)
page->read_gen = __wt_cache_read_gen_set(session);
+ /*
+ * If we are evicting in a dead tree, don't write dirty pages.
+ *
+ * Force pages clean to keep statistics correct and to let the
+ * page-discard function assert that no dirty pages are ever
+ * discarded.
+ */
+ if (F_ISSET(btree->dhandle, WT_DHANDLE_DEAD) &&
+ __wt_page_is_modified(page)) {
+ page->modify->write_gen = 0;
+ __wt_cache_dirty_decr(session, page);
+ }
+
WT_WITH_BTREE(session, btree, ret = __wt_evict_page(session, ref));
(void)WT_ATOMIC_SUB4(btree->evict_busy, 1);
diff --git a/src/third_party/wiredtiger/src/evict/evict_page.c b/src/third_party/wiredtiger/src/evict/evict_page.c
index 37612bda7e6..e276f72fe3f 100644
--- a/src/third_party/wiredtiger/src/evict/evict_page.c
+++ b/src/third_party/wiredtiger/src/evict/evict_page.c
@@ -316,14 +316,10 @@ __evict_review(
return (EBUSY);
/*
- * Check for an append-only workload needing an in-memory split.
- *
- * We can't do this earlier because in-memory splits require exclusive
- * access, and we can't split if a checkpoint is in progress because
- * the checkpoint could be walking the parent page.
- *
- * If an in-memory split completes, the page stays in memory and the
- * tree is left in the desired state: avoid the usual cleanup.
+ * Check for an append-only workload needing an in-memory split; we
+ * can't do this earlier because in-memory splits require exclusive
+ * access. If an in-memory split completes, the page stays in memory
+ * and the tree is left in the desired state: avoid the usual cleanup.
*/
if (!exclusive) {
WT_RET(__wt_split_insert(session, ref, inmem_splitp));
diff --git a/src/third_party/wiredtiger/src/include/api.h b/src/third_party/wiredtiger/src/include/api.h
index 70068e32b9b..8f8fd8e98b1 100644
--- a/src/third_party/wiredtiger/src/include/api.h
+++ b/src/third_party/wiredtiger/src/include/api.h
@@ -24,9 +24,9 @@
{ WT_CONFIG_BASE(s, h##_##n), config, NULL }; \
API_SESSION_INIT(s, h, n, cur, dh); \
WT_ERR(WT_SESSION_CHECK_PANIC(s)); \
- WT_ERR(((config) != NULL) ? \
- __wt_config_check((s), \
- WT_CONFIG_REF(session, h##_##n), (config), 0) : 0); \
+ if ((config) != NULL) \
+ WT_ERR(__wt_config_check((s), \
+ WT_CONFIG_REF(session, h##_##n), (config), 0)); \
WT_ERR(__wt_verbose((s), WT_VERB_API, "CALL: " #h ":" #n))
#define API_END(s, ret) \
@@ -96,29 +96,29 @@
#define CONNECTION_API_CALL(conn, s, n, config, cfg) \
s = (conn)->default_session; \
- API_CALL(s, connection, n, NULL, NULL, config, cfg)
+ API_CALL(s, WT_CONNECTION, n, NULL, NULL, config, cfg)
#define CONNECTION_API_CALL_NOCONF(conn, s, n) \
s = (conn)->default_session; \
- API_CALL_NOCONF(s, connection, n, NULL, NULL)
+ API_CALL_NOCONF(s, WT_CONNECTION, n, NULL, NULL)
#define SESSION_API_CALL(s, n, config, cfg) \
- API_CALL(s, session, n, NULL, NULL, config, cfg)
+ API_CALL(s, WT_SESSION, n, NULL, NULL, config, cfg)
#define SESSION_API_CALL_NOCONF(s, n) \
- API_CALL_NOCONF(s, session, n, NULL, NULL)
+ API_CALL_NOCONF(s, WT_SESSION, n, NULL, NULL)
#define SESSION_TXN_API_CALL(s, n, config, cfg) \
- TXN_API_CALL(s, session, n, NULL, NULL, config, cfg)
+ TXN_API_CALL(s, WT_SESSION, n, NULL, NULL, config, cfg)
#define CURSOR_API_CALL(cur, s, n, bt) \
(s) = (WT_SESSION_IMPL *)(cur)->session; \
- API_CALL_NOCONF(s, cursor, n, cur, \
+ API_CALL_NOCONF(s, WT_CURSOR, n, cur, \
((bt) == NULL) ? NULL : ((WT_BTREE *)(bt))->dhandle)
#define CURSOR_UPDATE_API_CALL(cur, s, n, bt) \
(s) = (WT_SESSION_IMPL *)(cur)->session; \
- TXN_API_CALL_NOCONF(s, cursor, n, cur, \
+ TXN_API_CALL_NOCONF(s, WT_CURSOR, n, cur, \
((bt) == NULL) ? NULL : ((WT_BTREE *)(bt))->dhandle)
#define CURSOR_UPDATE_API_END(s, ret) \
diff --git a/src/third_party/wiredtiger/src/include/btmem.h b/src/third_party/wiredtiger/src/include/btmem.h
index cda672bc7b4..e9b6b5a1d6e 100644
--- a/src/third_party/wiredtiger/src/include/btmem.h
+++ b/src/third_party/wiredtiger/src/include/btmem.h
@@ -412,8 +412,17 @@ struct __wt_page {
/*
* Macros to copy/set the index because the name is obscured to ensure
* the field isn't read multiple times.
+ *
+ * There are two versions of WT_INTL_INDEX_GET because the session split
+ * generation is usually set, but it's not always required: for example,
+ * if a page is locked for splitting, or being created or destroyed.
*/
-#define WT_INTL_INDEX_COPY(page) ((page)->u.intl.__index)
+#define WT_INTL_INDEX_GET_SAFE(page) \
+ ((page)->u.intl.__index)
+#define WT_INTL_INDEX_GET(session, page, pindex) do { \
+ WT_ASSERT(session, session->split_gen != 0); \
+ (pindex) = WT_INTL_INDEX_GET_SAFE(page); \
+} while (0)
#define WT_INTL_INDEX_SET(page, v) do { \
WT_WRITE_BARRIER(); \
((page)->u.intl.__index) = (v); \
@@ -421,21 +430,15 @@ struct __wt_page {
/*
* Macro to walk the list of references in an internal page.
- * Two flavors: by default, check that we have a split_gen, but
- * provide a "SAFE" version for code that can safely read the
- * page index without a split_gen.
*/
-#define WT_INTL_FOREACH_BEGIN_SAFE(session, page, ref) do { \
+#define WT_INTL_FOREACH_BEGIN(session, page, ref) do { \
WT_PAGE_INDEX *__pindex; \
WT_REF **__refp; \
uint32_t __entries; \
- for (__pindex = WT_INTL_INDEX_COPY(page), \
- __refp = __pindex->index, \
+ WT_INTL_INDEX_GET(session, page, __pindex); \
+ for (__refp = __pindex->index, \
__entries = __pindex->entries; __entries > 0; --__entries) {\
(ref) = *__refp++;
-#define WT_INTL_FOREACH_BEGIN(session, page, ref) \
- WT_ASSERT(session, session->split_gen != 0); \
- WT_INTL_FOREACH_BEGIN_SAFE(session, page, ref)
#define WT_INTL_FOREACH_END \
} \
} while (0)
diff --git a/src/third_party/wiredtiger/src/include/btree.h b/src/third_party/wiredtiger/src/include/btree.h
index cc571124207..44ec40364cc 100644
--- a/src/third_party/wiredtiger/src/include/btree.h
+++ b/src/third_party/wiredtiger/src/include/btree.h
@@ -144,8 +144,8 @@ struct __wt_btree {
/* Flags values up to 0xff are reserved for WT_DHANDLE_* */
#define WT_BTREE_BULK 0x00100 /* Bulk-load handle */
-#define WT_BTREE_NO_EVICTION 0x00200 /* Disable eviction */
-#define WT_BTREE_NO_HAZARD 0x00400 /* Disable hazard pointers */
+#define WT_BTREE_IN_MEMORY 0x00200 /* Cache-resident object */
+#define WT_BTREE_NO_EVICTION 0x00400 /* Disable eviction */
#define WT_BTREE_SALVAGE 0x00800 /* Handle is for salvage */
#define WT_BTREE_UPGRADE 0x01000 /* Handle is for upgrade */
#define WT_BTREE_VERIFY 0x02000 /* Handle is for verify */
diff --git a/src/third_party/wiredtiger/src/include/btree.i b/src/third_party/wiredtiger/src/include/btree.i
index 7d9a3095a0c..9038dab2b34 100644
--- a/src/third_party/wiredtiger/src/include/btree.i
+++ b/src/third_party/wiredtiger/src/include/btree.i
@@ -279,13 +279,11 @@ __wt_page_refp(WT_SESSION_IMPL *session,
WT_PAGE_INDEX *pindex;
uint32_t i;
- WT_ASSERT(session, session->split_gen != 0);
-
/*
* Copy the parent page's index value: the page can split at any time,
* but the index's value is always valid, even if it's not up-to-date.
*/
-retry: pindex = WT_INTL_INDEX_COPY(ref->home);
+retry: WT_INTL_INDEX_GET(session, ref->home, pindex);
/*
* Use the page's reference hint: it should be correct unless the page
@@ -967,10 +965,6 @@ __wt_page_can_evict(WT_SESSION_IMPL *session, WT_PAGE *page, int check_splits)
if (mod == NULL)
return (1);
- /* Skip pages that are already being evicted. */
- if (F_ISSET_ATOMIC(page, WT_PAGE_EVICT_LRU))
- return (0);
-
/*
* If the tree was deepened, there's a requirement that newly created
* internal pages not be evicted until all threads are known to have
@@ -1098,7 +1092,13 @@ __wt_page_release(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t flags)
*/
if (ref == NULL || __wt_ref_is_root(ref))
return (0);
- page = ref->page;
+
+ /*
+ * If hazard pointers aren't necessary for this file, we can't be
+ * evicting, we're done.
+ */
+ if (F_ISSET(btree, WT_BTREE_IN_MEMORY))
+ return (0);
/*
* Attempt to evict pages with the special "oldest" read generation.
@@ -1112,9 +1112,10 @@ __wt_page_release(WT_SESSION_IMPL *session, WT_REF *ref, uint32_t flags)
* it contains an update that isn't stable. Also skip forced eviction
* if we just did an in-memory split.
*/
- if (page->read_gen != WT_READGEN_OLDEST ||
+ page = ref->page;
+ if (F_ISSET(btree, WT_BTREE_NO_EVICTION) ||
LF_ISSET(WT_READ_NO_EVICT) ||
- F_ISSET(btree, WT_BTREE_NO_EVICTION) ||
+ page->read_gen != WT_READGEN_OLDEST ||
!__wt_page_can_evict(session, page, 1))
return (__wt_hazard_clear(session, page));
@@ -1229,13 +1230,13 @@ __wt_skip_choose_depth(WT_SESSION_IMPL *session)
}
/*
- * __wt_btree_size_overflow --
- * Check if the size of an in-memory tree with a single leaf page is over
+ * __wt_btree_lsm_size --
+ * Return if the size of an in-memory tree with a single leaf page is over
* a specified maximum. If called on anything other than a simple tree with a
- * single leaf page, returns true so the calling code will switch to a new tree.
+ * single leaf page, returns true so our LSM caller will switch to a new tree.
*/
static inline int
-__wt_btree_size_overflow(WT_SESSION_IMPL *session, uint64_t maxsize)
+__wt_btree_lsm_size(WT_SESSION_IMPL *session, uint64_t maxsize)
{
WT_BTREE *btree;
WT_PAGE *child, *root;
@@ -1254,7 +1255,7 @@ __wt_btree_size_overflow(WT_SESSION_IMPL *session, uint64_t maxsize)
return (1);
/* Check for a tree with a single leaf page. */
- pindex = WT_INTL_INDEX_COPY(root);
+ WT_INTL_INDEX_GET(session, root, pindex);
if (pindex->entries != 1) /* > 1 child page, switch */
return (1);
@@ -1273,104 +1274,3 @@ __wt_btree_size_overflow(WT_SESSION_IMPL *session, uint64_t maxsize)
return (child->memory_footprint > maxsize);
}
-
-/*
- * __wt_lex_compare --
- * Lexicographic comparison routine.
- *
- * Returns:
- * < 0 if user_item is lexicographically < tree_item
- * = 0 if user_item is lexicographically = tree_item
- * > 0 if user_item is lexicographically > tree_item
- *
- * We use the names "user" and "tree" so it's clear in the btree code which
- * the application is looking at when we call its comparison func.
- */
-static inline int
-__wt_lex_compare(const WT_ITEM *user_item, const WT_ITEM *tree_item)
-{
- const uint8_t *userp, *treep;
- size_t len, usz, tsz;
-
- usz = user_item->size;
- tsz = tree_item->size;
- len = WT_MIN(usz, tsz);
-
- for (userp = user_item->data, treep = tree_item->data;
- len > 0;
- --len, ++userp, ++treep)
- if (*userp != *treep)
- return (*userp < *treep ? -1 : 1);
-
- /* Contents are equal up to the smallest length. */
- return ((usz == tsz) ? 0 : (usz < tsz) ? -1 : 1);
-}
-
-/*
- * __wt_compare --
- * The same as __wt_lex_compare, but using the application's collator
- * function when configured.
- */
-static inline int
-__wt_compare(WT_SESSION_IMPL *session, WT_COLLATOR *collator,
- const WT_ITEM *user_item, const WT_ITEM *tree_item, int *cmpp)
-{
- if (collator == NULL) {
- *cmpp = __wt_lex_compare(user_item, tree_item);
- return (0);
- }
- return (collator->compare(
- collator, &session->iface, user_item, tree_item, cmpp));
-}
-
-/*
- * __wt_lex_compare_skip --
- * Lexicographic comparison routine, skipping leading bytes.
- *
- * Returns:
- * < 0 if user_item is lexicographically < tree_item
- * = 0 if user_item is lexicographically = tree_item
- * > 0 if user_item is lexicographically > tree_item
- *
- * We use the names "user" and "tree" so it's clear in the btree code which
- * the application is looking at when we call its comparison func.
- */
-static inline int
-__wt_lex_compare_skip(
- const WT_ITEM *user_item, const WT_ITEM *tree_item, size_t *matchp)
-{
- const uint8_t *userp, *treep;
- size_t len, usz, tsz;
-
- usz = user_item->size;
- tsz = tree_item->size;
- len = WT_MIN(usz, tsz) - *matchp;
-
- for (userp = (uint8_t *)user_item->data + *matchp,
- treep = (uint8_t *)tree_item->data + *matchp;
- len > 0;
- --len, ++userp, ++treep, ++*matchp)
- if (*userp != *treep)
- return (*userp < *treep ? -1 : 1);
-
- /* Contents are equal up to the smallest length. */
- return ((usz == tsz) ? 0 : (usz < tsz) ? -1 : 1);
-}
-
-/*
- * __wt_compare_skip --
- * The same as __wt_lex_compare_skip, but using the application's collator
- * function when configured.
- */
-static inline int
-__wt_compare_skip(WT_SESSION_IMPL *session, WT_COLLATOR *collator,
- const WT_ITEM *user_item, const WT_ITEM *tree_item, int *cmpp,
- size_t *matchp)
-{
- if (collator == NULL) {
- *cmpp = __wt_lex_compare_skip(user_item, tree_item, matchp);
- return (0);
- }
- return (collator->compare(
- collator, &session->iface, user_item, tree_item, cmpp));
-}
diff --git a/src/third_party/wiredtiger/src/include/btree_cmp.i b/src/third_party/wiredtiger/src/include/btree_cmp.i
new file mode 100644
index 00000000000..76f1ad4317a
--- /dev/null
+++ b/src/third_party/wiredtiger/src/include/btree_cmp.i
@@ -0,0 +1,190 @@
+/*-
+ * Copyright (c) 2014-2015 MongoDB, Inc.
+ * Copyright (c) 2008-2014 WiredTiger, Inc.
+ * All rights reserved.
+ *
+ * See the file LICENSE for redistribution information.
+ */
+
+#ifdef HAVE_X86INTRIN_H
+#if !defined(_MSC_VER)
+#include <x86intrin.h>
+#endif
+ /* 16B alignment */
+#define WT_ALIGNED_16(p) (((uintptr_t)(p) & 0x0f) == 0)
+#define WT_VECTOR_SIZE 16 /* chunk size */
+#endif
+
+/*
+ * __wt_lex_compare --
+ * Lexicographic comparison routine.
+ *
+ * Returns:
+ * < 0 if user_item is lexicographically < tree_item
+ * = 0 if user_item is lexicographically = tree_item
+ * > 0 if user_item is lexicographically > tree_item
+ *
+ * We use the names "user" and "tree" so it's clear in the btree code which
+ * the application is looking at when we call its comparison function.
+ */
+static inline int
+__wt_lex_compare(const WT_ITEM *user_item, const WT_ITEM *tree_item)
+{
+ size_t len, usz, tsz;
+ const uint8_t *userp, *treep;
+
+ usz = user_item->size;
+ tsz = tree_item->size;
+ len = WT_MIN(usz, tsz);
+
+ userp = user_item->data;
+ treep = tree_item->data;
+
+#ifdef HAVE_X86INTRIN_H
+ /* Use vector instructions if we'll execute at least 2 of them. */
+ if (len >= WT_VECTOR_SIZE * 2) {
+ size_t remain;
+ __m128i res_eq, u, t;
+
+ remain = len % WT_VECTOR_SIZE;
+ len -= remain;
+ if (WT_ALIGNED_16(userp) && WT_ALIGNED_16(treep))
+ for (; len > 0;
+ len -= WT_VECTOR_SIZE,
+ userp += WT_VECTOR_SIZE, treep += WT_VECTOR_SIZE) {
+ u = _mm_load_si128((__m128i *)userp);
+ t = _mm_load_si128((__m128i *)treep);
+ res_eq = _mm_cmpeq_epi8(u, t);
+ if (_mm_movemask_epi8(res_eq) != 65535)
+ break;
+ }
+ else
+ for (; len > 0;
+ len -= WT_VECTOR_SIZE,
+ userp += WT_VECTOR_SIZE, treep += WT_VECTOR_SIZE) {
+ u = _mm_loadu_si128((__m128i *)userp);
+ t = _mm_loadu_si128((__m128i *)treep);
+ res_eq = _mm_cmpeq_epi8(u, t);
+ if (_mm_movemask_epi8(res_eq) != 65535)
+ break;
+ }
+ len += remain;
+ }
+#endif
+ /*
+ * Use the non-vectorized version for the remaining bytes and for the
+ * small key sizes.
+ */
+ for (; len > 0; --len, ++userp, ++treep)
+ if (*userp != *treep)
+ return (*userp < *treep ? -1 : 1);
+
+ /* Contents are equal up to the smallest length. */
+ return ((usz == tsz) ? 0 : (usz < tsz) ? -1 : 1);
+}
+
+/*
+ * __wt_compare --
+ * The same as __wt_lex_compare, but using the application's collator
+ * function when configured.
+ */
+static inline int
+__wt_compare(WT_SESSION_IMPL *session, WT_COLLATOR *collator,
+ const WT_ITEM *user_item, const WT_ITEM *tree_item, int *cmpp)
+{
+ if (collator == NULL) {
+ *cmpp = __wt_lex_compare(user_item, tree_item);
+ return (0);
+ }
+ return (collator->compare(
+ collator, &session->iface, user_item, tree_item, cmpp));
+}
+
+/*
+ * __wt_lex_compare_skip --
+ * Lexicographic comparison routine, skipping leading bytes.
+ *
+ * Returns:
+ * < 0 if user_item is lexicographically < tree_item
+ * = 0 if user_item is lexicographically = tree_item
+ * > 0 if user_item is lexicographically > tree_item
+ *
+ * We use the names "user" and "tree" so it's clear in the btree code which
+ * the application is looking at when we call its comparison function.
+ */
+static inline int
+__wt_lex_compare_skip(
+ const WT_ITEM *user_item, const WT_ITEM *tree_item, size_t *matchp)
+{
+ size_t len, usz, tsz;
+ const uint8_t *userp, *treep;
+
+ usz = user_item->size;
+ tsz = tree_item->size;
+ len = WT_MIN(usz, tsz) - *matchp;
+
+ userp = (uint8_t *)user_item->data + *matchp;
+ treep = (uint8_t *)tree_item->data + *matchp;
+
+#ifdef HAVE_X86INTRIN_H
+ /* Use vector instructions if we'll execute at least 2 of them. */
+ if (len >= WT_VECTOR_SIZE * 2) {
+ size_t remain;
+ __m128i res_eq, u, t;
+
+ remain = len % WT_VECTOR_SIZE;
+ len -= remain;
+ if (WT_ALIGNED_16(userp) && WT_ALIGNED_16(treep))
+ for (; len > 0;
+ len -= WT_VECTOR_SIZE,
+ userp += WT_VECTOR_SIZE, treep += WT_VECTOR_SIZE,
+ *matchp += WT_VECTOR_SIZE) {
+ u = _mm_load_si128((__m128i *)userp);
+ t = _mm_load_si128((__m128i *)treep);
+ res_eq = _mm_cmpeq_epi8(u, t);
+ if (_mm_movemask_epi8(res_eq) != 65535)
+ break;
+ }
+ else
+ for (; len > 0;
+ len -= WT_VECTOR_SIZE,
+ userp += WT_VECTOR_SIZE, treep += WT_VECTOR_SIZE,
+ *matchp += WT_VECTOR_SIZE) {
+ u = _mm_loadu_si128((__m128i *)userp);
+ t = _mm_loadu_si128((__m128i *)treep);
+ res_eq = _mm_cmpeq_epi8(u, t);
+ if (_mm_movemask_epi8(res_eq) != 65535)
+ break;
+ }
+ len += remain;
+ }
+#endif
+ /*
+ * Use the non-vectorized version for the remaining bytes and for the
+ * small key sizes.
+ */
+ for (; len > 0; --len, ++userp, ++treep, ++*matchp)
+ if (*userp != *treep)
+ return (*userp < *treep ? -1 : 1);
+
+ /* Contents are equal up to the smallest length. */
+ return ((usz == tsz) ? 0 : (usz < tsz) ? -1 : 1);
+}
+
+/*
+ * __wt_compare_skip --
+ * The same as __wt_lex_compare_skip, but using the application's collator
+ * function when configured.
+ */
+static inline int
+__wt_compare_skip(WT_SESSION_IMPL *session, WT_COLLATOR *collator,
+ const WT_ITEM *user_item, const WT_ITEM *tree_item, int *cmpp,
+ size_t *matchp)
+{
+ if (collator == NULL) {
+ *cmpp = __wt_lex_compare_skip(user_item, tree_item, matchp);
+ return (0);
+ }
+ return (collator->compare(
+ collator, &session->iface, user_item, tree_item, cmpp));
+}
diff --git a/src/third_party/wiredtiger/src/include/cell.i b/src/third_party/wiredtiger/src/include/cell.i
index 77e9fa1e3c1..80e0396d4a9 100644
--- a/src/third_party/wiredtiger/src/include/cell.i
+++ b/src/third_party/wiredtiger/src/include/cell.i
@@ -549,14 +549,15 @@ __wt_cell_leaf_value_parse(WT_PAGE *page, WT_CELL *cell)
static inline int
__wt_cell_unpack_safe(WT_CELL *cell, WT_CELL_UNPACK *unpack, uint8_t *end)
{
- uint64_t saved_v, v;
- uint32_t saved_len;
- int copied;
+ struct {
+ uint32_t len;
+ uint64_t v;
+ } copy;
+ uint64_t v;
const uint8_t *p;
- copied = 0;
- saved_len = 0;
- saved_v = 0;
+ copy.len = 0;
+ copy.v = 0; /* -Werror=maybe-uninitialized */
/*
* The verification code specifies an end argument, a pointer to 1 past
@@ -572,14 +573,18 @@ __wt_cell_unpack_safe(WT_CELL *cell, WT_CELL_UNPACK *unpack, uint8_t *end)
restart:
/*
- * This code is performance critical for scans through read-only trees.
- * Avoid WT_CLEAR here: it makes this code run significantly slower.
+ * This path is performance critical for read-only trees, we're parsing
+ * on-page structures. For that reason we don't clear the unpacked cell
+ * structure (although that would be simpler), instead we make sure we
+ * initialize all structure elements either here or in the immediately
+ * following switch.
*/
- WT_CLEAR_INLINE(WT_CELL_UNPACK, *unpack);
WT_CELL_LEN_CHK(cell, 0);
unpack->cell = cell;
- unpack->type = __wt_cell_type(cell);
+ unpack->v = 0;
unpack->raw = __wt_cell_type_raw(cell);
+ unpack->type = __wt_cell_type(cell);
+ unpack->ovfl = 0;
/*
* Handle cells with neither an RLE count or data length: short key/data
@@ -589,19 +594,24 @@ restart:
case WT_CELL_KEY_SHORT_PFX:
WT_CELL_LEN_CHK(cell, 1); /* skip prefix */
unpack->prefix = cell->__chunk[1];
-
unpack->data = cell->__chunk + 2;
unpack->size = cell->__chunk[0] >> WT_CELL_SHORT_SHIFT;
unpack->__len = 2 + unpack->size;
goto done;
case WT_CELL_KEY_SHORT:
case WT_CELL_VALUE_SHORT:
+ unpack->prefix = 0;
unpack->data = cell->__chunk + 1;
unpack->size = cell->__chunk[0] >> WT_CELL_SHORT_SHIFT;
unpack->__len = 1 + unpack->size;
goto done;
}
+ unpack->prefix = 0;
+ unpack->data = NULL;
+ unpack->size = 0;
+ unpack->__len = 0;
+
p = (uint8_t *)cell + 1; /* skip cell */
/*
@@ -638,10 +648,9 @@ restart:
*/
WT_RET(__wt_vunpack_uint(
&p, end == NULL ? 0 : (size_t)(end - p), &v));
- saved_len = WT_PTRDIFF32(p, cell);
- saved_v = unpack->v;
+ copy.len = WT_PTRDIFF32(p, cell);
+ copy.v = unpack->v;
cell = (WT_CELL *)((uint8_t *)cell - v);
- copied = 1;
goto restart;
case WT_CELL_KEY_OVFL:
@@ -691,10 +700,10 @@ restart:
* we need the right length).
*/
done: WT_CELL_LEN_CHK(cell, unpack->__len);
- if (copied) {
+ if (copy.len != 0) {
unpack->raw = WT_CELL_VALUE_COPY;
- unpack->__len = saved_len;
- unpack->v = saved_v;
+ unpack->__len = copy.len;
+ unpack->v = copy.v;
}
return (0);
diff --git a/src/third_party/wiredtiger/src/include/column.i b/src/third_party/wiredtiger/src/include/column.i
index bf12a48a3e4..fc1f372b2a9 100644
--- a/src/third_party/wiredtiger/src/include/column.i
+++ b/src/third_party/wiredtiger/src/include/column.i
@@ -7,8 +7,92 @@
*/
/*
+ * __col_insert_search_gt --
+ * Search a column-store insert list for the next larger record.
+ */
+static inline WT_INSERT *
+__col_insert_search_gt(WT_INSERT_HEAD *inshead, uint64_t recno)
+{
+ WT_INSERT *ins, **insp;
+ int i;
+
+ /* If there's no insert chain to search, we're done. */
+ if ((ins = WT_SKIP_LAST(inshead)) == NULL)
+ return (NULL);
+
+ /* Fast path check for targets past the end of the skiplist. */
+ if (recno >= WT_INSERT_RECNO(ins))
+ return (NULL);
+
+ /*
+ * The insert list is a skip list: start at the highest skip level, then
+ * go as far as possible at each level before stepping down to the next.
+ */
+ ins = NULL;
+ for (i = WT_SKIP_MAXDEPTH - 1, insp = &inshead->head[i]; i >= 0;)
+ if (*insp != NULL && recno >= WT_INSERT_RECNO(*insp)) {
+ ins = *insp; /* GTE: keep going at this level */
+ insp = &(*insp)->next[i];
+ } else {
+ --i; /* LT: drop down a level */
+ --insp;
+ }
+
+ /*
+ * If we didn't find any records smaller than the target, we never set
+ * the return value, set it to the first record in the list. Otherwise,
+ * it references a record less-than-or-equal to the target, move to a
+ * later record, that is, a subsequent record greater than the target.
+ * Because inserts happen concurrently, additional records might be
+ * inserted after the searched-for record that are still smaller than
+ * the target, continue to move forward until reaching a record larger
+ * than the target. There isn't any safety testing because we confirmed
+ * such a record exists before searching.
+ */
+ if (ins == NULL)
+ ins = WT_SKIP_FIRST(inshead);
+ while (recno >= WT_INSERT_RECNO(ins))
+ ins = WT_SKIP_NEXT(ins);
+ return (ins);
+}
+
+/*
+ * __col_insert_search_lt --
+ * Search a column-store insert list for the next smaller record.
+ */
+static inline WT_INSERT *
+__col_insert_search_lt(WT_INSERT_HEAD *inshead, uint64_t recno)
+{
+ WT_INSERT *ins, **insp;
+ int i;
+
+ /* If there's no insert chain to search, we're done. */
+ if ((ins = WT_SKIP_FIRST(inshead)) == NULL)
+ return (NULL);
+
+ /* Fast path check for targets before the skiplist. */
+ if (recno <= WT_INSERT_RECNO(ins))
+ return (NULL);
+
+ /*
+ * The insert list is a skip list: start at the highest skip level, then
+ * go as far as possible at each level before stepping down to the next.
+ */
+ for (i = WT_SKIP_MAXDEPTH - 1, insp = &inshead->head[i]; i >= 0;)
+ if (*insp != NULL && recno > WT_INSERT_RECNO(*insp)) {
+ ins = *insp; /* GT: keep going at this level */
+ insp = &(*insp)->next[i];
+ } else {
+ --i; /* LTE: drop down a level */
+ --insp;
+ }
+
+ return (ins);
+}
+
+/*
* __col_insert_search_match --
- * Search an column-store insert list for an exact match.
+ * Search a column-store insert list for an exact match.
*/
static inline WT_INSERT *
__col_insert_search_match(WT_INSERT_HEAD *inshead, uint64_t recno)
@@ -154,7 +238,7 @@ __col_fix_last_recno(WT_PAGE *page)
* Search a variable-length column-store page for a record.
*/
static inline WT_COL *
-__col_var_search(WT_PAGE *page, uint64_t recno)
+__col_var_search(WT_PAGE *page, uint64_t recno, uint64_t *start_recnop)
{
WT_COL_RLE *repeat;
uint64_t start_recno;
@@ -174,8 +258,11 @@ __col_var_search(WT_PAGE *page, uint64_t recno)
repeat = page->pg_var_repeats + indx;
if (recno >= repeat->recno &&
- recno < repeat->recno + repeat->rle)
+ recno < repeat->recno + repeat->rle) {
+ if (start_recnop != NULL)
+ *start_recnop = repeat->recno;
return (page->pg_var_d + repeat->indx);
+ }
if (recno < repeat->recno)
continue;
base = indx + 1;
diff --git a/src/third_party/wiredtiger/src/include/config.h b/src/third_party/wiredtiger/src/include/config.h
index 1f30667b8d6..baf81b823a6 100644
--- a/src/third_party/wiredtiger/src/include/config.h
+++ b/src/third_party/wiredtiger/src/include/config.h
@@ -22,6 +22,7 @@ struct __wt_config_check {
int (*checkf)(WT_SESSION_IMPL *, WT_CONFIG_ITEM *);
const char *checks;
const WT_CONFIG_CHECK *subconfigs;
+ u_int subconfigs_entries;
};
#define WT_CONFIG_REF(session, n) \
@@ -33,6 +34,7 @@ struct __wt_config_entry {
const char *base; /* configuration base */
const WT_CONFIG_CHECK *checks; /* check array */
+ u_int checks_entries;
};
struct __wt_config_parser_impl {
@@ -47,37 +49,37 @@ struct __wt_config_parser_impl {
* DO NOT EDIT: automatically built by dist/api_config.py.
* configuration section: BEGIN
*/
-#define WT_CONFIG_ENTRY_colgroup_meta 0
-#define WT_CONFIG_ENTRY_connection_add_collator 1
-#define WT_CONFIG_ENTRY_connection_add_compressor 2
-#define WT_CONFIG_ENTRY_connection_add_data_source 3
-#define WT_CONFIG_ENTRY_connection_add_extractor 4
-#define WT_CONFIG_ENTRY_connection_async_new_op 5
-#define WT_CONFIG_ENTRY_connection_close 6
-#define WT_CONFIG_ENTRY_connection_load_extension 7
-#define WT_CONFIG_ENTRY_connection_open_session 8
-#define WT_CONFIG_ENTRY_connection_reconfigure 9
-#define WT_CONFIG_ENTRY_cursor_close 10
-#define WT_CONFIG_ENTRY_cursor_reconfigure 11
-#define WT_CONFIG_ENTRY_file_meta 12
-#define WT_CONFIG_ENTRY_index_meta 13
-#define WT_CONFIG_ENTRY_session_begin_transaction 14
-#define WT_CONFIG_ENTRY_session_checkpoint 15
-#define WT_CONFIG_ENTRY_session_close 16
-#define WT_CONFIG_ENTRY_session_commit_transaction 17
-#define WT_CONFIG_ENTRY_session_compact 18
-#define WT_CONFIG_ENTRY_session_create 19
-#define WT_CONFIG_ENTRY_session_drop 20
-#define WT_CONFIG_ENTRY_session_log_printf 21
-#define WT_CONFIG_ENTRY_session_open_cursor 22
-#define WT_CONFIG_ENTRY_session_reconfigure 23
-#define WT_CONFIG_ENTRY_session_rename 24
-#define WT_CONFIG_ENTRY_session_rollback_transaction 25
-#define WT_CONFIG_ENTRY_session_salvage 26
-#define WT_CONFIG_ENTRY_session_strerror 27
-#define WT_CONFIG_ENTRY_session_truncate 28
-#define WT_CONFIG_ENTRY_session_upgrade 29
-#define WT_CONFIG_ENTRY_session_verify 30
+#define WT_CONFIG_ENTRY_WT_CONNECTION_add_collator 0
+#define WT_CONFIG_ENTRY_WT_CONNECTION_add_compressor 1
+#define WT_CONFIG_ENTRY_WT_CONNECTION_add_data_source 2
+#define WT_CONFIG_ENTRY_WT_CONNECTION_add_extractor 3
+#define WT_CONFIG_ENTRY_WT_CONNECTION_async_new_op 4
+#define WT_CONFIG_ENTRY_WT_CONNECTION_close 5
+#define WT_CONFIG_ENTRY_WT_CONNECTION_load_extension 6
+#define WT_CONFIG_ENTRY_WT_CONNECTION_open_session 7
+#define WT_CONFIG_ENTRY_WT_CONNECTION_reconfigure 8
+#define WT_CONFIG_ENTRY_WT_CURSOR_close 9
+#define WT_CONFIG_ENTRY_WT_CURSOR_reconfigure 10
+#define WT_CONFIG_ENTRY_WT_SESSION_begin_transaction 11
+#define WT_CONFIG_ENTRY_WT_SESSION_checkpoint 12
+#define WT_CONFIG_ENTRY_WT_SESSION_close 13
+#define WT_CONFIG_ENTRY_WT_SESSION_commit_transaction 14
+#define WT_CONFIG_ENTRY_WT_SESSION_compact 15
+#define WT_CONFIG_ENTRY_WT_SESSION_create 16
+#define WT_CONFIG_ENTRY_WT_SESSION_drop 17
+#define WT_CONFIG_ENTRY_WT_SESSION_log_printf 18
+#define WT_CONFIG_ENTRY_WT_SESSION_open_cursor 19
+#define WT_CONFIG_ENTRY_WT_SESSION_reconfigure 20
+#define WT_CONFIG_ENTRY_WT_SESSION_rename 21
+#define WT_CONFIG_ENTRY_WT_SESSION_rollback_transaction 22
+#define WT_CONFIG_ENTRY_WT_SESSION_salvage 23
+#define WT_CONFIG_ENTRY_WT_SESSION_strerror 24
+#define WT_CONFIG_ENTRY_WT_SESSION_truncate 25
+#define WT_CONFIG_ENTRY_WT_SESSION_upgrade 26
+#define WT_CONFIG_ENTRY_WT_SESSION_verify 27
+#define WT_CONFIG_ENTRY_colgroup_meta 28
+#define WT_CONFIG_ENTRY_file_meta 29
+#define WT_CONFIG_ENTRY_index_meta 30
#define WT_CONFIG_ENTRY_table_meta 31
#define WT_CONFIG_ENTRY_wiredtiger_open 32
#define WT_CONFIG_ENTRY_wiredtiger_open_all 33
diff --git a/src/third_party/wiredtiger/src/include/connection.h b/src/third_party/wiredtiger/src/include/connection.h
index 533b9ea8bbe..0121a1625c5 100644
--- a/src/third_party/wiredtiger/src/include/connection.h
+++ b/src/third_party/wiredtiger/src/include/connection.h
@@ -202,6 +202,7 @@ struct __wt_connection_impl {
u_int open_btree_count; /* Locked: open writable btree count */
uint32_t next_file_id; /* Locked: file ID counter */
+ uint32_t open_file_count; /* Atomic: open file handle count */
/*
* WiredTiger allocates space for 50 simultaneous sessions (threads of
@@ -255,29 +256,6 @@ struct __wt_connection_impl {
WT_CONNECTION_STATS stats; /* Connection statistics */
-#if SPINLOCK_TYPE == SPINLOCK_PTHREAD_MUTEX_LOGGING
- /*
- * Spinlock registration, so we can track which spinlocks are heavily
- * used, which are blocking and where.
- *
- * There's an array of spinlocks, and an array of blocking IDs.
- */
-#define WT_SPINLOCK_MAX 1024
-#define WT_SPINLOCK_MAX_LOCATION_ID 60
- WT_SPINLOCK *spinlock_list[WT_SPINLOCK_MAX];
-
- /* Spinlock blocking matrix */
- struct __wt_connection_stats_spinlock {
- const char *name; /* Mutex name */
-
- const char *file; /* Caller's file/line, ID location */
- int line;
-
- u_int total; /* Count of total, blocked calls */
- u_int blocked[WT_SPINLOCK_MAX_LOCATION_ID];
- } spinlock_block[WT_SPINLOCK_MAX_LOCATION_ID];
-#endif
-
WT_ASYNC *async; /* Async structure */
int async_cfg; /* Global async configuration */
uint32_t async_size; /* Async op array size */
@@ -337,6 +315,7 @@ struct __wt_connection_impl {
WT_CONDVAR *sweep_cond; /* Handle sweep wait mutex */
time_t sweep_idle_time;/* Handle sweep idle time */
time_t sweep_interval;/* Handle sweep interval */
+ u_int sweep_handles_min;/* Handle sweep minimum open */
/* Locked: collator list */
TAILQ_HEAD(__wt_coll_qh, __wt_named_collator) collqh;
diff --git a/src/third_party/wiredtiger/src/include/cursor.h b/src/third_party/wiredtiger/src/include/cursor.h
index d23deee8c98..4dba18ff558 100644
--- a/src/third_party/wiredtiger/src/include/cursor.h
+++ b/src/third_party/wiredtiger/src/include/cursor.h
@@ -112,12 +112,16 @@ struct __wt_cursor_btree {
int compare;
/*
- * The key value from a binary search of a row-store files; we keep a
- * copy of the last key we retrieved in the search, it avoids having
- * doing the additional work of getting the key again for return to
- * the application.
+ * A key returned from a binary search or cursor movement on a row-store
+ * page; if we find an exact match on a row-store leaf page in a search
+ * operation, keep a copy of key we built during the search to avoid
+ * doing the additional work of getting the key again for return to the
+ * application. Note, this only applies to exact matches when searching
+ * disk-image structures, so it's not, for example, a key from an insert
+ * list. Additionally, this structure is used to build keys when moving
+ * a cursor through a row-store leaf page.
*/
- WT_ITEM search_key;
+ WT_ITEM *row_key, _row_key;
/*
* It's relatively expensive to calculate the last record on a variable-
@@ -163,9 +167,15 @@ struct __wt_cursor_btree {
WT_ROW *rip_saved; /* Last-returned key reference */
/*
- * A temporary buffer for caching RLE values for column-store files.
+ * A temporary buffer for caching RLE values for column-store files (if
+ * RLE is non-zero, then we don't unpack the value every time we move
+ * to the next cursor position, we re-use the unpacked value we stored
+ * here the first time we hit the value).
+ *
+ * A temporary buffer for building on-page keys when searching row-store
+ * files.
*/
- WT_ITEM tmp;
+ WT_ITEM *tmp, _tmp;
/*
* The update structure allocated by the row- and column-store modify
diff --git a/src/third_party/wiredtiger/src/include/cursor.i b/src/third_party/wiredtiger/src/include/cursor.i
index dd38a5746c1..57c19f50417 100644
--- a/src/third_party/wiredtiger/src/include/cursor.i
+++ b/src/third_party/wiredtiger/src/include/cursor.i
@@ -264,7 +264,7 @@ __cursor_row_slot_return(WT_CURSOR_BTREE *cbt, WT_ROW *rip, WT_UPDATE *upd)
__wt_cell_unpack(cell, unpack);
if (unpack->type == WT_CELL_KEY &&
cbt->rip_saved != NULL && cbt->rip_saved == rip - 1) {
- WT_ASSERT(session, cbt->tmp.size >= unpack->prefix);
+ WT_ASSERT(session, cbt->row_key->size >= unpack->prefix);
/*
* Grow the buffer as necessary as well as ensure data has been
@@ -274,22 +274,22 @@ __cursor_row_slot_return(WT_CURSOR_BTREE *cbt, WT_ROW *rip, WT_UPDATE *upd)
* Don't grow the buffer unnecessarily or copy data we don't
* need, truncate the item's data length to the prefix bytes.
*/
- cbt->tmp.size = unpack->prefix;
+ cbt->row_key->size = unpack->prefix;
WT_RET(__wt_buf_grow(
- session, &cbt->tmp, cbt->tmp.size + unpack->size));
- memcpy((uint8_t *)cbt->tmp.data + cbt->tmp.size,
+ session, cbt->row_key, cbt->row_key->size + unpack->size));
+ memcpy((uint8_t *)cbt->row_key->data + cbt->row_key->size,
unpack->data, unpack->size);
- cbt->tmp.size += unpack->size;
+ cbt->row_key->size += unpack->size;
} else {
/*
* Call __wt_row_leaf_key_work instead of __wt_row_leaf_key: we
* already did __wt_row_leaf_key's fast-path checks inline.
*/
-slow: WT_RET(
- __wt_row_leaf_key_work(session, page, rip, &cbt->tmp, 0));
+slow: WT_RET(__wt_row_leaf_key_work(
+ session, page, rip, cbt->row_key, 0));
}
- kb->data = cbt->tmp.data;
- kb->size = cbt->tmp.size;
+ kb->data = cbt->row_key->data;
+ kb->size = cbt->row_key->size;
cbt->rip_saved = rip;
value:
diff --git a/src/third_party/wiredtiger/src/include/dhandle.h b/src/third_party/wiredtiger/src/include/dhandle.h
index 300e8e735b9..034db30a0a2 100644
--- a/src/third_party/wiredtiger/src/include/dhandle.h
+++ b/src/third_party/wiredtiger/src/include/dhandle.h
@@ -65,11 +65,12 @@ struct __wt_data_handle {
WT_DSRC_STATS stats; /* Data-source statistics */
/* Flags values over 0xff are reserved for WT_BTREE_* */
-#define WT_DHANDLE_DISCARD 0x01 /* Discard on release */
-#define WT_DHANDLE_DISCARD_CLOSE 0x02 /* Close on release */
-#define WT_DHANDLE_EXCLUSIVE 0x04 /* Need exclusive access */
-#define WT_DHANDLE_HAVE_REF 0x08 /* Already have ref */
-#define WT_DHANDLE_LOCK_ONLY 0x10 /* Handle only used as a lock */
-#define WT_DHANDLE_OPEN 0x20 /* Handle is open */
+#define WT_DHANDLE_DEAD 0x01 /* Dead, awaiting discard */
+#define WT_DHANDLE_DISCARD 0x02 /* Discard on release */
+#define WT_DHANDLE_DISCARD_FORCE 0x04 /* Force discard on release */
+#define WT_DHANDLE_EXCLUSIVE 0x08 /* Need exclusive access */
+#define WT_DHANDLE_HAVE_REF 0x10 /* Already have ref */
+#define WT_DHANDLE_LOCK_ONLY 0x20 /* Handle only used as a lock */
+#define WT_DHANDLE_OPEN 0x40 /* Handle is open */
uint32_t flags;
};
diff --git a/src/third_party/wiredtiger/src/include/extern.h b/src/third_party/wiredtiger/src/include/extern.h
index 86c8f501eb2..48bf792bcf5 100644
--- a/src/third_party/wiredtiger/src/include/extern.h
+++ b/src/third_party/wiredtiger/src/include/extern.h
@@ -71,6 +71,7 @@ extern int __wt_verify_ckpt_load( WT_SESSION_IMPL *session, WT_BLOCK *block, WT_
extern int __wt_verify_ckpt_unload(WT_SESSION_IMPL *session, WT_BLOCK *block);
extern int __wt_block_verify_addr(WT_SESSION_IMPL *session, WT_BLOCK *block, const uint8_t *addr, size_t addr_size);
extern u_int __wt_block_header(WT_BLOCK *block);
+extern int __wt_block_truncate(WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t len);
extern int __wt_block_write_size(WT_SESSION_IMPL *session, WT_BLOCK *block, size_t *sizep);
extern int __wt_block_write(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_ITEM *buf, uint8_t *addr, size_t *addr_sizep, int data_cksum);
extern int __wt_block_write_off(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_ITEM *buf, wt_off_t *offsetp, uint32_t *sizep, uint32_t *cksump, int data_cksum, int caller_locked);
@@ -99,6 +100,7 @@ extern int __wt_btcur_next_random(WT_CURSOR_BTREE *cbt);
extern int __wt_btcur_compare(WT_CURSOR_BTREE *a_arg, WT_CURSOR_BTREE *b_arg, int *cmpp);
extern int __wt_btcur_equals( WT_CURSOR_BTREE *a_arg, WT_CURSOR_BTREE *b_arg, int *equalp);
extern int __wt_btcur_range_truncate(WT_CURSOR_BTREE *start, WT_CURSOR_BTREE *stop);
+extern void __wt_btcur_open(WT_CURSOR_BTREE *cbt);
extern int __wt_btcur_close(WT_CURSOR_BTREE *cbt);
extern int __wt_debug_set_verbose(WT_SESSION_IMPL *session, const char *v);
extern int __wt_debug_addr_print( WT_SESSION_IMPL *session, const uint8_t *addr, size_t addr_size);
@@ -181,7 +183,7 @@ extern int __wt_config_initn( WT_SESSION_IMPL *session, WT_CONFIG *conf, const c
extern int __wt_config_init(WT_SESSION_IMPL *session, WT_CONFIG *conf, const char *str);
extern int __wt_config_subinit( WT_SESSION_IMPL *session, WT_CONFIG *conf, WT_CONFIG_ITEM *item);
extern int __wt_config_next(WT_CONFIG *conf, WT_CONFIG_ITEM *key, WT_CONFIG_ITEM *value);
-extern int __wt_config_get(WT_SESSION_IMPL *session, const char **cfg, WT_CONFIG_ITEM *key, WT_CONFIG_ITEM *value);
+extern int __wt_config_get(WT_SESSION_IMPL *session, const char **cfg_arg, WT_CONFIG_ITEM *key, WT_CONFIG_ITEM *value);
extern int __wt_config_gets(WT_SESSION_IMPL *session, const char **cfg, const char *key, WT_CONFIG_ITEM *value);
extern int __wt_config_gets_none(WT_SESSION_IMPL *session, const char **cfg, const char *key, WT_CONFIG_ITEM *value);
extern int __wt_config_getone(WT_SESSION_IMPL *session, const char *config, WT_CONFIG_ITEM *key, WT_CONFIG_ITEM *value);
@@ -194,10 +196,10 @@ extern void __wt_conn_foc_discard(WT_SESSION_IMPL *session);
extern int __wt_configure_method(WT_SESSION_IMPL *session, const char *method, const char *uri, const char *config, const char *type, const char *check);
extern int __wt_config_check(WT_SESSION_IMPL *session, const WT_CONFIG_ENTRY *entry, const char *config, size_t config_len);
extern int __wt_config_collapse( WT_SESSION_IMPL *session, const char **cfg, char **config_ret);
-extern int __wt_config_merge( WT_SESSION_IMPL *session, const char **cfg, const char **config_ret);
-extern int __wt_config_concat( WT_SESSION_IMPL *session, const char **cfg, char **config_ret);
+extern int __wt_config_merge(WT_SESSION_IMPL *session, const char **cfg, const char *cfg_strip, const char **config_ret);
extern int __wt_conn_config_init(WT_SESSION_IMPL *session);
extern void __wt_conn_config_discard(WT_SESSION_IMPL *session);
+extern const WT_CONFIG_ENTRY *__wt_conn_config_match(const char *method);
extern int __wt_ext_config_parser_open(WT_EXTENSION_API *wt_ext, WT_SESSION *wt_session, const char *config, size_t len, WT_CONFIG_PARSER **config_parserp);
extern int __wt_ext_config_get(WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, WT_CONFIG_ARG *cfg_arg, const char *key, WT_CONFIG_ITEM *cval);
extern int __wt_config_upgrade(WT_SESSION_IMPL *session, WT_ITEM *buf);
@@ -231,7 +233,7 @@ extern int __wt_conn_btree_apply(WT_SESSION_IMPL *session, int apply_checkpoints
extern int __wt_conn_btree_apply_single_ckpt(WT_SESSION_IMPL *session, const char *uri, int (*func)(WT_SESSION_IMPL *, const char *[]), const char *cfg[]);
extern int __wt_conn_btree_apply_single(WT_SESSION_IMPL *session, const char *uri, const char *checkpoint, int (*func)(WT_SESSION_IMPL *, const char *[]), const char *cfg[]);
extern int __wt_conn_dhandle_close_all( WT_SESSION_IMPL *session, const char *name, int force);
-extern int __wt_conn_dhandle_discard_single(WT_SESSION_IMPL *session, int final);
+extern int __wt_conn_dhandle_discard_single(WT_SESSION_IMPL *session, int final, int force);
extern int __wt_conn_dhandle_discard(WT_SESSION_IMPL *session);
extern int __wt_connection_init(WT_CONNECTION_IMPL *conn);
extern int __wt_connection_destroy(WT_CONNECTION_IMPL *conn);
@@ -326,7 +328,7 @@ extern int __wt_log_open(WT_SESSION_IMPL *session);
extern int __wt_log_close(WT_SESSION_IMPL *session);
extern int __wt_log_newfile(WT_SESSION_IMPL *session, int conn_create, int *created);
extern int __wt_log_read(WT_SESSION_IMPL *session, WT_ITEM *record, WT_LSN *lsnp, uint32_t flags);
-extern int __wt_log_scan(WT_SESSION_IMPL *session, WT_LSN *lsnp, uint32_t flags, int (*func)(WT_SESSION_IMPL *session, WT_ITEM *record, WT_LSN *lsnp, void *cookie, int firstrecord), void *cookie);
+extern int __wt_log_scan(WT_SESSION_IMPL *session, WT_LSN *lsnp, uint32_t flags, int (*func)(WT_SESSION_IMPL *session, WT_ITEM *record, WT_LSN *lsnp, WT_LSN *next_lsnp, void *cookie, int firstrecord), void *cookie);
extern int __wt_log_write(WT_SESSION_IMPL *session, WT_ITEM *record, WT_LSN *lsnp, uint32_t flags);
extern int __wt_log_vprintf(WT_SESSION_IMPL *session, const char *fmt, va_list ap);
extern int __wt_logrec_alloc(WT_SESSION_IMPL *session, size_t size, WT_ITEM **logrecp);
@@ -425,6 +427,7 @@ extern int __wt_metadata_remove(WT_SESSION_IMPL *session, const char *key);
extern int __wt_metadata_search( WT_SESSION_IMPL *session, const char *key, char **valuep);
extern void __wt_meta_track_discard(WT_SESSION_IMPL *session);
extern int __wt_meta_track_on(WT_SESSION_IMPL *session);
+extern int __wt_meta_track_find_handle( WT_SESSION_IMPL *session, const char *name, const char *checkpoint);
extern int __wt_meta_track_off(WT_SESSION_IMPL *session, int need_sync, int unroll);
extern int __wt_meta_track_sub_on(WT_SESSION_IMPL *session);
extern int __wt_meta_track_sub_off(WT_SESSION_IMPL *session);
@@ -491,10 +494,10 @@ extern int __wt_read( WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t offset, size
extern int __wt_write(WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t offset, size_t len, const void *buf);
extern void __wt_sleep(uint64_t seconds, uint64_t micro_seconds);
extern int __wt_fopen(WT_SESSION_IMPL *session, const char *name, WT_FHANDLE_MODE mode_flag, u_int flags, FILE **fpp);
-extern int __wt_vfprintf(WT_SESSION_IMPL *session, FILE *fp, const char *fmt, va_list ap);
-extern int __wt_fprintf(WT_SESSION_IMPL *session, FILE *fp, const char *fmt, ...) WT_GCC_FUNC_DECL_ATTRIBUTE((format (printf, 3, 4)));
-extern int __wt_fflush(WT_SESSION_IMPL *session, FILE *fp);
-extern int __wt_fclose(WT_SESSION_IMPL *session, FILE **fpp, WT_FHANDLE_MODE mode_flag);
+extern int __wt_vfprintf(FILE *fp, const char *fmt, va_list ap);
+extern int __wt_fprintf(FILE *fp, const char *fmt, ...) WT_GCC_FUNC_DECL_ATTRIBUTE((format (printf, 2, 3)));
+extern int __wt_fflush(FILE *fp);
+extern int __wt_fclose(FILE **fpp, WT_FHANDLE_MODE mode_flag);
extern uint64_t __wt_strtouq(const char *nptr, char **endptr, int base);
extern int __wt_thread_create(WT_SESSION_IMPL *session, wt_thread_t *tidret, WT_THREAD_CALLBACK(*func)(void *), void *arg);
extern int __wt_thread_join(WT_SESSION_IMPL *session, wt_thread_t tid);
@@ -574,7 +577,7 @@ extern int __wt_open_internal_session(WT_CONNECTION_IMPL *conn, const char *name
extern int __wt_open_session(WT_CONNECTION_IMPL *conn, WT_EVENT_HANDLER *event_handler, const char *config, WT_SESSION_IMPL **sessionp);
extern int __wt_compact_uri_analyze(WT_SESSION_IMPL *session, const char *uri, int *skip);
extern int __wt_session_compact( WT_SESSION *wt_session, const char *uri, const char *config);
-extern int __wt_session_lock_dhandle(WT_SESSION_IMPL *session, uint32_t flags);
+extern int __wt_session_lock_dhandle(WT_SESSION_IMPL *session, uint32_t flags, int *deadp);
extern int __wt_session_release_btree(WT_SESSION_IMPL *session);
extern int __wt_session_get_btree_ckpt(WT_SESSION_IMPL *session, const char *uri, const char *cfg[], uint32_t flags);
extern void __wt_session_close_cache(WT_SESSION_IMPL *session);
@@ -626,10 +629,6 @@ extern void __wt_huffman_close(WT_SESSION_IMPL *session, void *huffman_arg);
extern int __wt_print_huffman_code(void *huffman_arg, uint16_t symbol);
extern int __wt_huffman_encode(WT_SESSION_IMPL *session, void *huffman_arg, const uint8_t *from_arg, size_t from_len, WT_ITEM *to_buf);
extern int __wt_huffman_decode(WT_SESSION_IMPL *session, void *huffman_arg, const uint8_t *from_arg, size_t from_len, WT_ITEM *to_buf);
-extern int __wt_spin_lock_register_lock(WT_SESSION_IMPL *session, WT_SPINLOCK *t);
-extern void __wt_spin_lock_unregister_lock(WT_SESSION_IMPL *session, WT_SPINLOCK *t);
-extern int __wt_spin_lock_register_caller(WT_SESSION_IMPL *session, const char *name, const char *file, int line, int *idp);
-extern int __wt_statlog_dump_spinlock(WT_CONNECTION_IMPL *conn, const char *tag);
extern uint32_t __wt_nlpo2_round(uint32_t v);
extern uint32_t __wt_nlpo2(uint32_t v);
extern uint32_t __wt_log2_int(uint32_t n);
@@ -658,7 +657,7 @@ extern int WT_CDECL __wt_txnid_cmp(const void *v1, const void *v2);
extern void __wt_txn_release_snapshot(WT_SESSION_IMPL *session);
extern void __wt_txn_update_oldest(WT_SESSION_IMPL *session);
extern void __wt_txn_refresh(WT_SESSION_IMPL *session, int get_snapshot);
-extern int __wt_txn_begin(WT_SESSION_IMPL *session, const char *cfg[]);
+extern int __wt_txn_config(WT_SESSION_IMPL *session, const char *cfg[]);
extern void __wt_txn_release(WT_SESSION_IMPL *session);
extern int __wt_txn_commit(WT_SESSION_IMPL *session, const char *cfg[]);
extern int __wt_txn_rollback(WT_SESSION_IMPL *session, const char *cfg[]);
@@ -672,7 +671,7 @@ extern int __wt_checkpoint_list(WT_SESSION_IMPL *session, const char *cfg[]);
extern int __wt_txn_checkpoint(WT_SESSION_IMPL *session, const char *cfg[]);
extern int __wt_checkpoint(WT_SESSION_IMPL *session, const char *cfg[]);
extern int __wt_checkpoint_sync(WT_SESSION_IMPL *session, const char *cfg[]);
-extern int __wt_checkpoint_close(WT_SESSION_IMPL *session, int final, int force);
+extern int __wt_checkpoint_close(WT_SESSION_IMPL *session, int final);
extern uint64_t __wt_ext_transaction_id(WT_EXTENSION_API *wt_api, WT_SESSION *wt_session);
extern int __wt_ext_transaction_isolation_level( WT_EXTENSION_API *wt_api, WT_SESSION *wt_session);
extern int __wt_ext_transaction_notify( WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, WT_TXN_NOTIFY *notify);
diff --git a/src/third_party/wiredtiger/src/include/log.h b/src/third_party/wiredtiger/src/include/log.h
index 760321d9abb..ebe3a00b19f 100644
--- a/src/third_party/wiredtiger/src/include/log.h
+++ b/src/third_party/wiredtiger/src/include/log.h
@@ -128,7 +128,8 @@ typedef struct {
WT_LSN sync_dir_lsn; /* LSN of the last directory sync */
WT_LSN sync_lsn; /* LSN of the last sync */
WT_LSN trunc_lsn; /* End LSN for recovery truncation */
- WT_LSN write_lsn; /* Last LSN written to log file */
+ WT_LSN write_lsn; /* End of last LSN written */
+ WT_LSN write_start_lsn;/* Beginning of last LSN written */
/*
* Synchronization resources
diff --git a/src/third_party/wiredtiger/src/include/misc.h b/src/third_party/wiredtiger/src/include/misc.h
index 12cf2dec375..8f4a730ae90 100644
--- a/src/third_party/wiredtiger/src/include/misc.h
+++ b/src/third_party/wiredtiger/src/include/misc.h
@@ -126,6 +126,33 @@
#define FLD_ISSET(field, mask) ((field) & ((uint32_t)(mask)))
#define FLD_SET(field, mask) ((field) |= ((uint32_t)(mask)))
+/*
+ * Insertion sort, for sorting small sets of values.
+ *
+ * The "compare_lt" argument is a function or macro that returns true when
+ * its first argument is less than its second argument.
+ */
+#define WT_INSERTION_SORT(arrayp, n, value_type, compare_lt) do { \
+ value_type __v; \
+ int __i, __j, __n = (int)(n); \
+ if (__n == 2) { \
+ __v = (arrayp)[1]; \
+ if (compare_lt(__v, (arrayp)[0])) { \
+ (arrayp)[1] = (arrayp)[0]; \
+ (arrayp)[0] = __v; \
+ } \
+ } \
+ if (__n > 2) { \
+ for (__i = 1; __i < __n; ++__i) { \
+ __v = (arrayp)[__i]; \
+ for (__j = __i - 1; __j >= 0 && \
+ compare_lt(__v, (arrayp)[__j]); --__j) \
+ (arrayp)[__j + 1] = (arrayp)[__j]; \
+ (arrayp)[__j + 1] = __v; \
+ } \
+ } \
+} while (0)
+
/* Verbose messages. */
#ifdef HAVE_VERBOSE
#define WT_VERBOSE_ISSET(session, f) \
@@ -134,17 +161,6 @@
#define WT_VERBOSE_ISSET(session, f) 0
#endif
-/*
- * Clear a structure, two flavors: inline when we want to guarantee there's
- * no function call or setup/tear-down of a loop, and the default where the
- * compiler presumably chooses. Gcc 4.3 is supposed to get this right, but
- * we've seen problems when calling memset to clear structures in performance
- * critical paths.
- */
-#define WT_CLEAR_INLINE(type, s) do { \
- static const type __clear; \
- s = __clear; \
-} while (0)
#define WT_CLEAR(s) \
memset(&(s), 0, sizeof(s))
diff --git a/src/third_party/wiredtiger/src/include/mutex.h b/src/third_party/wiredtiger/src/include/mutex.h
index 07aa740c525..fd7fd16dea7 100644
--- a/src/third_party/wiredtiger/src/include/mutex.h
+++ b/src/third_party/wiredtiger/src/include/mutex.h
@@ -61,10 +61,9 @@ struct __wt_rwlock {
* instructions).
*/
#define SPINLOCK_GCC 0
-#define SPINLOCK_PTHREAD_MUTEX 1
-#define SPINLOCK_PTHREAD_MUTEX_ADAPTIVE 2
-#define SPINLOCK_PTHREAD_MUTEX_LOGGING 3
-#define SPINLOCK_MSVC 4
+#define SPINLOCK_MSVC 1
+#define SPINLOCK_PTHREAD_MUTEX 2
+#define SPINLOCK_PTHREAD_MUTEX_ADAPTIVE 3
#if SPINLOCK_TYPE == SPINLOCK_GCC
@@ -73,16 +72,12 @@ typedef volatile int WT_COMPILER_TYPE_ALIGN(WT_CACHE_LINE_ALIGNMENT)
#elif SPINLOCK_TYPE == SPINLOCK_PTHREAD_MUTEX ||\
SPINLOCK_TYPE == SPINLOCK_PTHREAD_MUTEX_ADAPTIVE ||\
- SPINLOCK_TYPE == SPINLOCK_MSVC ||\
- SPINLOCK_TYPE == SPINLOCK_PTHREAD_MUTEX_LOGGING
+ SPINLOCK_TYPE == SPINLOCK_MSVC
typedef WT_COMPILER_TYPE_ALIGN(WT_CACHE_LINE_ALIGNMENT) struct {
wt_mutex_t lock;
- uint64_t counter; /* Statistics: counter */
-
const char *name; /* Statistics: mutex name */
- int8_t id; /* Statistics: current holder ID */
int8_t initialized; /* Lock initialized, for cleanup */
} WT_SPINLOCK;
diff --git a/src/third_party/wiredtiger/src/include/mutex.i b/src/third_party/wiredtiger/src/include/mutex.i
index e4b497af2a7..8bca50635e6 100644
--- a/src/third_party/wiredtiger/src/include/mutex.i
+++ b/src/third_party/wiredtiger/src/include/mutex.i
@@ -16,10 +16,6 @@
#if SPINLOCK_TYPE == SPINLOCK_GCC
-#define WT_DECL_SPINLOCK_ID(i)
-#define __wt_spin_trylock(session, lock, idp) \
- __wt_spin_trylock_func(session, lock)
-
/* Default to spinning 1000 times before yielding. */
#ifndef WT_SPIN_COUNT
#define WT_SPIN_COUNT 1000
@@ -52,11 +48,11 @@ __wt_spin_destroy(WT_SESSION_IMPL *session, WT_SPINLOCK *t)
}
/*
- * __wt_spin_trylock_func --
+ * __wt_spin_trylock --
* Try to lock a spinlock or fail immediately if it is busy.
*/
static inline int
-__wt_spin_trylock_func(WT_SESSION_IMPL *session, WT_SPINLOCK *t)
+__wt_spin_trylock(WT_SESSION_IMPL *session, WT_SPINLOCK *t)
{
WT_UNUSED(session);
@@ -95,8 +91,7 @@ __wt_spin_unlock(WT_SESSION_IMPL *session, WT_SPINLOCK *t)
}
#elif SPINLOCK_TYPE == SPINLOCK_PTHREAD_MUTEX ||\
- SPINLOCK_TYPE == SPINLOCK_PTHREAD_MUTEX_ADAPTIVE ||\
- SPINLOCK_TYPE == SPINLOCK_PTHREAD_MUTEX_LOGGING
+ SPINLOCK_TYPE == SPINLOCK_PTHREAD_MUTEX_ADAPTIVE
/*
* __wt_spin_init --
@@ -118,10 +113,6 @@ __wt_spin_init(WT_SESSION_IMPL *session, WT_SPINLOCK *t, const char *name)
t->name = name;
t->initialized = 1;
-#if SPINLOCK_TYPE == SPINLOCK_PTHREAD_MUTEX_LOGGING
- WT_RET(__wt_spin_lock_register_lock(session, t));
-#endif
-
WT_UNUSED(session);
return (0);
}
@@ -135,9 +126,6 @@ __wt_spin_destroy(WT_SESSION_IMPL *session, WT_SPINLOCK *t)
{
WT_UNUSED(session);
-#if SPINLOCK_TYPE == SPINLOCK_PTHREAD_MUTEX_LOGGING
- __wt_spin_lock_unregister_lock(session, t);
-#endif
if (t->initialized) {
(void)pthread_mutex_destroy(&t->lock);
t->initialized = 0;
@@ -147,16 +135,12 @@ __wt_spin_destroy(WT_SESSION_IMPL *session, WT_SPINLOCK *t)
#if SPINLOCK_TYPE == SPINLOCK_PTHREAD_MUTEX ||\
SPINLOCK_TYPE == SPINLOCK_PTHREAD_MUTEX_ADAPTIVE
-#define WT_DECL_SPINLOCK_ID(i)
-#define __wt_spin_trylock(session, lock, idp) \
- __wt_spin_trylock_func(session, lock)
-
/*
- * __wt_spin_trylock_func --
+ * __wt_spin_trylock --
* Try to lock a spinlock or fail immediately if it is busy.
*/
static inline int
-__wt_spin_trylock_func(WT_SESSION_IMPL *session, WT_SPINLOCK *t)
+__wt_spin_trylock(WT_SESSION_IMPL *session, WT_SPINLOCK *t)
{
WT_UNUSED(session);
@@ -176,106 +160,6 @@ __wt_spin_lock(WT_SESSION_IMPL *session, WT_SPINLOCK *t)
}
#endif
-#if SPINLOCK_TYPE == SPINLOCK_PTHREAD_MUTEX_LOGGING
-
-/*
- * When logging statistics, we track which spinlocks block and why.
- */
-#define WT_DECL_SPINLOCK_ID(i) \
- static int i = WT_SPINLOCK_REGISTER
-#define WT_SPINLOCK_REGISTER -1
-#define WT_SPINLOCK_REGISTER_FAILED -2
-#define __wt_spin_trylock(session, lock, idp) \
- __wt_spin_trylock_func(session, lock, idp, __FILE__, __LINE__)
-#define __wt_spin_lock(session, lock) do { \
- WT_DECL_SPINLOCK_ID(__id); \
- __wt_spin_lock_func(session, lock, &__id, __FILE__, __LINE__); \
-} while (0)
-
-/*
- * __wt_spin_trylock_func --
- * Try to lock a spinlock or fail immediately if it is busy.
- */
-static inline int
-__wt_spin_trylock_func(WT_SESSION_IMPL *session,
- WT_SPINLOCK *t, int *idp, const char *file, int line)
-{
- WT_CONNECTION_IMPL *conn;
- WT_DECL_RET;
-
- conn = S2C_SAFE(session);
- /* If we're not maintaining statistics, it's simple. */
- if (session == NULL || !FLD_ISSET(conn->stat_flags, WT_STAT_CONN_FAST))
- return (pthread_mutex_trylock(&t->lock));
-
- /*
- * If this caller hasn't yet registered, do so. The caller's location
- * ID is a static offset into a per-connection structure, and that has
- * problems: first, if there are multiple connections, we'll need to
- * hold some kind of lock to avoid racing when setting that value, and
- * second, if/when there are multiple connections and/or a single
- * connection is closed and re-opened, the variable may be initialized
- * and the underlying connection information may not. Check both.
- */
- if (*idp == WT_SPINLOCK_REGISTER ||
- conn->spinlock_block[*idp].name == NULL)
- WT_RET(__wt_spin_lock_register_caller(
- session, t->name, file, line, idp));
-
- /*
- * Try to acquire the mutex: on failure, update blocking statistics, on
- * success, set our ID as the mutex holder.
- *
- * Note the race between acquiring the lock and setting our ID as the
- * holder, this can appear in the output as mutexes blocking in ways
- * that can't actually happen (although still an indicator of a mutex
- * that's busier than we'd like).
- */
- if ((ret = pthread_mutex_trylock(&t->lock)) == 0)
- t->id = *idp;
- else
- if (*idp >= 0) {
- ++conn->spinlock_block[*idp].total;
- if (t->id >= 0)
- ++conn->spinlock_block[*idp].blocked[t->id];
- }
-
- /* Update the mutex counter and flush to minimize the windows. */
- ++t->counter;
- WT_FULL_BARRIER();
- return (ret);
-}
-
-/*
- * __wt_spin_lock_func --
- * Spin until the lock is acquired.
- */
-static inline void
-__wt_spin_lock_func(WT_SESSION_IMPL *session,
- WT_SPINLOCK *t, int *idp, const char *file, int line)
-{
- /* If we're not maintaining statistics, it's simple. */
- if (session == NULL ||
- !FLD_ISSET(conn->stat_flags, WT_STAT_CONN_FAST)) {
- pthread_mutex_lock(&t->lock);
- return;
- }
-
- /* Try to acquire the mutex. */
- if (__wt_spin_trylock_func(session, t, idp, file, line) == 0)
- return;
-
- /*
- * On failure, wait on the mutex; once acquired, set our ID as the
- * holder and flush to minimize the windows.
- */
- pthread_mutex_lock(&t->lock);
- t->id = *idp;
- WT_FULL_BARRIER();
-}
-
-#endif
-
/*
* __wt_spin_unlock --
* Release the spinlock.
@@ -290,13 +174,9 @@ __wt_spin_unlock(WT_SESSION_IMPL *session, WT_SPINLOCK *t)
#elif SPINLOCK_TYPE == SPINLOCK_MSVC
-#define WT_DECL_SPINLOCK_ID(i)
#define WT_SPINLOCK_REGISTER -1
#define WT_SPINLOCK_REGISTER_FAILED -2
-#define __wt_spin_trylock(session, lock, idp) \
- __wt_spin_trylock_func(session, lock)
-
/*
* __wt_spin_init --
* Initialize a spinlock.
@@ -305,7 +185,9 @@ static inline int
__wt_spin_init(WT_SESSION_IMPL *session, WT_SPINLOCK *t, const char *name)
{
WT_UNUSED(session);
- WT_UNUSED(name);
+
+ t->name = name;
+ t->initialized = 1;
InitializeCriticalSectionAndSpinCount(&t->lock, 4000);
@@ -321,15 +203,18 @@ __wt_spin_destroy(WT_SESSION_IMPL *session, WT_SPINLOCK *t)
{
WT_UNUSED(session);
- DeleteCriticalSection(&t->lock);
+ if (t->initialized) {
+ DeleteCriticalSection(&t->lock);
+ t->initialized = 0;
+ }
}
/*
- * __wt_spin_trylock_func --
+ * __wt_spin_trylock --
* Try to lock a spinlock or fail immediately if it is busy.
*/
static inline int
-__wt_spin_trylock_func(WT_SESSION_IMPL *session, WT_SPINLOCK *t)
+__wt_spin_trylock(WT_SESSION_IMPL *session, WT_SPINLOCK *t)
{
WT_UNUSED(session);
diff --git a/src/third_party/wiredtiger/src/include/schema.h b/src/third_party/wiredtiger/src/include/schema.h
index 25c1baae60f..5d524534b39 100644
--- a/src/third_party/wiredtiger/src/include/schema.h
+++ b/src/third_party/wiredtiger/src/include/schema.h
@@ -125,12 +125,18 @@ struct __wt_table {
WT_CONNECTION_IMPL *__conn = S2C(session); \
int __handle_locked = \
F_ISSET(session, WT_SESSION_HANDLE_LIST_LOCKED);\
+ int __table_locked = \
+ F_ISSET(session, WT_SESSION_TABLE_LOCKED); \
int __schema_locked = \
F_ISSET(session, WT_SESSION_SCHEMA_LOCKED); \
if (__handle_locked) { \
F_CLR(session, WT_SESSION_HANDLE_LIST_LOCKED); \
__wt_spin_unlock(session, &__conn->dhandle_lock);\
} \
+ if (__table_locked) { \
+ F_CLR(session, WT_SESSION_TABLE_LOCKED); \
+ __wt_spin_unlock(session, &__conn->table_lock);\
+ } \
if (__schema_locked) { \
F_CLR(session, WT_SESSION_SCHEMA_LOCKED); \
__wt_spin_unlock(session, &__conn->schema_lock);\
@@ -140,6 +146,10 @@ struct __wt_table {
__wt_spin_lock(session, &__conn->schema_lock); \
F_SET(session, WT_SESSION_SCHEMA_LOCKED); \
} \
+ if (__table_locked) { \
+ __wt_spin_lock(session, &__conn->table_lock); \
+ F_SET(session, WT_SESSION_TABLE_LOCKED); \
+ } \
if (__handle_locked) { \
__wt_spin_lock(session, &__conn->dhandle_lock); \
F_SET(session, WT_SESSION_HANDLE_LIST_LOCKED); \
diff --git a/src/third_party/wiredtiger/src/include/session.h b/src/third_party/wiredtiger/src/include/session.h
index 2c88727c662..daa47d6e776 100644
--- a/src/third_party/wiredtiger/src/include/session.h
+++ b/src/third_party/wiredtiger/src/include/session.h
@@ -32,7 +32,6 @@ struct __wt_hazard {
/* Get the connection implementation for a session */
#define S2C(session) ((WT_CONNECTION_IMPL *)(session)->iface.connection)
-#define S2C_SAFE(session) ((session) == NULL ? NULL : S2C(session))
/* Get the btree for a session */
#define S2BT(session) ((WT_BTREE *)(session)->dhandle->handle)
diff --git a/src/third_party/wiredtiger/src/include/stat.h b/src/third_party/wiredtiger/src/include/stat.h
index e04e645b3ea..cbe8167907a 100644
--- a/src/third_party/wiredtiger/src/include/stat.h
+++ b/src/third_party/wiredtiger/src/include/stat.h
@@ -23,7 +23,7 @@ struct __wt_stats {
#define WT_STAT_ATOMIC_INCRV(stats, fld, value) do { \
(void)WT_ATOMIC_ADD8(WT_STAT(stats, fld), (value)); \
} while (0)
-#define WT_STAT_ATOMIC_INCR(stats, fld) WT_ATOMIC_ADD(WT_STAT(stats, fld), 1)
+#define WT_STAT_ATOMIC_INCR(stats, fld) WT_STAT_ATOMIC_INCRV(stats, fld, 1)
#define WT_STAT_DECRV(stats, fld, value) do { \
(stats)->fld.v -= (value); \
} while (0)
diff --git a/src/third_party/wiredtiger/src/include/txn.i b/src/third_party/wiredtiger/src/include/txn.i
index 3a3bdde2b73..4141d829f1d 100644
--- a/src/third_party/wiredtiger/src/include/txn.i
+++ b/src/third_party/wiredtiger/src/include/txn.i
@@ -204,9 +204,35 @@ __wt_txn_read(WT_SESSION_IMPL *session, WT_UPDATE *upd)
}
/*
+ * __wt_txn_begin --
+ * Begin a transaction.
+ */
+static inline int
+__wt_txn_begin(WT_SESSION_IMPL *session, const char *cfg[])
+{
+ WT_TXN *txn;
+
+ txn = &session->txn;
+ txn->isolation = session->isolation;
+ txn->txn_logsync = S2C(session)->txn_logsync;
+
+ if (cfg != NULL)
+ WT_RET(__wt_txn_config(session, cfg));
+
+ if (txn->isolation == TXN_ISO_SNAPSHOT) {
+ if (session->ncursors > 0)
+ WT_RET(__wt_session_copy_values(session));
+ __wt_txn_refresh(session, 1);
+ }
+
+ F_SET(txn, TXN_RUNNING);
+ return (0);
+}
+
+/*
* __wt_txn_autocommit_check --
* If an auto-commit transaction is required, start one.
-*/
+ */
static inline int
__wt_txn_autocommit_check(WT_SESSION_IMPL *session)
{
diff --git a/src/third_party/wiredtiger/src/include/wiredtiger.in b/src/third_party/wiredtiger/src/include/wiredtiger.in
index bfd2641785f..05e92d313f2 100644
--- a/src/third_party/wiredtiger/src/include/wiredtiger.in
+++ b/src/third_party/wiredtiger/src/include/wiredtiger.in
@@ -522,7 +522,7 @@ struct __wt_cursor {
* @snippet ex_all.c Reconfigure a cursor
*
* @param cursor the cursor handle
- * @configstart{cursor.reconfigure, see dist/api_data.py}
+ * @configstart{WT_CURSOR.reconfigure, see dist/api_data.py}
* @config{append, append the value as a new record\, creating a new
* record number key; valid only for cursors with record number keys., a
* boolean flag; default \c false.}
@@ -809,7 +809,7 @@ struct __wt_session {
* @snippet ex_all.c Close a session
*
* @param session the session handle
- * @configempty{session.close, see dist/api_data.py}
+ * @configempty{WT_SESSION.close, see dist/api_data.py}
* @errors
*/
int __F(close)(WT_HANDLE_CLOSED(WT_SESSION) *session,
@@ -826,7 +826,7 @@ struct __wt_session {
* All cursors are reset.
*
* @param session the session handle
- * @configstart{session.reconfigure, see dist/api_data.py}
+ * @configstart{WT_SESSION.reconfigure, see dist/api_data.py}
* @config{isolation, the default isolation level for operations in this
* session., a string\, chosen from the following options: \c
* "read-uncommitted"\, \c "read-committed"\, \c "snapshot"; default \c
@@ -888,7 +888,7 @@ struct __wt_session {
* <br>
* @copydoc doc_cursor_types
* @param to_dup a cursor to duplicate
- * @configstart{session.open_cursor, see dist/api_data.py}
+ * @configstart{WT_SESSION.open_cursor, see dist/api_data.py}
* @config{append, append the value as a new record\, creating a new
* record number key; valid only for cursors with record number keys., a
* boolean flag; default \c false.}
@@ -977,7 +977,7 @@ struct __wt_session {
* @param name the URI of the object to create, such as
* \c "table:stock". For a description of URI formats
* see @ref data_sources.
- * @configstart{session.create, see dist/api_data.py}
+ * @configstart{WT_SESSION.create, see dist/api_data.py}
* @config{allocation_size, the file unit allocation size\, in bytes\,
* must a power-of-two; smaller values decrease the file space required
* by overflow items\, and the default value of 4KB is a good choice
@@ -1181,7 +1181,7 @@ struct __wt_session {
* @param session the session handle
* @param name the URI of the object to compact, such as
* \c "table:stock"
- * @configstart{session.compact, see dist/api_data.py}
+ * @configstart{WT_SESSION.compact, see dist/api_data.py}
* @config{timeout, maximum amount of time to allow for compact in
* seconds. The actual amount of time spent in compact may exceed the
* configured value. A value of zero disables the timeout., an integer;
@@ -1199,7 +1199,7 @@ struct __wt_session {
*
* @param session the session handle
* @param name the URI of the object to drop, such as \c "table:stock"
- * @configstart{session.drop, see dist/api_data.py}
+ * @configstart{WT_SESSION.drop, see dist/api_data.py}
* @config{force, return success if the object does not exist., a
* boolean flag; default \c false.}
* @config{remove_files, should the underlying files be removed?., a
@@ -1229,7 +1229,7 @@ struct __wt_session {
* @param session the session handle
* @param uri the current URI of the object, such as \c "table:old"
* @param newuri the new URI of the object, such as \c "table:new"
- * @configempty{session.rename, see dist/api_data.py}
+ * @configempty{WT_SESSION.rename, see dist/api_data.py}
* @ebusy_errors
*/
int __F(rename)(WT_SESSION *session,
@@ -1254,7 +1254,7 @@ struct __wt_session {
*
* @param session the session handle
* @param name the URI of the file or table to salvage
- * @configstart{session.salvage, see dist/api_data.py}
+ * @configstart{WT_SESSION.salvage, see dist/api_data.py}
* @config{force, force salvage even of files that do not appear to be
* WiredTiger files., a boolean flag; default \c false.}
* @configend
@@ -1284,7 +1284,7 @@ struct __wt_session {
* @param stop optional cursor marking the last record discarded;
* if <code>NULL</code>, the truncate continues to the end of the
* object
- * @configempty{session.truncate, see dist/api_data.py}
+ * @configempty{WT_SESSION.truncate, see dist/api_data.py}
* @ebusy_errors
*/
int __F(truncate)(WT_SESSION *session,
@@ -1302,7 +1302,7 @@ struct __wt_session {
*
* @param session the session handle
* @param name the URI of the file or table to upgrade
- * @configempty{session.upgrade, see dist/api_data.py}
+ * @configempty{WT_SESSION.upgrade, see dist/api_data.py}
* @ebusy_errors
*/
int __F(upgrade)(WT_SESSION *session,
@@ -1319,7 +1319,7 @@ struct __wt_session {
*
* @param session the session handle
* @param name the URI of the file or table to verify
- * @configstart{session.verify, see dist/api_data.py}
+ * @configstart{WT_SESSION.verify, see dist/api_data.py}
* @config{dump_address, Display addresses and page types as pages are
* verified\, using the application's message handler\, intended for
* debugging., a boolean flag; default \c false.}
@@ -1362,7 +1362,7 @@ struct __wt_session {
* @snippet ex_all.c transaction commit/rollback
*
* @param session the session handle
- * @configstart{session.begin_transaction, see dist/api_data.py}
+ * @configstart{WT_SESSION.begin_transaction, see dist/api_data.py}
* @config{isolation, the isolation level for this transaction; defaults
* to the session's isolation level., a string\, chosen from the
* following options: \c "read-uncommitted"\, \c "read-committed"\, \c
@@ -1391,7 +1391,7 @@ struct __wt_session {
* @snippet ex_all.c transaction commit/rollback
*
* @param session the session handle
- * @configempty{session.commit_transaction, see dist/api_data.py}
+ * @configempty{WT_SESSION.commit_transaction, see dist/api_data.py}
* @errors
*/
int __F(commit_transaction)(WT_SESSION *session, const char *config);
@@ -1406,7 +1406,7 @@ struct __wt_session {
* @snippet ex_all.c transaction commit/rollback
*
* @param session the session handle
- * @configempty{session.rollback_transaction, see dist/api_data.py}
+ * @configempty{WT_SESSION.rollback_transaction, see dist/api_data.py}
* @errors
*/
int __F(rollback_transaction)(WT_SESSION *session, const char *config);
@@ -1420,7 +1420,7 @@ struct __wt_session {
* @snippet ex_all.c Checkpoint examples
*
* @param session the session handle
- * @configstart{session.checkpoint, see dist/api_data.py}
+ * @configstart{WT_SESSION.checkpoint, see dist/api_data.py}
* @config{drop, specify a list of checkpoints to drop. The list may
* additionally contain one of the following keys: \c "from=all" to drop
* all checkpoints\, \c "from=<checkpoint>" to drop all checkpoints
@@ -1495,7 +1495,7 @@ struct __wt_connection {
*
* @param connection the connection handle
* @param uri the connection handle
- * @configstart{connection.async_new_op, see dist/api_data.py}
+ * @configstart{WT_CONNECTION.async_new_op, see dist/api_data.py}
* @config{append, append the value as a new record\, creating a new
* record number key; valid only for operations with record number
* keys., a boolean flag; default \c false.}
@@ -1531,7 +1531,7 @@ struct __wt_connection {
* @snippet ex_all.c Close a connection
*
* @param connection the connection handle
- * @configstart{connection.close, see dist/api_data.py}
+ * @configstart{WT_CONNECTION.close, see dist/api_data.py}
* @config{leak_memory, don't free memory during close., a boolean flag;
* default \c false.}
* @configend
@@ -1546,7 +1546,7 @@ struct __wt_connection {
* @snippet ex_all.c Reconfigure a connection
*
* @param connection the connection handle
- * @configstart{connection.reconfigure, see dist/api_data.py}
+ * @configstart{WT_CONNECTION.reconfigure, see dist/api_data.py}
* @config{async = (, asynchronous operations configuration options., a
* set of related configuration options defined below.}
* @config{&nbsp;&nbsp;&nbsp;&nbsp;enabled, enable asynchronous
@@ -1555,7 +1555,8 @@ struct __wt_connection {
* simultaneous asynchronous operations., an integer between 1 and 4096;
* default \c 1024.}
* @config{&nbsp;&nbsp;&nbsp;&nbsp;threads, the number
- * of worker threads to service asynchronous requests., an integer
+ * of worker threads to service asynchronous requests. Each worker
+ * thread uses a session from the configured session_max., an integer
* between 1 and 20; default \c 2.}
* @config{ ),,}
* @config{cache_overhead, assume the heap allocator overhead is the
@@ -1570,8 +1571,9 @@ struct __wt_connection {
* @config{cache_size, maximum heap memory to allocate for the cache. A
* database should configure either \c cache_size or \c shared_cache but
* not both., an integer between 1MB and 10TB; default \c 100MB.}
- * @config{checkpoint = (, periodically checkpoint the database., a set
- * of related configuration options defined below.}
+ * @config{checkpoint = (, periodically checkpoint the database.
+ * Enabling the checkpoint server uses a session from the configured
+ * session_max., a set of related configuration options defined below.}
* @config{&nbsp;&nbsp;&nbsp;&nbsp;log_size, wait for this amount of log
* record bytes to be written to the log between each checkpoint. A
* database can configure both log_size and wait to set an upper bound
@@ -1590,7 +1592,8 @@ struct __wt_connection {
* @config{&nbsp;&nbsp;&nbsp;&nbsp;threads_max, maximum number of
* threads WiredTiger will start to help evict pages from cache. The
* number of threads started will vary depending on the current eviction
- * load., an integer between 1 and 20; default \c 1.}
+ * load. Each eviction worker thread uses a session from the configured
+ * session_max., an integer between 1 and 20; default \c 1.}
* @config{&nbsp;&nbsp;&nbsp;&nbsp;threads_min, minimum number of
* threads WiredTiger will start to help evict pages from cache. The
* number of threads currently running will vary depending on the
@@ -1609,24 +1612,32 @@ struct __wt_connection {
* integer between 10 and 99; default \c 95.}
* @config{file_manager = (, control how file handles are managed., a
* set of related configuration options defined below.}
+ * @config{&nbsp;&nbsp;&nbsp;&nbsp;close_handle_minimum, number of
+ * handles open before the file manager will look for handles to close.,
+ * an integer greater than or equal to 0; default \c 250.}
* @config{&nbsp;&nbsp;&nbsp;&nbsp;close_idle_time, amount of time in
* seconds a file handle needs to be idle before attempting to close
- * it., an integer between 1 and 1000; default \c 30.}
+ * it., an integer between 1 and 100000; default \c 30.}
* @config{&nbsp;&nbsp;&nbsp;&nbsp;close_scan_interval, interval in
* seconds at which to check for files that are inactive and close
- * them., an integer between 1 and 1000; default \c 10.}
+ * them., an integer between 1 and 100000; default \c 10.}
* @config{ ),,}
* @config{lsm_manager = (, configure database wide options for LSM tree
- * management., a set of related configuration options defined below.}
- * @config{&nbsp;&nbsp;&nbsp;&nbsp;merge, merge LSM chunks where
- * possible., a boolean flag; default \c true.}
+ * management. The LSM manager is started automatically the first time
+ * an LSM tree is opened. The LSM manager uses a session from the
+ * configured session_max., a set of related configuration options
+ * defined below.}
+ * @config{&nbsp;&nbsp;&nbsp;&nbsp;merge, merge LSM
+ * chunks where possible., a boolean flag; default \c true.}
* @config{&nbsp;&nbsp;&nbsp;&nbsp;worker_thread_max, Configure a set of
- * threads to manage merging LSM trees in the database., an integer
- * between 3 and 20; default \c 4.}
+ * threads to manage merging LSM trees in the database. Each worker
+ * thread uses a session handle from the configured session_max., an
+ * integer between 3 and 20; default \c 4.}
* @config{ ),,}
* @config{shared_cache = (, shared cache configuration options. A
* database should configure either a cache_size or a shared_cache not
- * both., a set of related configuration options defined below.}
+ * both. Enabling a shared cache uses a session from the configured
+ * session_max., a set of related configuration options defined below.}
* @config{&nbsp;&nbsp;&nbsp;&nbsp;chunk, the granularity that a shared
* cache is redistributed., an integer between 1MB and 10TB; default \c
* 10MB.}
@@ -1657,9 +1668,11 @@ struct __wt_connection {
* \c "none"\, \c "clear"; default \c none.}
* @config{statistics_log = (, log any statistics the database is
* configured to maintain\, to a file. See @ref statistics for more
- * information., a set of related configuration options defined below.}
- * @config{&nbsp;&nbsp;&nbsp;&nbsp;on_close, log statistics on database
- * close., a boolean flag; default \c false.}
+ * information. Enabling the statistics log server uses a session from
+ * the configured session_max., a set of related configuration options
+ * defined below.}
+ * @config{&nbsp;&nbsp;&nbsp;&nbsp;on_close, log
+ * statistics on database close., a boolean flag; default \c false.}
* @config{&nbsp;&nbsp;&nbsp;&nbsp;path, the pathname to a file into
* which the log records are written\, may contain ISO C standard
* strftime conversion specifications. If the value is not an absolute
@@ -1710,7 +1723,7 @@ struct __wt_connection {
* @snippet ex_all.c Configure method configuration
*
* @param connection the connection handle
- * @param method the name of the method
+ * @param method the method being configured
* @param uri the object type or NULL for all object types
* @param config the additional configuration's name and default value
* @param type the additional configuration's type (must be one of
@@ -1747,7 +1760,7 @@ struct __wt_connection {
* @param connection the connection handle
* @param errhandler An error handler. If <code>NULL</code>, the
* connection's error handler is used
- * @configstart{connection.open_session, see dist/api_data.py}
+ * @configstart{WT_CONNECTION.open_session, see dist/api_data.py}
* @config{isolation, the default isolation level for operations in this
* session., a string\, chosen from the following options: \c
* "read-uncommitted"\, \c "read-committed"\, \c "snapshot"; default \c
@@ -1774,7 +1787,7 @@ struct __wt_connection {
* @param path the filename of the extension module, or \c "local" to
* search the current application binary for the initialization
* function, see @ref extensions for more details.
- * @configstart{connection.load_extension, see dist/api_data.py}
+ * @configstart{WT_CONNECTION.load_extension, see dist/api_data.py}
* @config{config, configuration string passed to the entry point of the
* extension as its WT_CONFIG_ARG argument., a string; default empty.}
* @config{entry, the entry point of the extension\, called to
@@ -1805,7 +1818,7 @@ struct __wt_connection {
* @param prefix the URI prefix for this data source, e.g., "file:"
* @param data_source the application-supplied implementation of
* WT_DATA_SOURCE to manage this data source.
- * @configempty{connection.add_data_source, see dist/api_data.py}
+ * @configempty{WT_CONNECTION.add_data_source, see dist/api_data.py}
* @errors
*/
int __F(add_data_source)(WT_CONNECTION *connection, const char *prefix,
@@ -1823,7 +1836,7 @@ struct __wt_connection {
* @param name the name of the collation to be used in calls to
* WT_SESSION::create, may not be \c "none"
* @param collator the application-supplied collation handler
- * @configempty{connection.add_collator, see dist/api_data.py}
+ * @configempty{WT_CONNECTION.add_collator, see dist/api_data.py}
* @errors
*/
int __F(add_collator)(WT_CONNECTION *connection,
@@ -1843,7 +1856,7 @@ struct __wt_connection {
* @param name the name of the compression function to be used in calls
* to WT_SESSION::create, may not be \c "none"
* @param compressor the application-supplied compression handler
- * @configempty{connection.add_compressor, see dist/api_data.py}
+ * @configempty{WT_CONNECTION.add_compressor, see dist/api_data.py}
* @errors
*/
int __F(add_compressor)(WT_CONNECTION *connection,
@@ -1861,7 +1874,7 @@ struct __wt_connection {
* @param name the name of the extractor to be used in calls to
* WT_SESSION::create, may not be \c "none"
* @param extractor the application-supplied extractor
- * @configempty{connection.add_extractor, see dist/api_data.py}
+ * @configempty{WT_CONNECTION.add_extractor, see dist/api_data.py}
* @errors
*/
int __F(add_extractor)(WT_CONNECTION *connection, const char *name,
@@ -1897,8 +1910,10 @@ struct __wt_connection {
* maximum number of expected simultaneous asynchronous operations., an integer
* between 1 and 4096; default \c 1024.}
* @config{&nbsp;&nbsp;&nbsp;&nbsp;threads, the number of worker threads to
- * service asynchronous requests., an integer between 1 and 20; default \c 2.}
- * @config{ ),,}
+ * service asynchronous requests. Each worker thread uses a session from the
+ * configured session_max., an integer between 1 and 20; default \c 2.}
+ * @config{
+ * ),,}
* @config{buffer_alignment, in-memory alignment (in bytes) for buffers used for
* I/O. The default value of -1 indicates a platform-specific alignment value
* should be used (4KB on Linux systems when direct I/O is configured\, zero
@@ -1914,7 +1929,8 @@ struct __wt_connection {
* @config{cache_size, maximum heap memory to allocate for the cache. A
* database should configure either \c cache_size or \c shared_cache but not
* both., an integer between 1MB and 10TB; default \c 100MB.}
- * @config{checkpoint = (, periodically checkpoint the database., a set of
+ * @config{checkpoint = (, periodically checkpoint the database. Enabling the
+ * checkpoint server uses a session from the configured session_max., a set of
* related configuration options defined below.}
* @config{&nbsp;&nbsp;&nbsp;&nbsp;log_size, wait for this amount of log record
* bytes to be written to the log between each checkpoint. A database can
@@ -1949,13 +1965,15 @@ struct __wt_connection {
* configuration options defined below.}
* @config{&nbsp;&nbsp;&nbsp;&nbsp;threads_max, maximum number of threads
* WiredTiger will start to help evict pages from cache. The number of threads
- * started will vary depending on the current eviction load., an integer between
- * 1 and 20; default \c 1.}
- * @config{&nbsp;&nbsp;&nbsp;&nbsp;threads_min, minimum
- * number of threads WiredTiger will start to help evict pages from cache. The
- * number of threads currently running will vary depending on the current
- * eviction load., an integer between 1 and 20; default \c 1.}
- * @config{ ),,}
+ * started will vary depending on the current eviction load. Each eviction
+ * worker thread uses a session from the configured session_max., an integer
+ * between 1 and 20; default \c 1.}
+ * @config{&nbsp;&nbsp;&nbsp;&nbsp;threads_min,
+ * minimum number of threads WiredTiger will start to help evict pages from
+ * cache. The number of threads currently running will vary depending on the
+ * current eviction load., an integer between 1 and 20; default \c 1.}
+ * @config{
+ * ),,}
* @config{eviction_dirty_target, continue evicting until the cache has less
* dirty memory than the value\, as a percentage of the total cache size. Dirty
* pages will only be evicted if the cache is full enough to trigger eviction.,
@@ -1980,19 +1998,23 @@ struct __wt_connection {
* following options: \c "data"\, \c "log"; default empty.}
* @config{file_manager = (, control how file handles are managed., a set of
* related configuration options defined below.}
+ * @config{&nbsp;&nbsp;&nbsp;&nbsp;close_handle_minimum, number of handles open
+ * before the file manager will look for handles to close., an integer greater
+ * than or equal to 0; default \c 250.}
* @config{&nbsp;&nbsp;&nbsp;&nbsp;close_idle_time, amount of time in seconds a
* file handle needs to be idle before attempting to close it., an integer
- * between 1 and 1000; default \c 30.}
+ * between 1 and 100000; default \c 30.}
* @config{&nbsp;&nbsp;&nbsp;&nbsp;close_scan_interval, interval in seconds at
* which to check for files that are inactive and close them., an integer
- * between 1 and 1000; default \c 10.}
+ * between 1 and 100000; default \c 10.}
* @config{ ),,}
* @config{hazard_max, maximum number of simultaneous hazard pointers per
* session handle., an integer greater than or equal to 15; default \c 1000.}
- * @config{log = (, enable logging., a set of related configuration options
- * defined below.}
- * @config{&nbsp;&nbsp;&nbsp;&nbsp;archive, automatically
- * archive unneeded log files., a boolean flag; default \c true.}
+ * @config{log = (, enable logging. Enabling logging uses three sessions from
+ * the configured session_max., a set of related configuration options defined
+ * below.}
+ * @config{&nbsp;&nbsp;&nbsp;&nbsp;archive, automatically archive
+ * unneeded log files., a boolean flag; default \c true.}
* @config{&nbsp;&nbsp;&nbsp;&nbsp;compressor, configure a compressor for log
* records. Permitted values are \c "none" or custom compression engine name
* created with WT_CONNECTION::add_compressor. If WiredTiger has builtin
@@ -2013,11 +2035,14 @@ struct __wt_connection {
* chosen from the following options: \c "error"\, \c "on"; default \c on.}
* @config{ ),,}
* @config{lsm_manager = (, configure database wide options for LSM tree
- * management., a set of related configuration options defined below.}
+ * management. The LSM manager is started automatically the first time an LSM
+ * tree is opened. The LSM manager uses a session from the configured
+ * session_max., a set of related configuration options defined below.}
* @config{&nbsp;&nbsp;&nbsp;&nbsp;merge, merge LSM chunks where possible., a
* boolean flag; default \c true.}
* @config{&nbsp;&nbsp;&nbsp;&nbsp;worker_thread_max, Configure a set of threads
- * to manage merging LSM trees in the database., an integer between 3 and 20;
+ * to manage merging LSM trees in the database. Each worker thread uses a
+ * session handle from the configured session_max., an integer between 3 and 20;
* default \c 4.}
* @config{ ),,}
* @config{mmap, Use memory mapping to access files when possible., a boolean
@@ -2029,7 +2054,8 @@ struct __wt_connection {
* @config{session_max, maximum expected number of sessions (including server
* threads)., an integer greater than or equal to 1; default \c 100.}
* @config{shared_cache = (, shared cache configuration options. A database
- * should configure either a cache_size or a shared_cache not both., a set of
+ * should configure either a cache_size or a shared_cache not both. Enabling a
+ * shared cache uses a session from the configured session_max., a set of
* related configuration options defined below.}
* @config{&nbsp;&nbsp;&nbsp;&nbsp;chunk, the granularity that a shared cache is
* redistributed., an integer between 1MB and 10TB; default \c 10MB.}
@@ -2057,8 +2083,9 @@ struct __wt_connection {
* list\, with values chosen from the following options: \c "all"\, \c "fast"\,
* \c "none"\, \c "clear"; default \c none.}
* @config{statistics_log = (, log any statistics the database is configured to
- * maintain\, to a file. See @ref statistics for more information., a set of
- * related configuration options defined below.}
+ * maintain\, to a file. See @ref statistics for more information. Enabling
+ * the statistics log server uses a session from the configured session_max., a
+ * set of related configuration options defined below.}
* @config{&nbsp;&nbsp;&nbsp;&nbsp;on_close, log statistics on database close.,
* a boolean flag; default \c false.}
* @config{&nbsp;&nbsp;&nbsp;&nbsp;path, the
@@ -2421,7 +2448,7 @@ int wiredtiger_unpack_uint(WT_PACK_STREAM *ps, uint64_t *up);
/*! @} */
/*!
- * @name Configuration string parsing
+ * @name Configuration strings
* @{
*/
@@ -2477,6 +2504,27 @@ struct __wt_config_item {
type;
};
+#if !defined(SWIG) && !defined(DOXYGEN)
+/*!
+ * Validate a configuration string for a WiredTiger API.
+ * This API is outside the scope of a WiredTiger connection handle, since
+ * applications may need to validate configuration strings prior to calling
+ * ::wiredtiger_open.
+ * @param session the session handle (may be \c NULL if the database not yet
+ * opened).
+ * @param errhandler An error handler (used if \c session is \c NULL; if both
+ * \c session and \c errhandler are \c NULL, error messages will be written to
+ * stderr).
+ * @param name the WiredTiger function or method to validate.
+ * @param config the configuration string being parsed.
+ * @returns zero for success, non-zero to indicate an error.
+ *
+ * @snippet ex_all.c Validate a configuration string
+ */
+int wiredtiger_config_validate(WT_SESSION *session,
+ WT_EVENT_HANDLER *errhandler, const char *name, const char *config);
+#endif
+
/*!
* Create a handle that can be used to parse or create configuration strings
* compatible with WiredTiger APIs.
@@ -2490,6 +2538,8 @@ struct __wt_config_item {
* @param len the number of valid bytes in \c config
* @param[out] config_parserp A pointer to the newly opened handle
* @errors
+ *
+ * @snippet ex_config_parse.c Create a configuration parser
*/
int wiredtiger_config_parser_open(WT_SESSION *session,
const char *config, size_t len, WT_CONFIG_PARSER **config_parserp);
diff --git a/src/third_party/wiredtiger/src/include/wt_internal.h b/src/third_party/wiredtiger/src/include/wt_internal.h
index 576827bebcd..abc552a2835 100644
--- a/src/third_party/wiredtiger/src/include/wt_internal.h
+++ b/src/third_party/wiredtiger/src/include/wt_internal.h
@@ -41,9 +41,6 @@ extern "C" {
#else
#include <pthread.h>
#endif
-#ifdef HAVE_PTHREAD_NP_H
-#include <pthread_np.h>
-#endif
#include <stddef.h>
#include <stdio.h>
#include <stdint.h>
@@ -127,8 +124,6 @@ struct __wt_connection_impl;
typedef struct __wt_connection_impl WT_CONNECTION_IMPL;
struct __wt_connection_stats;
typedef struct __wt_connection_stats WT_CONNECTION_STATS;
-struct __wt_connection_stats_spinlock;
- typedef struct __wt_connection_stats_spinlock WT_CONNECTION_STATS_SPINLOCK;
struct __wt_cursor_backup;
typedef struct __wt_cursor_backup WT_CURSOR_BACKUP;
struct __wt_cursor_backup_entry;
@@ -331,6 +326,7 @@ struct __wt_update;
#include "txn.i" /* required by btree.i */
#include "btree.i" /* required by cursor.i */
+#include "btree_cmp.i"
#include "cursor.i"
#include "bitstring.i"
diff --git a/src/third_party/wiredtiger/src/log/log.c b/src/third_party/wiredtiger/src/log/log.c
index 28483624b83..27be3dfb07c 100644
--- a/src/third_party/wiredtiger/src/log/log.c
+++ b/src/third_party/wiredtiger/src/log/log.c
@@ -46,7 +46,10 @@ __wt_log_needs_recovery(WT_SESSION_IMPL *session, WT_LSN *ckp_lsn, int *rec)
WT_CONNECTION_IMPL *conn;
WT_CURSOR *c;
WT_DECL_RET;
+ WT_ITEM dummy_key, dummy_value;
WT_LOG *log;
+ uint64_t dummy_txnid;
+ uint32_t dummy_fileid, dummy_optype, rectype;
conn = S2C(session);
log = conn->log;
@@ -59,21 +62,37 @@ __wt_log_needs_recovery(WT_SESSION_IMPL *session, WT_LSN *ckp_lsn, int *rec)
if (log == NULL)
return (0);
+ /*
+ * See if there are any data modification records between the
+ * checkpoint LSN and the end of the log. If there are none then
+ * we can skip recovery.
+ */
WT_RET(__wt_curlog_open(session, "log:", NULL, &c));
c->set_key(c, ckp_lsn->file, ckp_lsn->offset, 0);
if ((ret = c->search(c)) == 0) {
+ while ((ret = c->next(c)) == 0) {
+ /*
+ * The only thing we care about is the rectype.
+ */
+ WT_ERR(c->get_value(c, &dummy_txnid, &rectype,
+ &dummy_optype, &dummy_fileid,
+ &dummy_key, &dummy_value));
+ if (rectype == WT_LOGREC_COMMIT)
+ break;
+ }
/*
- * If the checkpoint LSN we're given is the last record,
- * then recovery is not needed.
+ * If we get to the end of the log, we can skip recovery.
*/
- if ((ret = c->next(c)) == WT_NOTFOUND) {
+ if (ret == WT_NOTFOUND) {
*rec = 0;
ret = 0;
}
} else if (ret == WT_NOTFOUND)
/*
- * If we didn't find that LSN, we need to run recovery,
- * but not return any error.
+ * We should always find the checkpoint LSN as it now points
+ * to the beginning of a written log record. But if we're
+ * running recovery on an earlier database we may not. In
+ * that case, we need to run recovery, don't return an error.
*/
ret = 0;
else
@@ -332,7 +351,6 @@ __log_decompress(WT_SESSION_IMPL *session, WT_ITEM *in, WT_ITEM **out)
{
WT_COMPRESSOR *compressor;
WT_CONNECTION_IMPL *conn;
- WT_DECL_RET;
WT_LOG_RECORD *logrec;
size_t result_len, skip;
uint32_t uncompressed_size;
@@ -342,14 +360,14 @@ __log_decompress(WT_SESSION_IMPL *session, WT_ITEM *in, WT_ITEM **out)
skip = WT_LOG_COMPRESS_SKIP;
compressor = conn->log_compressor;
if (compressor == NULL || compressor->decompress == NULL)
- WT_ERR_MSG(session, WT_ERROR,
+ WT_RET_MSG(session, WT_ERROR,
"log_read: Compressed record with "
"no configured compressor");
uncompressed_size = logrec->mem_len;
- WT_ERR(__wt_scr_alloc(session, 0, out));
- WT_ERR(__wt_buf_initsize(session, *out, uncompressed_size));
+ WT_RET(__wt_scr_alloc(session, 0, out));
+ WT_RET(__wt_buf_initsize(session, *out, uncompressed_size));
memcpy((*out)->mem, in->mem, skip);
- WT_ERR(compressor->decompress(compressor, &session->iface,
+ WT_RET(compressor->decompress(compressor, &session->iface,
(uint8_t *)in->mem + skip, in->size - skip,
(uint8_t *)(*out)->mem + skip,
uncompressed_size - skip, &result_len));
@@ -360,9 +378,10 @@ __log_decompress(WT_SESSION_IMPL *session, WT_ITEM *in, WT_ITEM **out)
* here after corruption happens. If we're salvaging the file,
* it's OK, otherwise it's really, really bad.
*/
- if (ret != 0 || result_len != uncompressed_size - WT_LOG_COMPRESS_SKIP)
- WT_ERR(WT_ERROR);
-err: return (ret);
+ if (result_len != uncompressed_size - WT_LOG_COMPRESS_SKIP)
+ return (WT_ERROR);
+
+ return (0);
}
/*
@@ -564,7 +583,7 @@ __log_truncate(WT_SESSION_IMPL *session,
{
WT_CONNECTION_IMPL *conn;
WT_DECL_RET;
- WT_FH *log_fh, *tmp_fh;
+ WT_FH *log_fh;
WT_LOG *log;
uint32_t lognum;
u_int i, logcount;
@@ -581,10 +600,8 @@ __log_truncate(WT_SESSION_IMPL *session,
*/
WT_ERR(__log_openfile(session, 0, &log_fh, file_prefix, lsn->file));
WT_ERR(__wt_ftruncate(session, log_fh, lsn->offset));
- tmp_fh = log_fh;
- log_fh = NULL;
- WT_ERR(__wt_fsync(session, tmp_fh));
- WT_ERR(__wt_close(session, &tmp_fh));
+ WT_ERR(__wt_fsync(session, log_fh));
+ WT_ERR(__wt_close(session, &log_fh));
/*
* If we just want to truncate the current log, return and skip
@@ -605,10 +622,8 @@ __log_truncate(WT_SESSION_IMPL *session,
*/
WT_ERR(__wt_ftruncate(session,
log_fh, LOG_FIRST_RECORD));
- tmp_fh = log_fh;
- log_fh = NULL;
- WT_ERR(__wt_fsync(session, tmp_fh));
- WT_ERR(__wt_close(session, &tmp_fh));
+ WT_ERR(__wt_fsync(session, log_fh));
+ WT_ERR(__wt_close(session, &log_fh));
}
}
err: WT_TRET(__wt_close(session, &log_fh));
@@ -630,7 +645,7 @@ __wt_log_allocfile(
WT_DECL_ITEM(from_path);
WT_DECL_ITEM(to_path);
WT_DECL_RET;
- WT_FH *log_fh, *tmp_fh;
+ WT_FH *log_fh;
WT_LOG *log;
conn = S2C(session);
@@ -655,10 +670,8 @@ __wt_log_allocfile(
WT_ERR(__wt_ftruncate(session, log_fh, LOG_FIRST_RECORD));
if (prealloc)
WT_ERR(__log_prealloc(session, log_fh));
- tmp_fh = log_fh;
- log_fh = NULL;
- WT_ERR(__wt_fsync(session, tmp_fh));
- WT_ERR(__wt_close(session, &tmp_fh));
+ WT_ERR(__wt_fsync(session, log_fh));
+ WT_ERR(__wt_close(session, &log_fh));
WT_ERR(__wt_verbose(session, WT_VERB_LOG,
"log_prealloc: rename %s to %s",
(char *)from_path->data, (char *)to_path->data));
@@ -922,7 +935,6 @@ __log_release(WT_SESSION_IMPL *session, WT_LOGSLOT *slot, int *freep)
WT_LSN sync_lsn;
size_t write_size;
int locked, yield_count;
- WT_DECL_SPINLOCK_ID(id); /* Must appear last */
conn = S2C(session);
log = conn->log;
@@ -968,6 +980,7 @@ __log_release(WT_SESSION_IMPL *session, WT_LOGSLOT *slot, int *freep)
WT_ERR(__wt_cond_wait(
session, log->log_write_cond, 200));
}
+ log->write_start_lsn = slot->slot_start_lsn;
log->write_lsn = slot->slot_end_lsn;
WT_ERR(__wt_cond_signal(session, log->log_write_cond));
@@ -989,7 +1002,7 @@ __log_release(WT_SESSION_IMPL *session, WT_LOGSLOT *slot, int *freep)
* beginning of our file.
*/
if (log->sync_lsn.file < slot->slot_end_lsn.file ||
- __wt_spin_trylock(session, &log->log_sync_lock, &id) != 0) {
+ __wt_spin_trylock(session, &log->log_sync_lock) != 0) {
WT_ERR(__wt_cond_wait(
session, log->log_sync_cond, 10000));
continue;
@@ -1123,6 +1136,7 @@ __wt_log_newfile(WT_SESSION_IMPL *session, int conn_create, int *created)
WT_RET(__wt_fsync(session, log->log_fh));
log->sync_lsn = end_lsn;
log->write_lsn = end_lsn;
+ log->write_start_lsn = end_lsn;
}
if (created != NULL)
*created = create_log;
@@ -1238,7 +1252,8 @@ err:
int
__wt_log_scan(WT_SESSION_IMPL *session, WT_LSN *lsnp, uint32_t flags,
int (*func)(WT_SESSION_IMPL *session,
- WT_ITEM *record, WT_LSN *lsnp, void *cookie, int firstrecord), void *cookie)
+ WT_ITEM *record, WT_LSN *lsnp, WT_LSN *next_lsnp,
+ void *cookie, int firstrecord), void *cookie)
{
WT_CONNECTION_IMPL *conn;
WT_DECL_ITEM(uncitem);
@@ -1247,7 +1262,7 @@ __wt_log_scan(WT_SESSION_IMPL *session, WT_LSN *lsnp, uint32_t flags,
WT_ITEM buf;
WT_LOG *log;
WT_LOG_RECORD *logrec;
- WT_LSN end_lsn, rd_lsn, start_lsn;
+ WT_LSN end_lsn, next_lsn, rd_lsn, start_lsn;
wt_off_t log_size;
uint32_t allocsize, cksum, firstlog, lastlog, lognum, rdup_len, reclen;
u_int i, logcount;
@@ -1370,6 +1385,7 @@ advance:
WT_ERR(__log_openfile(
session, 0, &log_fh, WT_LOG_FILENAME, rd_lsn.file));
WT_ERR(__log_filesize(session, log_fh, &log_size));
+ eol = 0;
continue;
}
/*
@@ -1432,6 +1448,12 @@ advance:
*/
if (log != NULL)
log->trunc_lsn = rd_lsn;
+ /*
+ * If the user asked for a specific LSN and it is not
+ * a valid LSN, return WT_NOTFOUND.
+ */
+ if (LF_ISSET(WT_LOGSCAN_ONE))
+ ret = WT_NOTFOUND;
break;
}
@@ -1440,23 +1462,25 @@ advance:
* header, invoke the callback.
*/
WT_STAT_FAST_CONN_INCR(session, log_scan_records);
+ next_lsn = rd_lsn;
+ next_lsn.offset += (wt_off_t)rdup_len;
if (rd_lsn.offset != 0) {
if (F_ISSET(logrec, WT_LOG_RECORD_COMPRESSED)) {
WT_ERR(__log_decompress(session, &buf,
&uncitem));
WT_ERR((*func)(session, uncitem, &rd_lsn,
- cookie, firstrecord));
+ &next_lsn, cookie, firstrecord));
__wt_scr_free(session, &uncitem);
} else
- WT_ERR((*func)(session, &buf, &rd_lsn, cookie,
- firstrecord));
+ WT_ERR((*func)(session, &buf,
+ &rd_lsn, &next_lsn, cookie, firstrecord));
firstrecord = 0;
if (LF_ISSET(WT_LOGSCAN_ONE))
break;
}
- rd_lsn.offset += (wt_off_t)rdup_len;
+ rd_lsn = next_lsn;
}
/* Truncate if we're in recovery. */
@@ -1495,7 +1519,6 @@ __log_direct_write(WT_SESSION_IMPL *session, WT_ITEM *record, WT_LSN *lsnp,
WT_LOGSLOT tmp;
WT_MYSLOT myslot;
int dummy, locked;
- WT_DECL_SPINLOCK_ID(id); /* Must appear last */
log = S2C(session)->log;
myslot.slot = &tmp;
@@ -1504,7 +1527,7 @@ __log_direct_write(WT_SESSION_IMPL *session, WT_ITEM *record, WT_LSN *lsnp,
WT_CLEAR(tmp);
/* Fast path the contended case. */
- if (__wt_spin_trylock(session, &log->log_slot_lock, &id) != 0)
+ if (__wt_spin_trylock(session, &log->log_slot_lock) != 0)
return (EAGAIN);
locked = 1;
diff --git a/src/third_party/wiredtiger/src/lsm/lsm_cursor.c b/src/third_party/wiredtiger/src/lsm/lsm_cursor.c
index a18269baa28..7c9ac35d489 100644
--- a/src/third_party/wiredtiger/src/lsm/lsm_cursor.c
+++ b/src/third_party/wiredtiger/src/lsm/lsm_cursor.c
@@ -97,10 +97,11 @@ __clsm_enter_update(WT_CURSOR_LSM *clsm)
hard_limit = F_ISSET(lsm_tree, WT_LSM_TREE_NEED_SWITCH) ? 1 : 0;
if (have_primary) {
+ WT_ENTER_PAGE_INDEX(session);
WT_WITH_BTREE(session, ((WT_CURSOR_BTREE *)primary)->btree,
- ovfl = __wt_btree_size_overflow(
- session, hard_limit ?
+ ovfl = __wt_btree_lsm_size(session, hard_limit ?
2 * lsm_tree->chunk_size : lsm_tree->chunk_size));
+ WT_LEAVE_PAGE_INDEX(session);
/* If there was no overflow, we're done. */
if (!ovfl)
@@ -391,26 +392,37 @@ __clsm_open_cursors(
c = &clsm->iface;
session = (WT_SESSION_IMPL *)c->session;
txn = &session->txn;
- lsm_tree = clsm->lsm_tree;
chunk = NULL;
+ locked = 0;
+ lsm_tree = clsm->lsm_tree;
- if (update) {
- if (txn->isolation == TXN_ISO_SNAPSHOT)
- F_SET(clsm, WT_CLSM_OPEN_SNAPSHOT);
- } else
+ /*
+ * Ensure that any snapshot update has cursors on the right set of
+ * chunks to guarantee visibility is correct.
+ */
+ if (update && txn->isolation == TXN_ISO_SNAPSHOT)
+ F_SET(clsm, WT_CLSM_OPEN_SNAPSHOT);
+
+ /*
+ * Query operations need a full set of cursors. Overwrite cursors
+ * do queries in service of updates.
+ */
+ if (!update || !F_ISSET(c, WT_CURSTD_OVERWRITE))
F_SET(clsm, WT_CLSM_OPEN_READ);
if (lsm_tree->nchunks == 0)
return (0);
- ckpt_cfg[0] = WT_CONFIG_BASE(session, session_open_cursor);
+ ckpt_cfg[0] = WT_CONFIG_BASE(session, WT_SESSION_open_cursor);
ckpt_cfg[1] = "checkpoint=" WT_CHECKPOINT ",raw";
ckpt_cfg[2] = NULL;
- /* Copy the key, so we don't lose the cursor position. */
- if (F_ISSET(c, WT_CURSTD_KEY_INT) && !WT_DATA_IN_ITEM(&c->key))
- WT_RET(__wt_buf_set(
- session, &c->key, c->key.data, c->key.size));
+ /*
+ * If the key is pointing to memory that is pinned by a chunk
+ * cursor, take a copy before closing cursors.
+ */
+ if (F_ISSET(c, WT_CURSTD_KEY_INT))
+ WT_CURSOR_NEEDKEY(c);
F_CLR(clsm, WT_CLSM_ITERATE_NEXT | WT_CLSM_ITERATE_PREV);
@@ -1201,9 +1213,21 @@ __clsm_search_near(WT_CURSOR *cursor, int *exactp)
deleted = __clsm_deleted(clsm, &cursor->value);
if (!deleted)
__clsm_deleted_decode(clsm, &cursor->value);
- else if ((ret = cursor->next(cursor)) == 0) {
- cmp = 1;
- deleted = 0;
+ else {
+ /*
+ * We have a key pointing at memory that is
+ * pinned by the current chunk cursor. In the
+ * unlikely event that we have to reopen cursors
+ * to move to the next record, make sure the cursor
+ * flags are set so a copy is made before the current
+ * chunk cursor releases its position.
+ */
+ F_CLR(cursor, WT_CURSTD_KEY_SET);
+ F_SET(cursor, WT_CURSTD_KEY_INT);
+ if ((ret = cursor->next(cursor)) == 0) {
+ cmp = 1;
+ deleted = 0;
+ }
}
WT_ERR_NOTFOUND_OK(ret);
}
diff --git a/src/third_party/wiredtiger/src/lsm/lsm_manager.c b/src/third_party/wiredtiger/src/lsm/lsm_manager.c
index 12b24984fcb..3d9fc27d1d2 100644
--- a/src/third_party/wiredtiger/src/lsm/lsm_manager.c
+++ b/src/third_party/wiredtiger/src/lsm/lsm_manager.c
@@ -327,8 +327,7 @@ __wt_lsm_manager_destroy(WT_SESSION_IMPL *session)
WT_TRET(wt_session->close(wt_session, NULL));
}
}
- WT_STAT_FAST_CONN_INCRV(session,
- lsm_work_units_discarded, removed);
+ WT_STAT_FAST_CONN_INCRV(session, lsm_work_units_discarded, removed);
/* Free resources that are allocated in connection initialize */
__wt_spin_destroy(session, &manager->switch_lock);
diff --git a/src/third_party/wiredtiger/src/lsm/lsm_merge.c b/src/third_party/wiredtiger/src/lsm/lsm_merge.c
index 6ca1b0f04ab..d75f3b0619b 100644
--- a/src/third_party/wiredtiger/src/lsm/lsm_merge.c
+++ b/src/third_party/wiredtiger/src/lsm/lsm_merge.c
@@ -244,7 +244,7 @@ __wt_lsm_merge(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, u_int id)
int create_bloom, locked, in_sync, tret;
const char *cfg[3];
const char *drop_cfg[] =
- { WT_CONFIG_BASE(session, session_drop), "force", NULL };
+ { WT_CONFIG_BASE(session, WT_SESSION_drop), "force", NULL };
bloom = NULL;
chunk = NULL;
@@ -337,7 +337,7 @@ __wt_lsm_merge(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree, u_int id)
/* Discard pages we read as soon as we're done with them. */
F_SET(session, WT_SESSION_NO_CACHE);
- cfg[0] = WT_CONFIG_BASE(session, session_open_cursor);
+ cfg[0] = WT_CONFIG_BASE(session, WT_SESSION_open_cursor);
cfg[1] = "bulk,raw,skip_sort_check";
cfg[2] = NULL;
WT_ERR(__wt_open_cursor(session, chunk->uri, NULL, cfg, &dest));
diff --git a/src/third_party/wiredtiger/src/lsm/lsm_stat.c b/src/third_party/wiredtiger/src/lsm/lsm_stat.c
index e994300d4d3..5398982aef4 100644
--- a/src/third_party/wiredtiger/src/lsm/lsm_stat.c
+++ b/src/third_party/wiredtiger/src/lsm/lsm_stat.c
@@ -26,9 +26,9 @@ __curstat_lsm_init(
int locked;
char config[64];
const char *cfg[] = {
- WT_CONFIG_BASE(session, session_open_cursor), NULL, NULL };
+ WT_CONFIG_BASE(session, WT_SESSION_open_cursor), NULL, NULL };
const char *disk_cfg[] = {
- WT_CONFIG_BASE(session, session_open_cursor),
+ WT_CONFIG_BASE(session, WT_SESSION_open_cursor),
"checkpoint=" WT_CHECKPOINT, NULL, NULL };
locked = 0;
diff --git a/src/third_party/wiredtiger/src/lsm/lsm_tree.c b/src/third_party/wiredtiger/src/lsm/lsm_tree.c
index 2bded10cb96..cce49984f43 100644
--- a/src/third_party/wiredtiger/src/lsm/lsm_tree.c
+++ b/src/third_party/wiredtiger/src/lsm/lsm_tree.c
@@ -230,7 +230,7 @@ __lsm_tree_cleanup_old(WT_SESSION_IMPL *session, const char *uri)
{
WT_DECL_RET;
const char *cfg[] =
- { WT_CONFIG_BASE(session, session_drop), "force", NULL };
+ { WT_CONFIG_BASE(session, WT_SESSION_drop), "force", NULL };
int exists;
WT_RET(__wt_exist(session, uri + strlen("file:"), &exists));
@@ -303,7 +303,7 @@ __wt_lsm_tree_create(WT_SESSION_IMPL *session,
WT_DECL_RET;
WT_LSM_TREE *lsm_tree;
const char *cfg[] =
- { WT_CONFIG_BASE(session, session_create), config, NULL };
+ { WT_CONFIG_BASE(session, WT_SESSION_create), config, NULL };
char *tmpconfig;
/* If the tree is open, it already exists. */
@@ -372,7 +372,7 @@ __wt_lsm_tree_create(WT_SESSION_IMPL *session,
cval.len -= 2;
}
WT_ERR(__wt_config_check(session,
- WT_CONFIG_REF(session, session_create), cval.str, cval.len));
+ WT_CONFIG_REF(session, WT_SESSION_create), cval.str, cval.len));
WT_ERR(__wt_strndup(
session, cval.str, cval.len, &lsm_tree->bloom_config));
@@ -513,7 +513,7 @@ __lsm_tree_open_check(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree)
WT_CONFIG_ITEM cval;
uint64_t maxleafpage, required;
const char *cfg[] = { WT_CONFIG_BASE(
- session, session_create), lsm_tree->file_config, NULL };
+ session, WT_SESSION_create), lsm_tree->file_config, NULL };
WT_RET(__wt_config_gets(session, cfg, "leaf_page_max", &cval));
maxleafpage = (uint64_t)cval.val;
@@ -539,8 +539,7 @@ __lsm_tree_open_check(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree)
* Open an LSM tree structure.
*/
static int
-__lsm_tree_open(
- WT_SESSION_IMPL *session, const char *uri, WT_LSM_TREE **treep)
+__lsm_tree_open(WT_SESSION_IMPL *session, const char *uri, WT_LSM_TREE **treep)
{
WT_CONNECTION_IMPL *conn;
WT_DECL_RET;
diff --git a/src/third_party/wiredtiger/src/lsm/lsm_work_unit.c b/src/third_party/wiredtiger/src/lsm/lsm_work_unit.c
index dea012ccb9e..74a52ad7402 100644
--- a/src/third_party/wiredtiger/src/lsm/lsm_work_unit.c
+++ b/src/third_party/wiredtiger/src/lsm/lsm_work_unit.c
@@ -344,7 +344,7 @@ __wt_lsm_checkpoint_chunk(WT_SESSION_IMPL *session,
WT_RET_MSG(session, ret, "LSM metadata write");
/*
- * Clear the "cache resident" flag so the primary can be evicted and
+ * Clear the no-eviction flag so the primary can be evicted and
* eventually closed. Only do this once the checkpoint has succeeded:
* otherwise, accessing the leaf page during the checkpoint can trigger
* forced eviction.
@@ -457,7 +457,7 @@ __lsm_discard_handle(
WT_RET(__wt_session_get_btree(session, uri, checkpoint, NULL,
WT_DHANDLE_EXCLUSIVE | WT_DHANDLE_LOCK_ONLY));
- F_SET(session->dhandle, WT_DHANDLE_DISCARD);
+ F_SET(session->dhandle, WT_DHANDLE_DISCARD_FORCE);
return (__wt_session_release_btree(session));
}
@@ -469,9 +469,8 @@ static int
__lsm_drop_file(WT_SESSION_IMPL *session, const char *uri)
{
WT_DECL_RET;
- const char *drop_cfg[] = {
- WT_CONFIG_BASE(session, session_drop), "remove_files=false", NULL
- };
+ const char *drop_cfg[] = { WT_CONFIG_BASE(
+ session, WT_SESSION_drop), "remove_files=false", NULL };
/*
* We need to grab the schema lock to drop the file, so first try to
diff --git a/src/third_party/wiredtiger/src/meta/meta_table.c b/src/third_party/wiredtiger/src/meta/meta_table.c
index fb568361f74..a2e4a2f8e9f 100644
--- a/src/third_party/wiredtiger/src/meta/meta_table.c
+++ b/src/third_party/wiredtiger/src/meta/meta_table.c
@@ -60,7 +60,7 @@ __wt_metadata_cursor(
WT_DATA_HANDLE *saved_dhandle;
WT_DECL_RET;
const char *cfg[] =
- { WT_CONFIG_BASE(session, session_open_cursor), config, NULL };
+ { WT_CONFIG_BASE(session, WT_SESSION_open_cursor), config, NULL };
saved_dhandle = session->dhandle;
WT_ERR(__wt_metadata_open(session));
@@ -71,7 +71,7 @@ __wt_metadata_cursor(
* We use the metadata a lot, so we have a handle cached; lock it and
* increment the in-use counter once the cursor is open.
*/
- WT_ERR(__wt_session_lock_dhandle(session, 0));
+ WT_ERR(__wt_session_lock_dhandle(session, 0, NULL));
WT_ERR(__wt_curfile_create(session, NULL, cfg, 0, 0, cursorp));
__wt_cursor_dhandle_incr_use(session);
diff --git a/src/third_party/wiredtiger/src/meta/meta_track.c b/src/third_party/wiredtiger/src/meta/meta_track.c
index 3bc6a1f9d60..62d4df47ff6 100644
--- a/src/third_party/wiredtiger/src/meta/meta_track.c
+++ b/src/third_party/wiredtiger/src/meta/meta_track.c
@@ -184,6 +184,35 @@ free: trk->op = WT_ST_EMPTY;
}
/*
+ * __wt_meta_track_find_handle --
+ * Check if we have already seen a handle.
+ */
+int
+__wt_meta_track_find_handle(
+ WT_SESSION_IMPL *session, const char *name, const char *checkpoint)
+{
+ WT_META_TRACK *trk, *trk_orig;
+
+ WT_ASSERT(session,
+ WT_META_TRACKING(session) && session->meta_track_nest > 0);
+
+ trk_orig = session->meta_track;
+ trk = session->meta_track_next;
+
+ while (--trk >= trk_orig) {
+ if (trk->op != WT_ST_LOCK)
+ continue;
+ if (strcmp(trk->dhandle->name, name) == 0 &&
+ ((trk->dhandle->checkpoint == NULL && checkpoint == NULL) ||
+ (trk->dhandle->checkpoint != NULL &&
+ strcmp(trk->dhandle->checkpoint, checkpoint) == 0)))
+ return (0);
+ }
+
+ return (WT_NOTFOUND);
+}
+
+/*
* __wt_meta_track_off --
* Turn off metadata operation tracking, unrolling on error.
*/
diff --git a/src/third_party/wiredtiger/src/meta/meta_turtle.c b/src/third_party/wiredtiger/src/meta/meta_turtle.c
index 7e3ac3530f8..79a555d0922 100644
--- a/src/third_party/wiredtiger/src/meta/meta_turtle.c
+++ b/src/third_party/wiredtiger/src/meta/meta_turtle.c
@@ -96,7 +96,7 @@ __metadata_load_hot_backup(WT_SESSION_IMPL *session)
F_SET(S2C(session), WT_CONN_WAS_BACKUP);
-err: WT_TRET(__wt_fclose(session, &fp, WT_FHANDLE_READ));
+err: WT_TRET(__wt_fclose(&fp, WT_FHANDLE_READ));
__wt_scr_free(session, &key);
__wt_scr_free(session, &value);
return (ret);
@@ -259,7 +259,7 @@ __wt_turtle_read(WT_SESSION_IMPL *session, const char *key, char **valuep)
/* Copy the value for the caller. */
WT_ERR(__wt_strdup(session, buf->data, valuep));
-err: WT_TRET(__wt_fclose(session, &fp, WT_FHANDLE_READ));
+err: WT_TRET(__wt_fclose(&fp, WT_FHANDLE_READ));
__wt_scr_free(session, &buf);
return (ret);
}
diff --git a/src/third_party/wiredtiger/src/os_posix/os_alloc.c b/src/third_party/wiredtiger/src/os_posix/os_alloc.c
index d3d4fd1dbcf..e0613197642 100644
--- a/src/third_party/wiredtiger/src/os_posix/os_alloc.c
+++ b/src/third_party/wiredtiger/src/os_posix/os_alloc.c
@@ -9,6 +9,21 @@
#include "wt_internal.h"
/*
+ * On systems with poor default allocators for allocations greater than 16 KB,
+ * we provide an option to use TCMalloc explicitly.
+ * This is important on Windows which does not have a builtin mechanism
+ * to replace C run-time memory management functions with alternatives.
+ */
+#ifdef HAVE_LIBTCMALLOC
+#include <gperftools/tcmalloc.h>
+
+#define calloc tc_calloc
+#define realloc tc_realloc
+#define posix_memalign tc_posix_memalign
+#define free tc_free
+#endif
+
+/*
* There's no malloc interface, WiredTiger never calls malloc.
*
* The problem is an application might allocate memory, write secret stuff in
@@ -145,8 +160,7 @@ __wt_realloc_aligned(WT_SESSION_IMPL *session,
bytes_to_allocate =
WT_ALIGN(bytes_to_allocate, S2C(session)->buffer_alignment);
- if (session != NULL)
- WT_STAT_FAST_CONN_INCR(session, memory_allocation);
+ WT_STAT_FAST_CONN_INCR(session, memory_allocation);
if ((ret = posix_memalign(&newp,
S2C(session)->buffer_alignment,
diff --git a/src/third_party/wiredtiger/src/os_posix/os_ftruncate.c b/src/third_party/wiredtiger/src/os_posix/os_ftruncate.c
index ce2527e87e2..696d8da54f4 100644
--- a/src/third_party/wiredtiger/src/os_posix/os_ftruncate.c
+++ b/src/third_party/wiredtiger/src/os_posix/os_ftruncate.c
@@ -18,10 +18,8 @@ __wt_ftruncate(WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t len)
WT_DECL_RET;
WT_SYSCALL_RETRY(ftruncate(fh->fd, len), ret);
- if (ret == 0) {
- fh->size = fh->extend_size = len;
+ if (ret == 0)
return (0);
- }
WT_RET_MSG(session, ret, "%s ftruncate error", fh->name);
}
diff --git a/src/third_party/wiredtiger/src/os_posix/os_open.c b/src/third_party/wiredtiger/src/os_posix/os_open.c
index 33b07ed6a49..2116efc6ea8 100644
--- a/src/third_party/wiredtiger/src/os_posix/os_open.c
+++ b/src/third_party/wiredtiger/src/os_posix/os_open.c
@@ -60,7 +60,7 @@ __wt_open(WT_SESSION_IMPL *session,
hash = __wt_hash_city64(name, strlen(name));
bucket = hash % WT_HASH_ARRAY_SIZE;
__wt_spin_lock(session, &conn->fh_lock);
- SLIST_FOREACH(tfh, &conn->fhhash[bucket], l) {
+ SLIST_FOREACH(tfh, &conn->fhhash[bucket], hashl) {
if (strcmp(name, tfh->name) == 0) {
++tfh->ref;
*fhp = tfh;
@@ -174,7 +174,7 @@ setupfh:
*/
matched = 0;
__wt_spin_lock(session, &conn->fh_lock);
- SLIST_FOREACH(tfh, &conn->fhhash[bucket], l) {
+ SLIST_FOREACH(tfh, &conn->fhhash[bucket], hashl) {
if (strcmp(name, tfh->name) == 0) {
++tfh->ref;
*fhp = tfh;
@@ -184,8 +184,7 @@ setupfh:
}
if (!matched) {
WT_CONN_FILE_INSERT(conn, fh, bucket);
- WT_STAT_FAST_CONN_INCR(session, file_open);
-
+ (void)WT_ATOMIC_ADD4(conn->open_file_count, 1);
*fhp = fh;
}
__wt_spin_unlock(session, &conn->fh_lock);
@@ -230,7 +229,7 @@ __wt_close(WT_SESSION_IMPL *session, WT_FH **fhp)
/* Remove from the list. */
bucket = fh->name_hash % WT_HASH_ARRAY_SIZE;
WT_CONN_FILE_REMOVE(conn, fh, bucket);
- WT_STAT_FAST_CONN_DECR(session, file_open);
+ (void)WT_ATOMIC_SUB4(conn->open_file_count, 1);
__wt_spin_unlock(session, &conn->fh_lock);
diff --git a/src/third_party/wiredtiger/src/os_posix/os_remove.c b/src/third_party/wiredtiger/src/os_posix/os_remove.c
index d1f658b7ae1..3fc692d8755 100644
--- a/src/third_party/wiredtiger/src/os_posix/os_remove.c
+++ b/src/third_party/wiredtiger/src/os_posix/os_remove.c
@@ -29,7 +29,7 @@ __remove_file_check(WT_SESSION_IMPL *session, const char *name)
* level should have closed it before removing.
*/
__wt_spin_lock(session, &conn->fh_lock);
- SLIST_FOREACH(fh, &conn->fhhash[bucket], l)
+ SLIST_FOREACH(fh, &conn->fhhash[bucket], hashl)
if (strcmp(name, fh->name) == 0)
break;
__wt_spin_unlock(session, &conn->fh_lock);
diff --git a/src/third_party/wiredtiger/src/os_posix/os_stdio.c b/src/third_party/wiredtiger/src/os_posix/os_stdio.c
index 8d97fdd2880..da880f5521e 100644
--- a/src/third_party/wiredtiger/src/os_posix/os_stdio.c
+++ b/src/third_party/wiredtiger/src/os_posix/os_stdio.c
@@ -59,13 +59,9 @@ __wt_fopen(WT_SESSION_IMPL *session,
* Vfprintf for a FILE handle.
*/
int
-__wt_vfprintf(WT_SESSION_IMPL *session, FILE *fp, const char *fmt, va_list ap)
+__wt_vfprintf(FILE *fp, const char *fmt, va_list ap)
{
- WT_DECL_RET;
-
- WT_UNUSED(session);
-
- return (vfprintf(fp, fmt, ap) < 0 ? __wt_errno() : ret);
+ return (vfprintf(fp, fmt, ap) < 0 ? __wt_errno() : 0);
}
/*
@@ -73,14 +69,14 @@ __wt_vfprintf(WT_SESSION_IMPL *session, FILE *fp, const char *fmt, va_list ap)
* Fprintf for a FILE handle.
*/
int
-__wt_fprintf(WT_SESSION_IMPL *session, FILE *fp, const char *fmt, ...)
- WT_GCC_FUNC_ATTRIBUTE((format (printf, 3, 4)))
+__wt_fprintf(FILE *fp, const char *fmt, ...)
+ WT_GCC_FUNC_ATTRIBUTE((format (printf, 2, 3)))
{
WT_DECL_RET;
va_list ap;
va_start(ap, fmt);
- ret = __wt_vfprintf(session, fp, fmt, ap);
+ ret = __wt_vfprintf(fp, fmt, ap);
va_end(ap);
return (ret);
@@ -91,10 +87,8 @@ __wt_fprintf(WT_SESSION_IMPL *session, FILE *fp, const char *fmt, ...)
* Flush a FILE handle.
*/
int
-__wt_fflush(WT_SESSION_IMPL *session, FILE *fp)
+__wt_fflush(FILE *fp)
{
- WT_UNUSED(session);
-
/* Flush the handle. */
return (fflush(fp) == 0 ? 0 : __wt_errno());
}
@@ -104,7 +98,7 @@ __wt_fflush(WT_SESSION_IMPL *session, FILE *fp)
* Close a FILE handle.
*/
int
-__wt_fclose(WT_SESSION_IMPL *session, FILE **fpp, WT_FHANDLE_MODE mode_flag)
+__wt_fclose(FILE **fpp, WT_FHANDLE_MODE mode_flag)
{
FILE *fp;
WT_DECL_RET;
@@ -120,7 +114,7 @@ __wt_fclose(WT_SESSION_IMPL *session, FILE **fpp, WT_FHANDLE_MODE mode_flag)
* OS buffers, then flush the OS buffers to the backing disk.
*/
if (mode_flag == WT_FHANDLE_APPEND || mode_flag == WT_FHANDLE_WRITE) {
- ret = __wt_fflush(session, fp);
+ ret = __wt_fflush(fp);
if (fsync(fileno(fp)) != 0)
WT_TRET(__wt_errno());
}
diff --git a/src/third_party/wiredtiger/src/os_win/os_errno.c b/src/third_party/wiredtiger/src/os_win/os_errno.c
index 81bcdf9089e..097c73b5731 100644
--- a/src/third_party/wiredtiger/src/os_win/os_errno.c
+++ b/src/third_party/wiredtiger/src/os_win/os_errno.c
@@ -28,7 +28,7 @@ __wt_map_error_to_windows_error(int error) {
}
/*
- * __wt_map_error_to_windows_error --
+ * __wt_map_windows_error_to_error --
* Return a positive integer, a decoded Windows error
*/
static int
diff --git a/src/third_party/wiredtiger/src/os_win/os_fallocate.c b/src/third_party/wiredtiger/src/os_win/os_fallocate.c
index f01ef0e101a..ee1335af12e 100644
--- a/src/third_party/wiredtiger/src/os_win/os_fallocate.c
+++ b/src/third_party/wiredtiger/src/os_win/os_fallocate.c
@@ -17,12 +17,13 @@ __wt_fallocate_config(WT_SESSION_IMPL *session, WT_FH *fh)
{
WT_UNUSED(session);
- fh->fallocate_available = WT_FALLOCATE_AVAILABLE;
-
/*
- * We use a separate handle for file size changes, so there's no need
- * for locking.
+ * fallocate on Windows would be implemented using SetEndOfFile, which
+ * can also truncate the file. WiredTiger expects fallocate to ignore
+ * requests to truncate the file which Windows does not do, so we don't
+ * support the call.
*/
+ fh->fallocate_available = WT_FALLOCATE_NOT_AVAILABLE;
fh->fallocate_requires_locking = 0;
}
@@ -34,23 +35,10 @@ int
__wt_fallocate(
WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t offset, wt_off_t len)
{
- WT_DECL_RET;
- LARGE_INTEGER largeint;
-
- WT_RET(__wt_verbose(
- session, WT_VERB_FILEOPS, "%s: fallocate", fh->name));
-
- largeint.QuadPart = offset + len;
-
- if ((ret = SetFilePointerEx(
- fh->filehandle_secondary, largeint, NULL, FILE_BEGIN)) == FALSE)
- WT_RET_MSG(session,
- __wt_errno(), "%s SetFilePointerEx error", fh->name);
-
- if ((ret = SetEndOfFile(fh->filehandle_secondary)) != FALSE) {
- fh->size = fh->extend_size = len;
- return (0);
- }
+ WT_UNUSED(session);
+ WT_UNUSED(fh);
+ WT_UNUSED(offset);
+ WT_UNUSED(len);
- WT_RET_MSG(session, __wt_errno(), "%s SetEndOfFile error", fh->name);
+ return (ENOTSUP);
}
diff --git a/src/third_party/wiredtiger/src/os_win/os_ftruncate.c b/src/third_party/wiredtiger/src/os_win/os_ftruncate.c
index d9b43e4596f..cc635306a71 100644
--- a/src/third_party/wiredtiger/src/os_win/os_ftruncate.c
+++ b/src/third_party/wiredtiger/src/os_win/os_ftruncate.c
@@ -26,10 +26,8 @@ __wt_ftruncate(WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t len)
fh->name);
ret = SetEndOfFile(fh->filehandle_secondary);
- if (ret != FALSE) {
- fh->size = fh->extend_size = len;
+ if (ret != FALSE)
return (0);
- }
if (GetLastError() == ERROR_USER_MAPPED_FILE)
return (EBUSY);
diff --git a/src/third_party/wiredtiger/src/os_win/os_once.c b/src/third_party/wiredtiger/src/os_win/os_once.c
index bec8c08777c..bb5e059452e 100644
--- a/src/third_party/wiredtiger/src/os_win/os_once.c
+++ b/src/third_party/wiredtiger/src/os_win/os_once.c
@@ -28,8 +28,8 @@ BOOL CALLBACK _wt_init_once_callback(
}
/*
- * __wt_library_init --
- * Some things to do, before we do anything else.
+ * __wt_once --
+ * One-time initialization per process.
*/
int
__wt_once(void(*init_routine)(void))
diff --git a/src/third_party/wiredtiger/src/os_win/os_open.c b/src/third_party/wiredtiger/src/os_win/os_open.c
index 4039bcb21e5..a77bef63b9d 100644
--- a/src/third_party/wiredtiger/src/os_win/os_open.c
+++ b/src/third_party/wiredtiger/src/os_win/os_open.c
@@ -39,7 +39,7 @@ __wt_open(WT_SESSION_IMPL *session,
/* Increment the reference count if we already have the file open. */
matched = 0;
__wt_spin_lock(session, &conn->fh_lock);
- SLIST_FOREACH(tfh, &conn->fhhash[bucket], l)
+ SLIST_FOREACH(tfh, &conn->fhhash[bucket], hashl)
if (strcmp(name, tfh->name) == 0) {
++tfh->ref;
*fhp = tfh;
@@ -160,7 +160,7 @@ setupfh:
*/
matched = 0;
__wt_spin_lock(session, &conn->fh_lock);
- SLIST_FOREACH(tfh, &conn->fhhash[bucket], l)
+ SLIST_FOREACH(tfh, &conn->fhhash[bucket], hashl)
if (strcmp(name, tfh->name) == 0) {
++tfh->ref;
*fhp = tfh;
@@ -169,7 +169,7 @@ setupfh:
}
if (!matched) {
WT_CONN_FILE_INSERT(conn, fh, bucket);
- WT_STAT_FAST_CONN_INCR(session, file_open);
+ (void)WT_ATOMIC_ADD4(conn->open_file_count, 1);
*fhp = fh;
}
@@ -217,7 +217,7 @@ __wt_close(WT_SESSION_IMPL *session, WT_FH **fhp)
/* Remove from the list. */
bucket = fh->name_hash % WT_HASH_ARRAY_SIZE;
WT_CONN_FILE_REMOVE(conn, fh, bucket);
- WT_STAT_FAST_CONN_DECR(session, file_open);
+ (void)WT_ATOMIC_SUB4(conn->open_file_count, 1);
__wt_spin_unlock(session, &conn->fh_lock);
diff --git a/src/third_party/wiredtiger/src/os_win/os_remove.c b/src/third_party/wiredtiger/src/os_win/os_remove.c
index 45b4d5ce6b0..0c6396c775f 100644
--- a/src/third_party/wiredtiger/src/os_win/os_remove.c
+++ b/src/third_party/wiredtiger/src/os_win/os_remove.c
@@ -29,7 +29,7 @@ __remove_file_check(WT_SESSION_IMPL *session, const char *name)
* level should have closed it before removing.
*/
__wt_spin_lock(session, &conn->fh_lock);
- SLIST_FOREACH(fh, &conn->fhhash[bucket], l)
+ SLIST_FOREACH(fh, &conn->fhhash[bucket], hashl)
if (strcmp(name, fh->name) == 0)
break;
__wt_spin_unlock(session, &conn->fh_lock);
diff --git a/src/third_party/wiredtiger/src/reconcile/rec_write.c b/src/third_party/wiredtiger/src/reconcile/rec_write.c
index 33d79e6d4ce..5bef5cd2d2d 100644
--- a/src/third_party/wiredtiger/src/reconcile/rec_write.c
+++ b/src/third_party/wiredtiger/src/reconcile/rec_write.c
@@ -127,15 +127,15 @@ typedef struct {
*/
struct __rec_boundary {
/*
- * The start field records location in the initial split buffer,
- * that is, the first byte of the split chunk recorded before we
- * decide to split a page; the offset between the first byte of
- * chunk[0] and the first byte of chunk[1] is chunk[0]'s length.
+ * Offset is the byte offset in the initial split buffer of the
+ * first byte of the split chunk, recorded before we decide to
+ * split the page; the difference between chunk[1]'s offset and
+ * chunk[0]'s offset is chunk[0]'s length.
*
- * Once we split a page, we stop filling in the start field, as
- * we're writing the split chunks as we find them.
+ * Once we split a page, we stop filling in offset values, we're
+ * writing the split chunks as we find them.
*/
- uint8_t *start; /* Split's first byte */
+ size_t offset; /* Split's first byte */
/*
* The recno and entries fields are the starting record number
@@ -499,17 +499,16 @@ __rec_root_write(WT_SESSION_IMPL *session, WT_PAGE *page, uint32_t flags)
switch (page->type) {
case WT_PAGE_COL_INT:
WT_RET(__wt_page_alloc(session,
- WT_PAGE_COL_INT, 1, mod->mod_multi_entries, 1, &next));
+ WT_PAGE_COL_INT, 1, mod->mod_multi_entries, 0, &next));
break;
case WT_PAGE_ROW_INT:
WT_RET(__wt_page_alloc(session,
- WT_PAGE_ROW_INT, 0, mod->mod_multi_entries, 1, &next));
+ WT_PAGE_ROW_INT, 0, mod->mod_multi_entries, 0, &next));
break;
WT_ILLEGAL_VALUE(session);
}
- WT_ASSERT(session, session->split_gen != 0);
- pindex = WT_INTL_INDEX_COPY(next);
+ WT_INTL_INDEX_GET(session, next, pindex);
for (i = 0; i < mod->mod_multi_entries; ++i) {
WT_ERR(__wt_multi_to_ref(session,
next, &mod->mod_multi[i], &pindex->index[i], NULL));
@@ -1512,8 +1511,7 @@ __rec_leaf_page_max(WT_SESSION_IMPL *session, WT_RECONCILE *r)
static void
__rec_split_bnd_init(WT_SESSION_IMPL *session, WT_BOUNDARY *bnd)
{
- bnd->start = NULL;
-
+ bnd->offset = 0;
bnd->recno = 0;
bnd->entries = 0;
@@ -1527,7 +1525,10 @@ __rec_split_bnd_init(WT_SESSION_IMPL *session, WT_BOUNDARY *bnd)
bnd->skip_next = 0;
bnd->skip_allocated = 0;
- /* Ignore the key, we re-use that memory in each new reconciliation. */
+ /*
+ * Don't touch the key, we re-use that memory in each new
+ * reconciliation.
+ */
bnd->already_compressed = 0;
}
@@ -1542,8 +1543,8 @@ __rec_split_bnd_grow(WT_SESSION_IMPL *session, WT_RECONCILE *r)
/*
* Make sure there's enough room for another boundary. The calculation
* is +2, because when filling in the current boundary's information,
- * we save the start point of the next boundary (for example, a record
- * number or key), in the (current + 1) slot.
+ * we save start information for the next boundary (a byte offset and a
+ * record number or key), in the (current + 1) slot.
*
* For the same reason, we're always initializing one ahead.
*/
@@ -1692,7 +1693,7 @@ __rec_split_init(WT_SESSION_IMPL *session,
WT_RET(__rec_split_bnd_grow(session, r));
__rec_split_bnd_init(session, &r->bnd[0]);
r->bnd[0].recno = recno;
- r->bnd[0].start = WT_PAGE_HEADER_BYTE(btree, dsk);
+ r->bnd[0].offset = WT_PAGE_HEADER_BYTE_SIZE(btree);
/*
* If the maximum page size is the same as the split page size, either
@@ -1984,10 +1985,10 @@ __rec_split(WT_SESSION_IMPL *session, WT_RECONCILE *r, size_t next_len)
session, r, &next->key, dsk->type));
/*
- * Set the starting buffer address and clear the entries (the
+ * Set the starting buffer offset and clear the entries (the
* latter not required, but cleaner).
*/
- next->start = r->first_free;
+ next->offset = WT_PTRDIFF(r->first_free, dsk);
next->entries = 0;
/* Set the space available to another split-size chunk. */
@@ -2643,8 +2644,8 @@ __rec_split_fixup(WT_SESSION_IMPL *session, WT_RECONCILE *r)
WT_DECL_ITEM(tmp);
WT_DECL_RET;
WT_PAGE_HEADER *dsk;
- uint32_t i, len;
- uint8_t *dsk_start;
+ size_t i, len;
+ uint8_t *dsk_start, *p;
/*
* When we overflow physical limits of the page, we walk the list of
@@ -2672,14 +2673,14 @@ __rec_split_fixup(WT_SESSION_IMPL *session, WT_RECONCILE *r)
dsk_start = WT_PAGE_HEADER_BYTE(btree, dsk);
for (i = 0, bnd = r->bnd; i < r->bnd_next; ++i, ++bnd) {
/* Copy the page contents to the temporary buffer. */
- len = WT_PTRDIFF32((bnd + 1)->start, bnd->start);
- memcpy(dsk_start, bnd->start, len);
+ len = (bnd + 1)->offset - bnd->offset;
+ memcpy(dsk_start, (uint8_t *)r->dsk.mem + bnd->offset, len);
/* Finalize the header information and write the page. */
dsk->recno = bnd->recno;
dsk->u.entries = bnd->entries;
- dsk->mem_size =
- tmp->size = WT_PAGE_HEADER_BYTE_SIZE(btree) + len;
+ tmp->size = WT_PAGE_HEADER_BYTE_SIZE(btree) + len;
+ dsk->mem_size = WT_STORE_SIZE(tmp->size);
WT_ERR(__rec_split_write(session, r, bnd, tmp, 0));
}
@@ -2698,13 +2699,14 @@ __rec_split_fixup(WT_SESSION_IMPL *session, WT_RECONCILE *r)
* chunk, including header, because if there was room for that large a
* remnant, we wouldn't have switched from accumulating to a page end.
*/
- len = WT_PTRDIFF32(r->first_free, bnd->start);
+ p = (uint8_t *)r->dsk.mem + bnd->offset;
+ len = WT_PTRDIFF(r->first_free, p);
if (len >= r->split_size - WT_PAGE_HEADER_BYTE_SIZE(btree))
WT_PANIC_ERR(session, EINVAL,
"Reconciliation remnant too large for the split buffer");
dsk = r->dsk.mem;
dsk_start = WT_PAGE_HEADER_BYTE(btree, dsk);
- (void)memmove(dsk_start, bnd->start, len);
+ (void)memmove(dsk_start, p, len);
/*
* Fix up our caller's information, including updating the starting
@@ -2931,8 +2933,11 @@ __wt_bulk_init(WT_SESSION_IMPL *session, WT_CURSOR_BULK *cbulk)
WT_RET_MSG(session, EINVAL,
"bulk-load is only possible for newly created trees");
- /* Get a reference to the empty leaf page. */
- pindex = WT_INTL_INDEX_COPY(btree->root.page);
+ /*
+ * Get a reference to the empty leaf page; we have exclusive access so
+ * we can take a copy of the page, confident the parent won't split.
+ */
+ pindex = WT_INTL_INDEX_GET_SAFE(btree->root.page);
cbulk->ref = pindex->index[0];
cbulk->leaf = cbulk->ref->page;
@@ -3598,7 +3603,7 @@ __rec_col_var(WT_SESSION_IMPL *session,
WT_INSERT *ins;
WT_ITEM *last;
WT_UPDATE *upd;
- uint64_t n, nrepeat, repeat_count, rle, src_recno;
+ uint64_t n, nrepeat, repeat_count, rle, skip, src_recno;
uint32_t i, size;
int deleted, last_deleted, orig_deleted, update_no_copy;
const void *data;
@@ -3913,11 +3918,26 @@ compare: /*
for (n = WT_INSERT_RECNO(ins); src_recno <= n; ++src_recno) {
/*
* The application may have inserted records which left
- * gaps in the name space.
+ * gaps in the name space, and these gaps can be huge.
+ * If we're in a set of deleted records, skip the boring
+ * part.
*/
- if (src_recno < n)
+ if (src_recno < n) {
deleted = 1;
- else {
+ if (last_deleted) {
+ /*
+ * The record adjustment is decremented
+ * by one so we can naturally fall into
+ * the RLE accounting below, where we
+ * increment rle by one, then continue
+ * in the outer loop, where we increment
+ * src_recno by one.
+ */
+ skip = (n - src_recno) - 1;
+ rle += skip;
+ src_recno += skip;
+ }
+ } else {
deleted = WT_UPDATE_DELETED_ISSET(upd);
if (!deleted) {
data = WT_UPDATE_DATA(upd);
@@ -5453,15 +5473,6 @@ err: __wt_scr_free(session, &tmp);
}
/*
- * The dictionary --
- * The rest of this file is support for dictionaries.
- *
- * It's difficult to write generic skiplist functions without turning a single
- * memory allocation into two, or requiring a function call instead of a simple
- * comparison. Fortunately, skiplists are relatively simple things and we can
- * include them in-place. If you need generic skip-list functions to modify,
- * this set wouldn't be a bad place to start.
- *
* __rec_dictionary_skip_search --
* Search a dictionary skiplist.
*/
diff --git a/src/third_party/wiredtiger/src/schema/schema_create.c b/src/third_party/wiredtiger/src/schema/schema_create.c
index 80e443d8a21..c003ad90ca7 100644
--- a/src/third_party/wiredtiger/src/schema/schema_create.c
+++ b/src/third_party/wiredtiger/src/schema/schema_create.c
@@ -180,10 +180,11 @@ __create_colgroup(WT_SESSION_IMPL *session,
const char **cfgp, *cfg[4] =
{ WT_CONFIG_BASE(session, colgroup_meta), config, NULL, NULL };
const char *sourcecfg[] = { config, NULL, NULL };
- const char *cgname, *source, *tablename;
- char *cgconf, *sourceconf, *oldconf;
+ const char *cgname, *source, *sourceconf, *tablename;
+ char *cgconf, *oldconf;
- cgconf = sourceconf = oldconf = NULL;
+ sourceconf = NULL;
+ cgconf = oldconf = NULL;
WT_CLEAR(fmt);
WT_CLEAR(confbuf);
WT_CLEAR(namebuf);
@@ -244,7 +245,7 @@ __create_colgroup(WT_SESSION_IMPL *session,
table, cval.str, cval.len, NULL, 1, &fmt));
}
sourcecfg[1] = fmt.data;
- WT_ERR(__wt_config_concat(session, sourcecfg, &sourceconf));
+ WT_ERR(__wt_config_merge(session, sourcecfg, NULL, &sourceconf));
WT_ERR(__wt_schema_create(session, source, sourceconf));
@@ -322,13 +323,14 @@ __create_index(WT_SESSION_IMPL *session,
const char *cfg[4] =
{ WT_CONFIG_BASE(session, index_meta), NULL, NULL, NULL };
const char *sourcecfg[] = { config, NULL, NULL };
- const char *source, *idxname, *tablename;
- char *sourceconf, *idxconf;
+ const char *source, *sourceconf, *idxname, *tablename;
+ char *idxconf;
size_t tlen;
int have_extractor;
u_int i, npublic_cols;
- idxconf = sourceconf = NULL;
+ sourceconf = NULL;
+ idxconf = NULL;
WT_CLEAR(confbuf);
WT_CLEAR(fmt);
WT_CLEAR(extra_cols);
@@ -458,7 +460,7 @@ __create_index(WT_SESSION_IMPL *session,
session, &fmt, ",index_key_columns=%u", npublic_cols));
sourcecfg[1] = fmt.data;
- WT_ERR(__wt_config_concat(session, sourcecfg, &sourceconf));
+ WT_ERR(__wt_config_merge(session, sourcecfg, NULL, &sourceconf));
WT_ERR(__wt_schema_create(session, source, sourceconf));
@@ -573,7 +575,7 @@ __create_data_source(WT_SESSION_IMPL *session,
{
WT_CONFIG_ITEM cval;
const char *cfg[] = {
- WT_CONFIG_BASE(session, session_create), config, NULL };
+ WT_CONFIG_BASE(session, WT_SESSION_create), config, NULL };
/*
* Check to be sure the key/value formats are legal: the underlying
diff --git a/src/third_party/wiredtiger/src/schema/schema_open.c b/src/third_party/wiredtiger/src/schema/schema_open.c
index 5bc589f0781..414722652a0 100644
--- a/src/third_party/wiredtiger/src/schema/schema_open.c
+++ b/src/third_party/wiredtiger/src/schema/schema_open.c
@@ -187,13 +187,12 @@ __open_index(WT_SESSION_IMPL *session, WT_TABLE *table, WT_INDEX *idx)
/* Start with the declared index columns. */
WT_ERR(__wt_config_subinit(session, &colconf, &idx->colconf));
- npublic_cols = 0;
- while ((ret = __wt_config_next(&colconf, &ckey, &cval)) == 0) {
+ for (npublic_cols = 0;
+ (ret = __wt_config_next(&colconf, &ckey, &cval)) == 0;
+ ++npublic_cols)
WT_ERR(__wt_buf_catfmt(
session, buf, "%.*s,", (int)ckey.len, ckey.str));
- ++npublic_cols;
- }
- if (ret != 0 && ret != WT_NOTFOUND)
+ if (ret != WT_NOTFOUND)
goto err;
/*
diff --git a/src/third_party/wiredtiger/src/schema/schema_truncate.c b/src/third_party/wiredtiger/src/schema/schema_truncate.c
index 1eb76226aad..be9f6bcfb57 100644
--- a/src/third_party/wiredtiger/src/schema/schema_truncate.c
+++ b/src/third_party/wiredtiger/src/schema/schema_truncate.c
@@ -84,7 +84,7 @@ __truncate_dsrc(WT_SESSION_IMPL *session, const char *uri)
const char *cfg[2];
/* Open a cursor and traverse the object, removing every entry. */
- cfg[0] = WT_CONFIG_BASE(session, session_open_cursor);
+ cfg[0] = WT_CONFIG_BASE(session, WT_SESSION_open_cursor);
cfg[1] = NULL;
WT_RET(__wt_open_cursor(session, uri, NULL, cfg, &cursor));
while ((ret = cursor->next(cursor)) == 0)
diff --git a/src/third_party/wiredtiger/src/session/session_api.c b/src/third_party/wiredtiger/src/session/session_api.c
index 599c7bdf44a..ac24ae18c1d 100644
--- a/src/third_party/wiredtiger/src/session/session_api.c
+++ b/src/third_party/wiredtiger/src/session/session_api.c
@@ -385,7 +385,7 @@ __wt_session_create_strip(WT_SESSION *wt_session,
{
WT_SESSION_IMPL *session = (WT_SESSION_IMPL *)wt_session;
const char *cfg[] =
- { WT_CONFIG_BASE(session, session_create), v1, v2, NULL };
+ { WT_CONFIG_BASE(session, WT_SESSION_create), v1, v2, NULL };
return (__wt_config_collapse(session, cfg, value_ret));
}
diff --git a/src/third_party/wiredtiger/src/session/session_dhandle.c b/src/third_party/wiredtiger/src/session/session_dhandle.c
index 0825f783ca3..ce5f95a40d0 100644
--- a/src/third_party/wiredtiger/src/session/session_dhandle.c
+++ b/src/third_party/wiredtiger/src/session/session_dhandle.c
@@ -47,7 +47,7 @@ __session_add_dhandle(
* the schema lock.
*/
int
-__wt_session_lock_dhandle(WT_SESSION_IMPL *session, uint32_t flags)
+__wt_session_lock_dhandle(WT_SESSION_IMPL *session, uint32_t flags, int *deadp)
{
enum { NOLOCK, READLOCK, WRITELOCK } locked;
WT_BTREE *btree;
@@ -57,6 +57,8 @@ __wt_session_lock_dhandle(WT_SESSION_IMPL *session, uint32_t flags)
btree = S2BT(session);
dhandle = session->dhandle;
locked = NOLOCK;
+ if (deadp != NULL)
+ *deadp = 0;
/*
* Special operation flags will cause the handle to be reopened.
@@ -95,7 +97,10 @@ __wt_session_lock_dhandle(WT_SESSION_IMPL *session, uint32_t flags)
* required, we're done. Otherwise, check that the handle is open and
* that no special flags are required.
*/
- if (LF_ISSET(WT_DHANDLE_LOCK_ONLY) ||
+ if (F_ISSET(dhandle, WT_DHANDLE_DEAD)) {
+ WT_ASSERT(session, deadp != NULL);
+ *deadp = 1;
+ } else if (LF_ISSET(WT_DHANDLE_LOCK_ONLY) ||
(F_ISSET(dhandle, WT_DHANDLE_OPEN) && special_flags == 0))
return (0);
@@ -135,46 +140,25 @@ __wt_session_release_btree(WT_SESSION_IMPL *session)
dhandle = session->dhandle;
locked = F_ISSET(dhandle, WT_DHANDLE_EXCLUSIVE) ? WRITELOCK : READLOCK;
- if (F_ISSET(dhandle, WT_DHANDLE_DISCARD_CLOSE)) {
- /*
- * If configured to discard on last close, trade any read lock
- * for an exclusive lock. If the exchange succeeds, setup for
- * discard. It is expected acquiring an exclusive lock will fail
- * sometimes since the handle may still be in use: in that case
- * we're done.
- */
- if (locked == READLOCK) {
- locked = NOLOCK;
- WT_ERR(__wt_readunlock(session, dhandle->rwlock));
- ret = __wt_try_writelock(session, dhandle->rwlock);
- if (ret != 0) {
- if (ret == EBUSY)
- ret = 0;
- goto err;
- }
- locked = WRITELOCK;
- F_CLR(dhandle, WT_DHANDLE_DISCARD_CLOSE);
- F_SET(dhandle,
- WT_DHANDLE_DISCARD | WT_DHANDLE_EXCLUSIVE);
- }
- }
-
/*
* If we had special flags set, close the handle so that future access
* can get a handle without special flags.
*/
- if (F_ISSET(dhandle, WT_DHANDLE_DISCARD) ||
+ if (F_ISSET(dhandle, WT_DHANDLE_DISCARD_FORCE)) {
+ WT_WITH_DHANDLE_LOCK(session,
+ ret = __wt_conn_btree_sync_and_close(session, 0, 1));
+ F_CLR(dhandle, WT_DHANDLE_DISCARD_FORCE);
+ } else if (F_ISSET(dhandle, WT_DHANDLE_DISCARD) ||
F_ISSET(btree, WT_BTREE_SPECIAL_FLAGS)) {
WT_ASSERT(session, F_ISSET(dhandle, WT_DHANDLE_EXCLUSIVE));
+ ret = __wt_conn_btree_sync_and_close(session, 0, 0);
F_CLR(dhandle, WT_DHANDLE_DISCARD);
-
- WT_TRET(__wt_conn_btree_sync_and_close(session, 0, 0));
}
if (F_ISSET(dhandle, WT_DHANDLE_EXCLUSIVE))
F_CLR(dhandle, WT_DHANDLE_EXCLUSIVE);
-err: switch (locked) {
+ switch (locked) {
case NOLOCK:
break;
case READLOCK:
@@ -312,7 +296,8 @@ __session_dhandle_sweep(WT_SESSION_IMPL *session)
dhandle = dhandle_cache->dhandle;
if (dhandle != session->dhandle &&
dhandle->session_inuse == 0 &&
- now - dhandle->timeofdeath > conn->sweep_idle_time) {
+ (F_ISSET(dhandle, WT_DHANDLE_DEAD) ||
+ now - dhandle->timeofdeath > conn->sweep_idle_time)) {
WT_STAT_FAST_CONN_INCR(session, dh_session_handles);
__session_discard_btree(session, dhandle_cache);
}
@@ -348,6 +333,7 @@ __wt_session_get_btree(WT_SESSION_IMPL *session,
WT_DATA_HANDLE_CACHE *dhandle_cache;
WT_DECL_RET;
uint64_t bucket;
+ int is_dead;
WT_ASSERT(session, !F_ISSET(session, WT_SESSION_NO_DATA_HANDLES));
WT_ASSERT(session, !LF_ISSET(WT_DHANDLE_HAVE_REF));
@@ -381,7 +367,8 @@ __wt_session_get_btree(WT_SESSION_IMPL *session,
if (dhandle != NULL) {
/* Try to lock the handle; if this succeeds, we're done. */
- if ((ret = __wt_session_lock_dhandle(session, flags)) == 0)
+ if ((ret =
+ __wt_session_lock_dhandle(session, flags, &is_dead)) == 0)
goto done;
/* Propagate errors we don't expect. */
@@ -389,17 +376,23 @@ __wt_session_get_btree(WT_SESSION_IMPL *session,
return (ret);
/*
- * Don't try harder to get the btree handle if our caller
- * hasn't allowed us to take the schema lock - they do so on
- * purpose and will handle error returns.
+ * Don't try harder to get the handle if we're only checking
+ * for locks or our caller hasn't allowed us to take the schema
+ * lock - they do so on purpose and will handle error returns.
*/
- if (!F_ISSET(session, WT_SESSION_SCHEMA_LOCKED) &&
+ if ((LF_ISSET(WT_DHANDLE_LOCK_ONLY) && ret == EBUSY) ||
+ (!F_ISSET(session, WT_SESSION_SCHEMA_LOCKED) &&
F_ISSET(session,
- WT_SESSION_HANDLE_LIST_LOCKED | WT_SESSION_TABLE_LOCKED))
+ WT_SESSION_HANDLE_LIST_LOCKED | WT_SESSION_TABLE_LOCKED)))
return (ret);
- /* We found the data handle, don't try to get it again. */
- LF_SET(WT_DHANDLE_HAVE_REF);
+ /* If we found the handle and it isn't dead, reopen it. */
+ if (is_dead) {
+ __session_discard_btree(session, dhandle_cache);
+ dhandle_cache = NULL;
+ session->dhandle = dhandle = NULL;
+ } else
+ LF_SET(WT_DHANDLE_HAVE_REF);
}
/*
@@ -419,11 +412,11 @@ __wt_session_get_btree(WT_SESSION_IMPL *session,
WT_RET(__session_add_dhandle(session, NULL));
WT_ASSERT(session, LF_ISSET(WT_DHANDLE_LOCK_ONLY) ||
- F_ISSET(session->dhandle, WT_DHANDLE_OPEN));
+ (F_ISSET(session->dhandle, WT_DHANDLE_OPEN) &&
+ !F_ISSET(session->dhandle, WT_DHANDLE_DEAD)));
done: WT_ASSERT(session, LF_ISSET(WT_DHANDLE_EXCLUSIVE) ==
F_ISSET(session->dhandle, WT_DHANDLE_EXCLUSIVE));
- F_SET(session->dhandle, LF_ISSET(WT_DHANDLE_DISCARD_CLOSE));
return (0);
}
@@ -438,9 +431,18 @@ __wt_session_lock_checkpoint(WT_SESSION_IMPL *session, const char *checkpoint)
WT_DATA_HANDLE *dhandle, *saved_dhandle;
WT_DECL_RET;
+ WT_ASSERT(session, WT_META_TRACKING(session));
saved_dhandle = session->dhandle;
/*
+ * If we already have the checkpoint locked, don't attempt to lock
+ * it again.
+ */
+ if ((ret = __wt_meta_track_find_handle(
+ session, saved_dhandle->name, checkpoint)) != WT_NOTFOUND)
+ return (ret);
+
+ /*
* Get the checkpoint handle exclusive, so no one else can access it
* while we are creating the new checkpoint.
*/
@@ -463,7 +465,6 @@ __wt_session_lock_checkpoint(WT_SESSION_IMPL *session, const char *checkpoint)
dhandle = session->dhandle;
F_SET(dhandle, WT_DHANDLE_DISCARD);
- WT_ASSERT(session, WT_META_TRACKING(session));
WT_ERR(__wt_meta_track_handle_lock(session, 0));
/* Restore the original btree in the session. */
diff --git a/src/third_party/wiredtiger/src/support/err.c b/src/third_party/wiredtiger/src/support/err.c
index fc6569cb81e..e9b7a53a2ab 100644
--- a/src/third_party/wiredtiger/src/support/err.c
+++ b/src/third_party/wiredtiger/src/support/err.c
@@ -16,15 +16,12 @@ static int
__handle_error_default(WT_EVENT_HANDLER *handler,
WT_SESSION *wt_session, int error, const char *errmsg)
{
- WT_SESSION_IMPL *session;
-
WT_UNUSED(handler);
+ WT_UNUSED(wt_session);
WT_UNUSED(error);
- session = (WT_SESSION_IMPL *)wt_session;
-
- WT_RET(__wt_fprintf(session, stderr, "%s\n", errmsg));
- WT_RET(__wt_fflush(session, stderr));
+ WT_RET(__wt_fprintf(stderr, "%s\n", errmsg));
+ WT_RET(__wt_fflush(stderr));
return (0);
}
@@ -36,14 +33,11 @@ static int
__handle_message_default(WT_EVENT_HANDLER *handler,
WT_SESSION *wt_session, const char *message)
{
- WT_SESSION_IMPL *session;
-
WT_UNUSED(handler);
+ WT_UNUSED(wt_session);
- session = (WT_SESSION_IMPL *)wt_session;
-
- WT_RET(__wt_fprintf(session, stdout, "%s\n", message));
- WT_RET(__wt_fflush(session, stdout));
+ WT_RET(__wt_fprintf(stdout, "%s\n", message));
+ WT_RET(__wt_fflush(stdout));
return (0);
}
@@ -181,23 +175,23 @@ __wt_eventv(WT_SESSION_IMPL *session, int msg_event, int error,
* example, we can end up here without a session.)
*/
if (session == NULL) {
- WT_RET(__wt_fprintf(session, stderr,
+ WT_RET(__wt_fprintf(stderr,
"WiredTiger Error%s%s: ",
error == 0 ? "" : ": ",
error == 0 ? "" : __wt_strerror(session, error, NULL, 0)));
- WT_RET(__wt_vfprintf(session, stderr, fmt, ap));
- WT_RET(__wt_fprintf(session, stderr, "\n"));
- return (__wt_fflush(session, stderr));
+ WT_RET(__wt_vfprintf(stderr, fmt, ap));
+ WT_RET(__wt_fprintf(stderr, "\n"));
+ return (__wt_fflush(stderr));
}
p = s;
end = s + sizeof(s);
/*
- * We have several prefixes for the error message:
- * a timestamp and the process and thread ids, the database error
- * prefix, the data-source's name, and the session's name. Write them
- * as a comma-separate list, followed by a colon.
+ * We have several prefixes for the error message: a timestamp and the
+ * process and thread ids, the database error prefix, the data-source's
+ * name, and the session's name. Write them as a comma-separate list,
+ * followed by a colon.
*/
prefix_cnt = 0;
if (__wt_epoch(session, &ts) == 0) {
diff --git a/src/third_party/wiredtiger/src/support/filename.c b/src/third_party/wiredtiger/src/support/filename.c
index db466ed3bd4..2d284aeb0b0 100644
--- a/src/third_party/wiredtiger/src/support/filename.c
+++ b/src/third_party/wiredtiger/src/support/filename.c
@@ -104,7 +104,7 @@ __wt_sync_and_rename_fp(
*fpp = NULL;
/* Flush to disk and close the handle. */
- WT_RET(__wt_fclose(session, &fp, WT_FHANDLE_WRITE));
+ WT_RET(__wt_fclose(&fp, WT_FHANDLE_WRITE));
/* Rename the source file to the target. */
WT_RET(__wt_rename(session, from, to));
diff --git a/src/third_party/wiredtiger/src/support/hazard.c b/src/third_party/wiredtiger/src/support/hazard.c
index bc44f7967a5..37cb8bf6ce0 100644
--- a/src/third_party/wiredtiger/src/support/hazard.c
+++ b/src/third_party/wiredtiger/src/support/hazard.c
@@ -33,7 +33,7 @@ __wt_hazard_set(WT_SESSION_IMPL *session, WT_REF *ref, int *busyp
*busyp = 0;
/* If a file can never be evicted, hazard pointers aren't required. */
- if (F_ISSET(btree, WT_BTREE_NO_HAZARD))
+ if (F_ISSET(btree, WT_BTREE_IN_MEMORY))
return (0);
/*
@@ -142,7 +142,7 @@ __wt_hazard_clear(WT_SESSION_IMPL *session, WT_PAGE *page)
btree = S2BT(session);
/* If a file can never be evicted, hazard pointers aren't required. */
- if (F_ISSET(btree, WT_BTREE_NO_HAZARD))
+ if (F_ISSET(btree, WT_BTREE_IN_MEMORY))
return (0);
/*
diff --git a/src/third_party/wiredtiger/src/support/scratch.c b/src/third_party/wiredtiger/src/support/scratch.c
index 957101b8fae..ebea484a51f 100644
--- a/src/third_party/wiredtiger/src/support/scratch.c
+++ b/src/third_party/wiredtiger/src/support/scratch.c
@@ -269,6 +269,8 @@ __wt_scr_discard(WT_SESSION_IMPL *session)
__wt_free(session, *bufp);
}
+ session->scratch_alloc = 0;
+ session->scratch_cached = 0;
__wt_free(session, session->scratch);
#ifdef HAVE_DIAGNOSTIC
__wt_free(session, session->scratch_track);
diff --git a/src/third_party/wiredtiger/src/support/stat.c b/src/third_party/wiredtiger/src/support/stat.c
index 824914bf8bf..aa30126ca91 100644
--- a/src/third_party/wiredtiger/src/support/stat.c
+++ b/src/third_party/wiredtiger/src/support/stat.c
@@ -253,6 +253,16 @@ __wt_stat_aggregate_dsrc_stats(const void *child, const void *parent)
p->btree_column_internal.v += c->btree_column_internal.v;
p->btree_column_deleted.v += c->btree_column_deleted.v;
p->btree_column_variable.v += c->btree_column_variable.v;
+ if (c->btree_maxintlkey.v > p->btree_maxintlkey.v)
+ p->btree_maxintlkey.v = c->btree_maxintlkey.v;
+ if (c->btree_maxintlpage.v > p->btree_maxintlpage.v)
+ p->btree_maxintlpage.v = c->btree_maxintlpage.v;
+ if (c->btree_maxleafkey.v > p->btree_maxleafkey.v)
+ p->btree_maxleafkey.v = c->btree_maxleafkey.v;
+ if (c->btree_maxleafpage.v > p->btree_maxleafpage.v)
+ p->btree_maxleafpage.v = c->btree_maxleafpage.v;
+ if (c->btree_maxleafvalue.v > p->btree_maxleafvalue.v)
+ p->btree_maxleafvalue.v = c->btree_maxleafvalue.v;
if (c->btree_maximum_depth.v > p->btree_maximum_depth.v)
p->btree_maximum_depth.v = c->btree_maximum_depth.v;
p->btree_entries.v += c->btree_entries.v;
@@ -301,6 +311,7 @@ __wt_stat_aggregate_dsrc_stats(const void *child, const void *parent)
p->bloom_page_evict.v += c->bloom_page_evict.v;
p->bloom_page_read.v += c->bloom_page_read.v;
p->bloom_count.v += c->bloom_count.v;
+ p->lsm_chunk_count.v += c->lsm_chunk_count.v;
if (c->lsm_generation_max.v > p->lsm_generation_max.v)
p->lsm_generation_max.v = c->lsm_generation_max.v;
p->lsm_lookup_no_bloom.v += c->lsm_lookup_no_bloom.v;
@@ -550,7 +561,6 @@ __wt_stat_refresh_connection_stats(void *stats_arg)
stats = (WT_CONNECTION_STATS *)stats_arg;
stats->async_cur_queue.v = 0;
- stats->async_max_queue.v = 0;
stats->async_alloc_race.v = 0;
stats->async_flush.v = 0;
stats->async_alloc_view.v = 0;
@@ -582,7 +592,6 @@ __wt_stat_refresh_connection_stats(void *stats_arg)
stats->cache_eviction_hazard.v = 0;
stats->cache_inmem_split.v = 0;
stats->cache_eviction_internal.v = 0;
- stats->cache_eviction_maximum_page_size.v = 0;
stats->cache_eviction_dirty.v = 0;
stats->cache_eviction_deepen.v = 0;
stats->cache_eviction_force.v = 0;
diff --git a/src/third_party/wiredtiger/src/txn/txn.c b/src/third_party/wiredtiger/src/txn/txn.c
index a1bec569ce7..fb0a4b7fa6d 100644
--- a/src/third_party/wiredtiger/src/txn/txn.c
+++ b/src/third_party/wiredtiger/src/txn/txn.c
@@ -34,8 +34,11 @@ __txn_sort_snapshot(WT_SESSION_IMPL *session, uint32_t n, uint64_t snap_max)
txn = &session->txn;
- if (n > 1)
+ if (n <= 10)
+ WT_INSERTION_SORT(txn->snapshot, n, uint64_t, TXNID_LT);
+ else
qsort(txn->snapshot, n, sizeof(uint64_t), __wt_txnid_cmp);
+
txn->snapshot_count = n;
txn->snap_max = snap_max;
txn->snap_min = (n > 0 && TXNID_LE(txn->snapshot[0], snap_max)) ?
@@ -261,11 +264,11 @@ __wt_txn_refresh(WT_SESSION_IMPL *session, int get_snapshot)
}
/*
- * __wt_txn_begin --
- * Begin a transaction.
+ * __wt_txn_config --
+ * Configure a transaction.
*/
int
-__wt_txn_begin(WT_SESSION_IMPL *session, const char *cfg[])
+__wt_txn_config(WT_SESSION_IMPL *session, const char *cfg[])
{
WT_CONFIG_ITEM cval;
WT_TXN *txn;
@@ -273,9 +276,7 @@ __wt_txn_begin(WT_SESSION_IMPL *session, const char *cfg[])
txn = &session->txn;
WT_RET(__wt_config_gets_def(session, cfg, "isolation", 0, &cval));
- if (cval.len == 0)
- txn->isolation = session->isolation;
- else
+ if (cval.len != 0)
txn->isolation =
WT_STRING_MATCH("snapshot", cval.str, cval.len) ?
TXN_ISO_SNAPSHOT :
@@ -291,18 +292,11 @@ __wt_txn_begin(WT_SESSION_IMPL *session, const char *cfg[])
* the connection-wide flag and not overridden here, we end up clearing
* all flags.
*/
- txn->txn_logsync = S2C(session)->txn_logsync;
WT_RET(__wt_config_gets_def(session, cfg, "sync",
FLD_ISSET(txn->txn_logsync, WT_LOG_FLUSH) ? 1 : 0, &cval));
if (!cval.val)
txn->txn_logsync = 0;
- F_SET(txn, TXN_RUNNING);
- if (txn->isolation == TXN_ISO_SNAPSHOT) {
- if (session->ncursors > 0)
- WT_RET(__wt_session_copy_values(session));
- __wt_txn_refresh(session, 1);
- }
return (0);
}
diff --git a/src/third_party/wiredtiger/src/txn/txn_ckpt.c b/src/third_party/wiredtiger/src/txn/txn_ckpt.c
index 7c1532390f9..45560ff897a 100644
--- a/src/third_party/wiredtiger/src/txn/txn_ckpt.c
+++ b/src/third_party/wiredtiger/src/txn/txn_ckpt.c
@@ -349,9 +349,8 @@ __wt_txn_checkpoint(WT_SESSION_IMPL *session, const char *cfg[])
WT_TXN *txn;
WT_TXN_GLOBAL *txn_global;
WT_TXN_ISOLATION saved_isolation;
- const char *txn_cfg[] =
- { WT_CONFIG_BASE(session, session_begin_transaction),
- "isolation=snapshot", NULL };
+ const char *txn_cfg[] = { WT_CONFIG_BASE(session,
+ WT_SESSION_begin_transaction), "isolation=snapshot", NULL };
void *saved_meta_next;
int full, logging, tracking;
u_int i;
@@ -1090,7 +1089,7 @@ __wt_checkpoint_sync(WT_SESSION_IMPL *session, const char *cfg[])
* Checkpoint a single file as part of closing the handle.
*/
int
-__wt_checkpoint_close(WT_SESSION_IMPL *session, int final, int force)
+__wt_checkpoint_close(WT_SESSION_IMPL *session, int final)
{
WT_BTREE *btree;
WT_DECL_RET;
@@ -1099,8 +1098,8 @@ __wt_checkpoint_close(WT_SESSION_IMPL *session, int final, int force)
btree = S2BT(session);
bulk = F_ISSET(btree, WT_BTREE_BULK) ? 1 : 0;
- /* Handle forced discard (when dropping a file). */
- if (force)
+ /* If the handle is already dead, force the discard. */
+ if (F_ISSET(session->dhandle, WT_DHANDLE_DEAD))
return (__wt_cache_op(session, NULL, WT_SYNC_DISCARD_FORCE));
/*
diff --git a/src/third_party/wiredtiger/src/txn/txn_log.c b/src/third_party/wiredtiger/src/txn/txn_log.c
index d3e010cf401..901785628e1 100644
--- a/src/third_party/wiredtiger/src/txn/txn_log.c
+++ b/src/third_party/wiredtiger/src/txn/txn_log.c
@@ -302,7 +302,7 @@ __wt_txn_checkpoint_log(
switch (flags) {
case WT_TXN_LOG_CKPT_PREPARE:
txn->full_ckpt = 1;
- *ckpt_lsn = S2C(session)->log->alloc_lsn;
+ *ckpt_lsn = S2C(session)->log->write_start_lsn;
break;
case WT_TXN_LOG_CKPT_START:
@@ -327,7 +327,7 @@ __wt_txn_checkpoint_log(
txn->ckpt_nsnapshot = 0;
WT_CLEAR(empty);
ckpt_snapshot = &empty;
- *ckpt_lsn = S2C(session)->log->alloc_lsn;
+ *ckpt_lsn = S2C(session)->log->write_start_lsn;
} else
ckpt_snapshot = txn->ckpt_snapshot;
@@ -440,7 +440,8 @@ __wt_txn_truncate_end(WT_SESSION_IMPL *session)
*/
static int
__txn_printlog(WT_SESSION_IMPL *session,
- WT_ITEM *rawrec, WT_LSN *lsnp, void *cookie, int firstrecord)
+ WT_ITEM *rawrec, WT_LSN *lsnp, WT_LSN *next_lsnp,
+ void *cookie, int firstrecord)
{
FILE *out;
WT_LOG_RECORD *logrec;
@@ -452,6 +453,7 @@ __txn_printlog(WT_SESSION_IMPL *session,
const uint8_t *end, *p;
const char *msg;
+ WT_UNUSED(next_lsnp);
out = cookie;
p = LOG_SKIP_HEADER(rawrec->data);
diff --git a/src/third_party/wiredtiger/src/txn/txn_recover.c b/src/third_party/wiredtiger/src/txn/txn_recover.c
index bc098875abf..571754bf5bf 100644
--- a/src/third_party/wiredtiger/src/txn/txn_recover.c
+++ b/src/third_party/wiredtiger/src/txn/txn_recover.c
@@ -41,8 +41,8 @@ __recovery_cursor(WT_SESSION_IMPL *session, WT_RECOVERY *r,
WT_LSN *lsnp, u_int id, int duplicate, WT_CURSOR **cp)
{
WT_CURSOR *c;
- const char *cfg[] = { WT_CONFIG_BASE(session, session_open_cursor),
- "overwrite", NULL };
+ const char *cfg[] = { WT_CONFIG_BASE(
+ session, WT_SESSION_open_cursor), "overwrite", NULL };
int metadata_op;
c = NULL;
@@ -263,13 +263,15 @@ __txn_commit_apply(
*/
static int
__txn_log_recover(WT_SESSION_IMPL *session,
- WT_ITEM *logrec, WT_LSN *lsnp, void *cookie, int firstrecord)
+ WT_ITEM *logrec, WT_LSN *lsnp, WT_LSN *next_lsnp,
+ void *cookie, int firstrecord)
{
WT_RECOVERY *r;
const uint8_t *end, *p;
uint64_t txnid;
uint32_t rectype;
+ WT_UNUSED(next_lsnp);
r = cookie;
p = LOG_SKIP_HEADER(logrec->data);
end = (const uint8_t *)logrec->data + logrec->size;
@@ -374,32 +376,30 @@ __recovery_free(WT_RECOVERY *r)
static int
__recovery_file_scan(WT_RECOVERY *r)
{
- WT_DECL_RET;
WT_CURSOR *c;
- const char *uri, *config;
+ WT_DECL_RET;
int cmp;
+ const char *uri, *config;
/* Scan through all files in the metadata. */
c = r->files[0].c;
c->set_key(c, "file:");
if ((ret = c->search_near(c, &cmp)) != 0) {
/* Is the metadata empty? */
- if (ret == WT_NOTFOUND)
- ret = 0;
- goto err;
+ WT_RET_NOTFOUND_OK(ret);
+ return (0);
}
if (cmp < 0)
- WT_ERR_NOTFOUND_OK(c->next(c));
+ WT_RET_NOTFOUND_OK(c->next(c));
for (; ret == 0; ret = c->next(c)) {
- WT_ERR(c->get_key(c, &uri));
+ WT_RET(c->get_key(c, &uri));
if (!WT_PREFIX_MATCH(uri, "file:"))
break;
- WT_ERR(c->get_value(c, &config));
- WT_ERR(__recovery_setup_file(r, uri, config));
+ WT_RET(c->get_value(c, &config));
+ WT_RET(__recovery_setup_file(r, uri, config));
}
- WT_ERR_NOTFOUND_OK(ret);
-
-err: return (ret);
+ WT_RET_NOTFOUND_OK(ret);
+ return (0);
}
/*
diff --git a/src/third_party/wiredtiger/src/utilities/util_load.c b/src/third_party/wiredtiger/src/utilities/util_load.c
index 994df10b70b..f4f173b90c2 100644
--- a/src/third_party/wiredtiger/src/utilities/util_load.c
+++ b/src/third_party/wiredtiger/src/utilities/util_load.c
@@ -11,7 +11,6 @@
static int config_read(WT_SESSION *, char ***, int *);
static int config_rename(WT_SESSION *, char **, const char *);
-static void config_remove(char *, const char *);
static int format(WT_SESSION *);
static int insert(WT_CURSOR *, const char *);
static int load_dump(WT_SESSION *);
@@ -350,13 +349,11 @@ config_reorder(WT_SESSION *session, char **list)
int
config_update(WT_SESSION *session, char **list)
{
+ WT_DECL_RET;
int found;
- const char *cfg[] = { NULL, NULL, NULL };
+ size_t cnt;
+ const char *p, **cfg;
char **configp, **listp;
- const char **rm;
- static const char *rmnames[] = {
- "filename", "id", "checkpoint", "checkpoint_lsn",
- "version", "source", NULL };
/*
* If the object has been renamed, replace all of the column group,
@@ -383,59 +380,29 @@ config_update(WT_SESSION *session, char **list)
}
/*
- * Remove all "filename=", "source=" and other configurations
- * that foil loading from the values. New filenames are chosen
- * as part of table load.
- */
- for (listp = list; *listp != NULL; listp += 2)
- for (rm = rmnames; *rm != NULL; rm++)
- if (strstr(listp[1], *rm) != NULL)
- config_remove(listp[1], *rm);
-
- /*
- * It's possible to update everything except the key/value formats.
+ * Updating the key/value formats seems like an easy mistake to make.
* If there were command-line configuration pairs, walk the list of
- * command-line configuration strings, and check.
+ * command-line configuration strings and check.
*/
for (configp = cmdconfig;
- cmdconfig != NULL && *configp != NULL; configp += 2)
+ configp != NULL && *configp != NULL; configp += 2)
if (strstr(configp[1], "key_format=") ||
strstr(configp[1], "value_format="))
return (util_err(session, 0,
- "the command line configuration string may not "
- "modify the object's key or value format"));
+ "an object's key or value format may not be "
+ "modified"));
/*
* If there were command-line configuration pairs, walk the list of
- * command-line URIs and find a matching dump URI. For each match,
- * rewrite the dump configuration as described by the command-line
- * configuration. It is an error if a command-line URI doesn't find
- * a single, exact match, that's likely a mistake.
+ * command-line URIs and find a matching dump URI. It is an error
+ * if a command-line URI doesn't find a single, exact match, that's
+ * likely a mistake.
*/
for (configp = cmdconfig;
- cmdconfig != NULL && *configp != NULL; configp += 2) {
- found = 0;
- for (listp = list; *listp != NULL; listp += 2) {
- if (strncmp(*configp, listp[0], strlen(*configp)) != 0)
- continue;
- /*
- * !!!
- * We support JSON configuration strings, which leads to
- * configuration strings with brackets. Unfortunately,
- * that implies we can't simply append new configuration
- * strings to existing ones. We call an unpublished
- * WiredTiger API to do the concatenation: if anyone
- * else ever needs it we can make it public, but I think
- * that's unlikely. We're also playing fast and loose
- * with types, but it should work.
- */
- cfg[0] = listp[1];
- cfg[1] = configp[1];
- if (__wt_config_concat(
- (WT_SESSION_IMPL *)session, cfg, &listp[1]) != 0)
- return (1);
- ++found;
- }
+ configp != NULL && *configp != NULL; configp += 2) {
+ for (found = 0, listp = list; *listp != NULL; listp += 2)
+ if (strncmp(*configp, listp[0], strlen(*configp)) == 0)
+ ++found;
switch (found) {
case 0:
return (util_err(session, 0,
@@ -451,8 +418,46 @@ config_update(WT_SESSION *session, char **list)
}
}
- /* Leak the memory, I don't care. */
- return (0);
+ /*
+ * Allocate a big enough configuration stack to hold all of the command
+ * line arguments, a list of configuration values to remove, and the
+ * base configuration values, plus some slop.
+ */
+ for (cnt = 0, configp = cmdconfig;
+ cmdconfig != NULL && *configp != NULL; configp += 2)
+ ++cnt;
+ if ((cfg = calloc(cnt + 10, sizeof(cfg[0]))) == NULL)
+ return (util_err(session, errno, NULL));
+
+ /*
+ * For each match, rewrite the dump configuration as described by any
+ * command-line configuration arguments.
+ *
+ * New filenames will be chosen as part of the table load, remove all
+ * "filename=", "source=" and other configurations that foil loading
+ * from the values; we call an unpublished API to do the work.
+ */
+ for (listp = list; *listp != NULL; listp += 2) {
+ cnt = 0;
+ cfg[cnt++] = listp[1];
+ for (configp = cmdconfig;
+ cmdconfig != NULL && *configp != NULL; configp += 2)
+ if (strncmp(*configp, listp[0], strlen(*configp)) == 0)
+ cfg[cnt++] = configp[1];
+ cfg[cnt++] = NULL;
+
+ if ((ret = __wt_config_merge((WT_SESSION_IMPL *)session,
+ cfg,
+ "filename=,id=,"
+ "checkpoint=,checkpoint_lsn=,version=,source=,",
+ &p)) != 0)
+ break;
+
+ free(listp[1]);
+ listp[1] = (char *)p;
+ }
+ free(cfg);
+ return (ret);
}
/*
@@ -487,46 +492,6 @@ config_rename(WT_SESSION *session, char **urip, const char *name)
}
/*
- * config_remove --
- * Remove a single config key and its value.
- */
-static void
-config_remove(char *config, const char *ckey)
-{
- int parens, quoted;
- char *begin, match[100], *next, *p;
-
- snprintf(match, sizeof(match), "%s=", ckey);
- if ((begin = strstr(config, match)) != NULL) {
- parens = 0;
- quoted = 0;
- next = NULL;
- for (p = begin + strlen(match); !next && *p; p++)
- switch (*p) {
- case '(':
- if (!quoted)
- parens++;
- break;
- case ')':
- if (!quoted)
- parens--;
- break;
- case '"':
- quoted = !quoted;
- break;
- case ',':
- if (!quoted && parens == 0)
- next = p + 1;
- break;
- }
- if (next)
- memmove(begin, next, strlen(next) + 1);
- else
- *begin = '\0';
- }
-}
-
-/*
* format --
* The input doesn't match the dump format.
*/
diff --git a/src/third_party/wiredtiger/tools/wtstats/stat_data.py b/src/third_party/wiredtiger/tools/wtstats/stat_data.py
index a4fc2fcc831..db5b14d6cd6 100644
--- a/src/third_party/wiredtiger/tools/wtstats/stat_data.py
+++ b/src/third_party/wiredtiger/tools/wtstats/stat_data.py
@@ -62,8 +62,10 @@ no_scale_per_second_list = [
'session: open cursor count',
]
no_clear_list = [
+ 'async: maximum work queue length',
'cache: bytes currently in the cache',
'cache: maximum bytes configured',
+ 'cache: maximum page size at eviction',
'cache: pages currently held in the cache',
'cache: percentage overhead',
'cache: tracked bytes belonging to internal pages in the cache',
diff --git a/src/third_party/wiredtiger/tools/wtstats/wtstats.html.template b/src/third_party/wiredtiger/tools/wtstats/wtstats.html.template
index 6d4376c1d82..1780ecfe037 100644
--- a/src/third_party/wiredtiger/tools/wtstats/wtstats.html.template
+++ b/src/third_party/wiredtiger/tools/wtstats/wtstats.html.template
@@ -10011,17 +10011,26 @@ svg.multiline .line {
}
</style></head><body><div id="app"></div></body><script type="text/javascript">(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
(function (global){
-!function t(e,n,r){function i(a,u){if(!n[a]){if(!e[a]){var s="function"==typeof require&&require;if(!u&&s)return s(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[a]={exports:{}};e[a][0].call(c.exports,function(t){var n=e[a][1][t];return i(n?n:t)},c,c.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(t){{var e=(window.$=window.jQuery=t("jquery"),t("../views/app")),n=t("../models/app");t("debug")("index")}t("bootstrap/js/dropdown"),t("bootstrap/js/collapse"),t("bootstrap/js/transition"),t("bootstrap/js/button");var data="### INSERT DATA HERE ###",r=window.app=new n(data,{parse:!0}),i=document.getElementById("app"),o=new e({model:r,el:i});o.render()},{"../models/app":2,"../views/app":63,"bootstrap/js/button":51,"bootstrap/js/collapse":52,"bootstrap/js/dropdown":53,"bootstrap/js/transition":54,debug:57,jquery:61}],2:[function(t,e){{var n=t("ampersand-state"),r=t("./chart"),i=t("./stat-collection"),o=t("./sidebar"),a=t("lodash"),u=t("debug")("model:app");e.exports=n.extend({children:{sidebar:o,chart:r},collections:{stats:i},props:{selectionState:{type:"array","default":function(){return[]}}},parse:function(t){var e=(new Date).getFullYear(),n={},r=a.map(t.series,function(t){if(-1!==t.key.indexOf(":"))var r=t.key.split(":"),i=r[0].trim(),o=r[1].trim();else var i="stats",o=t.key;var data=a.sortBy(a.map(t.values,function(t,n){var r=n.split(" ");r.splice(2,0,e.toString());var i=r.join(" ");return{x:new Date(i),y:t}}),"x"),u=Math.min.apply(null,data.map(function(t){return t.x}));return data.forEach(function(t){t.xrel=(t.x-u)/1e3}),n[i]=!0,{group:i,name:o,data:data}});n=a.keys(n).map(function(t){return{title:t}});var i={stats:r,sidebar:{panels:n}};return i},initialize:function(){var t=this.sidebar.panels;t.each(function(t){t.app=this}.bind(this)),this.stats.each(function(e){e.app=this,t.get(e.group).stats.add(e)}.bind(this))},clearSelectionState:function(){this.selectionState=[],u("clear")},toggleAllExcept:function(t){this.stats.filter(function(e){return e!==t}).some(function(t){return t.selected});0!==this.selectionState.length&&t.selected?(this.stats.each(function(t,e){t.selected=this.selectionState.length?this.selectionState[e]:!0}.bind(this)),this.clearSelectionState()):(this.selectionState=this.stats.map(function(t){return t.selected}),this.stats.each(function(e){e.selected=e===t}))}})}},{"./chart":3,"./sidebar":7,"./stat-collection":8,"ampersand-state":21,debug:57,lodash:62}],3:[function(t,e){{var n=t("ampersand-state"),r=t("lodash");t("debug")("model:chart"),e.exports=n.extend({props:{xSetting:{type:"string","default":"relative",values:["relative","absolute"]},ySetting:{type:"string","default":"linear",values:["linear","log-scale"]},allowSampling:{type:"boolean","default":!0},subSampled:{type:"boolean","default":!1},recalcXDomain:{type:"boolean","default":!0}},derived:{series:{deps:["parent"],cache:!1,fn:function(){var t=this.parent.stats.filter(function(t){return t.selected}).map(function(t){return r.pick(t,["color","data","name","cid","selected"])});return t}},empty:{deps:["parent","series"],cache:!1,fn:function(){return 0===this.series.length}}}})}},{"ampersand-state":21,debug:57,lodash:62}],4:[function(t,e){{var n=t("d3");e.exports=function(){function t(){var t=n.scale.category20();return t}var e;return{getInstance:function(){return e||(e=t()),e}}}()}},{d3:56}],5:[function(t,e){{var n=t("ampersand-state"),r=t("./stat-collection");t("debug")("model:panel"),e.exports=n.extend({collections:{stats:r},props:{title:{type:"string",required:!0},open:{type:"boolean","default":!1},app:{type:"object"}},derived:{selected:{deps:["stats"],cache:!1,fn:function(){var t=this.stats.filter(function(t){return t.selected});return t.length===this.stats.length?"all":0===t.length?"none":"some"}},suptitle:{deps:["title"],cache:!1,fn:function(){var t=this.title.split(" ");return t.length>1?t[0]:""}},subtitle:{deps:["title"],fn:function(){var t=this.title.split(" ");return t.length>1?t[1]:this.title}}}})}},{"./stat-collection":8,"ampersand-state":21,debug:57}],6:[function(t,e){{var n=t("ampersand-state");t("debug")("model:search"),e.exports=n.extend({props:{content:{type:"string","default":""}},derived:{empty:{deps:["content"],fn:function(){return""===this.content}}}})}},{"ampersand-state":21,debug:57}],7:[function(t,e){{var n=t("ampersand-state"),r=t("ampersand-collection"),i=t("./search"),o=t("./panel"),a=(t("lodash"),t("debug")("model:sidebar"),r.extend({mainIndex:"title",model:o}));e.exports=n.extend({children:{search:i},collections:{panels:a}})}},{"./panel":5,"./search":6,"ampersand-collection":12,"ampersand-state":21,debug:57,lodash:62}],8:[function(t,e){{var n=t("ampersand-collection"),r=t("ampersand-collection-underscore-mixin"),i=t("./stat");e.exports=n.extend(r,{comparator:"name",model:i})}},{"./stat":9,"ampersand-collection":12,"ampersand-collection-underscore-mixin":10}],9:[function(t,e){{var n=t("ampersand-state"),r=t("./colors").getInstance();t("debug")("model:stat"),e.exports=n.extend({props:{name:{type:"string","default":""},group:{type:"string","default":""},selected:{type:"boolean","default":!1},data:{type:"object"},app:{type:"object"}},derived:{color:{cache:!0,fn:function(){return r(this.cid)}}}})}},{"./colors":4,"ampersand-state":21,debug:57}],10:[function(t,e){"undefined"!=typeof window&&(window.ampersand=window.ampersand||{},window.ampersand["ampersand-collection-underscore-mixin"]=window.ampersand["ampersand-collection-underscore-mixin"]||[],window.ampersand["ampersand-collection-underscore-mixin"].push("1.0.3"));var n=t("underscore"),r=[].slice,i={},o=["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","difference","indexOf","shuffle","lastIndexOf","isEmpty","chain","sample","partition"];n.each(o,function(t){n[t]&&(i[t]=function(){var e=r.call(arguments);return e.unshift(this.models),n[t].apply(n,e)})});var a=["groupBy","countBy","sortBy","indexBy"];n.each(a,function(t){n[t]&&(i[t]=function(e,r){var i=n.isFunction(e)?e:function(t){return t.get?t.get(e):t[e]};return n[t](this.models,i,r)})}),i.where=function(t,e){return n.isEmpty(t)?e?void 0:[]:this[e?"find":"filter"](function(e){var n;for(var r in t)if(n=e.get?e.get(r):e[r],t[r]!==n)return!1;return!0})},i.findWhere=function(t){return this.where(t,!0)},i.pluck=function(t){return n.invoke(this.models,"get",t)},e.exports=i},{underscore:11}],11:[function(t,e,n){(function(){function t(t){function e(e,n,r,i,o,a){for(;o>=0&&a>o;o+=t){var u=i?i[o]:o;r=n(r,e[u],u,e)}return r}return function(n,r,i,o){r=x(r,o,4);var a=!E(n)&&b.keys(n),u=(a||n).length,s=t>0?0:u-1;return arguments.length<3&&(i=n[a?a[s]:s],s+=t),e(n,r,i,a,s,u)}}function r(t){return function(e,n,r){n=w(n,r);for(var i=null!=e&&e.length,o=t>0?0:i-1;o>=0&&i>o;o+=t)if(n(e[o],o,e))return o;return-1}}function i(t,e){var n=A.length,r=t.constructor,i=b.isFunction(r)&&r.prototype||s,o="constructor";for(b.has(t,o)&&!b.contains(e,o)&&e.push(o);n--;)o=A[n],o in t&&t[o]!==i[o]&&!b.contains(e,o)&&e.push(o)}var o=this,a=o._,u=Array.prototype,s=Object.prototype,l=Function.prototype,c=u.push,f=u.slice,h=s.toString,p=s.hasOwnProperty,d=Array.isArray,g=Object.keys,v=l.bind,m=Object.create,y=function(){},b=function(t){return t instanceof b?t:this instanceof b?void(this._wrapped=t):new b(t)};"undefined"!=typeof n?("undefined"!=typeof e&&e.exports&&(n=e.exports=b),n._=b):o._=b,b.VERSION="1.8.2";var x=function(t,e,n){if(void 0===e)return t;switch(null==n?3:n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,o){return t.call(e,n,r,i,o)}}return function(){return t.apply(e,arguments)}},w=function(t,e,n){return null==t?b.identity:b.isFunction(t)?x(t,e,n):b.isObject(t)?b.matcher(t):b.property(t)};b.iteratee=function(t,e){return w(t,e,1/0)};var _=function(t,e){return function(n){var r=arguments.length;if(2>r||null==n)return n;for(var i=1;r>i;i++)for(var o=arguments[i],a=t(o),u=a.length,s=0;u>s;s++){var l=a[s];e&&void 0!==n[l]||(n[l]=o[l])}return n}},M=function(t){if(!b.isObject(t))return{};if(m)return m(t);y.prototype=t;var e=new y;return y.prototype=null,e},k=Math.pow(2,53)-1,E=function(t){var e=t&&t.length;return"number"==typeof e&&e>=0&&k>=e};b.each=b.forEach=function(t,e,n){e=x(e,n);var r,i;if(E(t))for(r=0,i=t.length;i>r;r++)e(t[r],r,t);else{var o=b.keys(t);for(r=0,i=o.length;i>r;r++)e(t[o[r]],o[r],t)}return t},b.map=b.collect=function(t,e,n){e=w(e,n);for(var r=!E(t)&&b.keys(t),i=(r||t).length,o=Array(i),a=0;i>a;a++){var u=r?r[a]:a;o[a]=e(t[u],u,t)}return o},b.reduce=b.foldl=b.inject=t(1),b.reduceRight=b.foldr=t(-1),b.find=b.detect=function(t,e,n){var r;return r=E(t)?b.findIndex(t,e,n):b.findKey(t,e,n),void 0!==r&&-1!==r?t[r]:void 0},b.filter=b.select=function(t,e,n){var r=[];return e=w(e,n),b.each(t,function(t,n,i){e(t,n,i)&&r.push(t)}),r},b.reject=function(t,e,n){return b.filter(t,b.negate(w(e)),n)},b.every=b.all=function(t,e,n){e=w(e,n);for(var r=!E(t)&&b.keys(t),i=(r||t).length,o=0;i>o;o++){var a=r?r[o]:o;if(!e(t[a],a,t))return!1}return!0},b.some=b.any=function(t,e,n){e=w(e,n);for(var r=!E(t)&&b.keys(t),i=(r||t).length,o=0;i>o;o++){var a=r?r[o]:o;if(e(t[a],a,t))return!0}return!1},b.contains=b.includes=b.include=function(t,e,n){return E(t)||(t=b.values(t)),b.indexOf(t,e,"number"==typeof n&&n)>=0},b.invoke=function(t,e){var n=f.call(arguments,2),r=b.isFunction(e);return b.map(t,function(t){var i=r?e:t[e];return null==i?i:i.apply(t,n)})},b.pluck=function(t,e){return b.map(t,b.property(e))},b.where=function(t,e){return b.filter(t,b.matcher(e))},b.findWhere=function(t,e){return b.find(t,b.matcher(e))},b.max=function(t,e,n){var r,i,o=-1/0,a=-1/0;if(null==e&&null!=t){t=E(t)?t:b.values(t);for(var u=0,s=t.length;s>u;u++)r=t[u],r>o&&(o=r)}else e=w(e,n),b.each(t,function(t,n,r){i=e(t,n,r),(i>a||i===-1/0&&o===-1/0)&&(o=t,a=i)});return o},b.min=function(t,e,n){var r,i,o=1/0,a=1/0;if(null==e&&null!=t){t=E(t)?t:b.values(t);for(var u=0,s=t.length;s>u;u++)r=t[u],o>r&&(o=r)}else e=w(e,n),b.each(t,function(t,n,r){i=e(t,n,r),(a>i||1/0===i&&1/0===o)&&(o=t,a=i)});return o},b.shuffle=function(t){for(var e,n=E(t)?t:b.values(t),r=n.length,i=Array(r),o=0;r>o;o++)e=b.random(0,o),e!==o&&(i[o]=i[e]),i[e]=n[o];return i},b.sample=function(t,e,n){return null==e||n?(E(t)||(t=b.values(t)),t[b.random(t.length-1)]):b.shuffle(t).slice(0,Math.max(0,e))},b.sortBy=function(t,e,n){return e=w(e,n),b.pluck(b.map(t,function(t,n,r){return{value:t,index:n,criteria:e(t,n,r)}}).sort(function(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(r>n||void 0===r)return-1}return t.index-e.index}),"value")};var C=function(t){return function(e,n,r){var i={};return n=w(n,r),b.each(e,function(r,o){var a=n(r,o,e);t(i,r,a)}),i}};b.groupBy=C(function(t,e,n){b.has(t,n)?t[n].push(e):t[n]=[e]}),b.indexBy=C(function(t,e,n){t[n]=e}),b.countBy=C(function(t,e,n){b.has(t,n)?t[n]++:t[n]=1}),b.toArray=function(t){return t?b.isArray(t)?f.call(t):E(t)?b.map(t,b.identity):b.values(t):[]},b.size=function(t){return null==t?0:E(t)?t.length:b.keys(t).length},b.partition=function(t,e,n){e=w(e,n);var r=[],i=[];return b.each(t,function(t,n,o){(e(t,n,o)?r:i).push(t)}),[r,i]},b.first=b.head=b.take=function(t,e,n){return null==t?void 0:null==e||n?t[0]:b.initial(t,t.length-e)},b.initial=function(t,e,n){return f.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))},b.last=function(t,e,n){return null==t?void 0:null==e||n?t[t.length-1]:b.rest(t,Math.max(0,t.length-e))},b.rest=b.tail=b.drop=function(t,e,n){return f.call(t,null==e||n?1:e)},b.compact=function(t){return b.filter(t,b.identity)};var S=function(t,e,n,r){for(var i=[],o=0,a=r||0,u=t&&t.length;u>a;a++){var s=t[a];if(E(s)&&(b.isArray(s)||b.isArguments(s))){e||(s=S(s,e,n));var l=0,c=s.length;for(i.length+=c;c>l;)i[o++]=s[l++]}else n||(i[o++]=s)}return i};b.flatten=function(t,e){return S(t,e,!1)},b.without=function(t){return b.difference(t,f.call(arguments,1))},b.uniq=b.unique=function(t,e,n,r){if(null==t)return[];b.isBoolean(e)||(r=n,n=e,e=!1),null!=n&&(n=w(n,r));for(var i=[],o=[],a=0,u=t.length;u>a;a++){var s=t[a],l=n?n(s,a,t):s;e?(a&&o===l||i.push(s),o=l):n?b.contains(o,l)||(o.push(l),i.push(s)):b.contains(i,s)||i.push(s)}return i},b.union=function(){return b.uniq(S(arguments,!0,!0))},b.intersection=function(t){if(null==t)return[];for(var e=[],n=arguments.length,r=0,i=t.length;i>r;r++){var o=t[r];if(!b.contains(e,o)){for(var a=1;n>a&&b.contains(arguments[a],o);a++);a===n&&e.push(o)}}return e},b.difference=function(t){var e=S(arguments,!0,!0,1);return b.filter(t,function(t){return!b.contains(e,t)})},b.zip=function(){return b.unzip(arguments)},b.unzip=function(t){for(var e=t&&b.max(t,"length").length||0,n=Array(e),r=0;e>r;r++)n[r]=b.pluck(t,r);return n},b.object=function(t,e){for(var n={},r=0,i=t&&t.length;i>r;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n},b.indexOf=function(t,e,n){var r=0,i=t&&t.length;if("number"==typeof n)r=0>n?Math.max(0,i+n):n;else if(n&&i)return r=b.sortedIndex(t,e),t[r]===e?r:-1;if(e!==e)return b.findIndex(f.call(t,r),b.isNaN);for(;i>r;r++)if(t[r]===e)return r;return-1},b.lastIndexOf=function(t,e,n){var r=t?t.length:0;if("number"==typeof n&&(r=0>n?r+n+1:Math.min(r,n+1)),e!==e)return b.findLastIndex(f.call(t,0,r),b.isNaN);for(;--r>=0;)if(t[r]===e)return r;return-1},b.findIndex=r(1),b.findLastIndex=r(-1),b.sortedIndex=function(t,e,n,r){n=w(n,r,1);for(var i=n(e),o=0,a=t.length;a>o;){var u=Math.floor((o+a)/2);n(t[u])<i?o=u+1:a=u}return o},b.range=function(t,e,n){arguments.length<=1&&(e=t||0,t=0),n=n||1;for(var r=Math.max(Math.ceil((e-t)/n),0),i=Array(r),o=0;r>o;o++,t+=n)i[o]=t;return i};var T=function(t,e,n,r,i){if(!(r instanceof e))return t.apply(n,i);var o=M(t.prototype),a=t.apply(o,i);return b.isObject(a)?a:o};b.bind=function(t,e){if(v&&t.bind===v)return v.apply(t,f.call(arguments,1));if(!b.isFunction(t))throw new TypeError("Bind must be called on a function");var n=f.call(arguments,2),r=function(){return T(t,r,e,this,n.concat(f.call(arguments)))};return r},b.partial=function(t){var e=f.call(arguments,1),n=function(){for(var r=0,i=e.length,o=Array(i),a=0;i>a;a++)o[a]=e[a]===b?arguments[r++]:e[a];for(;r<arguments.length;)o.push(arguments[r++]);return T(t,n,this,this,o)};return n},b.bindAll=function(t){var e,n,r=arguments.length;if(1>=r)throw new Error("bindAll must be passed function names");for(e=1;r>e;e++)n=arguments[e],t[n]=b.bind(t[n],t);return t},b.memoize=function(t,e){var n=function(r){var i=n.cache,o=""+(e?e.apply(this,arguments):r);return b.has(i,o)||(i[o]=t.apply(this,arguments)),i[o]};return n.cache={},n},b.delay=function(t,e){var n=f.call(arguments,2);return setTimeout(function(){return t.apply(null,n)},e)},b.defer=b.partial(b.delay,b,1),b.throttle=function(t,e,n){var r,i,o,a=null,u=0;n||(n={});var s=function(){u=n.leading===!1?0:b.now(),a=null,o=t.apply(r,i),a||(r=i=null)};return function(){var l=b.now();u||n.leading!==!1||(u=l);var c=e-(l-u);return r=this,i=arguments,0>=c||c>e?(a&&(clearTimeout(a),a=null),u=l,o=t.apply(r,i),a||(r=i=null)):a||n.trailing===!1||(a=setTimeout(s,c)),o}},b.debounce=function(t,e,n){var r,i,o,a,u,s=function(){var l=b.now()-a;e>l&&l>=0?r=setTimeout(s,e-l):(r=null,n||(u=t.apply(o,i),r||(o=i=null)))};return function(){o=this,i=arguments,a=b.now();var l=n&&!r;return r||(r=setTimeout(s,e)),l&&(u=t.apply(o,i),o=i=null),u}},b.wrap=function(t,e){return b.partial(e,t)},b.negate=function(t){return function(){return!t.apply(this,arguments)}},b.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}},b.after=function(t,e){return function(){return--t<1?e.apply(this,arguments):void 0}},b.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),1>=t&&(e=null),n}},b.once=b.partial(b.before,2);var j=!{toString:null}.propertyIsEnumerable("toString"),A=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];b.keys=function(t){if(!b.isObject(t))return[];if(g)return g(t);var e=[];for(var n in t)b.has(t,n)&&e.push(n);return j&&i(t,e),e},b.allKeys=function(t){if(!b.isObject(t))return[];var e=[];for(var n in t)e.push(n);return j&&i(t,e),e},b.values=function(t){for(var e=b.keys(t),n=e.length,r=Array(n),i=0;n>i;i++)r[i]=t[e[i]];return r},b.mapObject=function(t,e,n){e=w(e,n);for(var r,i=b.keys(t),o=i.length,a={},u=0;o>u;u++)r=i[u],a[r]=e(t[r],r,t);return a},b.pairs=function(t){for(var e=b.keys(t),n=e.length,r=Array(n),i=0;n>i;i++)r[i]=[e[i],t[e[i]]];return r},b.invert=function(t){for(var e={},n=b.keys(t),r=0,i=n.length;i>r;r++)e[t[n[r]]]=n[r];return e},b.functions=b.methods=function(t){var e=[];for(var n in t)b.isFunction(t[n])&&e.push(n);return e.sort()},b.extend=_(b.allKeys),b.extendOwn=b.assign=_(b.keys),b.findKey=function(t,e,n){e=w(e,n);for(var r,i=b.keys(t),o=0,a=i.length;a>o;o++)if(r=i[o],e(t[r],r,t))return r},b.pick=function(t,e,n){var r,i,o={},a=t;if(null==a)return o;b.isFunction(e)?(i=b.allKeys(a),r=x(e,n)):(i=S(arguments,!1,!1,1),r=function(t,e,n){return e in n},a=Object(a));for(var u=0,s=i.length;s>u;u++){var l=i[u],c=a[l];r(c,l,a)&&(o[l]=c)}return o},b.omit=function(t,e,n){if(b.isFunction(e))e=b.negate(e);else{var r=b.map(S(arguments,!1,!1,1),String);e=function(t,e){return!b.contains(r,e)}}return b.pick(t,e,n)},b.defaults=_(b.allKeys,!0),b.clone=function(t){return b.isObject(t)?b.isArray(t)?t.slice():b.extend({},t):t},b.tap=function(t,e){return e(t),t},b.isMatch=function(t,e){var n=b.keys(e),r=n.length;if(null==t)return!r;for(var i=Object(t),o=0;r>o;o++){var a=n[o];if(e[a]!==i[a]||!(a in i))return!1}return!0};var N=function(t,e,n,r){if(t===e)return 0!==t||1/t===1/e;if(null==t||null==e)return t===e;t instanceof b&&(t=t._wrapped),e instanceof b&&(e=e._wrapped);var i=h.call(t);if(i!==h.call(e))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!==+t?+e!==+e:0===+t?1/+t===1/e:+t===+e;case"[object Date]":case"[object Boolean]":return+t===+e}var o="[object Array]"===i;if(!o){if("object"!=typeof t||"object"!=typeof e)return!1;var a=t.constructor,u=e.constructor;if(a!==u&&!(b.isFunction(a)&&a instanceof a&&b.isFunction(u)&&u instanceof u)&&"constructor"in t&&"constructor"in e)return!1}n=n||[],r=r||[];for(var s=n.length;s--;)if(n[s]===t)return r[s]===e;if(n.push(t),r.push(e),o){if(s=t.length,s!==e.length)return!1;for(;s--;)if(!N(t[s],e[s],n,r))return!1}else{var l,c=b.keys(t);if(s=c.length,b.keys(e).length!==s)return!1;for(;s--;)if(l=c[s],!b.has(e,l)||!N(t[l],e[l],n,r))return!1}return n.pop(),r.pop(),!0};b.isEqual=function(t,e){return N(t,e)},b.isEmpty=function(t){return null==t?!0:E(t)&&(b.isArray(t)||b.isString(t)||b.isArguments(t))?0===t.length:0===b.keys(t).length},b.isElement=function(t){return!(!t||1!==t.nodeType)},b.isArray=d||function(t){return"[object Array]"===h.call(t)},b.isObject=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},b.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(t){b["is"+t]=function(e){return h.call(e)==="[object "+t+"]"}}),b.isArguments(arguments)||(b.isArguments=function(t){return b.has(t,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(b.isFunction=function(t){return"function"==typeof t||!1}),b.isFinite=function(t){return isFinite(t)&&!isNaN(parseFloat(t))},b.isNaN=function(t){return b.isNumber(t)&&t!==+t},b.isBoolean=function(t){return t===!0||t===!1||"[object Boolean]"===h.call(t)},b.isNull=function(t){return null===t},b.isUndefined=function(t){return void 0===t},b.has=function(t,e){return null!=t&&p.call(t,e)},b.noConflict=function(){return o._=a,this},b.identity=function(t){return t},b.constant=function(t){return function(){return t}},b.noop=function(){},b.property=function(t){return function(e){return null==e?void 0:e[t]}},b.propertyOf=function(t){return null==t?function(){}:function(e){return t[e]}},b.matcher=b.matches=function(t){return t=b.extendOwn({},t),function(e){return b.isMatch(e,t)}},b.times=function(t,e,n){var r=Array(Math.max(0,t));e=x(e,n,1);for(var i=0;t>i;i++)r[i]=e(i);return r},b.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))},b.now=Date.now||function(){return(new Date).getTime()};var O={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},q=b.invert(O),D=function(t){var e=function(e){return t[e]},n="(?:"+b.keys(t).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(i,e):t}};b.escape=D(O),b.unescape=D(q),b.result=function(t,e,n){var r=null==t?void 0:t[e];return void 0===r&&(r=n),b.isFunction(r)?r.call(t):r};var L=0;b.uniqueId=function(t){var e=++L+"";return t?t+e:e},b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var F=/(.)^/,z={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},R=/\\|'|\r|\n|\u2028|\u2029/g,I=function(t){return"\\"+z[t]};b.template=function(t,e,n){!e&&n&&(e=n),e=b.defaults({},e,b.templateSettings);var r=RegExp([(e.escape||F).source,(e.interpolate||F).source,(e.evaluate||F).source].join("|")+"|$","g"),i=0,o="__p+='";t.replace(r,function(e,n,r,a,u){return o+=t.slice(i,u).replace(R,I),i=u+e.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":a&&(o+="';\n"+a+"\n__p+='"),e}),o+="';\n",e.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{var a=new Function(e.variable||"obj","_",o)}catch(u){throw u.source=o,u}var s=function(data){return a.call(this,data,b)},l=e.variable||"obj";return s.source="function("+l+"){\n"+o+"}",s},b.chain=function(t){var e=b(t);return e._chain=!0,e};var P=function(t,e){return t._chain?b(e).chain():e};b.mixin=function(t){b.each(b.functions(t),function(e){var n=b[e]=t[e];b.prototype[e]=function(){var t=[this._wrapped];return c.apply(t,arguments),P(this,n.apply(b,t))}})},b.mixin(b),b.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=u[t];b.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],P(this,n)}}),b.each(["concat","join","slice"],function(t){var e=u[t];b.prototype[t]=function(){return P(this,e.apply(this._wrapped,arguments))}}),b.prototype.value=function(){return this._wrapped},b.prototype.valueOf=b.prototype.toJSON=b.prototype.value,b.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return b})}).call(this)},{}],12:[function(t,e){function n(t,e){if(e||(e={}),e.model&&(this.model=e.model),e.comparator&&(this.comparator=e.comparator),e.parent&&(this.parent=e.parent),!this.mainIndex){var n=this.model&&this.model.prototype&&this.model.prototype.idAttribute;this.mainIndex=n||"id"}this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,u({silent:!0},e))}var r=t("backbone-events-standalone"),i=t("ampersand-class-extend"),o=t("is-array"),a=t("amp-bind"),u=t("extend-object"),s=[].slice;u(n.prototype,r,{initialize:function(){},indexes:[],isModel:function(t){return this.model&&t instanceof this.model},add:function(t,e){return this.set(t,u({merge:!1,add:!0,remove:!1},e))},parse:function(t){return t},serialize:function(){return this.map(function(t){if(t.serialize)return t.serialize();var e={};return u(e,t),delete e.collection,e})},toJSON:function(){return this.serialize()},set:function(t,e){e=u({add:!0,remove:!0,merge:!0},e),e.parse&&(t=this.parse(t,e));var n=!o(t);t=n?t?[t]:[]:t.slice();var r,i,a,s,l,c,f,h=e.at,p=this.comparator&&null==h&&e.sort!==!1,d="string"==typeof this.comparator?this.comparator:null,g=[],v=[],m={},y=e.add,b=e.merge,x=e.remove,w=!p&&y&&x?[]:!1,_=this.model&&this.model.prototype||Object.prototype;for(c=0,f=t.length;f>c;c++){if(a=t[c]||{},r=this.isModel(a)?i=a:_.generateId?_.generateId(a):a[_.idAttribute||this.mainIndex],s=this.get(r))x&&(m[s.cid||s[this.mainIndex]]=!0),b&&(a=a===i?i.attributes:a,e.parse&&(a=s.parse(a,e)),s.set?(s.set(a,e),p&&!l&&s.hasChanged(d)&&(l=!0)):u(s,a)),t[c]=s;else if(y){if(i=t[c]=this._prepareModel(a,e),!i)continue;g.push(i),this._addReference(i,e)}i=s||i,i&&(w&&(i.isNew&&i.isNew()||!i[this.mainIndex]||!m[i.cid||i[this.mainIndex]])&&w.push(i),m[i[this.mainIndex]]=!0)}if(x){for(c=0,f=this.length;f>c;c++)i=this.models[c],m[i.cid||i[this.mainIndex]]||v.push(i);v.length&&this.remove(v,e)}if(g.length||w&&w.length)if(p&&(l=!0),null!=h)for(c=0,f=g.length;f>c;c++)this.models.splice(h+c,0,g[c]);else{var M=w||g;for(c=0,f=M.length;f>c;c++)this.models.push(M[c])}if(l&&this.sort({silent:!0}),!e.silent){for(c=0,f=g.length;f>c;c++)i=g[c],i.trigger?i.trigger("add",i,this,e):this.trigger("add",i,this,e);(l||w&&w.length)&&this.trigger("sort",this,e)}return n?t[0]:t},get:function(t,e){if(t){var n=this._indexes[e||this.mainIndex];return n[t]||n[t[this.mainIndex]]||this._indexes.cid[t]||this._indexes.cid[t.cid]}},at:function(t){return this.models[t]},remove:function(t,e){var n,r,i,a,u=!o(t);for(t=u?[t]:s.call(t),e||(e={}),n=0,r=t.length;r>n;n++)i=t[n]=this.get(t[n]),i&&(this._deIndex(i),a=this.models.indexOf(i),this.models.splice(a,1),e.silent||(e.index=a,i.trigger?i.trigger("remove",i,this,e):this.trigger("remove",i,this,e)),this._removeReference(i,e));return u?t[0]:t},reset:function(t,e){e||(e={});for(var n=0,r=this.models.length;r>n;n++)this._removeReference(this.models[n],e);return e.previousModels=this.models,this._reset(),t=this.add(t,u({silent:!0},e)),e.silent||this.trigger("reset",this,e),t},sort:function(t){var e=this;if(!this.comparator)throw new Error("Cannot sort a set without a comparator");return t||(t={}),this.models.sort("string"==typeof this.comparator?function(t,n){return t.get?(t=t.get(e.comparator),n=n.get(e.comparator)):(t=t[e.comparator],n=n[e.comparator]),t>n||void 0===t?1:n>t||void 0===n?-1:0}:1===this.comparator.length?function(t,n){return t=e.comparator(t),n=e.comparator(n),t>n||void 0===t?1:n>t||void 0===n?-1:0}:a(this.comparator,this)),t.silent||this.trigger("sort",this,t),this},_reset:function(){var t=this.indexes||[],e=0;t.push(this.mainIndex),t.push("cid");var n=t.length;for(this.models=[],this._indexes={};n>e;e++)this._indexes[t[e]]={}},_prepareModel:function(t,e){if(!this.model)return t;if(this.isModel(t))return t.collection||(t.collection=this),t;e=e?u({},e):{},e.collection=this;var n=new this.model(t,e);return n.validationError?(this.trigger("invalid",this,n.validationError,e),!1):n},_deIndex:function(t){for(var e in this._indexes)delete this._indexes[e][t[e]||t.get&&t.get(e)]},_index:function(t){for(var e in this._indexes){var n=t[e]||t.get&&t.get(e);n&&(this._indexes[e][n]=t)}},_addReference:function(t){this._index(t),t.collection||(t.collection=this),t.on&&t.on("all",this._onModelEvent,this)},_removeReference:function(t){this===t.collection&&delete t.collection,this._deIndex(t),t.off&&t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,n,r){("add"!==t&&"remove"!==t||n===this)&&("destroy"===t&&this.remove(e,r),e&&t==="change:"+this.mainIndex&&(this._deIndex(e),this._index(e)),this.trigger.apply(this,arguments))}}),Object.defineProperties(n.prototype,{length:{get:function(){return this.models.length}},isCollection:{value:!0}});var l=["indexOf","lastIndexOf","every","some","forEach","map","filter","reduce","reduceRight"];l.forEach(function(t){n.prototype[t]=function(){return this.models[t].apply(this.models,arguments)}}),n.prototype.each=n.prototype.forEach,n.extend=i,e.exports=n},{"amp-bind":13,"ampersand-class-extend":16,"backbone-events-standalone":18,"extend-object":19,"is-array":20}],13:[function(t,e){var n=t("amp-is-function"),r=t("amp-is-object"),i=Function.prototype.bind,o=Array.prototype.slice,a=function(){};e.exports=function(t,e){var u,s;if(i&&t.bind===i)return i.apply(t,o.call(arguments,1));if(!n(t))throw new TypeError("Bind must be called on a function");return u=o.call(arguments,2),s=function(){if(!(this instanceof s))return t.apply(e,u.concat(o.call(arguments)));a.prototype=t.prototype;var n=new a;a.prototype=null;var i=t.apply(n,u.concat(o.call(arguments)));return r(i)?i:n}}},{"amp-is-function":14,"amp-is-object":15}],14:[function(t,e){var n=Object.prototype.toString,r=function(t){return"[object Function]"===n.call(t)};"function"!=typeof/./&&(r=function(t){return"function"==typeof t||!1}),e.exports=r},{}],15:[function(t,e){e.exports=function(t){var e=typeof t;return!!t&&("function"===e||"object"===e)}},{}],16:[function(t,e){var n=t("extend-object"),r=function(t){var e,r=this,i=[].slice.call(arguments);e=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return r.apply(this,arguments)},n(e,r);var o=function(){this.constructor=e};return o.prototype=r.prototype,e.prototype=new o,t&&(i.unshift(e.prototype),n.apply(null,i)),e.__super__=r.prototype,e};e.exports=r},{"extend-object":19}],17:[function(t,e,n){!function(){function t(){return{keys:Object.keys,uniqueId:function(t){var e=++l+"";return t?t+e:e},has:function(t,e){return u.call(t,e)},each:function(t,e,n){if(null!=t)if(a&&t.forEach===a)t.forEach(e,n);else if(t.length===+t.length){for(var r=0,i=t.length;i>r;r++)if(e.call(n,t[r],r,t)===o)return}else for(var u in t)if(this.has(t,u)&&e.call(n,t[u],u,t)===o)return},once:function(t){var e,n=!1;return function(){return n?e:(n=!0,e=t.apply(this,arguments),t=null,e)}}}}var r,i=this,o={},a=Array.prototype.forEach,u=Object.prototype.hasOwnProperty,s=Array.prototype.slice,l=0,c=t();r={on:function(t,e,n){if(!h(this,"on",t,[e,n])||!e)return this;this._events||(this._events={});var r=this._events[t]||(this._events[t]=[]);return r.push({callback:e,context:n,ctx:n||this}),this},once:function(t,e,n){if(!h(this,"once",t,[e,n])||!e)return this;var r=this,i=c.once(function(){r.off(t,i),e.apply(this,arguments)});return i._callback=e,this.on(t,i,n)},off:function(t,e,n){var r,i,o,a,u,s,l,f;if(!this._events||!h(this,"off",t,[e,n]))return this;if(!t&&!e&&!n)return this._events={},this;for(a=t?[t]:c.keys(this._events),u=0,s=a.length;s>u;u++)if(t=a[u],o=this._events[t]){if(this._events[t]=r=[],e||n)for(l=0,f=o.length;f>l;l++)i=o[l],(e&&e!==i.callback&&e!==i.callback._callback||n&&n!==i.context)&&r.push(i);r.length||delete this._events[t]}return this},trigger:function(t){if(!this._events)return this;var e=s.call(arguments,1);if(!h(this,"trigger",t,e))return this;var n=this._events[t],r=this._events.all;return n&&p(n,e),r&&p(r,arguments),this},stopListening:function(t,e,n){var r=this._listeners;if(!r)return this;var i=!e&&!n;"object"==typeof e&&(n=this),t&&((r={})[t._listenerId]=t);for(var o in r)r[o].off(e,n,this),i&&delete this._listeners[o];return this}};var f=/\s+/,h=function(t,e,n,r){if(!n)return!0;if("object"==typeof n){for(var i in n)t[e].apply(t,[i,n[i]].concat(r));return!1}if(f.test(n)){for(var o=n.split(f),a=0,u=o.length;u>a;a++)t[e].apply(t,[o[a]].concat(r));return!1}return!0},p=function(t,e){var n,r=-1,i=t.length,o=e[0],a=e[1],u=e[2];switch(e.length){case 0:for(;++r<i;)(n=t[r]).callback.call(n.ctx);return;case 1:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o);return;case 2:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o,a);return;case 3:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o,a,u);return;default:for(;++r<i;)(n=t[r]).callback.apply(n.ctx,e)}},d={listenTo:"on",listenToOnce:"once"};c.each(d,function(t,e){r[e]=function(e,n,r){var i=this._listeners||(this._listeners={}),o=e._listenerId||(e._listenerId=c.uniqueId("l"));return i[o]=e,"object"==typeof n&&(r=this),e[t](n,r,this),this}}),r.bind=r.on,r.unbind=r.off,r.mixin=function(t){var e=["on","once","off","trigger","stopListening","listenTo","listenToOnce","bind","unbind"];return c.each(e,function(e){t[e]=this[e]
-},this),t},"function"==typeof define?define(function(){return r}):"undefined"!=typeof n?("undefined"!=typeof e&&e.exports&&(n=e.exports=r),n.BackboneEvents=r):i.BackboneEvents=r}(this)},{}],18:[function(t,e){e.exports=t("./backbone-events-standalone")},{"./backbone-events-standalone":17}],19:[function(t,e){var n=[],r=n.forEach,i=n.slice;e.exports=function(t){return r.call(i.call(arguments,1),function(e){if(e)for(var n in e)t[n]=e[n]}),t}},{}],20:[function(t,e){var n=Array.isArray,r=Object.prototype.toString;e.exports=n||function(t){return!!t&&"[object Array]"==r.call(t)}},{}],21:[function(t,e){function n(t,e){e||(e={}),this.cid||(this.cid=a.uniqueId("state")),this._events={},this._values={},this._definition=Object.create(this._definition),e.parse&&(t=this.parse(t,e)),this.parent=e.parent,this.collection=e.collection,this._keyTree=new s,this._initCollections(),this._initChildren(),this._cache={},this._previousAttributes={},t&&this.set(t,a.extend({silent:!0,initial:!0},e)),this._changed={},this._derived&&this._initDerived(),e.init!==!1&&this.initialize.apply(this,arguments)}function r(t,e,n,r){var i,o,u=t._definition[e]={};if(a.isString(n))i=t._ensureValidType(n),i&&(u.type=i);else{if(a.isArray(n)&&(o=n,n={type:o[0],required:o[1],"default":o[2]}),i=t._ensureValidType(n.type),i&&(u.type=i),n.required&&(u.required=!0),n["default"]&&"object"==typeof n["default"])throw new TypeError("The default value for "+e+" cannot be an object/array, must be a value or a function which returns a value/object/array");u["default"]=n["default"],u.allowNull=n.allowNull?n.allowNull:!1,n.setOnce&&(u.setOnce=!0),u.required&&a.isUndefined(u["default"])&&!u.setOnce&&(u["default"]=t._getDefaultForType(i)),u.test=n.test,u.values=n.values}return r&&(u.session=!0),Object.defineProperty(t,e,{set:function(t){this.set(e,t)},get:function(){var t=this._values[e],n=this._dataTypes[u.type];return"undefined"!=typeof t?(n&&n.get&&(t=n.get(t)),t):(t=a.result(u,"default"),this._values[e]=t,t)}}),u}function i(t,e,n){var r=t._derived[e]={fn:a.isFunction(n)?n:n.fn,cache:n.cache!==!1,depList:n.deps||[]};a.each(r.depList,function(n){t._deps[n]=a(t._deps[n]||[]).union([e])}),Object.defineProperty(t,e,{get:function(){return this._getDerivedProperty(e)},set:function(){throw new TypeError('"'+e+"\" is a derived property, it can't be set directly.")}})}function o(t){var e,n=this,o=[].slice.call(arguments);e=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return n.apply(this,arguments)},a.extend(e,n);var u=function(){this.constructor=e};u.prototype=n.prototype,e.prototype=new u,e.prototype._derived=a.extend({},n.prototype._derived),e.prototype._deps=a.extend({},n.prototype._deps),e.prototype._definition=a.extend({},n.prototype._definition),e.prototype._collections=a.extend({},n.prototype._collections),e.prototype._children=a.extend({},n.prototype._children),e.prototype._dataTypes=a.extend({},n.prototype._dataTypes||f),t&&o.forEach(function(t){var n=["dataTypes","props","session","derived","collections","children"];t.dataTypes&&a.each(t.dataTypes,function(t,n){e.prototype._dataTypes[n]=t}),t.props&&a.each(t.props,function(t,n){r(e.prototype,n,t)}),t.session&&a.each(t.session,function(t,n){r(e.prototype,n,t,!0)}),t.derived&&a.each(t.derived,function(t,n){i(e.prototype,n,t)}),t.collections&&a.each(t.collections,function(t,n){e.prototype._collections[n]=t}),t.children&&a.each(t.children,function(t,n){e.prototype._children[n]=t}),a.extend(e.prototype,a.omit(t,n))});Object.prototype.toString;return e.__super__=n.prototype,e}"undefined"!=typeof window&&(window.ampersand=window.ampersand||{},window.ampersand["ampersand-state"]=window.ampersand["ampersand-state"]||[],window.ampersand["ampersand-state"].push("4.4.5"));var a=t("underscore"),u=t("backbone-events-standalone"),s=t("key-tree-store"),l=t("array-next"),c=/^change:/;a.extend(n.prototype,u,{extraProperties:"ignore",idAttribute:"id",namespaceAttribute:"namespace",typeAttribute:"modelType",initialize:function(){return this},getId:function(){return this[this.idAttribute]},getNamespace:function(){return this[this.namespaceAttribute]},getType:function(){return this[this.typeAttribute]},isNew:function(){return null==this.getId()},escape:function(t){return a.escape(this.get(t))},isValid:function(t){return this._validate({},a.extend(t||{},{validate:!0}))},parse:function(t){return t},serialize:function(){var t=this.getAttributes({props:!0},!0);return a.each(this._children,function(e,n){t[n]=this[n].serialize()},this),a.each(this._collections,function(e,n){t[n]=this[n].serialize()},this),t},set:function(t,e,n){var r,i,o,u,s,l,c,f,h,p,d,g,v,m,y,b,x=this,w=this.extraProperties;if(a.isObject(t)||null===t?(h=t,n=e):(h={},h[t]=e),n=n||{},!this._validate(h,n))return!1;g=n.unset,d=n.silent,m=n.initial,i=[],r=this._changing,this._changing=!0,r||(this._previousAttributes=this.attributes,this._changed={});for(f in h){if(u=h[f],o=typeof u,v=this._values[f],s=this._definition[f],!s){if(this._children[f]||this._collections[f]){this[f].set(u,n);continue}if("ignore"===w)continue;if("reject"===w)throw new TypeError('No "'+f+'" property defined on '+(this.type||"this")+' model and extraProperties not set to "ignore" or "allow"');if("allow"===w)s=this._createPropertyDefinition(f,"any");else if(w)throw new TypeError('Invalid value for extraProperties: "'+w+'"')}if(b=this._getCompareForType(s.type),p=this._dataTypes[s.type],p&&p.set&&(l=p.set(u),u=l.val,o=l.type),s.test&&(c=s.test.call(this,u,o)))throw new TypeError("Property '"+f+"' failed validation with error: "+c);if(a.isUndefined(u)&&s.required)throw new TypeError("Required property '"+f+"' must be of type "+s.type+". Tried to set "+u);if(a.isNull(u)&&s.required&&!s.allowNull)throw new TypeError("Property '"+f+"' must be of type "+s.type+" (cannot be null). Tried to set "+u);if(s.type&&"any"!==s.type&&s.type!==o&&!a.isNull(u)&&!a.isUndefined(u))throw new TypeError("Property '"+f+"' must be of type "+s.type+". Tried to set "+u);if(s.values&&!a.contains(s.values,u))throw new TypeError("Property '"+f+"' must be one of values: "+s.values.join(", ")+". Tried to set "+u);if(y=!b(v,u,f),s.setOnce&&void 0!==v&&y&&!m)throw new TypeError("Property '"+f+"' can only be set once.");y?(i.push({prev:v,val:u,key:f}),x._changed[f]=u):delete x._changed[f]}if(a.each(i,function(t){x._previousAttributes[t.key]=t.prev,g?delete x._values[t.key]:x._values[t.key]=t.val}),!d&&i.length&&(x._pending=!0),d||a.each(i,function(t){x.trigger("change:"+t.key,x,t.val,n)}),r)return this;if(!d)for(;this._pending;)this._pending=!1,this.trigger("change",this,n);return this._pending=!1,this._changing=!1,this},get:function(t){return this[t]},toggle:function(t){var e=this._definition[t];if("boolean"===e.type)this[t]=!this[t];else{if(!e||!e.values)throw new TypeError("Can only toggle properties that are type `boolean` or have `values` array.");this[t]=l(e.values,this[t])}return this},previousAttributes:function(){return a.clone(this._previousAttributes)},hasChanged:function(t){return null==t?!a.isEmpty(this._changed):a.has(this._changed,t)},changedAttributes:function(t){if(!t)return this.hasChanged()?a.clone(this._changed):!1;var e,n,r,i=!1,o=this._changing?this._previousAttributes:this.attributes;for(var u in t)n=this._definition[u],n&&(r=this._getCompareForType(n.type),r(o[u],e=t[u])||((i||(i={}))[u]=e));return i},toJSON:function(){return this.serialize()},unset:function(t,e){{var n,r=this._definition[t];r.type}return r.required?(n=a.result(r,"default"),this.set(t,n,e)):this.set(t,n,a.extend({},e,{unset:!0}))},clear:function(t){var e=this;return a.each(a.keys(this.attributes),function(n){e.unset(n,t)}),this},previous:function(t){return null!=t&&Object.keys(this._previousAttributes).length?this._previousAttributes[t]:null},_getDefaultForType:function(t){var e=this._dataTypes[t];return e&&e["default"]},_getCompareForType:function(t){var e=this._dataTypes[t];return e&&e.compare?a.bind(e.compare,this):a.isEqual},_validate:function(t,e){if(!e.validate||!this.validate)return!0;t=a.extend({},this.attributes,t);var n=this.validationError=this.validate(t,e)||null;return n?(this.trigger("invalid",this,n,a.extend(e||{},{validationError:n})),!1):!0},_createPropertyDefinition:function(t,e,n){return r(this,t,e,n)},_ensureValidType:function(t){return a.contains(["string","number","boolean","array","object","date","any"].concat(a.keys(this._dataTypes)),t)?t:void 0},getAttributes:function(t,e){t||(t={}),a.defaults(t,{session:!1,props:!1,derived:!1});var n,r,i,o={};for(r in this._definition)i=this._definition[r],(t.session&&i.session||t.props&&!i.session)&&(n=e?this._values[r]:this[r],"undefined"==typeof n&&(n=a.result(i,"default")),"undefined"!=typeof n&&(o[r]=n));if(t.derived)for(r in this._derived)o[r]=this[r];return o},_initDerived:function(){var t=this;a.each(this._derived,function(e,n){var r=t._derived[n];r.deps=r.depList;var i=function(e){e=e||{};var i=r.fn.call(t);t._cache[n]===i&&r.cache||(r.cache&&(t._previousAttributes[n]=t._cache[n]),t._cache[n]=i,t.trigger("change:"+n,t,t._cache[n]))};r.deps.forEach(function(e){t._keyTree.add(e,i)})}),this.on("all",function(e){c.test(e)&&t._keyTree.get(e.split(":")[1]).forEach(function(t){t()})},this)},_getDerivedProperty:function(t,e){return this._derived[t].cache?((e||!this._cache.hasOwnProperty(t))&&(this._cache[t]=this._derived[t].fn.apply(this)),this._cache[t]):this._derived[t].fn.apply(this)},_initCollections:function(){var t;if(this._collections)for(t in this._collections)this[t]=new this._collections[t](null,{parent:this})},_initChildren:function(){var t;if(this._children)for(t in this._children)this[t]=new this._children[t]({},{parent:this}),this.listenTo(this[t],"all",this._getEventBubblingHandler(t))},_getEventBubblingHandler:function(t){return a.bind(function(e,n,r){c.test(e)?this.trigger("change:"+t+"."+e.split(":")[1],n,r):"change"===e&&this.trigger("change",this)},this)},_verifyRequired:function(){var t=this.attributes;for(var e in this._definition)if(this._definition[e].required&&"undefined"==typeof t[e])return!1;return!0}}),Object.defineProperties(n.prototype,{attributes:{get:function(){return this.getAttributes({props:!0,session:!0})}},all:{get:function(){return this.getAttributes({session:!0,props:!0,derived:!0})}},isState:{get:function(){return!0},set:function(){}}});var f={string:{"default":function(){return""}},date:{set:function(t){var e;if(null==t)e="object";else if(a.isDate(t))e="date",t=t.valueOf();else try{var n=new Date(t).valueOf();if(isNaN(n)&&(n=new Date(parseInt(t,10)).valueOf(),isNaN(n)))throw TypeError;t=n,e="date"}catch(r){e=typeof t}return{val:t,type:e}},get:function(t){return null==t?t:new Date(t)},"default":function(){return new Date}},array:{set:function(t){return{val:t,type:a.isArray(t)?"array":typeof t}},"default":function(){return[]}},object:{set:function(t){var e=typeof t;return"object"!==e&&a.isUndefined(t)&&(t=null,e="object"),{val:t,type:e}},"default":function(){return{}}},state:{set:function(t){var e=t instanceof n||t&&t.isState;return e?{val:t,type:"state"}:{val:t,type:typeof t}},compare:function(t,e,n){var r=t===e;return r||(t&&this.stopListening(t),null!=e&&this.listenTo(e,"all",this._getEventBubblingHandler(n))),r}}};n.extend=o,e.exports=n},{"array-next":22,"backbone-events-standalone":24,"key-tree-store":25,underscore:26}],22:[function(t,e){e.exports=function(t,e){var n=t.length,r=t.indexOf(e)+1;return r>n-1&&(r=0),t[r]}},{}],23:[function(t,e){e.exports=t(17)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/backbone-events-standalone/backbone-events-standalone.js":17}],24:[function(t,e){e.exports=t(18)},{"./backbone-events-standalone":23,"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/backbone-events-standalone/index.js":18}],25:[function(t,e){function n(){this.storage={}}n.prototype.add=function(t,e){var n=this.storage[t]||(this.storage[t]=[]);n.push(e)},n.prototype.remove=function(t){var e,n;for(e in this.storage)n=this.storage[e],n.some(function(e,r){return e===t?(n.splice(r,1),!0):void 0})},n.prototype.get=function(t){var e,n=[];for(e in this.storage)(t===e||0===e.indexOf(t+"."))&&(n=n.concat(this.storage[e]));return n},e.exports=n},{}],26:[function(t,e){e.exports=t(11)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection-underscore-mixin/node_modules/underscore/underscore.js":11}],27:[function(t,e){function n(t,e){e||(e={}),this.collection=t,this._reset(),this._watched=e.watched||[],this._parseFilters(e),this._runFilters(),this.listenTo(this.collection,"all",this._onCollectionEvent)}"undefined"!=typeof window&&(window.ampersand=window.ampersand||{},window.ampersand["ampersand-subcollection"]=window.ampersand["ampersand-subcollection"]||[],window.ampersand["ampersand-subcollection"].push("1.5.0"));var r=t("underscore"),i=t("backbone-events-standalone"),o=t("ampersand-class-extend"),a=t("ampersand-collection-underscore-mixin"),u=Array.prototype.slice;r.extend(n.prototype,i,a,{addFilter:function(t){this.swapFilters([t],[])},removeFilter:function(t){this.swapFilters([],[t])},clearFilters:function(){this._reset(),this._runFilters()},swapFilters:function(t,e){var n=this;e?r.isArray(e)||(e=[e]):e=this._filters,t?r.isArray(t)||(t=[t]):t=[],e.forEach(function(t){n._removeFilter(t)}),t.forEach(function(t){n._addFilter(t)}),this._runFilters()},configure:function(t,e){e&&this._resetFilters(),this._parseFilters(t),this._runFilters()},at:function(t){return this.models[t]},get:function(t,e){var n=this.collection.get(t,e);return n&&this.contains(n)?n:void 0},_removeFilter:function(t){var e=this._filters.indexOf(t);-1!==e&&this._filters.splice(e,1)},_reset:function(){this.models=[],this._resetFilters()},_resetFilters:function(){this._filters=[],this._watched=[],this.limit=void 0,this.offset=void 0},_addFilter:function(t){this._filters.push(t)},_watch:function(t){this._watched=r.union(this._watched,r.isArray(t)?t:[t])},_unwatch:function(t){this._watched=r.without(this._watched,t)},_parseFilters:function(t){t.where&&(r.each(t.where,function(t,e){this._addFilter(function(n){return(n.get?n.get(e):n[e])===t})},this),this._watch(r.keys(t.where))),t.hasOwnProperty("limit")&&(this.limit=t.limit),t.hasOwnProperty("offset")&&(this.offset=t.offset),t.filter&&this._addFilter(t.filter,!1),t.filters&&t.filters.forEach(this._addFilter,this),t.comparator&&(this.comparator=t.comparator)},_runFilters:function(){var t,e,n,i=u.call(this.models),o=u.call(this.collection.models),a=this.offset||0;t=this._filters.length?r.reduce(this._filters,function(t,e){return t.filter(e)},o):u.call(o),this.comparator&&(t=r.sortBy(t,this.comparator)),(this.limit||this.offset)&&(t=t.slice(a,this.limit+a)),e=r.difference(t,i),n=r.difference(i,t),this.models=t,r.each(n,function(t){this.trigger("remove",t,this)},this),r.each(e,function(t){this.trigger("add",t,this)},this),r.isEqual(i,t)||this.trigger("sort",this)},_onCollectionEvent:function(t,e){(r.contains(this._watched,t.split(":")[1])||r.contains(["add","remove","reset","sync"],t))&&this._runFilters(),(r.contains(["sync","invalid","destroy"])||-1!==t.indexOf("change"))&&this.contains(e)&&this.trigger.apply(this,arguments)}}),Object.defineProperty(n.prototype,"length",{get:function(){return this.models.length}}),Object.defineProperty(n.prototype,"isCollection",{get:function(){return!0}}),n.extend=o,e.exports=n},{"ampersand-class-extend":28,"ampersand-collection-underscore-mixin":10,"backbone-events-standalone":31,underscore:32}],28:[function(t,e){e.exports=t(16)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-class-extend/ampersand-class-extend.js":16,"extend-object":29}],29:[function(t,e){e.exports=t(19)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/extend-object/extend-object.js":19}],30:[function(t,e){e.exports=t(17)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/backbone-events-standalone/backbone-events-standalone.js":17}],31:[function(t,e){e.exports=t(18)},{"./backbone-events-standalone":30,"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/backbone-events-standalone/index.js":18}],32:[function(t,e){e.exports=t(11)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection-underscore-mixin/node_modules/underscore/underscore.js":11}],33:[function(t,e){function n(t){this.cid=a.uniqueId("view"),t||(t={});var e=t.parent;delete t.parent,f.call(this,t,{init:!1,parent:e}),this.on("change:el",this._handleElementChange,this),this._parsedBindings=l(this.bindings,this),this._initializeBindings(),t.el&&!this.autoRender&&this._handleElementChange(),this._initializeSubviews(),this.template=t.template||this.template,this.initialize.apply(this,arguments),this.set(a.pick(t,h)),this.autoRender&&this.template&&this.render()}"undefined"!=typeof window&&(window.ampersand=window.ampersand||{},window.ampersand["ampersand-view"]=window.ampersand["ampersand-view"]||[],window.ampersand["ampersand-view"].push("7.2.0"));var r=t("ampersand-state"),i=t("ampersand-collection-view"),o=t("domify"),a=t("underscore"),u=t("events-mixin"),s=t("matches-selector"),l=t("ampersand-dom-bindings"),c=t("get-object-path"),f=r.extend({dataTypes:{element:{set:function(t){return{val:t,type:t instanceof Element?"element":typeof t}},compare:function(t,e){return t===e}},collection:{set:function(t){return{val:t,type:t&&t.isCollection?"collection":typeof t}},compare:function(t,e){return t===e}}},props:{model:"state",el:"element",collection:"collection"},derived:{rendered:{deps:["el"],fn:function(){return!!this.el}},hasData:{deps:["model"],fn:function(){return!!this.model}}}}),h=["model","collection","el"];n.prototype=Object.create(f.prototype),a.extend(n.prototype,{query:function(t){return t?"string"==typeof t?s(this.el,t)?this.el:this.el.querySelector(t)||void 0:t:this.el},queryAll:function(t){var e=[];return this.el?""===t?[this.el]:(s(this.el,t)&&e.push(this.el),e.concat(Array.prototype.slice.call(this.el.querySelectorAll(t)))):e},queryByHook:function(t){return this.query('[data-hook~="'+t+'"]')},initialize:function(){},render:function(){return this.renderWithTemplate(this),this},remove:function(){var t=this._parsedBindings;return this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el),this._subviews&&a.chain(this._subviews).flatten().invoke("remove"),this.stopListening(),a.each(t,function(e,n){a.each(e,function(e,r){delete t[n][r]}),delete t[n]}),this.trigger("remove",this),this},_handleElementChange:function(){return this.eventManager&&this.eventManager.unbind(),this.eventManager=u(this.el,this),this.delegateEvents(),this._applyBindingsForKey(),this},delegateEvents:function(t){if(!t&&!(t=a.result(this,"events")))return this;this.undelegateEvents();for(var e in t)this.eventManager.bind(e,t[e]);return this},undelegateEvents:function(){return this.eventManager.unbind(),this},registerSubview:function(t){return this._subviews||(this._subviews=[]),this._subviews.push(t),t.el&&(t.parent=this),t},renderSubview:function(t,e){return"string"==typeof e&&(e=this.query(e)),this.registerSubview(t),t.render(),(e||this.el).appendChild(t.el),t},_applyBindingsForKey:function(t){if(this.el){var e,n=this._parsedBindings.getGrouped(t);for(e in n)n[e].forEach(function(t){t(this.el,c(this,e),a.last(e.split(".")))},this)}},_initializeBindings:function(){this.bindings&&this.on("all",function(t){"change:"===t.slice(0,7)&&this._applyBindingsForKey(t.split(":")[1])},this)},_initializeSubviews:function(){if(this.subviews)for(var t in this.subviews)this._parseSubview(this.subviews[t],t)},_parseSubview:function(t,e){function n(){var t,r;this.el&&(t=this.query(i.selector))&&(!i.waitFor||c(this,i.waitFor))&&(r=this[e]=i.prepareView.call(this,t),r.render(),this.registerSubview(r),this.off("change",n))}var r=this,i={selector:t.container||'[data-hook="'+t.hook+'"]',waitFor:t.waitFor||"",prepareView:t.prepareView||function(e){return new t.constructor({el:e,parent:r})}};this.on("change",n,this)},renderWithTemplate:function(t,e){var n=e||this.template;if(!n)throw new Error("Template string or function needed.");var r=a.isString(n)?n:n.call(this,t||this);a.isString(r)&&(r=o(r));var i=this.el&&this.el.parentNode;if(i&&i.replaceChild(r,this.el),"#document-fragment"===r.nodeName)throw new Error("Views can only have one root element.");return this.el=r,this},cacheElements:function(t){for(var e in t)this[e]=this.query(t[e])},listenToAndRun:function(t,e,n){var r=a.bind(n,this);this.listenTo(t,e,r),r()},animateRemove:function(){this.remove()},renderCollection:function(t,e,n,r){var o="string"==typeof n?this.query(n):n,u=a.extend({collection:t,el:o||this.el,view:e,parent:this,viewOptions:{parent:this}},r),s=new i(u);return s.render(),this.registerSubview(s)}}),n.extend=f.extend,e.exports=n},{"ampersand-collection-view":34,"ampersand-dom-bindings":39,"ampersand-state":21,domify:42,"events-mixin":43,"get-object-path":48,"matches-selector":49,underscore:50}],34:[function(t,e){function n(t){if(!t)throw new ReferenceError("Collection view missing required parameters: collection, el");if(!t.collection)throw new ReferenceError("Collection view requires a collection");if(!t.el&&!this.insertSelf)throw new ReferenceError("Collection view requires an el");r.extend(this,r.pick(t,a)),this.views=[],this.listenTo(this.collection,"add",this._addViewForModel),this.listenTo(this.collection,"remove",this._removeViewForModel),this.listenTo(this.collection,"sort",this._rerenderAll),this.listenTo(this.collection,"refresh reset",this._reset)}"undefined"!=typeof window&&(window.ampersand=window.ampersand||{},window.ampersand["ampersand-collection-view"]=window.ampersand["ampersand-collection-view"]||[],window.ampersand["ampersand-collection-view"].push("1.2.1"));var r=t("underscore"),i=t("backbone-events-standalone"),o=t("ampersand-class-extend"),a=["collection","el","viewOptions","view","emptyView","filter","reverse","parent"];r.extend(n.prototype,i,{render:function(){return this._renderAll(),this},remove:function(){r.invoke(this.views,"remove"),this.stopListening()},_getViewByModel:function(t){return r.find(this.views,function(e){return t===e.model})},_createViewForModel:function(t,e){var n=new this.view(r({model:t,collection:this.collection}).extend(this.viewOptions));return this.views.push(n),n.parent=this,n.renderedByParentView=!0,n.render(e),n},_getOrCreateByModel:function(t,e){return this._getViewByModel(t)||this._createViewForModel(t,e)},_addViewForModel:function(t,e,n){var r=this.filter?this.filter(t):!0;if(r){this.renderedEmptyView&&(this.renderedEmptyView.remove(),delete this.renderedEmptyView);var i=this._getOrCreateByModel(t,{containerEl:this.el});n&&n.rerender?this._insertView(i):this._insertViewAtIndex(i)}},_insertViewAtIndex:function(t){if(!t.insertSelf){var e,n,r=this.collection.indexOf(t.model);e=this.collection.at(this.reverse?r-1:r+1),n=this._getViewByModel(e),n?this.el.insertBefore(t.el,n&&n.el):this.el.appendChild(t.el)}},_insertView:function(t){t.insertSelf||(this.reverse&&this.el.firstChild?this.el.insertBefore(t.el,this.el.firstChild):this.el.appendChild(t.el))},_removeViewForModel:function(t){var e=this._getViewByModel(t);if(e){var n=this.views.indexOf(e);-1!==n&&(e=this.views.splice(n,1)[0],this._removeView(e),0===this.views.length&&this._renderEmptyView())}},_removeView:function(t){t.animateRemove?t.animateRemove():t.remove()},_renderAll:function(){this.collection.each(this._addViewForModel,this),0===this.views.length&&this._renderEmptyView()},_rerenderAll:function(t,e){e=e||{},this.collection.each(function(t){this._addViewForModel(t,this,r.extend(e,{rerender:!0}))},this)},_renderEmptyView:function(){if(this.emptyView&&!this.renderedEmptyView){var t=this.renderedEmptyView=new this.emptyView;this.el.appendChild(t.render().el)}},_reset:function(){var t=this.collection.map(this._getOrCreateByModel,this),e=r.difference(this.views,t);e.forEach(this._removeView,this),this.views=t,this._rerenderAll(),0===this.views.length&&this._renderEmptyView()}}),n.extend=o,e.exports=n},{"ampersand-class-extend":35,"backbone-events-standalone":38,underscore:50}],35:[function(t,e){e.exports=t(16)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-class-extend/ampersand-class-extend.js":16,"extend-object":36}],36:[function(t,e){e.exports=t(19)},{"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/extend-object/extend-object.js":19}],37:[function(t,e,n){!function(){function t(){return{keys:Object.keys||function(t){if("object"!=typeof t&&"function"!=typeof t||null===t)throw new TypeError("keys() called on a non-object");var e,n=[];for(e in t)t.hasOwnProperty(e)&&(n[n.length]=e);return n},uniqueId:function(t){var e=++l+"";return t?t+e:e},has:function(t,e){return u.call(t,e)},each:function(t,e,n){if(null!=t)if(a&&t.forEach===a)t.forEach(e,n);else if(t.length===+t.length){for(var r=0,i=t.length;i>r;r++)if(e.call(n,t[r],r,t)===o)return}else for(var u in t)if(this.has(t,u)&&e.call(n,t[u],u,t)===o)return},once:function(t){var e,n=!1;return function(){return n?e:(n=!0,e=t.apply(this,arguments),t=null,e)}}}}var r,i=this,o={},a=Array.prototype.forEach,u=Object.prototype.hasOwnProperty,s=Array.prototype.slice,l=0,c=t();r={on:function(t,e,n){if(!h(this,"on",t,[e,n])||!e)return this;this._events||(this._events={});var r=this._events[t]||(this._events[t]=[]);return r.push({callback:e,context:n,ctx:n||this}),this},once:function(t,e,n){if(!h(this,"once",t,[e,n])||!e)return this;var r=this,i=c.once(function(){r.off(t,i),e.apply(this,arguments)});return i._callback=e,this.on(t,i,n)},off:function(t,e,n){var r,i,o,a,u,s,l,f;if(!this._events||!h(this,"off",t,[e,n]))return this;if(!t&&!e&&!n)return this._events={},this;for(a=t?[t]:c.keys(this._events),u=0,s=a.length;s>u;u++)if(t=a[u],o=this._events[t]){if(this._events[t]=r=[],e||n)for(l=0,f=o.length;f>l;l++)i=o[l],(e&&e!==i.callback&&e!==i.callback._callback||n&&n!==i.context)&&r.push(i);r.length||delete this._events[t]}return this},trigger:function(t){if(!this._events)return this;var e=s.call(arguments,1);if(!h(this,"trigger",t,e))return this;var n=this._events[t],r=this._events.all;return n&&p(n,e),r&&p(r,arguments),this},stopListening:function(t,e,n){var r=this._listeners;if(!r)return this;var i=!e&&!n;"object"==typeof e&&(n=this),t&&((r={})[t._listenerId]=t);for(var o in r)r[o].off(e,n,this),i&&delete this._listeners[o];return this}};var f=/\s+/,h=function(t,e,n,r){if(!n)return!0;if("object"==typeof n){for(var i in n)t[e].apply(t,[i,n[i]].concat(r));return!1}if(f.test(n)){for(var o=n.split(f),a=0,u=o.length;u>a;a++)t[e].apply(t,[o[a]].concat(r));return!1}return!0},p=function(t,e){var n,r=-1,i=t.length,o=e[0],a=e[1],u=e[2];switch(e.length){case 0:for(;++r<i;)(n=t[r]).callback.call(n.ctx);return;case 1:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o);return;case 2:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o,a);return;case 3:for(;++r<i;)(n=t[r]).callback.call(n.ctx,o,a,u);return;default:for(;++r<i;)(n=t[r]).callback.apply(n.ctx,e)}},d={listenTo:"on",listenToOnce:"once"};c.each(d,function(t,e){r[e]=function(e,n,r){var i=this._listeners||(this._listeners={}),o=e._listenerId||(e._listenerId=c.uniqueId("l"));return i[o]=e,"object"==typeof n&&(r=this),e[t](n,r,this),this}}),r.bind=r.on,r.unbind=r.off,r.mixin=function(t){var e=["on","once","off","trigger","stopListening","listenTo","listenToOnce","bind","unbind"];return c.each(e,function(e){t[e]=this[e]},this),t},"function"==typeof define?define(function(){return r}):"undefined"!=typeof n?("undefined"!=typeof e&&e.exports&&(n=e.exports=r),n.BackboneEvents=r):i.BackboneEvents=r}(this)},{}],38:[function(t,e,n){arguments[4][18][0].apply(n,arguments)},{"./backbone-events-standalone":37,"/home/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/backbone-events-standalone/index.js":18}],39:[function(t,e){function n(t,e){if(""===e)return[t];var n=[];return u(t,e)&&n.push(t),n.concat(s.call(t.querySelectorAll(e)))}function r(t){return Array.isArray(t)?t:[t]}function i(t,e){var i,o=t.type||"text",u="function"==typeof o,s=function(){return"string"==typeof t.selector?t.selector:t.hook?'[data-hook~="'+t.hook+'"]':""}(),l=t.yes,c=t.no,f=!(!l&&!c);if(u)return function(t,r){n(t,s).forEach(function(t){o.call(e,t,r,i)}),i=r};if("text"===o)return function(t,e){n(t,s).forEach(function(t){a.text(t,e)})};if("class"===o)return function(t,e){n(t,s).forEach(function(t){a.switchClass(t,i,e)}),i=e};if("attribute"===o){if(!t.name)throw Error('attribute bindings must have a "name"');return function(e,o){var u=r(t.name);n(e,s).forEach(function(t){u.forEach(function(e){a.setAttribute(t,e,o)})}),i=o}}if("value"===o)return function(t,e){n(t,s).forEach(function(t){e||0===e||(e=""),document.activeElement!==t&&(t.value=e)}),i=e};if("booleanClass"===o)return f?(l=r(l||""),c=r(c||""),function(t,e){var r=e?c:l,i=e?l:c;n(t,s).forEach(function(t){r.forEach(function(e){a.removeClass(t,e)}),i.forEach(function(e){a.addClass(t,e)})})}):function(e,i,o){var u=r(t.name||o);n(e,s).forEach(function(t){u.forEach(function(e){a[i?"addClass":"removeClass"](t,e)})})};if("booleanAttribute"===o)return function(e,i,o){var u=r(t.name||o);n(e,s).forEach(function(t){u.forEach(function(e){a[i?"addAttribute":"removeAttribute"](t,e)})})};if("toggle"===o)return f?function(t,e){n(t,l).forEach(function(t){a[e?"show":"hide"](t)}),n(t,c).forEach(function(t){a[e?"hide":"show"](t)})}:function(t,e){n(t,s).forEach(function(t){a[e?"show":"hide"](t)})};if("switch"===o){if(!t.cases)throw Error('switch bindings must have "cases"');return function(e,r){for(var i in t.cases)n(e,t.cases[i]).forEach(function(t){a[r===i?"show":"hide"](t)})}}if("innerHTML"===o)return function(t,e){n(t,s).forEach(function(t){a.html(t,e)})};if("switchClass"===o){if(!t.cases)throw Error('switchClass bindings must have "cases"');return function(e,i,o){var u=r(t.name||o);for(var s in t.cases)n(e,t.cases[s]).forEach(function(t){u.forEach(function(e){a[i===s?"addClass":"removeClass"](t,e)})})}}throw new Error("no such binding type: "+o)}"undefined"!=typeof window&&(window.ampersand=window.ampersand||{},window.ampersand["ampersand-dom-bindings"]=window.ampersand["ampersand-dom-bindings"]||[],window.ampersand["ampersand-dom-bindings"].push("3.3.3"));var o=t("key-tree-store"),a=t("ampersand-dom"),u=t("matches-selector");e.exports=function(t,e){var n,r,a=new o;for(n in t)r=t[n],"string"==typeof r?a.add(n,i({type:"text",selector:r})):r.forEach?r.forEach(function(t){a.add(n,i(t,e))}):a.add(n,i(r,e));return a};var s=Array.prototype.slice},{"ampersand-dom":40,"key-tree-store":41,"matches-selector":49}],40:[function(t,e){function n(t){return t||0===t?t:""}function r(t,e){return t.classList?t.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(t.className)}function i(t,e){var n=t[e];return e in t&&(n===!0||n===!1)}function o(t){return"true"===l.getAttribute(t,"data-anddom-hidden")}function a(t){l.setAttribute(t,"data-anddom-display",t.style.display)}function u(t){t.style.display=l.getAttribute(t,"data-anddom-display")||"",l.removeAttribute(t,"data-anddom-hidden")}function s(t){l.setAttribute(t,"data-anddom-hidden","true"),t.style.display="none"}"undefined"!=typeof window&&(window.ampersand=window.ampersand||{},window.ampersand["ampersand-dom"]=window.ampersand["ampersand-dom"]||[],window.ampersand["ampersand-dom"].push("1.2.7"));var l=e.exports={text:function(t,e){t.textContent=n(e)},addClass:function(t,e){e=n(e),e&&(Array.isArray(e)?e.forEach(function(e){l.addClass(t,e)}):t.classList?t.classList.add(e):r(t,e)||(t.classList?t.classList.add(e):t.className+=" "+e))},removeClass:function(t,e){Array.isArray(e)?e.forEach(function(e){l.removeClass(t,e)}):t.classList?(e=n(e),e&&t.classList.remove(e)):t.className=t.className.replace(new RegExp("(^|\\b)"+e.split(" ").join("|")+"(\\b|$)","gi")," ")
-},hasClass:r,switchClass:function(t,e,n){e&&this.removeClass(t,e),this.addClass(t,n)},addAttribute:function(t,e){t.setAttribute(e,""),i(t,e)&&(t[e]=!0)},removeAttribute:function(t,e){t.removeAttribute(e),i(t,e)&&(t[e]=!1)},setAttribute:function(t,e,r){t.setAttribute(e,n(r))},getAttribute:function(t,e){return t.getAttribute(e)},hide:function(t){o(t)||(a(t),s(t))},show:function(t){u(t)},html:function(t,e){t.innerHTML=e}}},{}],41:[function(t,e){function n(){this.storage={}}var r=Array.prototype.slice;n.prototype.add=function(t,e){var n=this.storage[t]||(this.storage[t]=[]);n.push(e)},n.prototype.remove=function(t){var e,n;for(e in this.storage)n=this.storage[e],n.some(function(e,r){return e===t?(n.splice(r,1),!0):void 0})},n.prototype.get=function(t){var e,n=[];for(e in this.storage)t&&t!==e&&0!==e.indexOf(t+".")||(n=n.concat(this.storage[e]));return n},n.prototype.getGrouped=function(t){var e,n={};for(e in this.storage)t&&t!==e&&0!==e.indexOf(t+".")||(n[e]=r.call(this.storage[e]));return n},n.prototype.getAll=function(t){var e,n={};for(e in this.storage)(t===e||0===e.indexOf(t+"."))&&(n[e]=r.call(this.storage[e]));return n},n.prototype.run=function(t,e){var n=r.call(arguments,2);this.get(t).forEach(function(t){t.apply(e||this,n)})},e.exports=n},{}],42:[function(t,e){function n(t,e){if("string"!=typeof t)throw new TypeError("String expected");e||(e=document);var n=/<([\w:]+)/.exec(t);if(!n)return e.createTextNode(t);t=t.replace(/^\s+|\s+$/g,"");var r=n[1];if("body"==r){var i=e.createElement("html");return i.innerHTML=t,i.removeChild(i.lastChild)}var a=o[r]||o._default,u=a[0],s=a[1],l=a[2],i=e.createElement("div");for(i.innerHTML=s+t+l;u--;)i=i.lastChild;if(i.firstChild==i.lastChild)return i.removeChild(i.firstChild);for(var c=e.createDocumentFragment();i.firstChild;)c.appendChild(i.removeChild(i.firstChild));return c}e.exports=n;var r=document.createElement("div");r.innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>';var i=!r.getElementsByTagName("link").length;r=void 0;var o={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:i?[1,"X<div>","</div>"]:[0,"",""]};o.td=o.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],o.option=o.optgroup=[1,'<select multiple="multiple">',"</select>"],o.thead=o.tbody=o.colgroup=o.caption=o.tfoot=[1,"<table>","</table>"],o.text=o.circle=o.ellipse=o.line=o.path=o.polygon=o.polyline=o.rect=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"]},{}],43:[function(t,e){function n(t,e){if(!(this instanceof n))return new n(t,e);if(!t)throw new Error("element required");if(!e)throw new Error("object required");this.el=t,this.obj=e,this._events={}}function r(t){var e=t.split(/ +/);return{name:e.shift(),selector:e.join(" ")}}var i=t("component-event"),o=t("delegate-events"),a=["focus","blur"];e.exports=n,n.prototype.sub=function(t,e,n){this._events[t]=this._events[t]||{},this._events[t][e]=n},n.prototype.bind=function(t,e){function n(){var t=[].slice.call(arguments).concat(c);if("function"==typeof e)return void e.apply(s,t);if(!s[e])throw new Error(e+" method is not defined");s[e].apply(s,t)}var a=r(t),u=this.el,s=this.obj,l=a.name,e=e||"on"+l,c=[].slice.call(arguments,2);return a.selector?n=o.bind(u,a.selector,l,n):i.bind(u,l,n),this.sub(l,e,n),n},n.prototype.unbind=function(t,e){if(0==arguments.length)return this.unbindAll();if(1==arguments.length)return this.unbindAllOf(t);var n=this._events[t],r=-1!==a.indexOf(t);if(n){var o=n[e];o&&i.unbind(this.el,t,o,r)}},n.prototype.unbindAll=function(){for(var t in this._events)this.unbindAllOf(t)},n.prototype.unbindAllOf=function(t){var e=this._events[t];if(e)for(var n in e)this.unbind(t,n)}},{"component-event":44,"delegate-events":45}],44:[function(t,e,n){var r=window.addEventListener?"addEventListener":"attachEvent",i=window.removeEventListener?"removeEventListener":"detachEvent",o="addEventListener"!==r?"on":"";n.bind=function(t,e,n,i){return t[r](o+e,n,i||!1),n},n.unbind=function(t,e,n,r){return t[i](o+e,n,r||!1),n}},{}],45:[function(t,e,n){var r=t("closest"),i=t("event"),o=["focus","blur"];n.bind=function(t,e,n,a,u){return-1!==o.indexOf(n)&&(u=!0),i.bind(t,n,function(n){var i=n.target||n.srcElement;n.delegateTarget=r(i,e,!0,t),n.delegateTarget&&a.call(t,n)},u)},n.unbind=function(t,e,n,r){-1!==o.indexOf(e)&&(r=!0),i.unbind(t,e,n,r)}},{closest:46,event:44}],46:[function(t,e){var n=t("matches-selector");e.exports=function(t,e,r){for(var i=r?t:t.parentNode;i&&i!==document;){if(n(i,e))return i;i=i.parentNode}}},{"matches-selector":47}],47:[function(t,e){function n(t,e){if(i)return i.call(t,e);for(var n=t.parentNode.querySelectorAll(e),r=0;r<n.length;++r)if(n[r]==t)return!0;return!1}var r=Element.prototype,i=r.matchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector||r.msMatchesSelector||r.oMatchesSelector;e.exports=n},{}],48:[function(t,e){function n(t,e){if(-1==e.indexOf(".")&&-1==e.indexOf("["))return t[e];for(var n,r=e.split(/\.|\[|\]/g),i=-1,o=r.length;++i<o;)if(0==i&&(n=t),r[i]){if(void 0==n)break;n=n[r[i]]}return n}e.exports=n},{}],49:[function(t,e){"use strict";function n(t,e){if(i)return i.call(t,e);for(var n=t.parentNode.querySelectorAll(e),r=0;r<n.length;r++)if(n[r]==t)return!0;return!1}var r=Element.prototype,i=r.matches||r.matchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector||r.msMatchesSelector||r.oMatchesSelector;e.exports=n},{}],50:[function(t,e,n){(function(){var t=this,r=t._,i={},o=Array.prototype,a=Object.prototype,u=Function.prototype,s=o.push,l=o.slice,c=o.concat,f=a.toString,h=a.hasOwnProperty,p=o.forEach,d=o.map,g=o.reduce,v=o.reduceRight,m=o.filter,y=o.every,b=o.some,x=o.indexOf,w=o.lastIndexOf,_=Array.isArray,M=Object.keys,k=u.bind,E=function(t){return t instanceof E?t:this instanceof E?void(this._wrapped=t):new E(t)};"undefined"!=typeof n?("undefined"!=typeof e&&e.exports&&(n=e.exports=E),n._=E):t._=E,E.VERSION="1.6.0";var C=E.each=E.forEach=function(t,e,n){if(null==t)return t;if(p&&t.forEach===p)t.forEach(e,n);else if(t.length===+t.length){for(var r=0,o=t.length;o>r;r++)if(e.call(n,t[r],r,t)===i)return}else for(var a=E.keys(t),r=0,o=a.length;o>r;r++)if(e.call(n,t[a[r]],a[r],t)===i)return;return t};E.map=E.collect=function(t,e,n){var r=[];return null==t?r:d&&t.map===d?t.map(e,n):(C(t,function(t,i,o){r.push(e.call(n,t,i,o))}),r)};var S="Reduce of empty array with no initial value";E.reduce=E.foldl=E.inject=function(t,e,n,r){var i=arguments.length>2;if(null==t&&(t=[]),g&&t.reduce===g)return r&&(e=E.bind(e,r)),i?t.reduce(e,n):t.reduce(e);if(C(t,function(t,o,a){i?n=e.call(r,n,t,o,a):(n=t,i=!0)}),!i)throw new TypeError(S);return n},E.reduceRight=E.foldr=function(t,e,n,r){var i=arguments.length>2;if(null==t&&(t=[]),v&&t.reduceRight===v)return r&&(e=E.bind(e,r)),i?t.reduceRight(e,n):t.reduceRight(e);var o=t.length;if(o!==+o){var a=E.keys(t);o=a.length}if(C(t,function(u,s,l){s=a?a[--o]:--o,i?n=e.call(r,n,t[s],s,l):(n=t[s],i=!0)}),!i)throw new TypeError(S);return n},E.find=E.detect=function(t,e,n){var r;return T(t,function(t,i,o){return e.call(n,t,i,o)?(r=t,!0):void 0}),r},E.filter=E.select=function(t,e,n){var r=[];return null==t?r:m&&t.filter===m?t.filter(e,n):(C(t,function(t,i,o){e.call(n,t,i,o)&&r.push(t)}),r)},E.reject=function(t,e,n){return E.filter(t,function(t,r,i){return!e.call(n,t,r,i)},n)},E.every=E.all=function(t,e,n){e||(e=E.identity);var r=!0;return null==t?r:y&&t.every===y?t.every(e,n):(C(t,function(t,o,a){return(r=r&&e.call(n,t,o,a))?void 0:i}),!!r)};var T=E.some=E.any=function(t,e,n){e||(e=E.identity);var r=!1;return null==t?r:b&&t.some===b?t.some(e,n):(C(t,function(t,o,a){return r||(r=e.call(n,t,o,a))?i:void 0}),!!r)};E.contains=E.include=function(t,e){return null==t?!1:x&&t.indexOf===x?-1!=t.indexOf(e):T(t,function(t){return t===e})},E.invoke=function(t,e){var n=l.call(arguments,2),r=E.isFunction(e);return E.map(t,function(t){return(r?e:t[e]).apply(t,n)})},E.pluck=function(t,e){return E.map(t,E.property(e))},E.where=function(t,e){return E.filter(t,E.matches(e))},E.findWhere=function(t,e){return E.find(t,E.matches(e))},E.max=function(t,e,n){if(!e&&E.isArray(t)&&t[0]===+t[0]&&t.length<65535)return Math.max.apply(Math,t);var r=-1/0,i=-1/0;return C(t,function(t,o,a){var u=e?e.call(n,t,o,a):t;u>i&&(r=t,i=u)}),r},E.min=function(t,e,n){if(!e&&E.isArray(t)&&t[0]===+t[0]&&t.length<65535)return Math.min.apply(Math,t);var r=1/0,i=1/0;return C(t,function(t,o,a){var u=e?e.call(n,t,o,a):t;i>u&&(r=t,i=u)}),r},E.shuffle=function(t){var e,n=0,r=[];return C(t,function(t){e=E.random(n++),r[n-1]=r[e],r[e]=t}),r},E.sample=function(t,e,n){return null==e||n?(t.length!==+t.length&&(t=E.values(t)),t[E.random(t.length-1)]):E.shuffle(t).slice(0,Math.max(0,e))};var j=function(t){return null==t?E.identity:E.isFunction(t)?t:E.property(t)};E.sortBy=function(t,e,n){return e=j(e),E.pluck(E.map(t,function(t,r,i){return{value:t,index:r,criteria:e.call(n,t,r,i)}}).sort(function(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(r>n||void 0===r)return-1}return t.index-e.index}),"value")};var A=function(t){return function(e,n,r){var i={};return n=j(n),C(e,function(o,a){var u=n.call(r,o,a,e);t(i,u,o)}),i}};E.groupBy=A(function(t,e,n){E.has(t,e)?t[e].push(n):t[e]=[n]}),E.indexBy=A(function(t,e,n){t[e]=n}),E.countBy=A(function(t,e){E.has(t,e)?t[e]++:t[e]=1}),E.sortedIndex=function(t,e,n,r){n=j(n);for(var i=n.call(r,e),o=0,a=t.length;a>o;){var u=o+a>>>1;n.call(r,t[u])<i?o=u+1:a=u}return o},E.toArray=function(t){return t?E.isArray(t)?l.call(t):t.length===+t.length?E.map(t,E.identity):E.values(t):[]},E.size=function(t){return null==t?0:t.length===+t.length?t.length:E.keys(t).length},E.first=E.head=E.take=function(t,e,n){return null==t?void 0:null==e||n?t[0]:0>e?[]:l.call(t,0,e)},E.initial=function(t,e,n){return l.call(t,0,t.length-(null==e||n?1:e))},E.last=function(t,e,n){return null==t?void 0:null==e||n?t[t.length-1]:l.call(t,Math.max(t.length-e,0))},E.rest=E.tail=E.drop=function(t,e,n){return l.call(t,null==e||n?1:e)},E.compact=function(t){return E.filter(t,E.identity)};var N=function(t,e,n){return e&&E.every(t,E.isArray)?c.apply(n,t):(C(t,function(t){E.isArray(t)||E.isArguments(t)?e?s.apply(n,t):N(t,e,n):n.push(t)}),n)};E.flatten=function(t,e){return N(t,e,[])},E.without=function(t){return E.difference(t,l.call(arguments,1))},E.partition=function(t,e){var n=[],r=[];return C(t,function(t){(e(t)?n:r).push(t)}),[n,r]},E.uniq=E.unique=function(t,e,n,r){E.isFunction(e)&&(r=n,n=e,e=!1);var i=n?E.map(t,n,r):t,o=[],a=[];return C(i,function(n,r){(e?r&&a[a.length-1]===n:E.contains(a,n))||(a.push(n),o.push(t[r]))}),o},E.union=function(){return E.uniq(E.flatten(arguments,!0))},E.intersection=function(t){var e=l.call(arguments,1);return E.filter(E.uniq(t),function(t){return E.every(e,function(e){return E.contains(e,t)})})},E.difference=function(t){var e=c.apply(o,l.call(arguments,1));return E.filter(t,function(t){return!E.contains(e,t)})},E.zip=function(){for(var t=E.max(E.pluck(arguments,"length").concat(0)),e=new Array(t),n=0;t>n;n++)e[n]=E.pluck(arguments,""+n);return e},E.object=function(t,e){if(null==t)return{};for(var n={},r=0,i=t.length;i>r;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n},E.indexOf=function(t,e,n){if(null==t)return-1;var r=0,i=t.length;if(n){if("number"!=typeof n)return r=E.sortedIndex(t,e),t[r]===e?r:-1;r=0>n?Math.max(0,i+n):n}if(x&&t.indexOf===x)return t.indexOf(e,n);for(;i>r;r++)if(t[r]===e)return r;return-1},E.lastIndexOf=function(t,e,n){if(null==t)return-1;var r=null!=n;if(w&&t.lastIndexOf===w)return r?t.lastIndexOf(e,n):t.lastIndexOf(e);for(var i=r?n:t.length;i--;)if(t[i]===e)return i;return-1},E.range=function(t,e,n){arguments.length<=1&&(e=t||0,t=0),n=arguments[2]||1;for(var r=Math.max(Math.ceil((e-t)/n),0),i=0,o=new Array(r);r>i;)o[i++]=t,t+=n;return o};var O=function(){};E.bind=function(t,e){var n,r;if(k&&t.bind===k)return k.apply(t,l.call(arguments,1));if(!E.isFunction(t))throw new TypeError;return n=l.call(arguments,2),r=function(){if(!(this instanceof r))return t.apply(e,n.concat(l.call(arguments)));O.prototype=t.prototype;var i=new O;O.prototype=null;var o=t.apply(i,n.concat(l.call(arguments)));return Object(o)===o?o:i}},E.partial=function(t){var e=l.call(arguments,1);return function(){for(var n=0,r=e.slice(),i=0,o=r.length;o>i;i++)r[i]===E&&(r[i]=arguments[n++]);for(;n<arguments.length;)r.push(arguments[n++]);return t.apply(this,r)}},E.bindAll=function(t){var e=l.call(arguments,1);if(0===e.length)throw new Error("bindAll must be passed function names");return C(e,function(e){t[e]=E.bind(t[e],t)}),t},E.memoize=function(t,e){var n={};return e||(e=E.identity),function(){var r=e.apply(this,arguments);return E.has(n,r)?n[r]:n[r]=t.apply(this,arguments)}},E.delay=function(t,e){var n=l.call(arguments,2);return setTimeout(function(){return t.apply(null,n)},e)},E.defer=function(t){return E.delay.apply(E,[t,1].concat(l.call(arguments,1)))},E.throttle=function(t,e,n){var r,i,o,a=null,u=0;n||(n={});var s=function(){u=n.leading===!1?0:E.now(),a=null,o=t.apply(r,i),r=i=null};return function(){var l=E.now();u||n.leading!==!1||(u=l);var c=e-(l-u);return r=this,i=arguments,0>=c?(clearTimeout(a),a=null,u=l,o=t.apply(r,i),r=i=null):a||n.trailing===!1||(a=setTimeout(s,c)),o}},E.debounce=function(t,e,n){var r,i,o,a,u,s=function(){var l=E.now()-a;e>l?r=setTimeout(s,e-l):(r=null,n||(u=t.apply(o,i),o=i=null))};return function(){o=this,i=arguments,a=E.now();var l=n&&!r;return r||(r=setTimeout(s,e)),l&&(u=t.apply(o,i),o=i=null),u}},E.once=function(t){var e,n=!1;return function(){return n?e:(n=!0,e=t.apply(this,arguments),t=null,e)}},E.wrap=function(t,e){return E.partial(e,t)},E.compose=function(){var t=arguments;return function(){for(var e=arguments,n=t.length-1;n>=0;n--)e=[t[n].apply(this,e)];return e[0]}},E.after=function(t,e){return function(){return--t<1?e.apply(this,arguments):void 0}},E.keys=function(t){if(!E.isObject(t))return[];if(M)return M(t);var e=[];for(var n in t)E.has(t,n)&&e.push(n);return e},E.values=function(t){for(var e=E.keys(t),n=e.length,r=new Array(n),i=0;n>i;i++)r[i]=t[e[i]];return r},E.pairs=function(t){for(var e=E.keys(t),n=e.length,r=new Array(n),i=0;n>i;i++)r[i]=[e[i],t[e[i]]];return r},E.invert=function(t){for(var e={},n=E.keys(t),r=0,i=n.length;i>r;r++)e[t[n[r]]]=n[r];return e},E.functions=E.methods=function(t){var e=[];for(var n in t)E.isFunction(t[n])&&e.push(n);return e.sort()},E.extend=function(t){return C(l.call(arguments,1),function(e){if(e)for(var n in e)t[n]=e[n]}),t},E.pick=function(t){var e={},n=c.apply(o,l.call(arguments,1));return C(n,function(n){n in t&&(e[n]=t[n])}),e},E.omit=function(t){var e={},n=c.apply(o,l.call(arguments,1));for(var r in t)E.contains(n,r)||(e[r]=t[r]);return e},E.defaults=function(t){return C(l.call(arguments,1),function(e){if(e)for(var n in e)void 0===t[n]&&(t[n]=e[n])}),t},E.clone=function(t){return E.isObject(t)?E.isArray(t)?t.slice():E.extend({},t):t},E.tap=function(t,e){return e(t),t};var q=function(t,e,n,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return t===e;t instanceof E&&(t=t._wrapped),e instanceof E&&(e=e._wrapped);var i=f.call(t);if(i!=f.call(e))return!1;switch(i){case"[object String]":return t==String(e);case"[object Number]":return t!=+t?e!=+e:0==t?1/t==1/e:t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object RegExp]":return t.source==e.source&&t.global==e.global&&t.multiline==e.multiline&&t.ignoreCase==e.ignoreCase}if("object"!=typeof t||"object"!=typeof e)return!1;for(var o=n.length;o--;)if(n[o]==t)return r[o]==e;var a=t.constructor,u=e.constructor;if(a!==u&&!(E.isFunction(a)&&a instanceof a&&E.isFunction(u)&&u instanceof u)&&"constructor"in t&&"constructor"in e)return!1;n.push(t),r.push(e);var s=0,l=!0;if("[object Array]"==i){if(s=t.length,l=s==e.length)for(;s--&&(l=q(t[s],e[s],n,r)););}else{for(var c in t)if(E.has(t,c)&&(s++,!(l=E.has(e,c)&&q(t[c],e[c],n,r))))break;if(l){for(c in e)if(E.has(e,c)&&!s--)break;l=!s}}return n.pop(),r.pop(),l};E.isEqual=function(t,e){return q(t,e,[],[])},E.isEmpty=function(t){if(null==t)return!0;if(E.isArray(t)||E.isString(t))return 0===t.length;for(var e in t)if(E.has(t,e))return!1;return!0},E.isElement=function(t){return!(!t||1!==t.nodeType)},E.isArray=_||function(t){return"[object Array]"==f.call(t)},E.isObject=function(t){return t===Object(t)},C(["Arguments","Function","String","Number","Date","RegExp"],function(t){E["is"+t]=function(e){return f.call(e)=="[object "+t+"]"}}),E.isArguments(arguments)||(E.isArguments=function(t){return!(!t||!E.has(t,"callee"))}),"function"!=typeof/./&&(E.isFunction=function(t){return"function"==typeof t}),E.isFinite=function(t){return isFinite(t)&&!isNaN(parseFloat(t))},E.isNaN=function(t){return E.isNumber(t)&&t!=+t},E.isBoolean=function(t){return t===!0||t===!1||"[object Boolean]"==f.call(t)},E.isNull=function(t){return null===t},E.isUndefined=function(t){return void 0===t},E.has=function(t,e){return h.call(t,e)},E.noConflict=function(){return t._=r,this},E.identity=function(t){return t},E.constant=function(t){return function(){return t}},E.property=function(t){return function(e){return e[t]}},E.matches=function(t){return function(e){if(e===t)return!0;for(var n in t)if(t[n]!==e[n])return!1;return!0}},E.times=function(t,e,n){for(var r=Array(Math.max(0,t)),i=0;t>i;i++)r[i]=e.call(n,i);return r},E.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))},E.now=Date.now||function(){return(new Date).getTime()};var D={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"}};D.unescape=E.invert(D.escape);var L={escape:new RegExp("["+E.keys(D.escape).join("")+"]","g"),unescape:new RegExp("("+E.keys(D.unescape).join("|")+")","g")};E.each(["escape","unescape"],function(t){E[t]=function(e){return null==e?"":(""+e).replace(L[t],function(e){return D[t][e]})}}),E.result=function(t,e){if(null==t)return void 0;var n=t[e];return E.isFunction(n)?n.call(t):n},E.mixin=function(t){C(E.functions(t),function(e){var n=E[e]=t[e];E.prototype[e]=function(){var t=[this._wrapped];return s.apply(t,arguments),P.call(this,n.apply(E,t))}})};var F=0;E.uniqueId=function(t){var e=++F+"";return t?t+e:e},E.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var z=/(.)^/,R={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},I=/\\|'|\r|\n|\t|\u2028|\u2029/g;E.template=function(t,data,e){var n;e=E.defaults({},e,E.templateSettings);var r=new RegExp([(e.escape||z).source,(e.interpolate||z).source,(e.evaluate||z).source].join("|")+"|$","g"),i=0,o="__p+='";t.replace(r,function(e,n,r,a,u){return o+=t.slice(i,u).replace(I,function(t){return"\\"+R[t]}),n&&(o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'"),r&&(o+="'+\n((__t=("+r+"))==null?'':__t)+\n'"),a&&(o+="';\n"+a+"\n__p+='"),i=u+e.length,e}),o+="';\n",e.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{n=new Function(e.variable||"obj","_",o)}catch(a){throw a.source=o,a}if(data)return n(data,E);var u=function(data){return n.call(this,data,E)};return u.source="function("+(e.variable||"obj")+"){\n"+o+"}",u},E.chain=function(t){return E(t).chain()};var P=function(t){return this._chain?E(t).chain():t};E.mixin(E),C(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=o[t];E.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!=t&&"splice"!=t||0!==n.length||delete n[0],P.call(this,n)}}),C(["concat","join","slice"],function(t){var e=o[t];E.prototype[t]=function(){return P.call(this,e.apply(this._wrapped,arguments))}}),E.extend(E.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}}),"function"==typeof define&&define.amd&&define("underscore",[],function(){return E})}).call(this)},{}],51:[function(){+function(t){"use strict";function e(e){return this.each(function(){var r=t(this),data=r.data("bs.button"),i="object"==typeof e&&e;data||r.data("bs.button",data=new n(this,i)),"toggle"==e?data.toggle():e&&data.setState(e)})}var n=function(e,r){this.$element=t(e),this.options=t.extend({},n.DEFAULTS,r),this.isLoading=!1};n.VERSION="3.2.0",n.DEFAULTS={loadingText:"loading..."},n.prototype.setState=function(e){var n="disabled",r=this.$element,i=r.is("input")?"val":"html",data=r.data();e+="Text",null==data.resetText&&r.data("resetText",r[i]()),r[i](null==data[e]?this.options[e]:data[e]),setTimeout(t.proxy(function(){"loadingText"==e?(this.isLoading=!0,r.addClass(n).attr(n,n)):this.isLoading&&(this.isLoading=!1,r.removeClass(n).removeAttr(n))},this),0)},n.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var n=this.$element.find("input");"radio"==n.prop("type")&&(n.prop("checked")&&this.$element.hasClass("active")?t=!1:e.find(".active").removeClass("active")),t&&n.prop("checked",!this.$element.hasClass("active")).trigger("change")}t&&this.$element.toggleClass("active")};var r=t.fn.button;t.fn.button=e,t.fn.button.Constructor=n,t.fn.button.noConflict=function(){return t.fn.button=r,this},t(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(n){var r=t(n.target);r.hasClass("btn")||(r=r.closest(".btn")),e.call(r,"toggle"),n.preventDefault()})}(jQuery)},{}],52:[function(){+function(t){"use strict";function e(e){return this.each(function(){var r=t(this),data=r.data("bs.collapse"),i=t.extend({},n.DEFAULTS,r.data(),"object"==typeof e&&e);!data&&i.toggle&&"show"==e&&(e=!e),data||r.data("bs.collapse",data=new n(this,i)),"string"==typeof e&&data[e]()})}var n=function(e,r){this.$element=t(e),this.options=t.extend({},n.DEFAULTS,r),this.transitioning=null,this.options.parent&&(this.$parent=t(this.options.parent)),this.options.toggle&&this.toggle()};n.VERSION="3.2.0",n.DEFAULTS={toggle:!0},n.prototype.dimension=function(){var t=this.$element.hasClass("width");return t?"width":"height"},n.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var n=t.Event("show.bs.collapse");if(this.$element.trigger(n),!n.isDefaultPrevented()){var r=this.$parent&&this.$parent.find("> .panel > .in");if(r&&r.length){var i=r.data("bs.collapse");if(i&&i.transitioning)return;e.call(r,"hide"),i||r.data("bs.collapse",null)}var o=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[o](0),this.transitioning=1;var a=function(){this.$element.removeClass("collapsing").addClass("collapse in")[o](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!t.support.transition)return a.call(this);var u=t.camelCase(["scroll",o].join("-"));this.$element.one("bsTransitionEnd",t.proxy(a,this)).emulateTransitionEnd(350)[o](this.$element[0][u])}}},n.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var e=t.Event("hide.bs.collapse");if(this.$element.trigger(e),!e.isDefaultPrevented()){var n=this.dimension();this.$element[n](this.$element[n]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var r=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return t.support.transition?void this.$element[n](0).one("bsTransitionEnd",t.proxy(r,this)).emulateTransitionEnd(350):r.call(this)}}},n.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var r=t.fn.collapse;t.fn.collapse=e,t.fn.collapse.Constructor=n,t.fn.collapse.noConflict=function(){return t.fn.collapse=r,this},t(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(n){var r,i=t(this),o=i.attr("data-target")||n.preventDefault()||(r=i.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),a=t(o),data=a.data("bs.collapse"),u=data?"toggle":i.data(),s=i.attr("data-parent"),l=s&&t(s);data&&data.transitioning||(l&&l.find('[data-toggle="collapse"][data-parent="'+s+'"]').not(i).addClass("collapsed"),i[a.hasClass("in")?"addClass":"removeClass"]("collapsed")),e.call(a,u)})}(jQuery)},{}],53:[function(){+function(t){"use strict";function e(e){e&&3===e.which||(t(i).remove(),t(o).each(function(){var r=n(t(this)),i={relatedTarget:this};r.hasClass("open")&&(r.trigger(e=t.Event("hide.bs.dropdown",i)),e.isDefaultPrevented()||r.removeClass("open").trigger("hidden.bs.dropdown",i))}))}function n(e){var n=e.attr("data-target");n||(n=e.attr("href"),n=n&&/#[A-Za-z]/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,""));var r=n&&t(n);return r&&r.length?r:e.parent()}function r(e){return this.each(function(){var n=t(this),data=n.data("bs.dropdown");data||n.data("bs.dropdown",data=new a(this)),"string"==typeof e&&data[e].call(n)})}var i=".dropdown-backdrop",o='[data-toggle="dropdown"]',a=function(e){t(e).on("click.bs.dropdown",this.toggle)};a.VERSION="3.2.0",a.prototype.toggle=function(r){var i=t(this);if(!i.is(".disabled, :disabled")){var o=n(i),a=o.hasClass("open");if(e(),!a){"ontouchstart"in document.documentElement&&!o.closest(".navbar-nav").length&&t('<div class="dropdown-backdrop"/>').insertAfter(t(this)).on("click",e);var u={relatedTarget:this};if(o.trigger(r=t.Event("show.bs.dropdown",u)),r.isDefaultPrevented())return;i.trigger("focus"),o.toggleClass("open").trigger("shown.bs.dropdown",u)}return!1}},a.prototype.keydown=function(e){if(/(38|40|27)/.test(e.keyCode)){var r=t(this);if(e.preventDefault(),e.stopPropagation(),!r.is(".disabled, :disabled")){var i=n(r),a=i.hasClass("open");if(!a||a&&27==e.keyCode)return 27==e.which&&i.find(o).trigger("focus"),r.trigger("click");var u=" li:not(.divider):visible a",s=i.find('[role="menu"]'+u+', [role="listbox"]'+u);if(s.length){var l=s.index(s.filter(":focus"));38==e.keyCode&&l>0&&l--,40==e.keyCode&&l<s.length-1&&l++,~l||(l=0),s.eq(l).trigger("focus")}}}};var u=t.fn.dropdown;t.fn.dropdown=r,t.fn.dropdown.Constructor=a,t.fn.dropdown.noConflict=function(){return t.fn.dropdown=u,this},t(document).on("click.bs.dropdown.data-api",e).on("click.bs.dropdown.data-api",".dropdown form",function(t){t.stopPropagation()}).on("click.bs.dropdown.data-api",o,a.prototype.toggle).on("keydown.bs.dropdown.data-api",o+', [role="menu"], [role="listbox"]',a.prototype.keydown)}(jQuery)},{}],54:[function(){+function(t){"use strict";function e(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in e)if(void 0!==t.style[n])return{end:e[n]};return!1}t.fn.emulateTransitionEnd=function(e){var n=!1,r=this;t(this).one("bsTransitionEnd",function(){n=!0});var i=function(){n||t(r).trigger(t.support.transition.end)};return setTimeout(i,e),this},t(function(){t.support.transition=e(),t.support.transition&&(t.event.special.bsTransitionEnd={bindType:t.support.transition.end,delegateType:t.support.transition.end,handle:function(e){return t(e.target).is(this)?e.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery)},{}],55:[function(){},{}],56:[function(t,e){!function(){function t(t){return t&&(t.ownerDocument||t.document||t).documentElement}function n(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function r(t,e){return e>t?-1:t>e?1:t>=e?0:0/0}function i(t){return null===t?0/0:+t}function o(t){return!isNaN(t)}function a(t){return{left:function(e,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=e.length);i>r;){var o=r+i>>>1;t(e[o],n)<0?r=o+1:i=o}return r},right:function(e,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=e.length);i>r;){var o=r+i>>>1;t(e[o],n)>0?i=o:r=o+1}return r}}}function u(t){return t.length}function s(t){for(var e=1;t*e%1;)e*=10;return e}function l(t,e){for(var n in e)Object.defineProperty(t.prototype,n,{value:e[n],enumerable:!1})}function c(){this._=Object.create(null)}function f(t){return(t+="")===vu||t[0]===mu?mu+t:t}function h(t){return(t+="")[0]===mu?t.slice(1):t}function p(t){return f(t)in this._}function d(t){return(t=f(t))in this._&&delete this._[t]}function g(){var t=[];for(var e in this._)t.push(h(e));return t}function v(){var t=0;for(var e in this._)++t;return t}function m(){for(var t in this._)return!1;return!0}function y(){this._=Object.create(null)}function b(t){return t}function x(t,e,n){return function(){var r=n.apply(e,arguments);return r===e?t:r}}function w(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var n=0,r=yu.length;r>n;++n){var i=yu[n]+e;if(i in t)return i}}function _(){}function M(){}function k(t){function e(){for(var e,r=n,i=-1,o=r.length;++i<o;)(e=r[i].on)&&e.apply(this,arguments);return t}var n=[],r=new c;return e.on=function(e,i){var o,a=r.get(e);return arguments.length<2?a&&a.on:(a&&(a.on=null,n=n.slice(0,o=n.indexOf(a)).concat(n.slice(o+1)),r.remove(e)),i&&n.push(r.set(e,{on:i})),t)},e}function E(){ru.event.preventDefault()}function C(){for(var t,e=ru.event;t=e.sourceEvent;)e=t;return e}function S(t){for(var e=new M,n=0,r=arguments.length;++n<r;)e[arguments[n]]=k(e);return e.of=function(n,r){return function(i){try{var o=i.sourceEvent=ru.event;i.target=t,ru.event=i,e[i.type].apply(n,r)}finally{ru.event=o}}},e}function T(t){return xu(t,ku),t}function j(t){return"function"==typeof t?t:function(){return wu(t,this)}}function A(t){return"function"==typeof t?t:function(){return _u(t,this)}}function N(t,e){function n(){this.removeAttribute(t)}function r(){this.removeAttributeNS(t.space,t.local)}function i(){this.setAttribute(t,e)}function o(){this.setAttributeNS(t.space,t.local,e)}function a(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}function u(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}return t=ru.ns.qualify(t),null==e?t.local?r:n:"function"==typeof e?t.local?u:a:t.local?o:i}function O(t){return t.trim().replace(/\s+/g," ")}function q(t){return new RegExp("(?:^|\\s+)"+ru.requote(t)+"(?:\\s+|$)","g")}function D(t){return(t+"").trim().split(/^|\s+/)}function L(t,e){function n(){for(var n=-1;++n<i;)t[n](this,e)}function r(){for(var n=-1,r=e.apply(this,arguments);++n<i;)t[n](this,r)}t=D(t).map(F);var i=t.length;return"function"==typeof e?r:n}function F(t){var e=q(t);return function(n,r){if(i=n.classList)return r?i.add(t):i.remove(t);var i=n.getAttribute("class")||"";r?(e.lastIndex=0,e.test(i)||n.setAttribute("class",O(i+" "+t))):n.setAttribute("class",O(i.replace(e," ")))}}function z(t,e,n){function r(){this.style.removeProperty(t)}function i(){this.style.setProperty(t,e,n)}function o(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}return null==e?r:"function"==typeof e?o:i}function R(t,e){function n(){delete this[t]}function r(){this[t]=e}function i(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}return null==e?n:"function"==typeof e?i:r}function I(t){function e(){var e=this.ownerDocument,n=this.namespaceURI;return n?e.createElementNS(n,t):e.createElement(t)}function n(){return this.ownerDocument.createElementNS(t.space,t.local)}return"function"==typeof t?t:(t=ru.ns.qualify(t)).local?n:e}function P(){var t=this.parentNode;t&&t.removeChild(this)}function H(data){return{__data__:data}}function B(t){return function(){return Mu(this,t)}}function $(t){return arguments.length||(t=r),function(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}}function V(t,e){for(var n=0,r=t.length;r>n;n++)for(var i,o=t[n],a=0,u=o.length;u>a;a++)(i=o[a])&&e(i,a,n);return t}function U(t){return xu(t,Cu),t}function W(t){var e,n;return function(r,i,o){var a,u=t[o].update,s=u.length;for(o!=n&&(n=o,e=0),i>=e&&(e=i+1);!(a=u[e])&&++e<s;);return a}}function Y(t,e,n){function r(){var e=this[a];e&&(this.removeEventListener(t,e,e.$),delete this[a])}function i(){var i=s(e,ou(arguments));r.call(this),this.addEventListener(t,this[a]=i,i.$=n),i._=e}function o(){var e,n=new RegExp("^__on([^.]+)"+ru.requote(t)+"$");for(var r in this)if(e=r.match(n)){var i=this[r];
-this.removeEventListener(e[1],i,i.$),delete this[r]}}var a="__on"+t,u=t.indexOf("."),s=X;u>0&&(t=t.slice(0,u));var l=Su.get(t);return l&&(t=l,s=J),u?e?i:r:e?_:o}function X(t,e){return function(n){var r=ru.event;ru.event=n,e[0]=this.__data__;try{t.apply(this,e)}finally{ru.event=r}}}function J(t,e){var n=X(t,e);return function(t){var e=this,r=t.relatedTarget;r&&(r===e||8&r.compareDocumentPosition(e))||n.call(e,t)}}function Z(e){var r=".dragsuppress-"+ ++ju,i="click"+r,o=ru.select(n(e)).on("touchmove"+r,E).on("dragstart"+r,E).on("selectstart"+r,E);if(null==Tu&&(Tu="onselectstart"in e?!1:w(e.style,"userSelect")),Tu){var a=t(e).style,u=a[Tu];a[Tu]="none"}return function(t){if(o.on(r,null),Tu&&(a[Tu]=u),t){var e=function(){o.on(i,null)};o.on(i,function(){E(),e()},!0),setTimeout(e,0)}}}function K(t,e){e.changedTouches&&(e=e.changedTouches[0]);var r=t.ownerSVGElement||t;if(r.createSVGPoint){var i=r.createSVGPoint();if(0>Au){var o=n(t);if(o.scrollX||o.scrollY){r=ru.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var a=r[0][0].getScreenCTM();Au=!(a.f||a.e),r.remove()}}return Au?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY),i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}var u=t.getBoundingClientRect();return[e.clientX-u.left-t.clientLeft,e.clientY-u.top-t.clientTop]}function G(){return ru.event.changedTouches[0].identifier}function Q(t){return t>0?1:0>t?-1:0}function te(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0])}function ee(t){return t>1?0:-1>t?qu:Math.acos(t)}function ne(t){return t>1?Fu:-1>t?-Fu:Math.asin(t)}function re(t){return((t=Math.exp(t))-1/t)/2}function ie(t){return((t=Math.exp(t))+1/t)/2}function oe(t){return((t=Math.exp(2*t))-1)/(t+1)}function ae(t){return(t=Math.sin(t/2))*t}function ue(){}function se(t,e,n){return this instanceof se?(this.h=+t,this.s=+e,void(this.l=+n)):arguments.length<2?t instanceof se?new se(t.h,t.s,t.l):_e(""+t,Me,se):new se(t,e,n)}function le(t,e,n){function r(t){return t>360?t-=360:0>t&&(t+=360),60>t?o+(a-o)*t/60:180>t?a:240>t?o+(a-o)*(240-t)/60:o}function i(t){return Math.round(255*r(t))}var o,a;return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:0>e?0:e>1?1:e,n=0>n?0:n>1?1:n,a=.5>=n?n*(1+e):n+e-n*e,o=2*n-a,new ye(i(t+120),i(t),i(t-120))}function ce(t,e,n){return this instanceof ce?(this.h=+t,this.c=+e,void(this.l=+n)):arguments.length<2?t instanceof ce?new ce(t.h,t.c,t.l):t instanceof he?de(t.l,t.a,t.b):de((t=ke((t=ru.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new ce(t,e,n)}function fe(t,e,n){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new he(n,Math.cos(t*=zu)*e,Math.sin(t)*e)}function he(t,e,n){return this instanceof he?(this.l=+t,this.a=+e,void(this.b=+n)):arguments.length<2?t instanceof he?new he(t.l,t.a,t.b):t instanceof ce?fe(t.h,t.c,t.l):ke((t=ye(t)).r,t.g,t.b):new he(t,e,n)}function pe(t,e,n){var r=(t+16)/116,i=r+e/500,o=r-n/200;return i=ge(i)*Xu,r=ge(r)*Ju,o=ge(o)*Zu,new ye(me(3.2404542*i-1.5371385*r-.4985314*o),me(-.969266*i+1.8760108*r+.041556*o),me(.0556434*i-.2040259*r+1.0572252*o))}function de(t,e,n){return t>0?new ce(Math.atan2(n,e)*Ru,Math.sqrt(e*e+n*n),t):new ce(0/0,0/0,t)}function ge(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function ve(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function me(t){return Math.round(255*(.00304>=t?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function ye(t,e,n){return this instanceof ye?(this.r=~~t,this.g=~~e,void(this.b=~~n)):arguments.length<2?t instanceof ye?new ye(t.r,t.g,t.b):_e(""+t,ye,le):new ye(t,e,n)}function be(t){return new ye(t>>16,t>>8&255,255&t)}function xe(t){return be(t)+""}function we(t){return 16>t?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function _e(t,e,n){var r,i,o,a=0,u=0,s=0;if(r=/([a-z]+)\((.*)\)/i.exec(t))switch(i=r[2].split(","),r[1]){case"hsl":return n(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(Ce(i[0]),Ce(i[1]),Ce(i[2]))}return(o=Qu.get(t.toLowerCase()))?e(o.r,o.g,o.b):(null==t||"#"!==t.charAt(0)||isNaN(o=parseInt(t.slice(1),16))||(4===t.length?(a=(3840&o)>>4,a=a>>4|a,u=240&o,u=u>>4|u,s=15&o,s=s<<4|s):7===t.length&&(a=(16711680&o)>>16,u=(65280&o)>>8,s=255&o)),e(a,u,s))}function Me(t,e,n){var r,i,o=Math.min(t/=255,e/=255,n/=255),a=Math.max(t,e,n),u=a-o,s=(a+o)/2;return u?(i=.5>s?u/(a+o):u/(2-a-o),r=t==a?(e-n)/u+(n>e?6:0):e==a?(n-t)/u+2:(t-e)/u+4,r*=60):(r=0/0,i=s>0&&1>s?0:r),new se(r,i,s)}function ke(t,e,n){t=Ee(t),e=Ee(e),n=Ee(n);var r=ve((.4124564*t+.3575761*e+.1804375*n)/Xu),i=ve((.2126729*t+.7151522*e+.072175*n)/Ju),o=ve((.0193339*t+.119192*e+.9503041*n)/Zu);return he(116*i-16,500*(r-i),200*(i-o))}function Ee(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ce(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function Se(t){return"function"==typeof t?t:function(){return t}}function Te(t){return function(e,n,r){return 2===arguments.length&&"function"==typeof n&&(r=n,n=null),je(e,n,t,r)}}function je(t,e,n,r){function i(){var t,e=s.status;if(!e&&Ne(s)||e>=200&&300>e||304===e){try{t=n.call(o,s)}catch(r){return void a.error.call(o,r)}a.load.call(o,t)}else a.error.call(o,s)}var o={},a=ru.dispatch("beforesend","progress","load","error"),u={},s=new XMLHttpRequest,l=null;return!this.XDomainRequest||"withCredentials"in s||!/^(http(s)?:)?\/\//.test(t)||(s=new XDomainRequest),"onload"in s?s.onload=s.onerror=i:s.onreadystatechange=function(){s.readyState>3&&i()},s.onprogress=function(t){var e=ru.event;ru.event=t;try{a.progress.call(o,s)}finally{ru.event=e}},o.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?u[t]:(null==e?delete u[t]:u[t]=e+"",o)},o.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",o):e},o.responseType=function(t){return arguments.length?(l=t,o):l},o.response=function(t){return n=t,o},["get","post"].forEach(function(t){o[t]=function(){return o.send.apply(o,[t].concat(ou(arguments)))}}),o.send=function(n,data,r){if(2===arguments.length&&"function"==typeof data&&(r=data,data=null),s.open(n,t,!0),null==e||"accept"in u||(u.accept=e+",*/*"),s.setRequestHeader)for(var i in u)s.setRequestHeader(i,u[i]);return null!=e&&s.overrideMimeType&&s.overrideMimeType(e),null!=l&&(s.responseType=l),null!=r&&o.on("error",r).on("load",function(t){r(null,t)}),a.beforesend.call(o,s),s.send(null==data?null:data),o},o.abort=function(){return s.abort(),o},ru.rebind(o,a,"on"),null==r?o:o.get(Ae(r))}function Ae(t){return 1===t.length?function(e,n){t(null==e?n:null)}:t}function Ne(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}function Oe(){var t=qe(),e=De()-t;e>24?(isFinite(e)&&(clearTimeout(rs),rs=setTimeout(Oe,e)),ns=0):(ns=1,os(Oe))}function qe(){var t=Date.now();for(is=ts;is;)t>=is.t&&(is.f=is.c(t-is.t)),is=is.n;return t}function De(){for(var t,e=ts,n=1/0;e;)e.f?e=t?t.n=e.n:ts=e.n:(e.t<n&&(n=e.t),e=(t=e).n);return es=t,n}function Le(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}function Fe(t,e){var n=Math.pow(10,3*gu(8-e));return{scale:e>8?function(t){return t/n}:function(t){return t*n},symbol:t}}function ze(t){var e=t.decimal,n=t.thousands,r=t.grouping,i=t.currency,o=r&&n?function(t,e){for(var i=t.length,o=[],a=0,u=r[0],s=0;i>0&&u>0&&(s+u+1>e&&(u=Math.max(1,e-s)),o.push(t.substring(i-=u,i+u)),!((s+=u+1)>e));)u=r[a=(a+1)%r.length];return o.reverse().join(n)}:b;return function(t){var n=us.exec(t),r=n[1]||" ",a=n[2]||">",u=n[3]||"-",s=n[4]||"",l=n[5],c=+n[6],f=n[7],h=n[8],p=n[9],d=1,g="",v="",m=!1,y=!0;switch(h&&(h=+h.substring(1)),(l||"0"===r&&"="===a)&&(l=r="0",a="="),p){case"n":f=!0,p="g";break;case"%":d=100,v="%",p="f";break;case"p":d=100,v="%",p="r";break;case"b":case"o":case"x":case"X":"#"===s&&(g="0"+p.toLowerCase());case"c":y=!1;case"d":m=!0,h=0;break;case"s":d=-1,p="r"}"$"===s&&(g=i[0],v=i[1]),"r"!=p||h||(p="g"),null!=h&&("g"==p?h=Math.max(1,Math.min(21,h)):("e"==p||"f"==p)&&(h=Math.max(0,Math.min(20,h)))),p=ss.get(p)||Re;var b=l&&f;return function(t){var n=v;if(m&&t%1)return"";var i=0>t||0===t&&0>1/t?(t=-t,"-"):"-"===u?"":u;if(0>d){var s=ru.formatPrefix(t,h);t=s.scale(t),n=s.symbol+v}else t*=d;t=p(t,h);var x,w,_=t.lastIndexOf(".");if(0>_){var M=y?t.lastIndexOf("e"):-1;0>M?(x=t,w=""):(x=t.substring(0,M),w=t.substring(M))}else x=t.substring(0,_),w=e+t.substring(_+1);!l&&f&&(x=o(x,1/0));var k=g.length+x.length+w.length+(b?0:i.length),E=c>k?new Array(k=c-k+1).join(r):"";return b&&(x=o(E+x,E.length?c-w.length:1/0)),i+=g,t=x+w,("<"===a?i+t+E:">"===a?E+i+t:"^"===a?E.substring(0,k>>=1)+i+t+E.substring(k):i+(b?t:E+t))+n}}}function Re(t){return t+""}function Ie(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Pe(t,e,n){function r(e){var n=t(e),r=o(n,1);return r-e>e-n?n:r}function i(n){return e(n=t(new cs(n-1)),1),n}function o(t,n){return e(t=new cs(+t),n),t}function a(t,r,o){var a=i(t),u=[];if(o>1)for(;r>a;)n(a)%o||u.push(new Date(+a)),e(a,1);else for(;r>a;)u.push(new Date(+a)),e(a,1);return u}function u(t,e,n){try{cs=Ie;var r=new Ie;return r._=t,a(r,e,n)}finally{cs=Date}}t.floor=t,t.round=r,t.ceil=i,t.offset=o,t.range=a;var s=t.utc=He(t);return s.floor=s,s.round=He(r),s.ceil=He(i),s.offset=He(o),s.range=u,t}function He(t){return function(e,n){try{cs=Ie;var r=new Ie;return r._=e,t(r,n)._}finally{cs=Date}}}function Be(t){function e(t){function e(e){for(var n,i,o,a=[],u=-1,s=0;++u<r;)37===t.charCodeAt(u)&&(a.push(t.slice(s,u)),null!=(i=hs[n=t.charAt(++u)])&&(n=t.charAt(++u)),(o=T[n])&&(n=o(e,null==i?"e"===n?" ":"0":i)),a.push(n),s=u+1);return a.push(t.slice(s,u)),a.join("")}var r=t.length;return e.parse=function(e){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},i=n(r,t,e,0);if(i!=e.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var o=null!=r.Z&&cs!==Ie,a=new(o?Ie:cs);return"j"in r?a.setFullYear(r.y,0,r.j):"w"in r&&("W"in r||"U"in r)?(a.setFullYear(r.y,0,1),a.setFullYear(r.y,0,"W"in r?(r.w+6)%7+7*r.W-(a.getDay()+5)%7:r.w+7*r.U-(a.getDay()+6)%7)):a.setFullYear(r.y,r.m,r.d),a.setHours(r.H+(r.Z/100|0),r.M+r.Z%100,r.S,r.L),o?a._:a},e.toString=function(){return t},e}function n(t,e,n,r){for(var i,o,a,u=0,s=e.length,l=n.length;s>u;){if(r>=l)return-1;if(i=e.charCodeAt(u++),37===i){if(a=e.charAt(u++),o=j[a in hs?e.charAt(u++):a],!o||(r=o(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}function r(t,e,n){_.lastIndex=0;var r=_.exec(e.slice(n));return r?(t.w=M.get(r[0].toLowerCase()),n+r[0].length):-1}function i(t,e,n){x.lastIndex=0;var r=x.exec(e.slice(n));return r?(t.w=w.get(r[0].toLowerCase()),n+r[0].length):-1}function o(t,e,n){C.lastIndex=0;var r=C.exec(e.slice(n));return r?(t.m=S.get(r[0].toLowerCase()),n+r[0].length):-1}function a(t,e,n){k.lastIndex=0;var r=k.exec(e.slice(n));return r?(t.m=E.get(r[0].toLowerCase()),n+r[0].length):-1}function u(t,e,r){return n(t,T.c.toString(),e,r)}function s(t,e,r){return n(t,T.x.toString(),e,r)}function l(t,e,r){return n(t,T.X.toString(),e,r)}function c(t,e,n){var r=b.get(e.slice(n,n+=2).toLowerCase());return null==r?-1:(t.p=r,n)}var f=t.dateTime,h=t.date,p=t.time,d=t.periods,g=t.days,v=t.shortDays,m=t.months,y=t.shortMonths;e.utc=function(t){function n(t){try{cs=Ie;var e=new cs;return e._=t,r(e)}finally{cs=Date}}var r=e(t);return n.parse=function(t){try{cs=Ie;var e=r.parse(t);return e&&e._}finally{cs=Date}},n.toString=r.toString,n},e.multi=e.utc.multi=ln;var b=ru.map(),x=Ve(g),w=Ue(g),_=Ve(v),M=Ue(v),k=Ve(m),E=Ue(m),C=Ve(y),S=Ue(y);d.forEach(function(t,e){b.set(t.toLowerCase(),e)});var T={a:function(t){return v[t.getDay()]},A:function(t){return g[t.getDay()]},b:function(t){return y[t.getMonth()]},B:function(t){return m[t.getMonth()]},c:e(f),d:function(t,e){return $e(t.getDate(),e,2)},e:function(t,e){return $e(t.getDate(),e,2)},H:function(t,e){return $e(t.getHours(),e,2)},I:function(t,e){return $e(t.getHours()%12||12,e,2)},j:function(t,e){return $e(1+ls.dayOfYear(t),e,3)},L:function(t,e){return $e(t.getMilliseconds(),e,3)},m:function(t,e){return $e(t.getMonth()+1,e,2)},M:function(t,e){return $e(t.getMinutes(),e,2)},p:function(t){return d[+(t.getHours()>=12)]},S:function(t,e){return $e(t.getSeconds(),e,2)},U:function(t,e){return $e(ls.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return $e(ls.mondayOfYear(t),e,2)},x:e(h),X:e(p),y:function(t,e){return $e(t.getFullYear()%100,e,2)},Y:function(t,e){return $e(t.getFullYear()%1e4,e,4)},Z:un,"%":function(){return"%"}},j={a:r,A:i,b:o,B:a,c:u,d:tn,e:tn,H:nn,I:nn,j:en,L:an,m:Qe,M:rn,p:c,S:on,U:Ye,w:We,W:Xe,x:s,X:l,y:Ze,Y:Je,Z:Ke,"%":sn};return e}function $e(t,e,n){var r=0>t?"-":"",i=(r?-t:t)+"",o=i.length;return r+(n>o?new Array(n-o+1).join(e)+i:i)}function Ve(t){return new RegExp("^(?:"+t.map(ru.requote).join("|")+")","i")}function Ue(t){for(var e=new c,n=-1,r=t.length;++n<r;)e.set(t[n].toLowerCase(),n);return e}function We(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Ye(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n));return r?(t.U=+r[0],n+r[0].length):-1}function Xe(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n));return r?(t.W=+r[0],n+r[0].length):-1}function Je(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function Ze(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+2));return r?(t.y=Ge(+r[0]),n+r[0].length):-1}function Ke(t,e,n){return/^[+-]\d{4}$/.test(e=e.slice(n,n+5))?(t.Z=-e,n+5):-1}function Ge(t){return t+(t>68?1900:2e3)}function Qe(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function tn(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function en(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+3));return r?(t.j=+r[0],n+r[0].length):-1}function nn(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function rn(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function on(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function an(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function un(t){var e=t.getTimezoneOffset(),n=e>0?"-":"+",r=gu(e)/60|0,i=gu(e)%60;return n+$e(r,"0",2)+$e(i,"0",2)}function sn(t,e,n){ds.lastIndex=0;var r=ds.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function ln(t){for(var e=t.length,n=-1;++n<e;)t[n][0]=this(t[n][0]);return function(e){for(var n=0,r=t[n];!r[1](e);)r=t[++n];return r[0](e)}}function cn(){}function fn(t,e,n){var r=n.s=t+e,i=r-t,o=r-i;n.t=t-o+(e-i)}function hn(t,e){t&&ys.hasOwnProperty(t.type)&&ys[t.type](t,e)}function pn(t,e,n){var r,i=-1,o=t.length-n;for(e.lineStart();++i<o;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function dn(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)pn(t[n],e,1);e.polygonEnd()}function gn(){function t(t,e){t*=zu,e=e*zu/2+qu/4;var n=t-r,a=n>=0?1:-1,u=a*n,s=Math.cos(e),l=Math.sin(e),c=o*l,f=i*s+c*Math.cos(u),h=c*a*Math.sin(u);xs.add(Math.atan2(h,f)),r=t,i=s,o=l}var e,n,r,i,o;ws.point=function(a,u){ws.point=t,r=(e=a)*zu,i=Math.cos(u=(n=u)*zu/2+qu/4),o=Math.sin(u)},ws.lineEnd=function(){t(e,n)}}function vn(t){var e=t[0],n=t[1],r=Math.cos(n);return[r*Math.cos(e),r*Math.sin(e),Math.sin(n)]}function mn(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function yn(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function bn(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function xn(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function wn(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function _n(t){return[Math.atan2(t[1],t[0]),ne(t[2])]}function Mn(t,e){return gu(t[0]-e[0])<Nu&&gu(t[1]-e[1])<Nu}function kn(t,e){t*=zu;var n=Math.cos(e*=zu);En(n*Math.cos(t),n*Math.sin(t),Math.sin(e))}function En(t,e,n){++_s,ks+=(t-ks)/_s,Es+=(e-Es)/_s,Cs+=(n-Cs)/_s}function Cn(){function t(t,i){t*=zu;var o=Math.cos(i*=zu),a=o*Math.cos(t),u=o*Math.sin(t),s=Math.sin(i),l=Math.atan2(Math.sqrt((l=n*s-r*u)*l+(l=r*a-e*s)*l+(l=e*u-n*a)*l),e*a+n*u+r*s);Ms+=l,Ss+=l*(e+(e=a)),Ts+=l*(n+(n=u)),js+=l*(r+(r=s)),En(e,n,r)}var e,n,r;qs.point=function(i,o){i*=zu;var a=Math.cos(o*=zu);e=a*Math.cos(i),n=a*Math.sin(i),r=Math.sin(o),qs.point=t,En(e,n,r)}}function Sn(){qs.point=kn}function Tn(){function t(t,e){t*=zu;var n=Math.cos(e*=zu),a=n*Math.cos(t),u=n*Math.sin(t),s=Math.sin(e),l=i*s-o*u,c=o*a-r*s,f=r*u-i*a,h=Math.sqrt(l*l+c*c+f*f),p=r*a+i*u+o*s,d=h&&-ee(p)/h,g=Math.atan2(h,p);As+=d*l,Ns+=d*c,Os+=d*f,Ms+=g,Ss+=g*(r+(r=a)),Ts+=g*(i+(i=u)),js+=g*(o+(o=s)),En(r,i,o)}var e,n,r,i,o;qs.point=function(a,u){e=a,n=u,qs.point=t,a*=zu;var s=Math.cos(u*=zu);r=s*Math.cos(a),i=s*Math.sin(a),o=Math.sin(u),En(r,i,o)},qs.lineEnd=function(){t(e,n),qs.lineEnd=Sn,qs.point=kn}}function jn(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return n=e.invert(n,r),n&&t.invert(n[0],n[1])}),n}function An(){return!0}function Nn(t,e,n,r,i){var o=[],a=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,n=t[0],r=t[e];if(Mn(n,r)){i.lineStart();for(var u=0;e>u;++u)i.point((n=t[u])[0],n[1]);return void i.lineEnd()}var s=new qn(n,t,null,!0),l=new qn(n,null,s,!1);s.o=l,o.push(s),a.push(l),s=new qn(r,t,null,!1),l=new qn(r,null,s,!0),s.o=l,o.push(s),a.push(l)}}),a.sort(e),On(o),On(a),o.length){for(var u=0,s=n,l=a.length;l>u;++u)a[u].e=s=!s;for(var c,f,h=o[0];;){for(var p=h,d=!0;p.v;)if((p=p.n)===h)return;c=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(d)for(var u=0,l=c.length;l>u;++u)i.point((f=c[u])[0],f[1]);else r(p.x,p.n.x,1,i);p=p.n}else{if(d){c=p.p.z;for(var u=c.length-1;u>=0;--u)i.point((f=c[u])[0],f[1])}else r(p.x,p.p.x,-1,i);p=p.p}p=p.o,c=p.z,d=!d}while(!p.v);i.lineEnd()}}}function On(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function qn(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function Dn(t,e,n,r){return function(i,o){function a(e,n){var r=i(e,n);t(e=r[0],n=r[1])&&o.point(e,n)}function u(t,e){var n=i(t,e);v.point(n[0],n[1])}function s(){y.point=u,v.lineStart()}function l(){y.point=a,v.lineEnd()}function c(t,e){g.push([t,e]);var n=i(t,e);x.point(n[0],n[1])}function f(){x.lineStart(),g=[]}function h(){c(g[0][0],g[0][1]),x.lineEnd();var t,e=x.clean(),n=b.buffer(),r=n.length;if(g.pop(),d.push(g),g=null,r)if(1&e){t=n[0];var i,r=t.length-1,a=-1;if(r>0){for(w||(o.polygonStart(),w=!0),o.lineStart();++a<r;)o.point((i=t[a])[0],i[1]);o.lineEnd()}}else r>1&&2&e&&n.push(n.pop().concat(n.shift())),p.push(n.filter(Ln))}var p,d,g,v=e(o),m=i.invert(r[0],r[1]),y={point:a,lineStart:s,lineEnd:l,polygonStart:function(){y.point=c,y.lineStart=f,y.lineEnd=h,p=[],d=[]},polygonEnd:function(){y.point=a,y.lineStart=s,y.lineEnd=l,p=ru.merge(p);var t=Hn(m,d);p.length?(w||(o.polygonStart(),w=!0),Nn(p,zn,t,n,o)):t&&(w||(o.polygonStart(),w=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),w&&(o.polygonEnd(),w=!1),p=d=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}},b=Fn(),x=e(b),w=!1;return y}}function Ln(t){return t.length>1}function Fn(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,n){t.push([e,n])},lineEnd:_,buffer:function(){var n=e;return e=[],t=null,n},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function zn(t,e){return((t=t.x)[0]<0?t[1]-Fu-Nu:Fu-t[1])-((e=e.x)[0]<0?e[1]-Fu-Nu:Fu-e[1])}function Rn(t){var e,n=0/0,r=0/0,i=0/0;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var u=o>0?qu:-qu,s=gu(o-n);gu(s-qu)<Nu?(t.point(n,r=(r+a)/2>0?Fu:-Fu),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),t.point(o,r),e=0):i!==u&&s>=qu&&(gu(n-i)<Nu&&(n-=i*Nu),gu(o-u)<Nu&&(o-=u*Nu),r=In(n,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),e=0),t.point(n=o,r=a),i=u},lineEnd:function(){t.lineEnd(),n=r=0/0},clean:function(){return 2-e}}}function In(t,e,n,r){var i,o,a=Math.sin(t-n);return gu(a)>Nu?Math.atan((Math.sin(e)*(o=Math.cos(r))*Math.sin(n)-Math.sin(r)*(i=Math.cos(e))*Math.sin(t))/(i*o*a)):(e+r)/2}function Pn(t,e,n,r){var i;if(null==t)i=n*Fu,r.point(-qu,i),r.point(0,i),r.point(qu,i),r.point(qu,0),r.point(qu,-i),r.point(0,-i),r.point(-qu,-i),r.point(-qu,0),r.point(-qu,i);else if(gu(t[0]-e[0])>Nu){var o=t[0]<e[0]?qu:-qu;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])}function Hn(t,e){var n=t[0],r=t[1],i=[Math.sin(n),-Math.cos(n),0],o=0,a=0;xs.reset();for(var u=0,s=e.length;s>u;++u){var l=e[u],c=l.length;if(c)for(var f=l[0],h=f[0],p=f[1]/2+qu/4,d=Math.sin(p),g=Math.cos(p),v=1;;){v===c&&(v=0),t=l[v];var m=t[0],y=t[1]/2+qu/4,b=Math.sin(y),x=Math.cos(y),w=m-h,_=w>=0?1:-1,M=_*w,k=M>qu,E=d*b;if(xs.add(Math.atan2(E*_*Math.sin(M),g*x+E*Math.cos(M))),o+=k?w+_*Du:w,k^h>=n^m>=n){var C=yn(vn(f),vn(t));wn(C);var S=yn(i,C);wn(S);var T=(k^w>=0?-1:1)*ne(S[2]);(r>T||r===T&&(C[0]||C[1]))&&(a+=k^w>=0?1:-1)}if(!v++)break;h=m,d=b,g=x,f=t}}return(-Nu>o||Nu>o&&0>xs)^1&a}function Bn(t){function e(t,e){return Math.cos(t)*Math.cos(e)>o}function n(t){var n,o,s,l,c;return{lineStart:function(){l=s=!1,c=1},point:function(f,h){var p,d=[f,h],g=e(f,h),v=a?g?0:i(f,h):g?i(f+(0>f?qu:-qu),h):0;if(!n&&(l=s=g)&&t.lineStart(),g!==s&&(p=r(n,d),(Mn(n,p)||Mn(d,p))&&(d[0]+=Nu,d[1]+=Nu,g=e(d[0],d[1]))),g!==s)c=0,g?(t.lineStart(),p=r(d,n),t.point(p[0],p[1])):(p=r(n,d),t.point(p[0],p[1]),t.lineEnd()),n=p;else if(u&&n&&a^g){var m;v&o||!(m=r(d,n,!0))||(c=0,a?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1])))}!g||n&&Mn(n,d)||t.point(d[0],d[1]),n=d,s=g,o=v},lineEnd:function(){s&&t.lineEnd(),n=null},clean:function(){return c|(l&&s)<<1}}}function r(t,e,n){var r=vn(t),i=vn(e),a=[1,0,0],u=yn(r,i),s=mn(u,u),l=u[0],c=s-l*l;if(!c)return!n&&t;var f=o*s/c,h=-o*l/c,p=yn(a,u),d=xn(a,f),g=xn(u,h);bn(d,g);var v=p,m=mn(d,v),y=mn(v,v),b=m*m-y*(mn(d,d)-1);if(!(0>b)){var x=Math.sqrt(b),w=xn(v,(-m-x)/y);if(bn(w,d),w=_n(w),!n)return w;var _,M=t[0],k=e[0],E=t[1],C=e[1];M>k&&(_=M,M=k,k=_);var S=k-M,T=gu(S-qu)<Nu,j=T||Nu>S;if(!T&&E>C&&(_=E,E=C,C=_),j?T?E+C>0^w[1]<(gu(w[0]-M)<Nu?E:C):E<=w[1]&&w[1]<=C:S>qu^(M<=w[0]&&w[0]<=k)){var A=xn(v,(-m+x)/y);return bn(A,d),[w,_n(A)]}}}function i(e,n){var r=a?t:qu-t,i=0;return-r>e?i|=1:e>r&&(i|=2),-r>n?i|=4:n>r&&(i|=8),i}var o=Math.cos(t),a=o>0,u=gu(o)>Nu,s=gr(t,6*zu);return Dn(e,n,s,a?[0,-t]:[-qu,t-qu])}function $n(t,e,n,r){return function(i){var o,a=i.a,u=i.b,s=a.x,l=a.y,c=u.x,f=u.y,h=0,p=1,d=c-s,g=f-l;if(o=t-s,d||!(o>0)){if(o/=d,0>d){if(h>o)return;p>o&&(p=o)}else if(d>0){if(o>p)return;o>h&&(h=o)}if(o=n-s,d||!(0>o)){if(o/=d,0>d){if(o>p)return;o>h&&(h=o)}else if(d>0){if(h>o)return;p>o&&(p=o)}if(o=e-l,g||!(o>0)){if(o/=g,0>g){if(h>o)return;p>o&&(p=o)}else if(g>0){if(o>p)return;o>h&&(h=o)}if(o=r-l,g||!(0>o)){if(o/=g,0>g){if(o>p)return;o>h&&(h=o)}else if(g>0){if(h>o)return;p>o&&(p=o)}return h>0&&(i.a={x:s+h*d,y:l+h*g}),1>p&&(i.b={x:s+p*d,y:l+p*g}),i}}}}}}function Vn(t,e,n,r){function i(r,i){return gu(r[0]-t)<Nu?i>0?0:3:gu(r[0]-n)<Nu?i>0?2:1:gu(r[1]-e)<Nu?i>0?1:0:i>0?3:2}function o(t,e){return a(t.x,e.x)}function a(t,e){var n=i(t,1),r=i(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(u){function s(t){for(var e=0,n=v.length,r=t[1],i=0;n>i;++i)for(var o,a=1,u=v[i],s=u.length,l=u[0];s>a;++a)o=u[a],l[1]<=r?o[1]>r&&te(l,o,t)>0&&++e:o[1]<=r&&te(l,o,t)<0&&--e,l=o;return 0!==e}function l(o,u,s,l){var c=0,f=0;if(null==o||(c=i(o,s))!==(f=i(u,s))||a(o,u)<0^s>0){do l.point(0===c||3===c?t:n,c>1?r:e);while((c=(c+s+4)%4)!==f)}else l.point(u[0],u[1])}function c(i,o){return i>=t&&n>=i&&o>=e&&r>=o}function f(t,e){c(t,e)&&u.point(t,e)}function h(){j.point=d,v&&v.push(m=[]),k=!0,M=!1,w=_=0/0}function p(){g&&(d(y,b),x&&M&&S.rejoin(),g.push(S.buffer())),j.point=f,M&&u.lineEnd()}function d(t,e){t=Math.max(-Ls,Math.min(Ls,t)),e=Math.max(-Ls,Math.min(Ls,e));var n=c(t,e);if(v&&m.push([t,e]),k)y=t,b=e,x=n,k=!1,n&&(u.lineStart(),u.point(t,e));else if(n&&M)u.point(t,e);else{var r={a:{x:w,y:_},b:{x:t,y:e}};T(r)?(M||(u.lineStart(),u.point(r.a.x,r.a.y)),u.point(r.b.x,r.b.y),n||u.lineEnd(),E=!1):n&&(u.lineStart(),u.point(t,e),E=!1)}w=t,_=e,M=n}var g,v,m,y,b,x,w,_,M,k,E,C=u,S=Fn(),T=$n(t,e,n,r),j={point:f,lineStart:h,lineEnd:p,polygonStart:function(){u=S,g=[],v=[],E=!0},polygonEnd:function(){u=C,g=ru.merge(g);var e=s([t,r]),n=E&&e,i=g.length;(n||i)&&(u.polygonStart(),n&&(u.lineStart(),l(null,null,1,u),u.lineEnd()),i&&Nn(g,o,e,l,u),u.polygonEnd()),g=v=m=null}};return j}}function Un(t){var e=0,n=qu/3,r=ur(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*qu/180,n=t[1]*qu/180):[e/qu*180,n/qu*180]},i}function Wn(t,e){function n(t,e){var n=Math.sqrt(o-2*i*Math.sin(e))/i;return[n*Math.sin(t*=i),a-n*Math.cos(t)]}var r=Math.sin(t),i=(r+Math.sin(e))/2,o=1+r*(2*i-r),a=Math.sqrt(o)/i;return n.invert=function(t,e){var n=a-e;return[Math.atan2(t,n)/i,ne((o-(t*t+n*n)*i*i)/(2*i))]},n}function Yn(){function t(t,e){zs+=i*t-r*e,r=t,i=e}var e,n,r,i;Bs.point=function(o,a){Bs.point=t,e=r=o,n=i=a},Bs.lineEnd=function(){t(e,n)}}function Xn(t,e){Rs>t&&(Rs=t),t>Ps&&(Ps=t),Is>e&&(Is=e),e>Hs&&(Hs=e)}function Jn(){function t(t,e){a.push("M",t,",",e,o)}function e(t,e){a.push("M",t,",",e),u.point=n}function n(t,e){a.push("L",t,",",e)}function r(){u.point=t}function i(){a.push("Z")}var o=Zn(4.5),a=[],u={point:t,lineStart:function(){u.point=e},lineEnd:r,polygonStart:function(){u.lineEnd=i},polygonEnd:function(){u.lineEnd=r,u.point=t},pointRadius:function(t){return o=Zn(t),u},result:function(){if(a.length){var t=a.join("");return a=[],t}}};return u}function Zn(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Kn(t,e){ks+=t,Es+=e,++Cs}function Gn(){function t(t,r){var i=t-e,o=r-n,a=Math.sqrt(i*i+o*o);Ss+=a*(e+t)/2,Ts+=a*(n+r)/2,js+=a,Kn(e=t,n=r)}var e,n;Vs.point=function(r,i){Vs.point=t,Kn(e=r,n=i)}}function Qn(){Vs.point=Kn}function tr(){function t(t,e){var n=t-r,o=e-i,a=Math.sqrt(n*n+o*o);Ss+=a*(r+t)/2,Ts+=a*(i+e)/2,js+=a,a=i*t-r*e,As+=a*(r+t),Ns+=a*(i+e),Os+=3*a,Kn(r=t,i=e)}var e,n,r,i;Vs.point=function(o,a){Vs.point=t,Kn(e=r=o,n=i=a)},Vs.lineEnd=function(){t(e,n)}}function er(t){function e(e,n){t.moveTo(e+a,n),t.arc(e,n,a,0,Du)}function n(e,n){t.moveTo(e,n),u.point=r}function r(e,n){t.lineTo(e,n)}function i(){u.point=e}function o(){t.closePath()}var a=4.5,u={point:e,lineStart:function(){u.point=n},lineEnd:i,polygonStart:function(){u.lineEnd=o},polygonEnd:function(){u.lineEnd=i,u.point=e},pointRadius:function(t){return a=t,u},result:_};return u}function nr(t){function e(t){return(u?r:n)(t)}function n(e){return or(e,function(n,r){n=t(n,r),e.point(n[0],n[1])})}function r(e){function n(n,r){n=t(n,r),e.point(n[0],n[1])}function r(){b=0/0,k.point=o,e.lineStart()}function o(n,r){var o=vn([n,r]),a=t(n,r);i(b,x,y,w,_,M,b=a[0],x=a[1],y=n,w=o[0],_=o[1],M=o[2],u,e),e.point(b,x)}function a(){k.point=n,e.lineEnd()}function s(){r(),k.point=l,k.lineEnd=c}function l(t,e){o(f=t,h=e),p=b,d=x,g=w,v=_,m=M,k.point=o}function c(){i(b,x,y,w,_,M,p,d,f,g,v,m,u,e),k.lineEnd=a,a()}var f,h,p,d,g,v,m,y,b,x,w,_,M,k={point:n,lineStart:r,lineEnd:a,polygonStart:function(){e.polygonStart(),k.lineStart=s},polygonEnd:function(){e.polygonEnd(),k.lineStart=r}};return k}function i(e,n,r,u,s,l,c,f,h,p,d,g,v,m){var y=c-e,b=f-n,x=y*y+b*b;if(x>4*o&&v--){var w=u+p,_=s+d,M=l+g,k=Math.sqrt(w*w+_*_+M*M),E=Math.asin(M/=k),C=gu(gu(M)-1)<Nu||gu(r-h)<Nu?(r+h)/2:Math.atan2(_,w),S=t(C,E),T=S[0],j=S[1],A=T-e,N=j-n,O=b*A-y*N;(O*O/x>o||gu((y*A+b*N)/x-.5)>.3||a>u*p+s*d+l*g)&&(i(e,n,r,u,s,l,T,j,C,w/=k,_/=k,M,v,m),m.point(T,j),i(T,j,C,w,_,M,c,f,h,p,d,g,v,m))}}var o=.5,a=Math.cos(30*zu),u=16;return e.precision=function(t){return arguments.length?(u=(o=t*t)>0&&16,e):Math.sqrt(o)},e}function rr(t){var e=nr(function(e,n){return t([e*Ru,n*Ru])});return function(t){return sr(e(t))}}function ir(t){this.stream=t}function or(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function ar(t){return ur(function(){return t})()}function ur(t){function e(t){return t=u(t[0]*zu,t[1]*zu),[t[0]*h+s,l-t[1]*h]}function n(t){return t=u.invert((t[0]-s)/h,(l-t[1])/h),t&&[t[0]*Ru,t[1]*Ru]}function r(){u=jn(a=fr(m,y,x),o);var t=o(g,v);return s=p-t[0]*h,l=d+t[1]*h,i()}function i(){return c&&(c.valid=!1,c=null),e}var o,a,u,s,l,c,f=nr(function(t,e){return t=o(t,e),[t[0]*h+s,l-t[1]*h]}),h=150,p=480,d=250,g=0,v=0,m=0,y=0,x=0,w=Ds,_=b,M=null,k=null;return e.stream=function(t){return c&&(c.valid=!1),c=sr(w(a,f(_(t)))),c.valid=!0,c},e.clipAngle=function(t){return arguments.length?(w=null==t?(M=t,Ds):Bn((M=+t)*zu),i()):M},e.clipExtent=function(t){return arguments.length?(k=t,_=t?Vn(t[0][0],t[0][1],t[1][0],t[1][1]):b,i()):k},e.scale=function(t){return arguments.length?(h=+t,r()):h},e.translate=function(t){return arguments.length?(p=+t[0],d=+t[1],r()):[p,d]},e.center=function(t){return arguments.length?(g=t[0]%360*zu,v=t[1]%360*zu,r()):[g*Ru,v*Ru]},e.rotate=function(t){return arguments.length?(m=t[0]%360*zu,y=t[1]%360*zu,x=t.length>2?t[2]%360*zu:0,r()):[m*Ru,y*Ru,x*Ru]},ru.rebind(e,f,"precision"),function(){return o=t.apply(this,arguments),e.invert=o.invert&&n,r()}}function sr(t){return or(t,function(e,n){t.point(e*zu,n*zu)})}function lr(t,e){return[t,e]}function cr(t,e){return[t>qu?t-Du:-qu>t?t+Du:t,e]}function fr(t,e,n){return t?e||n?jn(pr(t),dr(e,n)):pr(t):e||n?dr(e,n):cr}function hr(t){return function(e,n){return e+=t,[e>qu?e-Du:-qu>e?e+Du:e,n]}}function pr(t){var e=hr(t);return e.invert=hr(-t),e}function dr(t,e){function n(t,e){var n=Math.cos(e),u=Math.cos(t)*n,s=Math.sin(t)*n,l=Math.sin(e),c=l*r+u*i;return[Math.atan2(s*o-c*a,u*r-l*i),ne(c*o+s*a)]}var r=Math.cos(t),i=Math.sin(t),o=Math.cos(e),a=Math.sin(e);return n.invert=function(t,e){var n=Math.cos(e),u=Math.cos(t)*n,s=Math.sin(t)*n,l=Math.sin(e),c=l*o-s*a;return[Math.atan2(s*o+l*a,u*r+c*i),ne(c*r-u*i)]},n}function gr(t,e){var n=Math.cos(t),r=Math.sin(t);return function(i,o,a,u){var s=a*e;null!=i?(i=vr(n,i),o=vr(n,o),(a>0?o>i:i>o)&&(i+=a*Du)):(i=t+a*Du,o=t-.5*s);for(var l,c=i;a>0?c>o:o>c;c-=s)u.point((l=_n([n,-r*Math.cos(c),-r*Math.sin(c)]))[0],l[1])}}function vr(t,e){var n=vn(e);n[0]-=t,wn(n);var r=ee(-n[1]);return((-n[2]<0?-r:r)+2*Math.PI-Nu)%(2*Math.PI)}function mr(t,e,n){var r=ru.range(t,e-Nu,n).concat(e);return function(t){return r.map(function(e){return[t,e]})}}function yr(t,e,n){var r=ru.range(t,e-Nu,n).concat(e);return function(t){return r.map(function(e){return[e,t]})}}function br(t){return t.source}function xr(t){return t.target}function wr(t,e,n,r){var i=Math.cos(e),o=Math.sin(e),a=Math.cos(r),u=Math.sin(r),s=i*Math.cos(t),l=i*Math.sin(t),c=a*Math.cos(n),f=a*Math.sin(n),h=2*Math.asin(Math.sqrt(ae(r-e)+i*a*ae(n-t))),p=1/Math.sin(h),d=h?function(t){var e=Math.sin(t*=h)*p,n=Math.sin(h-t)*p,r=n*s+e*c,i=n*l+e*f,a=n*o+e*u;return[Math.atan2(i,r)*Ru,Math.atan2(a,Math.sqrt(r*r+i*i))*Ru]}:function(){return[t*Ru,e*Ru]};return d.distance=h,d}function _r(){function t(t,i){var o=Math.sin(i*=zu),a=Math.cos(i),u=gu((t*=zu)-e),s=Math.cos(u);Us+=Math.atan2(Math.sqrt((u=a*Math.sin(u))*u+(u=r*o-n*a*s)*u),n*o+r*a*s),e=t,n=o,r=a}var e,n,r;Ws.point=function(i,o){e=i*zu,n=Math.sin(o*=zu),r=Math.cos(o),Ws.point=t},Ws.lineEnd=function(){Ws.point=Ws.lineEnd=_}}function Mr(t,e){function n(e,n){var r=Math.cos(e),i=Math.cos(n),o=t(r*i);return[o*i*Math.sin(e),o*Math.sin(n)]}return n.invert=function(t,n){var r=Math.sqrt(t*t+n*n),i=e(r),o=Math.sin(i),a=Math.cos(i);return[Math.atan2(t*o,r*a),Math.asin(r&&n*o/r)]},n}function kr(t,e){function n(t,e){a>0?-Fu+Nu>e&&(e=-Fu+Nu):e>Fu-Nu&&(e=Fu-Nu);var n=a/Math.pow(i(e),o);return[n*Math.sin(o*t),a-n*Math.cos(o*t)]}var r=Math.cos(t),i=function(t){return Math.tan(qu/4+t/2)},o=t===e?Math.sin(t):Math.log(r/Math.cos(e))/Math.log(i(e)/i(t)),a=r*Math.pow(i(t),o)/o;return o?(n.invert=function(t,e){var n=a-e,r=Q(o)*Math.sqrt(t*t+n*n);return[Math.atan2(t,n)/o,2*Math.atan(Math.pow(a/r,1/o))-Fu]},n):Cr}function Er(t,e){function n(t,e){var n=o-e;return[n*Math.sin(i*t),o-n*Math.cos(i*t)]
-}var r=Math.cos(t),i=t===e?Math.sin(t):(r-Math.cos(e))/(e-t),o=r/i+t;return gu(i)<Nu?lr:(n.invert=function(t,e){var n=o-e;return[Math.atan2(t,n)/i,o-Q(i)*Math.sqrt(t*t+n*n)]},n)}function Cr(t,e){return[t,Math.log(Math.tan(qu/4+e/2))]}function Sr(t){var e,n=ar(t),r=n.scale,i=n.translate,o=n.clipExtent;return n.scale=function(){var t=r.apply(n,arguments);return t===n?e?n.clipExtent(null):n:t},n.translate=function(){var t=i.apply(n,arguments);return t===n?e?n.clipExtent(null):n:t},n.clipExtent=function(t){var a=o.apply(n,arguments);if(a===n){if(e=null==t){var u=qu*r(),s=i();o([[s[0]-u,s[1]-u],[s[0]+u,s[1]+u]])}}else e&&(a=null);return a},n.clipExtent(null)}function Tr(t,e){return[Math.log(Math.tan(qu/4+e/2)),-t]}function jr(t){return t[0]}function Ar(t){return t[1]}function Nr(t){for(var e=t.length,n=[0,1],r=2,i=2;e>i;i++){for(;r>1&&te(t[n[r-2]],t[n[r-1]],t[i])<=0;)--r;n[r++]=i}return n.slice(0,r)}function Or(t,e){return t[0]-e[0]||t[1]-e[1]}function qr(t,e,n){return(n[0]-e[0])*(t[1]-e[1])<(n[1]-e[1])*(t[0]-e[0])}function Dr(t,e,n,r){var i=t[0],o=n[0],a=e[0]-i,u=r[0]-o,s=t[1],l=n[1],c=e[1]-s,f=r[1]-l,h=(u*(s-l)-f*(i-o))/(f*a-u*c);return[i+h*a,s+h*c]}function Lr(t){var e=t[0],n=t[t.length-1];return!(e[0]-n[0]||e[1]-n[1])}function Fr(){ri(this),this.edge=this.site=this.circle=null}function zr(t){var e=il.pop()||new Fr;return e.site=t,e}function Rr(t){Xr(t),el.remove(t),il.push(t),ri(t)}function Ir(t){var e=t.circle,n=e.x,r=e.cy,i={x:n,y:r},o=t.P,a=t.N,u=[t];Rr(t);for(var s=o;s.circle&&gu(n-s.circle.x)<Nu&&gu(r-s.circle.cy)<Nu;)o=s.P,u.unshift(s),Rr(s),s=o;u.unshift(s),Xr(s);for(var l=a;l.circle&&gu(n-l.circle.x)<Nu&&gu(r-l.circle.cy)<Nu;)a=l.N,u.push(l),Rr(l),l=a;u.push(l),Xr(l);var c,f=u.length;for(c=1;f>c;++c)l=u[c],s=u[c-1],ti(l.edge,s.site,l.site,i);s=u[0],l=u[f-1],l.edge=Gr(s.site,l.site,null,i),Yr(s),Yr(l)}function Pr(t){for(var e,n,r,i,o=t.x,a=t.y,u=el._;u;)if(r=Hr(u,a)-o,r>Nu)u=u.L;else{if(i=o-Br(u,a),!(i>Nu)){r>-Nu?(e=u.P,n=u):i>-Nu?(e=u,n=u.N):e=n=u;break}if(!u.R){e=u;break}u=u.R}var s=zr(t);if(el.insert(e,s),e||n){if(e===n)return Xr(e),n=zr(e.site),el.insert(s,n),s.edge=n.edge=Gr(e.site,s.site),Yr(e),void Yr(n);if(!n)return void(s.edge=Gr(e.site,s.site));Xr(e),Xr(n);var l=e.site,c=l.x,f=l.y,h=t.x-c,p=t.y-f,d=n.site,g=d.x-c,v=d.y-f,m=2*(h*v-p*g),y=h*h+p*p,b=g*g+v*v,x={x:(v*y-p*b)/m+c,y:(h*b-g*y)/m+f};ti(n.edge,l,d,x),s.edge=Gr(l,t,null,x),n.edge=Gr(t,d,null,x),Yr(e),Yr(n)}}function Hr(t,e){var n=t.site,r=n.x,i=n.y,o=i-e;if(!o)return r;var a=t.P;if(!a)return-1/0;n=a.site;var u=n.x,s=n.y,l=s-e;if(!l)return u;var c=u-r,f=1/o-1/l,h=c/l;return f?(-h+Math.sqrt(h*h-2*f*(c*c/(-2*l)-s+l/2+i-o/2)))/f+r:(r+u)/2}function Br(t,e){var n=t.N;if(n)return Hr(n,e);var r=t.site;return r.y===e?r.x:1/0}function $r(t){this.site=t,this.edges=[]}function Vr(t){for(var e,n,r,i,o,a,u,s,l,c,f=t[0][0],h=t[1][0],p=t[0][1],d=t[1][1],g=tl,v=g.length;v--;)if(o=g[v],o&&o.prepare())for(u=o.edges,s=u.length,a=0;s>a;)c=u[a].end(),r=c.x,i=c.y,l=u[++a%s].start(),e=l.x,n=l.y,(gu(r-e)>Nu||gu(i-n)>Nu)&&(u.splice(a,0,new ei(Qr(o.site,c,gu(r-f)<Nu&&d-i>Nu?{x:f,y:gu(e-f)<Nu?n:d}:gu(i-d)<Nu&&h-r>Nu?{x:gu(n-d)<Nu?e:h,y:d}:gu(r-h)<Nu&&i-p>Nu?{x:h,y:gu(e-h)<Nu?n:p}:gu(i-p)<Nu&&r-f>Nu?{x:gu(n-p)<Nu?e:f,y:p}:null),o.site,null)),++s)}function Ur(t,e){return e.angle-t.angle}function Wr(){ri(this),this.x=this.y=this.arc=this.site=this.cy=null}function Yr(t){var e=t.P,n=t.N;if(e&&n){var r=e.site,i=t.site,o=n.site;if(r!==o){var a=i.x,u=i.y,s=r.x-a,l=r.y-u,c=o.x-a,f=o.y-u,h=2*(s*f-l*c);if(!(h>=-Ou)){var p=s*s+l*l,d=c*c+f*f,g=(f*p-l*d)/h,v=(s*d-c*p)/h,f=v+u,m=ol.pop()||new Wr;m.arc=t,m.site=i,m.x=g+a,m.y=f+Math.sqrt(g*g+v*v),m.cy=f,t.circle=m;for(var y=null,b=rl._;b;)if(m.y<b.y||m.y===b.y&&m.x<=b.x){if(!b.L){y=b.P;break}b=b.L}else{if(!b.R){y=b;break}b=b.R}rl.insert(y,m),y||(nl=m)}}}}function Xr(t){var e=t.circle;e&&(e.P||(nl=e.N),rl.remove(e),ol.push(e),ri(e),t.circle=null)}function Jr(t){for(var e,n=Qs,r=$n(t[0][0],t[0][1],t[1][0],t[1][1]),i=n.length;i--;)e=n[i],(!Zr(e,t)||!r(e)||gu(e.a.x-e.b.x)<Nu&&gu(e.a.y-e.b.y)<Nu)&&(e.a=e.b=null,n.splice(i,1))}function Zr(t,e){var n=t.b;if(n)return!0;var r,i,o=t.a,a=e[0][0],u=e[1][0],s=e[0][1],l=e[1][1],c=t.l,f=t.r,h=c.x,p=c.y,d=f.x,g=f.y,v=(h+d)/2,m=(p+g)/2;if(g===p){if(a>v||v>=u)return;if(h>d){if(o){if(o.y>=l)return}else o={x:v,y:s};n={x:v,y:l}}else{if(o){if(o.y<s)return}else o={x:v,y:l};n={x:v,y:s}}}else if(r=(h-d)/(g-p),i=m-r*v,-1>r||r>1)if(h>d){if(o){if(o.y>=l)return}else o={x:(s-i)/r,y:s};n={x:(l-i)/r,y:l}}else{if(o){if(o.y<s)return}else o={x:(l-i)/r,y:l};n={x:(s-i)/r,y:s}}else if(g>p){if(o){if(o.x>=u)return}else o={x:a,y:r*a+i};n={x:u,y:r*u+i}}else{if(o){if(o.x<a)return}else o={x:u,y:r*u+i};n={x:a,y:r*a+i}}return t.a=o,t.b=n,!0}function Kr(t,e){this.l=t,this.r=e,this.a=this.b=null}function Gr(t,e,n,r){var i=new Kr(t,e);return Qs.push(i),n&&ti(i,t,e,n),r&&ti(i,e,t,r),tl[t.i].edges.push(new ei(i,t,e)),tl[e.i].edges.push(new ei(i,e,t)),i}function Qr(t,e,n){var r=new Kr(t,null);return r.a=e,r.b=n,Qs.push(r),r}function ti(t,e,n,r){t.a||t.b?t.l===n?t.b=r:t.a=r:(t.a=r,t.l=e,t.r=n)}function ei(t,e,n){var r=t.a,i=t.b;this.edge=t,this.site=e,this.angle=n?Math.atan2(n.y-e.y,n.x-e.x):t.l===e?Math.atan2(i.x-r.x,r.y-i.y):Math.atan2(r.x-i.x,i.y-r.y)}function ni(){this._=null}function ri(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function ii(t,e){var n=e,r=e.R,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function oi(t,e){var n=e,r=e.L,i=n.U;i?i.L===n?i.L=r:i.R=r:t._=r,r.U=i,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function ai(t){for(;t.L;)t=t.L;return t}function ui(t,e){var n,r,i,o=t.sort(si).pop();for(Qs=[],tl=new Array(t.length),el=new ni,rl=new ni;;)if(i=nl,o&&(!i||o.y<i.y||o.y===i.y&&o.x<i.x))(o.x!==n||o.y!==r)&&(tl[o.i]=new $r(o),Pr(o),n=o.x,r=o.y),o=t.pop();else{if(!i)break;Ir(i.arc)}e&&(Jr(e),Vr(e));var a={cells:tl,edges:Qs};return el=rl=Qs=tl=null,a}function si(t,e){return e.y-t.y||e.x-t.x}function li(t,e,n){return(t.x-n.x)*(e.y-t.y)-(t.x-e.x)*(n.y-t.y)}function ci(t){return t.x}function fi(t){return t.y}function hi(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function pi(t,e,n,r,i,o){if(!t(e,n,r,i,o)){var a=.5*(n+i),u=.5*(r+o),s=e.nodes;s[0]&&pi(t,s[0],n,r,a,u),s[1]&&pi(t,s[1],a,r,i,u),s[2]&&pi(t,s[2],n,u,a,o),s[3]&&pi(t,s[3],a,u,i,o)}}function di(t,e,n,r,i,o,a){var u,s=1/0;return function l(t,c,f,h,p){if(!(c>o||f>a||r>h||i>p)){if(d=t.point){var d,g=e-t.x,v=n-t.y,m=g*g+v*v;if(s>m){var y=Math.sqrt(s=m);r=e-y,i=n-y,o=e+y,a=n+y,u=d}}for(var b=t.nodes,x=.5*(c+h),w=.5*(f+p),_=e>=x,M=n>=w,k=M<<1|_,E=k+4;E>k;++k)if(t=b[3&k])switch(3&k){case 0:l(t,c,f,x,w);break;case 1:l(t,x,f,h,w);break;case 2:l(t,c,w,x,p);break;case 3:l(t,x,w,h,p)}}}(t,r,i,o,a),u}function gi(t,e){t=ru.rgb(t),e=ru.rgb(e);var n=t.r,r=t.g,i=t.b,o=e.r-n,a=e.g-r,u=e.b-i;return function(t){return"#"+we(Math.round(n+o*t))+we(Math.round(r+a*t))+we(Math.round(i+u*t))}}function vi(t,e){var n,r={},i={};for(n in t)n in e?r[n]=bi(t[n],e[n]):i[n]=t[n];for(n in e)n in t||(i[n]=e[n]);return function(t){for(n in r)i[n]=r[n](t);return i}}function mi(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function yi(t,e){var n,r,i,o=ul.lastIndex=sl.lastIndex=0,a=-1,u=[],s=[];for(t+="",e+="";(n=ul.exec(t))&&(r=sl.exec(e));)(i=r.index)>o&&(i=e.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(n=n[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,s.push({i:a,x:mi(n,r)})),o=sl.lastIndex;return o<e.length&&(i=e.slice(o),u[a]?u[a]+=i:u[++a]=i),u.length<2?s[0]?(e=s[0].x,function(t){return e(t)+""}):function(){return e}:(e=s.length,function(t){for(var n,r=0;e>r;++r)u[(n=s[r]).i]=n.x(t);return u.join("")})}function bi(t,e){for(var n,r=ru.interpolators.length;--r>=0&&!(n=ru.interpolators[r](t,e)););return n}function xi(t,e){var n,r=[],i=[],o=t.length,a=e.length,u=Math.min(t.length,e.length);for(n=0;u>n;++n)r.push(bi(t[n],e[n]));for(;o>n;++n)i[n]=t[n];for(;a>n;++n)i[n]=e[n];return function(t){for(n=0;u>n;++n)i[n]=r[n](t);return i}}function wi(t){return function(e){return 0>=e?0:e>=1?1:t(e)}}function _i(t){return function(e){return 1-t(1-e)}}function Mi(t){return function(e){return.5*(.5>e?t(2*e):2-t(2-2*e))}}function ki(t){return t*t}function Ei(t){return t*t*t}function Ci(t){if(0>=t)return 0;if(t>=1)return 1;var e=t*t,n=e*t;return 4*(.5>t?n:3*(t-e)+n-.75)}function Si(t){return function(e){return Math.pow(e,t)}}function Ti(t){return 1-Math.cos(t*Fu)}function ji(t){return Math.pow(2,10*(t-1))}function Ai(t){return 1-Math.sqrt(1-t*t)}function Ni(t,e){var n;return arguments.length<2&&(e=.45),arguments.length?n=e/Du*Math.asin(1/t):(t=1,n=e/4),function(r){return 1+t*Math.pow(2,-10*r)*Math.sin((r-n)*Du/e)}}function Oi(t){return t||(t=1.70158),function(e){return e*e*((t+1)*e-t)}}function qi(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function Di(t,e){t=ru.hcl(t),e=ru.hcl(e);var n=t.h,r=t.c,i=t.l,o=e.h-n,a=e.c-r,u=e.l-i;return isNaN(a)&&(a=0,r=isNaN(r)?e.c:r),isNaN(o)?(o=0,n=isNaN(n)?e.h:n):o>180?o-=360:-180>o&&(o+=360),function(t){return fe(n+o*t,r+a*t,i+u*t)+""}}function Li(t,e){t=ru.hsl(t),e=ru.hsl(e);var n=t.h,r=t.s,i=t.l,o=e.h-n,a=e.s-r,u=e.l-i;return isNaN(a)&&(a=0,r=isNaN(r)?e.s:r),isNaN(o)?(o=0,n=isNaN(n)?e.h:n):o>180?o-=360:-180>o&&(o+=360),function(t){return le(n+o*t,r+a*t,i+u*t)+""}}function Fi(t,e){t=ru.lab(t),e=ru.lab(e);var n=t.l,r=t.a,i=t.b,o=e.l-n,a=e.a-r,u=e.b-i;return function(t){return pe(n+o*t,r+a*t,i+u*t)+""}}function zi(t,e){return e-=t,function(n){return Math.round(t+e*n)}}function Ri(t){var e=[t.a,t.b],n=[t.c,t.d],r=Pi(e),i=Ii(e,n),o=Pi(Hi(n,e,-i))||0;e[0]*n[1]<n[0]*e[1]&&(e[0]*=-1,e[1]*=-1,r*=-1,i*=-1),this.rotate=(r?Math.atan2(e[1],e[0]):Math.atan2(-n[0],n[1]))*Ru,this.translate=[t.e,t.f],this.scale=[r,o],this.skew=o?Math.atan2(i,o)*Ru:0}function Ii(t,e){return t[0]*e[0]+t[1]*e[1]}function Pi(t){var e=Math.sqrt(Ii(t,t));return e&&(t[0]/=e,t[1]/=e),e}function Hi(t,e,n){return t[0]+=n*e[0],t[1]+=n*e[1],t}function Bi(t,e){var n,r=[],i=[],o=ru.transform(t),a=ru.transform(e),u=o.translate,s=a.translate,l=o.rotate,c=a.rotate,f=o.skew,h=a.skew,p=o.scale,d=a.scale;return u[0]!=s[0]||u[1]!=s[1]?(r.push("translate(",null,",",null,")"),i.push({i:1,x:mi(u[0],s[0])},{i:3,x:mi(u[1],s[1])})):r.push(s[0]||s[1]?"translate("+s+")":""),l!=c?(l-c>180?c+=360:c-l>180&&(l+=360),i.push({i:r.push(r.pop()+"rotate(",null,")")-2,x:mi(l,c)})):c&&r.push(r.pop()+"rotate("+c+")"),f!=h?i.push({i:r.push(r.pop()+"skewX(",null,")")-2,x:mi(f,h)}):h&&r.push(r.pop()+"skewX("+h+")"),p[0]!=d[0]||p[1]!=d[1]?(n=r.push(r.pop()+"scale(",null,",",null,")"),i.push({i:n-4,x:mi(p[0],d[0])},{i:n-2,x:mi(p[1],d[1])})):(1!=d[0]||1!=d[1])&&r.push(r.pop()+"scale("+d+")"),n=i.length,function(t){for(var e,o=-1;++o<n;)r[(e=i[o]).i]=e.x(t);return r.join("")}}function $i(t,e){return e=(e-=t=+t)||1/e,function(n){return(n-t)/e}}function Vi(t,e){return e=(e-=t=+t)||1/e,function(n){return Math.max(0,Math.min(1,(n-t)/e))}}function Ui(t){for(var e=t.source,n=t.target,r=Yi(e,n),i=[e];e!==r;)e=e.parent,i.push(e);for(var o=i.length;n!==r;)i.splice(o,0,n),n=n.parent;return i}function Wi(t){for(var e=[],n=t.parent;null!=n;)e.push(t),t=n,n=n.parent;return e.push(t),e}function Yi(t,e){if(t===e)return t;for(var n=Wi(t),r=Wi(e),i=n.pop(),o=r.pop(),a=null;i===o;)a=i,i=n.pop(),o=r.pop();return a}function Xi(t){t.fixed|=2}function Ji(t){t.fixed&=-7}function Zi(t){t.fixed|=4,t.px=t.x,t.py=t.y}function Ki(t){t.fixed&=-5}function Gi(t,e,n){var r=0,i=0;if(t.charge=0,!t.leaf)for(var o,a=t.nodes,u=a.length,s=-1;++s<u;)o=a[s],null!=o&&(Gi(o,e,n),t.charge+=o.charge,r+=o.charge*o.cx,i+=o.charge*o.cy);if(t.point){t.leaf||(t.point.x+=Math.random()-.5,t.point.y+=Math.random()-.5);var l=e*n[t.point.index];t.charge+=t.pointCharge=l,r+=l*t.point.x,i+=l*t.point.y}t.cx=r/t.charge,t.cy=i/t.charge}function Qi(t,e){return ru.rebind(t,e,"sort","children","value"),t.nodes=t,t.links=oo,t}function to(t,e){for(var n=[t];null!=(t=n.pop());)if(e(t),(i=t.children)&&(r=i.length))for(var r,i;--r>=0;)n.push(i[r])}function eo(t,e){for(var n=[t],r=[];null!=(t=n.pop());)if(r.push(t),(o=t.children)&&(i=o.length))for(var i,o,a=-1;++a<i;)n.push(o[a]);for(;null!=(t=r.pop());)e(t)}function no(t){return t.children}function ro(t){return t.value}function io(t,e){return e.value-t.value}function oo(t){return ru.merge(t.map(function(t){return(t.children||[]).map(function(e){return{source:t,target:e}})}))}function ao(t){return t.x}function uo(t){return t.y}function so(t,e,n){t.y0=e,t.y=n}function lo(data){return ru.range(data.length)}function co(data){for(var t=-1,e=data[0].length,n=[];++t<e;)n[t]=0;return n}function fo(t){for(var e,n=1,r=0,i=t[0][1],o=t.length;o>n;++n)(e=t[n][1])>i&&(r=n,i=e);return r}function ho(t){return t.reduce(po,0)}function po(t,e){return t+e[1]}function go(t,e){return vo(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function vo(t,e){for(var n=-1,r=+t[0],i=(t[1]-r)/e,o=[];++n<=e;)o[n]=i*n+r;return o}function mo(t){return[ru.min(t),ru.max(t)]}function yo(t,e){return t.value-e.value}function bo(t,e){var n=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=n,n._pack_prev=e}function xo(t,e){t._pack_next=e,e._pack_prev=t}function wo(t,e){var n=e.x-t.x,r=e.y-t.y,i=t.r+e.r;return.999*i*i>n*n+r*r}function _o(t){function e(t){c=Math.min(t.x-t.r,c),f=Math.max(t.x+t.r,f),h=Math.min(t.y-t.r,h),p=Math.max(t.y+t.r,p)}if((n=t.children)&&(l=n.length)){var n,r,i,o,a,u,s,l,c=1/0,f=-1/0,h=1/0,p=-1/0;if(n.forEach(Mo),r=n[0],r.x=-r.r,r.y=0,e(r),l>1&&(i=n[1],i.x=i.r,i.y=0,e(i),l>2))for(o=n[2],Co(r,i,o),e(o),bo(r,o),r._pack_prev=o,bo(o,i),i=r._pack_next,a=3;l>a;a++){Co(r,i,o=n[a]);var d=0,g=1,v=1;for(u=i._pack_next;u!==i;u=u._pack_next,g++)if(wo(u,o)){d=1;break}if(1==d)for(s=r._pack_prev;s!==u._pack_prev&&!wo(s,o);s=s._pack_prev,v++);d?(v>g||g==v&&i.r<r.r?xo(r,i=u):xo(r=s,i),a--):(bo(r,o),i=o,e(o))}var m=(c+f)/2,y=(h+p)/2,b=0;for(a=0;l>a;a++)o=n[a],o.x-=m,o.y-=y,b=Math.max(b,o.r+Math.sqrt(o.x*o.x+o.y*o.y));t.r=b,n.forEach(ko)}}function Mo(t){t._pack_next=t._pack_prev=t}function ko(t){delete t._pack_next,delete t._pack_prev}function Eo(t,e,n,r){var i=t.children;if(t.x=e+=r*t.x,t.y=n+=r*t.y,t.r*=r,i)for(var o=-1,a=i.length;++o<a;)Eo(i[o],e,n,r)}function Co(t,e,n){var r=t.r+n.r,i=e.x-t.x,o=e.y-t.y;if(r&&(i||o)){var a=e.r+n.r,u=i*i+o*o;a*=a,r*=r;var s=.5+(r-a)/(2*u),l=Math.sqrt(Math.max(0,2*a*(r+u)-(r-=u)*r-a*a))/(2*u);n.x=t.x+s*i+l*o,n.y=t.y+s*o-l*i}else n.x=t.x+r,n.y=t.y}function So(t,e){return t.parent==e.parent?1:2}function To(t){var e=t.children;return e.length?e[0]:t.t}function jo(t){var e,n=t.children;return(e=n.length)?n[e-1]:t.t}function Ao(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function No(t){for(var e,n=0,r=0,i=t.children,o=i.length;--o>=0;)e=i[o],e.z+=n,e.m+=n,n+=e.s+(r+=e.c)}function Oo(t,e,n){return t.a.parent===e.parent?t.a:n}function qo(t){return 1+ru.max(t,function(t){return t.y})}function Do(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}function Lo(t){var e=t.children;return e&&e.length?Lo(e[0]):t}function Fo(t){var e,n=t.children;return n&&(e=n.length)?Fo(n[e-1]):t}function zo(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Ro(t,e){var n=t.x+e[3],r=t.y+e[0],i=t.dx-e[1]-e[3],o=t.dy-e[0]-e[2];return 0>i&&(n+=i/2,i=0),0>o&&(r+=o/2,o=0),{x:n,y:r,dx:i,dy:o}}function Io(t){var e=t[0],n=t[t.length-1];return n>e?[e,n]:[n,e]}function Po(t){return t.rangeExtent?t.rangeExtent():Io(t.range())}function Ho(t,e,n,r){var i=n(t[0],t[1]),o=r(e[0],e[1]);return function(t){return o(i(t))}}function Bo(t,e){var n,r=0,i=t.length-1,o=t[r],a=t[i];return o>a&&(n=r,r=i,i=n,n=o,o=a,a=n),t[r]=e.floor(o),t[i]=e.ceil(a),t}function $o(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:bl}function Vo(t,e,n,r){var i=[],o=[],a=0,u=Math.min(t.length,e.length)-1;for(t[u]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<=u;)i.push(n(t[a-1],t[a])),o.push(r(e[a-1],e[a]));return function(e){var n=ru.bisect(t,e,1,u)-1;return o[n](i[n](e))}}function Uo(t,e,n,r){function i(){var i=Math.min(t.length,e.length)>2?Vo:Ho,s=r?Vi:$i;return a=i(t,e,s,n),u=i(e,t,s,bi),o}function o(t){return a(t)}var a,u;return o.invert=function(t){return u(t)},o.domain=function(e){return arguments.length?(t=e.map(Number),i()):t},o.range=function(t){return arguments.length?(e=t,i()):e},o.rangeRound=function(t){return o.range(t).interpolate(zi)},o.clamp=function(t){return arguments.length?(r=t,i()):r},o.interpolate=function(t){return arguments.length?(n=t,i()):n},o.ticks=function(e){return Jo(t,e)},o.tickFormat=function(e,n){return Zo(t,e,n)},o.nice=function(e){return Yo(t,e),i()},o.copy=function(){return Uo(t,e,n,r)},i()}function Wo(t,e){return ru.rebind(t,e,"range","rangeRound","interpolate","clamp")}function Yo(t,e){return Bo(t,$o(Xo(t,e)[2]))}function Xo(t,e){null==e&&(e=10);var n=Io(t),r=n[1]-n[0],i=Math.pow(10,Math.floor(Math.log(r/e)/Math.LN10)),o=e/r*i;return.15>=o?i*=10:.35>=o?i*=5:.75>=o&&(i*=2),n[0]=Math.ceil(n[0]/i)*i,n[1]=Math.floor(n[1]/i)*i+.5*i,n[2]=i,n}function Jo(t,e){return ru.range.apply(ru,Xo(t,e))}function Zo(t,e,n){var r=Xo(t,e);if(n){var i=us.exec(n);if(i.shift(),"s"===i[8]){var o=ru.formatPrefix(Math.max(gu(r[0]),gu(r[1])));return i[7]||(i[7]="."+Ko(o.scale(r[2]))),i[8]="f",n=ru.format(i.join("")),function(t){return n(o.scale(t))+o.symbol}}i[7]||(i[7]="."+Go(i[8],r)),n=i.join("")}else n=",."+Ko(r[2])+"f";return ru.format(n)}function Ko(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function Go(t,e){var n=Ko(e[2]);return t in xl?Math.abs(n-Ko(Math.max(gu(e[0]),gu(e[1]))))+ +("e"!==t):n-2*("%"===t)}function Qo(t,e,n,r){function i(t){return(n?Math.log(0>t?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function o(t){return n?Math.pow(e,t):-Math.pow(e,-t)}function a(e){return t(i(e))}return a.invert=function(e){return o(t.invert(e))},a.domain=function(e){return arguments.length?(n=e[0]>=0,t.domain((r=e.map(Number)).map(i)),a):r},a.base=function(n){return arguments.length?(e=+n,t.domain(r.map(i)),a):e},a.nice=function(){var e=Bo(r.map(i),n?Math:_l);return t.domain(e),r=e.map(o),a},a.ticks=function(){var t=Io(r),a=[],u=t[0],s=t[1],l=Math.floor(i(u)),c=Math.ceil(i(s)),f=e%1?2:e;if(isFinite(c-l)){if(n){for(;c>l;l++)for(var h=1;f>h;h++)a.push(o(l)*h);a.push(o(l))}else for(a.push(o(l));l++<c;)for(var h=f-1;h>0;h--)a.push(o(l)*h);for(l=0;a[l]<u;l++);for(c=a.length;a[c-1]>s;c--);a=a.slice(l,c)}return a},a.tickFormat=function(t,e){if(!arguments.length)return wl;arguments.length<2?e=wl:"function"!=typeof e&&(e=ru.format(e));var r,u=Math.max(.1,t/a.ticks().length),s=n?(r=1e-12,Math.ceil):(r=-1e-12,Math.floor);return function(t){return t/o(s(i(t)+r))<=u?e(t):""}},a.copy=function(){return Qo(t.copy(),e,n,r)},Wo(a,t)}function ta(t,e,n){function r(e){return t(i(e))}var i=ea(e),o=ea(1/e);return r.invert=function(e){return o(t.invert(e))},r.domain=function(e){return arguments.length?(t.domain((n=e.map(Number)).map(i)),r):n},r.ticks=function(t){return Jo(n,t)},r.tickFormat=function(t,e){return Zo(n,t,e)},r.nice=function(t){return r.domain(Yo(n,t))},r.exponent=function(a){return arguments.length?(i=ea(e=a),o=ea(1/e),t.domain(n.map(i)),r):e},r.copy=function(){return ta(t.copy(),e,n)},Wo(r,t)}function ea(t){return function(e){return 0>e?-Math.pow(-e,t):Math.pow(e,t)}}function na(t,e){function n(n){return o[((i.get(n)||("range"===e.t?i.set(n,t.push(n)):0/0))-1)%o.length]}function r(e,n){return ru.range(t.length).map(function(t){return e+n*t})}var i,o,a;return n.domain=function(r){if(!arguments.length)return t;t=[],i=new c;for(var o,a=-1,u=r.length;++a<u;)i.has(o=r[a])||i.set(o,t.push(o));return n[e.t].apply(n,e.a)},n.range=function(t){return arguments.length?(o=t,a=0,e={t:"range",a:arguments},n):o},n.rangePoints=function(i,u){arguments.length<2&&(u=0);var s=i[0],l=i[1],c=t.length<2?(s=(s+l)/2,0):(l-s)/(t.length-1+u);return o=r(s+c*u/2,c),a=0,e={t:"rangePoints",a:arguments},n},n.rangeRoundPoints=function(i,u){arguments.length<2&&(u=0);var s=i[0],l=i[1],c=t.length<2?(s=l=Math.round((s+l)/2),0):(l-s)/(t.length-1+u)|0;return o=r(s+Math.round(c*u/2+(l-s-(t.length-1+u)*c)/2),c),a=0,e={t:"rangeRoundPoints",a:arguments},n},n.rangeBands=function(i,u,s){arguments.length<2&&(u=0),arguments.length<3&&(s=u);var l=i[1]<i[0],c=i[l-0],f=i[1-l],h=(f-c)/(t.length-u+2*s);return o=r(c+h*s,h),l&&o.reverse(),a=h*(1-u),e={t:"rangeBands",a:arguments},n},n.rangeRoundBands=function(i,u,s){arguments.length<2&&(u=0),arguments.length<3&&(s=u);var l=i[1]<i[0],c=i[l-0],f=i[1-l],h=Math.floor((f-c)/(t.length-u+2*s));return o=r(c+Math.round((f-c-(t.length-u)*h)/2),h),l&&o.reverse(),a=Math.round(h*(1-u)),e={t:"rangeRoundBands",a:arguments},n},n.rangeBand=function(){return a},n.rangeExtent=function(){return Io(e.a[0])},n.copy=function(){return na(t,e)},n.domain(t)}function ra(t,e){function n(){var n=0,r=e.length;for(u=[];++n<r;)u[n-1]=ru.quantile(t,n/r);return a}function a(t){return isNaN(t=+t)?void 0:e[ru.bisect(u,t)]}var u;return a.domain=function(e){return arguments.length?(t=e.map(i).filter(o).sort(r),n()):t},a.range=function(t){return arguments.length?(e=t,n()):e},a.quantiles=function(){return u},a.invertExtent=function(n){return n=e.indexOf(n),0>n?[0/0,0/0]:[n>0?u[n-1]:t[0],n<u.length?u[n]:t[t.length-1]]},a.copy=function(){return ra(t,e)},n()}function ia(t,e,n){function r(e){return n[Math.max(0,Math.min(a,Math.floor(o*(e-t))))]}function i(){return o=n.length/(e-t),a=n.length-1,r}var o,a;return r.domain=function(n){return arguments.length?(t=+n[0],e=+n[n.length-1],i()):[t,e]},r.range=function(t){return arguments.length?(n=t,i()):n},r.invertExtent=function(e){return e=n.indexOf(e),e=0>e?0/0:e/o+t,[e,e+1/o]},r.copy=function(){return ia(t,e,n)},i()}function oa(t,e){function n(n){return n>=n?e[ru.bisect(t,n)]:void 0}return n.domain=function(e){return arguments.length?(t=e,n):t},n.range=function(t){return arguments.length?(e=t,n):e},n.invertExtent=function(n){return n=e.indexOf(n),[t[n-1],t[n]]},n.copy=function(){return oa(t,e)},n}function aa(t){function e(t){return+t}return e.invert=e,e.domain=e.range=function(n){return arguments.length?(t=n.map(e),e):t},e.ticks=function(e){return Jo(t,e)},e.tickFormat=function(e,n){return Zo(t,e,n)},e.copy=function(){return aa(t)},e}function ua(){return 0}function sa(t){return t.innerRadius}function la(t){return t.outerRadius}function ca(t){return t.startAngle}function fa(t){return t.endAngle}function ha(t){return t&&t.padAngle}function pa(t,e,n,r){return(t-n)*e-(e-r)*t>0?0:1}function da(t,e,n,r,i){var o=t[0]-e[0],a=t[1]-e[1],u=(i?r:-r)/Math.sqrt(o*o+a*a),s=u*a,l=-u*o,c=t[0]+s,f=t[1]+l,h=e[0]+s,p=e[1]+l,d=(c+h)/2,g=(f+p)/2,v=h-c,m=p-f,y=v*v+m*m,b=n-r,x=c*p-h*f,w=(0>m?-1:1)*Math.sqrt(b*b*y-x*x),_=(x*m-v*w)/y,M=(-x*v-m*w)/y,k=(x*m+v*w)/y,E=(-x*v+m*w)/y,C=_-d,S=M-g,T=k-d,j=E-g;return C*C+S*S>T*T+j*j&&(_=k,M=E),[[_-s,M-l],[_*n/b,M*n/b]]}function ga(t){function e(data){function e(){s.push("M",o(t(l),u))}for(var a,s=[],l=[],c=-1,f=data.length,h=Se(n),p=Se(r);++c<f;)i.call(this,a=data[c],c)?l.push([+h.call(this,a,c),+p.call(this,a,c)]):l.length&&(e(),l=[]);return l.length&&e(),s.length?s.join(""):null}var n=jr,r=Ar,i=An,o=va,a=o.key,u=.7;return e.x=function(t){return arguments.length?(n=t,e):n},e.y=function(t){return arguments.length?(r=t,e):r},e.defined=function(t){return arguments.length?(i=t,e):i},e.interpolate=function(t){return arguments.length?(a="function"==typeof t?o=t:(o=Tl.get(t)||va).key,e):a},e.tension=function(t){return arguments.length?(u=t,e):u},e}function va(t){return t.join("L")}function ma(t){return va(t)+"Z"}function ya(t){for(var e=0,n=t.length,r=t[0],i=[r[0],",",r[1]];++e<n;)i.push("H",(r[0]+(r=t[e])[0])/2,"V",r[1]);return n>1&&i.push("H",r[0]),i.join("")}function ba(t){for(var e=0,n=t.length,r=t[0],i=[r[0],",",r[1]];++e<n;)i.push("V",(r=t[e])[1],"H",r[0]);return i.join("")}function xa(t){for(var e=0,n=t.length,r=t[0],i=[r[0],",",r[1]];++e<n;)i.push("H",(r=t[e])[0],"V",r[1]);return i.join("")}function wa(t,e){return t.length<4?va(t):t[1]+ka(t.slice(1,-1),Ea(t,e))}function _a(t,e){return t.length<3?va(t):t[0]+ka((t.push(t[0]),t),Ea([t[t.length-2]].concat(t,[t[1]]),e))}function Ma(t,e){return t.length<3?va(t):t[0]+ka(t,Ea(t,e))}function ka(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return va(t);var n=t.length!=e.length,r="",i=t[0],o=t[1],a=e[0],u=a,s=1;if(n&&(r+="Q"+(o[0]-2*a[0]/3)+","+(o[1]-2*a[1]/3)+","+o[0]+","+o[1],i=t[1],s=2),e.length>1){u=e[1],o=t[s],s++,r+="C"+(i[0]+a[0])+","+(i[1]+a[1])+","+(o[0]-u[0])+","+(o[1]-u[1])+","+o[0]+","+o[1];for(var l=2;l<e.length;l++,s++)o=t[s],u=e[l],r+="S"+(o[0]-u[0])+","+(o[1]-u[1])+","+o[0]+","+o[1]}if(n){var c=t[s];r+="Q"+(o[0]+2*u[0]/3)+","+(o[1]+2*u[1]/3)+","+c[0]+","+c[1]}return r}function Ea(t,e){for(var n,r=[],i=(1-e)/2,o=t[0],a=t[1],u=1,s=t.length;++u<s;)n=o,o=a,a=t[u],r.push([i*(a[0]-n[0]),i*(a[1]-n[1])]);return r}function Ca(t){if(t.length<3)return va(t);var e=1,n=t.length,r=t[0],i=r[0],o=r[1],a=[i,i,i,(r=t[1])[0]],u=[o,o,o,r[1]],s=[i,",",o,"L",Aa(Nl,a),",",Aa(Nl,u)];for(t.push(t[n-1]);++e<=n;)r=t[e],a.shift(),a.push(r[0]),u.shift(),u.push(r[1]),Na(s,a,u);return t.pop(),s.push("L",r),s.join("")}function Sa(t){if(t.length<4)return va(t);for(var e,n=[],r=-1,i=t.length,o=[0],a=[0];++r<3;)e=t[r],o.push(e[0]),a.push(e[1]);for(n.push(Aa(Nl,o)+","+Aa(Nl,a)),--r;++r<i;)e=t[r],o.shift(),o.push(e[0]),a.shift(),a.push(e[1]),Na(n,o,a);return n.join("")}function Ta(t){for(var e,n,r=-1,i=t.length,o=i+4,a=[],u=[];++r<4;)n=t[r%i],a.push(n[0]),u.push(n[1]);for(e=[Aa(Nl,a),",",Aa(Nl,u)],--r;++r<o;)n=t[r%i],a.shift(),a.push(n[0]),u.shift(),u.push(n[1]),Na(e,a,u);return e.join("")}function ja(t,e){var n=t.length-1;if(n)for(var r,i,o=t[0][0],a=t[0][1],u=t[n][0]-o,s=t[n][1]-a,l=-1;++l<=n;)r=t[l],i=l/n,r[0]=e*r[0]+(1-e)*(o+i*u),r[1]=e*r[1]+(1-e)*(a+i*s);return Ca(t)}function Aa(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function Na(t,e,n){t.push("C",Aa(jl,e),",",Aa(jl,n),",",Aa(Al,e),",",Aa(Al,n),",",Aa(Nl,e),",",Aa(Nl,n))}function Oa(t,e){return(e[1]-t[1])/(e[0]-t[0])}function qa(t){for(var e=0,n=t.length-1,r=[],i=t[0],o=t[1],a=r[0]=Oa(i,o);++e<n;)r[e]=(a+(a=Oa(i=o,o=t[e+1])))/2;return r[e]=a,r}function Da(t){for(var e,n,r,i,o=[],a=qa(t),u=-1,s=t.length-1;++u<s;)e=Oa(t[u],t[u+1]),gu(e)<Nu?a[u]=a[u+1]=0:(n=a[u]/e,r=a[u+1]/e,i=n*n+r*r,i>9&&(i=3*e/Math.sqrt(i),a[u]=i*n,a[u+1]=i*r));for(u=-1;++u<=s;)i=(t[Math.min(s,u+1)][0]-t[Math.max(0,u-1)][0])/(6*(1+a[u]*a[u])),o.push([i||0,a[u]*i||0]);return o}function La(t){return t.length<3?va(t):t[0]+ka(t,Da(t))}function Fa(t){for(var e,n,r,i=-1,o=t.length;++i<o;)e=t[i],n=e[0],r=e[1]-Fu,e[0]=n*Math.cos(r),e[1]=n*Math.sin(r);return t}function za(t){function e(data){function e(){d.push("M",u(t(v),f),c,l(t(g.reverse()),f),"Z")}for(var s,h,p,d=[],g=[],v=[],m=-1,y=data.length,b=Se(n),x=Se(i),w=n===r?function(){return h}:Se(r),_=i===o?function(){return p}:Se(o);++m<y;)a.call(this,s=data[m],m)?(g.push([h=+b.call(this,s,m),p=+x.call(this,s,m)]),v.push([+w.call(this,s,m),+_.call(this,s,m)])):g.length&&(e(),g=[],v=[]);return g.length&&e(),d.length?d.join(""):null}var n=jr,r=jr,i=0,o=Ar,a=An,u=va,s=u.key,l=u,c="L",f=.7;return e.x=function(t){return arguments.length?(n=r=t,e):r},e.x0=function(t){return arguments.length?(n=t,e):n},e.x1=function(t){return arguments.length?(r=t,e):r},e.y=function(t){return arguments.length?(i=o=t,e):o},e.y0=function(t){return arguments.length?(i=t,e):i},e.y1=function(t){return arguments.length?(o=t,e):o},e.defined=function(t){return arguments.length?(a=t,e):a},e.interpolate=function(t){return arguments.length?(s="function"==typeof t?u=t:(u=Tl.get(t)||va).key,l=u.reverse||u,c=u.closed?"M":"L",e):s},e.tension=function(t){return arguments.length?(f=t,e):f},e}function Ra(t){return t.radius}function Ia(t){return[t.x,t.y]}function Pa(t){return function(){var e=t.apply(this,arguments),n=e[0],r=e[1]-Fu;return[n*Math.cos(r),n*Math.sin(r)]}}function Ha(){return 64}function Ba(){return"circle"}function $a(t){var e=Math.sqrt(t/qu);return"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+-e+"A"+e+","+e+" 0 1,1 0,"+e+"Z"}function Va(t){return function(){var e,n;(e=this[t])&&(n=e[e.active])&&(--e.count?delete e[e.active]:delete this[t],e.active+=.5,n.event&&n.event.interrupt.call(this,this.__data__,n.index))}}function Ua(t,e,n){return xu(t,Rl),t.namespace=e,t.id=n,t}function Wa(t,e,n,r){var i=t.id,o=t.namespace;return V(t,"function"==typeof n?function(t,a,u){t[o][i].tween.set(e,r(n.call(t,t.__data__,a,u)))}:(n=r(n),function(t){t[o][i].tween.set(e,n)}))}function Ya(t){return null==t&&(t=""),function(){this.textContent=t}}function Xa(t){return null==t?"__transition__":"__transition_"+t+"__"}function Ja(t,e,n,r,i){var o=t[n]||(t[n]={active:0,count:0}),a=o[r];if(!a){var u=i.time;a=o[r]={tween:new c,time:u,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++o.count,ru.timer(function(i){function s(n){if(o.active>r)return c();var i=o[o.active];i&&(--o.count,delete o[o.active],i.event&&i.event.interrupt.call(t,t.__data__,i.index)),o.active=r,a.event&&a.event.start.call(t,t.__data__,e),a.tween.forEach(function(n,r){(r=r.call(t,t.__data__,e))&&g.push(r)}),h=a.ease,f=a.duration,ru.timer(function(){return d.c=l(n||1)?An:l,1},0,u)}function l(n){if(o.active!==r)return 1;for(var i=n/f,u=h(i),s=g.length;s>0;)g[--s].call(t,u);return i>=1?(a.event&&a.event.end.call(t,t.__data__,e),c()):void 0}function c(){return--o.count?delete o[r]:delete t[n],1}var f,h,p=a.delay,d=is,g=[];return d.t=p+u,i>=p?s(i-p):void(d.c=s)},0,u)}}function Za(t,e,n){t.attr("transform",function(t){var r=e(t);return"translate("+(isFinite(r)?r:n(t))+",0)"})}function Ka(t,e,n){t.attr("transform",function(t){var r=e(t);return"translate(0,"+(isFinite(r)?r:n(t))+")"})}function Ga(t){return t.toISOString()}function Qa(t,e,n){function r(e){return t(e)}function i(t,n){var r=t[1]-t[0],i=r/n,o=ru.bisect(Yl,i);return o==Yl.length?[e.year,Xo(t.map(function(t){return t/31536e6}),n)[2]]:o?e[i/Yl[o-1]<Yl[o]/i?o-1:o]:[Zl,Xo(t,n)[2]]}return r.invert=function(e){return tu(t.invert(e))},r.domain=function(e){return arguments.length?(t.domain(e),r):t.domain().map(tu)},r.nice=function(t,e){function n(n){return!isNaN(n)&&!t.range(n,tu(+n+1),e).length}var o=r.domain(),a=Io(o),u=null==t?i(a,10):"number"==typeof t&&i(a,t);return u&&(t=u[0],e=u[1]),r.domain(Bo(o,e>1?{floor:function(e){for(;n(e=t.floor(e));)e=tu(e-1);return e},ceil:function(e){for(;n(e=t.ceil(e));)e=tu(+e+1);return e}}:t))},r.ticks=function(t,e){var n=Io(r.domain()),o=null==t?i(n,10):"number"==typeof t?i(n,t):!t.range&&[{range:t},e];return o&&(t=o[0],e=o[1]),t.range(n[0],tu(+n[1]+1),1>e?1:e)},r.tickFormat=function(){return n},r.copy=function(){return Qa(t.copy(),e,n)},Wo(r,t)}function tu(t){return new Date(t)}function eu(t){return JSON.parse(t.responseText)}function nu(t){var e=au.createRange();return e.selectNode(au.body),e.createContextualFragment(t.responseText)}var ru={version:"3.5.5"},iu=[].slice,ou=function(t){return iu.call(t)},au=this.document;if(au)try{ou(au.documentElement.childNodes)[0].nodeType}catch(uu){ou=function(t){for(var e=t.length,n=new Array(e);e--;)n[e]=t[e];return n}}if(Date.now||(Date.now=function(){return+new Date}),au)try{au.createElement("DIV").style.setProperty("opacity",0,"")}catch(su){var lu=this.Element.prototype,cu=lu.setAttribute,fu=lu.setAttributeNS,hu=this.CSSStyleDeclaration.prototype,pu=hu.setProperty;lu.setAttribute=function(t,e){cu.call(this,t,e+"")},lu.setAttributeNS=function(t,e,n){fu.call(this,t,e,n+"")},hu.setProperty=function(t,e,n){pu.call(this,t,e+"",n)}}ru.ascending=r,ru.descending=function(t,e){return t>e?-1:e>t?1:e>=t?0:0/0},ru.min=function(t,e){var n,r,i=-1,o=t.length;if(1===arguments.length){for(;++i<o;)if(null!=(r=t[i])&&r>=r){n=r;break}for(;++i<o;)null!=(r=t[i])&&n>r&&(n=r)}else{for(;++i<o;)if(null!=(r=e.call(t,t[i],i))&&r>=r){n=r;break}for(;++i<o;)null!=(r=e.call(t,t[i],i))&&n>r&&(n=r)}return n},ru.max=function(t,e){var n,r,i=-1,o=t.length;if(1===arguments.length){for(;++i<o;)if(null!=(r=t[i])&&r>=r){n=r;break}for(;++i<o;)null!=(r=t[i])&&r>n&&(n=r)}else{for(;++i<o;)if(null!=(r=e.call(t,t[i],i))&&r>=r){n=r;break}for(;++i<o;)null!=(r=e.call(t,t[i],i))&&r>n&&(n=r)}return n},ru.extent=function(t,e){var n,r,i,o=-1,a=t.length;
-if(1===arguments.length){for(;++o<a;)if(null!=(r=t[o])&&r>=r){n=i=r;break}for(;++o<a;)null!=(r=t[o])&&(n>r&&(n=r),r>i&&(i=r))}else{for(;++o<a;)if(null!=(r=e.call(t,t[o],o))&&r>=r){n=i=r;break}for(;++o<a;)null!=(r=e.call(t,t[o],o))&&(n>r&&(n=r),r>i&&(i=r))}return[n,i]},ru.sum=function(t,e){var n,r=0,i=t.length,a=-1;if(1===arguments.length)for(;++a<i;)o(n=+t[a])&&(r+=n);else for(;++a<i;)o(n=+e.call(t,t[a],a))&&(r+=n);return r},ru.mean=function(t,e){var n,r=0,a=t.length,u=-1,s=a;if(1===arguments.length)for(;++u<a;)o(n=i(t[u]))?r+=n:--s;else for(;++u<a;)o(n=i(e.call(t,t[u],u)))?r+=n:--s;return s?r/s:void 0},ru.quantile=function(t,e){var n=(t.length-1)*e+1,r=Math.floor(n),i=+t[r-1],o=n-r;return o?i+o*(t[r]-i):i},ru.median=function(t,e){var n,a=[],u=t.length,s=-1;if(1===arguments.length)for(;++s<u;)o(n=i(t[s]))&&a.push(n);else for(;++s<u;)o(n=i(e.call(t,t[s],s)))&&a.push(n);return a.length?ru.quantile(a.sort(r),.5):void 0},ru.variance=function(t,e){var n,r,a=t.length,u=0,s=0,l=-1,c=0;if(1===arguments.length)for(;++l<a;)o(n=i(t[l]))&&(r=n-u,u+=r/++c,s+=r*(n-u));else for(;++l<a;)o(n=i(e.call(t,t[l],l)))&&(r=n-u,u+=r/++c,s+=r*(n-u));return c>1?s/(c-1):void 0},ru.deviation=function(){var t=ru.variance.apply(this,arguments);return t?Math.sqrt(t):t};var du=a(r);ru.bisectLeft=du.left,ru.bisect=ru.bisectRight=du.right,ru.bisector=function(t){return a(1===t.length?function(e,n){return r(t(e),n)}:t)},ru.shuffle=function(t,e,n){(o=arguments.length)<3&&(n=t.length,2>o&&(e=0));for(var r,i,o=n-e;o;)i=Math.random()*o--|0,r=t[o+e],t[o+e]=t[i+e],t[i+e]=r;return t},ru.permute=function(t,e){for(var n=e.length,r=new Array(n);n--;)r[n]=t[e[n]];return r},ru.pairs=function(t){for(var e,n=0,r=t.length-1,i=t[0],o=new Array(0>r?0:r);r>n;)o[n]=[e=i,i=t[++n]];return o},ru.zip=function(){if(!(r=arguments.length))return[];for(var t=-1,e=ru.min(arguments,u),n=new Array(e);++t<e;)for(var r,i=-1,o=n[t]=new Array(r);++i<r;)o[i]=arguments[i][t];return n},ru.transpose=function(t){return ru.zip.apply(ru,t)},ru.keys=function(t){var e=[];for(var n in t)e.push(n);return e},ru.values=function(t){var e=[];for(var n in t)e.push(t[n]);return e},ru.entries=function(t){var e=[];for(var n in t)e.push({key:n,value:t[n]});return e},ru.merge=function(t){for(var e,n,r,i=t.length,o=-1,a=0;++o<i;)a+=t[o].length;for(n=new Array(a);--i>=0;)for(r=t[i],e=r.length;--e>=0;)n[--a]=r[e];return n};var gu=Math.abs;ru.range=function(t,e,n){if(arguments.length<3&&(n=1,arguments.length<2&&(e=t,t=0)),(e-t)/n===1/0)throw new Error("infinite range");var r,i=[],o=s(gu(n)),a=-1;if(t*=o,e*=o,n*=o,0>n)for(;(r=t+n*++a)>e;)i.push(r/o);else for(;(r=t+n*++a)<e;)i.push(r/o);return i},ru.map=function(t,e){var n=new c;if(t instanceof c)t.forEach(function(t,e){n.set(t,e)});else if(Array.isArray(t)){var r,i=-1,o=t.length;if(1===arguments.length)for(;++i<o;)n.set(i,t[i]);else for(;++i<o;)n.set(e.call(t,r=t[i],i),r)}else for(var a in t)n.set(a,t[a]);return n};var vu="__proto__",mu="\x00";l(c,{has:p,get:function(t){return this._[f(t)]},set:function(t,e){return this._[f(t)]=e},remove:d,keys:g,values:function(){var t=[];for(var e in this._)t.push(this._[e]);return t},entries:function(){var t=[];for(var e in this._)t.push({key:h(e),value:this._[e]});return t},size:v,empty:m,forEach:function(t){for(var e in this._)t.call(this,h(e),this._[e])}}),ru.nest=function(){function t(e,a,u){if(u>=o.length)return r?r.call(i,a):n?a.sort(n):a;for(var s,l,f,h,p=-1,d=a.length,g=o[u++],v=new c;++p<d;)(h=v.get(s=g(l=a[p])))?h.push(l):v.set(s,[l]);return e?(l=e(),f=function(n,r){l.set(n,t(e,r,u))}):(l={},f=function(n,r){l[n]=t(e,r,u)}),v.forEach(f),l}function e(t,n){if(n>=o.length)return t;var r=[],i=a[n++];return t.forEach(function(t,i){r.push({key:t,values:e(i,n)})}),i?r.sort(function(t,e){return i(t.key,e.key)}):r}var n,r,i={},o=[],a=[];return i.map=function(e,n){return t(n,e,0)},i.entries=function(n){return e(t(ru.map,n,0),0)},i.key=function(t){return o.push(t),i},i.sortKeys=function(t){return a[o.length-1]=t,i},i.sortValues=function(t){return n=t,i},i.rollup=function(t){return r=t,i},i},ru.set=function(t){var e=new y;if(t)for(var n=0,r=t.length;r>n;++n)e.add(t[n]);return e},l(y,{has:p,add:function(t){return this._[f(t+="")]=!0,t},remove:d,values:g,size:v,empty:m,forEach:function(t){for(var e in this._)t.call(this,h(e))}}),ru.behavior={},ru.rebind=function(t,e){for(var n,r=1,i=arguments.length;++r<i;)t[n=arguments[r]]=x(t,e,e[n]);return t};var yu=["webkit","ms","moz","Moz","o","O"];ru.dispatch=function(){for(var t=new M,e=-1,n=arguments.length;++e<n;)t[arguments[e]]=k(t);return t},M.prototype.on=function(t,e){var n=t.indexOf("."),r="";if(n>=0&&(r=t.slice(n+1),t=t.slice(0,n)),t)return arguments.length<2?this[t].on(r):this[t].on(r,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(r,null);return this}},ru.event=null,ru.requote=function(t){return t.replace(bu,"\\$&")};var bu=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,xu={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)t[n]=e[n]},wu=function(t,e){return e.querySelector(t)},_u=function(t,e){return e.querySelectorAll(t)},Mu=function(t,e){var n=t.matches||t[w(t,"matchesSelector")];return(Mu=function(t,e){return n.call(t,e)})(t,e)};"function"==typeof Sizzle&&(wu=function(t,e){return Sizzle(t,e)[0]||null},_u=Sizzle,Mu=Sizzle.matchesSelector),ru.selection=function(){return ru.select(au.documentElement)};var ku=ru.selection.prototype=[];ku.select=function(t){var e,n,r,i,o=[];t=j(t);for(var a=-1,u=this.length;++a<u;){o.push(e=[]),e.parentNode=(r=this[a]).parentNode;for(var s=-1,l=r.length;++s<l;)(i=r[s])?(e.push(n=t.call(i,i.__data__,s,a)),n&&"__data__"in i&&(n.__data__=i.__data__)):e.push(null)}return T(o)},ku.selectAll=function(t){var e,n,r=[];t=A(t);for(var i=-1,o=this.length;++i<o;)for(var a=this[i],u=-1,s=a.length;++u<s;)(n=a[u])&&(r.push(e=ou(t.call(n,n.__data__,u,i))),e.parentNode=n);return T(r)};var Eu={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};ru.ns={prefix:Eu,qualify:function(t){var e=t.indexOf(":"),n=t;return e>=0&&(n=t.slice(0,e),t=t.slice(e+1)),Eu.hasOwnProperty(n)?{space:Eu[n],local:t}:t}},ku.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node();return t=ru.ns.qualify(t),t.local?n.getAttributeNS(t.space,t.local):n.getAttribute(t)}for(e in t)this.each(N(e,t[e]));return this}return this.each(N(t,e))},ku.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node(),r=(t=D(t)).length,i=-1;if(e=n.classList){for(;++i<r;)if(!e.contains(t[i]))return!1}else for(e=n.getAttribute("class");++i<r;)if(!q(t[i]).test(e))return!1;return!0}for(e in t)this.each(L(e,t[e]));return this}return this.each(L(t,e))},ku.style=function(t,e,r){var i=arguments.length;if(3>i){if("string"!=typeof t){2>i&&(e="");for(r in t)this.each(z(r,t[r],e));return this}if(2>i){var o=this.node();return n(o).getComputedStyle(o,null).getPropertyValue(t)}r=""}return this.each(z(t,e,r))},ku.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(R(e,t[e]));return this}return this.each(R(t,e))},ku.text=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent},ku.html=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML},ku.append=function(t){return t=I(t),this.select(function(){return this.appendChild(t.apply(this,arguments))})},ku.insert=function(t,e){return t=I(t),e=j(e),this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})},ku.remove=function(){return this.each(P)},ku.data=function(t,e){function n(t,n){var r,i,o,a=t.length,f=n.length,h=Math.min(a,f),p=new Array(f),d=new Array(f),g=new Array(a);if(e){var v,m=new c,y=new Array(a);for(r=-1;++r<a;)m.has(v=e.call(i=t[r],i.__data__,r))?g[r]=i:m.set(v,i),y[r]=v;for(r=-1;++r<f;)(i=m.get(v=e.call(n,o=n[r],r)))?i!==!0&&(p[r]=i,i.__data__=o):d[r]=H(o),m.set(v,!0);for(r=-1;++r<a;)m.get(y[r])!==!0&&(g[r]=t[r])}else{for(r=-1;++r<h;)i=t[r],o=n[r],i?(i.__data__=o,p[r]=i):d[r]=H(o);for(;f>r;++r)d[r]=H(n[r]);for(;a>r;++r)g[r]=t[r]}d.update=p,d.parentNode=p.parentNode=g.parentNode=t.parentNode,u.push(d),s.push(p),l.push(g)}var r,i,o=-1,a=this.length;if(!arguments.length){for(t=new Array(a=(r=this[0]).length);++o<a;)(i=r[o])&&(t[o]=i.__data__);return t}var u=U([]),s=T([]),l=T([]);if("function"==typeof t)for(;++o<a;)n(r=this[o],t.call(r,r.parentNode.__data__,o));else for(;++o<a;)n(r=this[o],t);return s.enter=function(){return u},s.exit=function(){return l},s},ku.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")},ku.filter=function(t){var e,n,r,i=[];"function"!=typeof t&&(t=B(t));for(var o=0,a=this.length;a>o;o++){i.push(e=[]),e.parentNode=(n=this[o]).parentNode;for(var u=0,s=n.length;s>u;u++)(r=n[u])&&t.call(r,r.__data__,u,o)&&e.push(r)}return T(i)},ku.order=function(){for(var t=-1,e=this.length;++t<e;)for(var n,r=this[t],i=r.length-1,o=r[i];--i>=0;)(n=r[i])&&(o&&o!==n.nextSibling&&o.parentNode.insertBefore(n,o),o=n);return this},ku.sort=function(t){t=$.apply(this,arguments);for(var e=-1,n=this.length;++e<n;)this[e].sort(t);return this.order()},ku.each=function(t){return V(this,function(e,n,r){t.call(e,e.__data__,n,r)})},ku.call=function(t){var e=ou(arguments);return t.apply(e[0]=this,e),this},ku.empty=function(){return!this.node()},ku.node=function(){for(var t=0,e=this.length;e>t;t++)for(var n=this[t],r=0,i=n.length;i>r;r++){var o=n[r];if(o)return o}return null},ku.size=function(){var t=0;return V(this,function(){++t}),t};var Cu=[];ru.selection.enter=U,ru.selection.enter.prototype=Cu,Cu.append=ku.append,Cu.empty=ku.empty,Cu.node=ku.node,Cu.call=ku.call,Cu.size=ku.size,Cu.select=function(t){for(var e,n,r,i,o,a=[],u=-1,s=this.length;++u<s;){r=(i=this[u]).update,a.push(e=[]),e.parentNode=i.parentNode;for(var l=-1,c=i.length;++l<c;)(o=i[l])?(e.push(r[l]=n=t.call(i.parentNode,o.__data__,l,u)),n.__data__=o.__data__):e.push(null)}return T(a)},Cu.insert=function(t,e){return arguments.length<2&&(e=W(this)),ku.insert.call(this,t,e)},ru.select=function(e){var n;return"string"==typeof e?(n=[wu(e,au)],n.parentNode=au.documentElement):(n=[e],n.parentNode=t(e)),T([n])},ru.selectAll=function(t){var e;return"string"==typeof t?(e=ou(_u(t,au)),e.parentNode=au.documentElement):(e=t,e.parentNode=null),T([e])},ku.on=function(t,e,n){var r=arguments.length;if(3>r){if("string"!=typeof t){2>r&&(e=!1);for(n in t)this.each(Y(n,t[n],e));return this}if(2>r)return(r=this.node()["__on"+t])&&r._;n=!1}return this.each(Y(t,e,n))};var Su=ru.map({mouseenter:"mouseover",mouseleave:"mouseout"});au&&Su.forEach(function(t){"on"+t in au&&Su.remove(t)});var Tu,ju=0;ru.mouse=function(t){return K(t,C())};var Au=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;ru.touch=function(t,e,n){if(arguments.length<3&&(n=e,e=C().changedTouches),e)for(var r,i=0,o=e.length;o>i;++i)if((r=e[i]).identifier===n)return K(t,r)},ru.behavior.drag=function(){function t(){this.on("mousedown.drag",o).on("touchstart.drag",a)}function e(t,e,n,o,a){return function(){function u(){var t,n,r=e(h,g);r&&(t=r[0]-b[0],n=r[1]-b[1],d|=t|n,b=r,p({type:"drag",x:r[0]+l[0],y:r[1]+l[1],dx:t,dy:n}))}function s(){e(h,g)&&(m.on(o+v,null).on(a+v,null),y(d&&ru.event.target===f),p({type:"dragend"}))}var l,c=this,f=ru.event.target,h=c.parentNode,p=r.of(c,arguments),d=0,g=t(),v=".drag"+(null==g?"":"-"+g),m=ru.select(n(f)).on(o+v,u).on(a+v,s),y=Z(f),b=e(h,g);i?(l=i.apply(c,arguments),l=[l.x-b[0],l.y-b[1]]):l=[0,0],p({type:"dragstart"})}}var r=S(t,"drag","dragstart","dragend"),i=null,o=e(_,ru.mouse,n,"mousemove","mouseup"),a=e(G,ru.touch,b,"touchmove","touchend");return t.origin=function(e){return arguments.length?(i=e,t):i},ru.rebind(t,r,"on")},ru.touches=function(t,e){return arguments.length<2&&(e=C().touches),e?ou(e).map(function(e){var n=K(t,e);return n.identifier=e.identifier,n}):[]};var Nu=1e-6,Ou=Nu*Nu,qu=Math.PI,Du=2*qu,Lu=Du-Nu,Fu=qu/2,zu=qu/180,Ru=180/qu,Iu=Math.SQRT2,Pu=2,Hu=4;ru.interpolateZoom=function(t,e){function n(t){var e=t*y;if(m){var n=ie(g),a=o/(Pu*h)*(n*oe(Iu*e+g)-re(g));return[r+a*l,i+a*c,o*n/ie(Iu*e+g)]}return[r+t*l,i+t*c,o*Math.exp(Iu*e)]}var r=t[0],i=t[1],o=t[2],a=e[0],u=e[1],s=e[2],l=a-r,c=u-i,f=l*l+c*c,h=Math.sqrt(f),p=(s*s-o*o+Hu*f)/(2*o*Pu*h),d=(s*s-o*o-Hu*f)/(2*s*Pu*h),g=Math.log(Math.sqrt(p*p+1)-p),v=Math.log(Math.sqrt(d*d+1)-d),m=v-g,y=(m||Math.log(s/o))/Iu;return n.duration=1e3*y,n},ru.behavior.zoom=function(){function t(t){t.on(N,f).on($u+".zoom",p).on("dblclick.zoom",d).on(D,h)}function e(t){return[(t[0]-k.x)/k.k,(t[1]-k.y)/k.k]}function r(t){return[t[0]*k.k+k.x,t[1]*k.k+k.y]}function i(t){k.k=Math.max(T[0],Math.min(T[1],t))}function o(t,e){e=r(e),k.x+=t[0]-e[0],k.y+=t[1]-e[1]}function a(e,n,r,a){e.__chart__={x:k.x,y:k.y,k:k.k},i(Math.pow(2,a)),o(v=n,r),e=ru.select(e),j>0&&(e=e.transition().duration(j)),e.call(t.event)}function u(){w&&w.domain(x.range().map(function(t){return(t-k.x)/k.k}).map(x.invert)),M&&M.domain(_.range().map(function(t){return(t-k.y)/k.k}).map(_.invert))}function s(t){A++||t({type:"zoomstart"})}function l(t){u(),t({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function c(t){--A||t({type:"zoomend"}),v=null}function f(){function t(){f=1,o(ru.mouse(i),p),l(u)}function r(){h.on(O,null).on(q,null),d(f&&ru.event.target===a),c(u)}var i=this,a=ru.event.target,u=L.of(i,arguments),f=0,h=ru.select(n(i)).on(O,t).on(q,r),p=e(ru.mouse(i)),d=Z(i);zl.call(i),s(u)}function h(){function t(){var t=ru.touches(d);return p=k.k,t.forEach(function(t){t.identifier in v&&(v[t.identifier]=e(t))}),t}function n(){var e=ru.event.target;ru.select(e).on(x,r).on(w,u),_.push(e);for(var n=ru.event.changedTouches,i=0,o=n.length;o>i;++i)v[n[i].identifier]=null;var s=t(),l=Date.now();if(1===s.length){if(500>l-b){var c=s[0];a(d,c,v[c.identifier],Math.floor(Math.log(k.k)/Math.LN2)+1),E()}b=l}else if(s.length>1){var c=s[0],f=s[1],h=c[0]-f[0],p=c[1]-f[1];m=h*h+p*p}}function r(){var t,e,n,r,a=ru.touches(d);zl.call(d);for(var u=0,s=a.length;s>u;++u,r=null)if(n=a[u],r=v[n.identifier]){if(e)break;t=n,e=r}if(r){var c=(c=n[0]-t[0])*c+(c=n[1]-t[1])*c,f=m&&Math.sqrt(c/m);t=[(t[0]+n[0])/2,(t[1]+n[1])/2],e=[(e[0]+r[0])/2,(e[1]+r[1])/2],i(f*p)}b=null,o(t,e),l(g)}function u(){if(ru.event.touches.length){for(var e=ru.event.changedTouches,n=0,r=e.length;r>n;++n)delete v[e[n].identifier];for(var i in v)return void t()}ru.selectAll(_).on(y,null),M.on(N,f).on(D,h),C(),c(g)}var p,d=this,g=L.of(d,arguments),v={},m=0,y=".zoom-"+ru.event.changedTouches[0].identifier,x="touchmove"+y,w="touchend"+y,_=[],M=ru.select(d),C=Z(d);n(),s(g),M.on(N,null).on(D,n)}function p(){var t=L.of(this,arguments);y?clearTimeout(y):(g=e(v=m||ru.mouse(this)),zl.call(this),s(t)),y=setTimeout(function(){y=null,c(t)},50),E(),i(Math.pow(2,.002*Bu())*k.k),o(v,g),l(t)}function d(){var t=ru.mouse(this),n=Math.log(k.k)/Math.LN2;a(this,t,e(t),ru.event.shiftKey?Math.ceil(n)-1:Math.floor(n)+1)}var g,v,m,y,b,x,w,_,M,k={x:0,y:0,k:1},C=[960,500],T=Vu,j=250,A=0,N="mousedown.zoom",O="mousemove.zoom",q="mouseup.zoom",D="touchstart.zoom",L=S(t,"zoomstart","zoom","zoomend");return $u||($u="onwheel"in au?(Bu=function(){return-ru.event.deltaY*(ru.event.deltaMode?120:1)},"wheel"):"onmousewheel"in au?(Bu=function(){return ru.event.wheelDelta},"mousewheel"):(Bu=function(){return-ru.event.detail},"MozMousePixelScroll")),t.event=function(t){t.each(function(){var t=L.of(this,arguments),e=k;Ll?ru.select(this).transition().each("start.zoom",function(){k=this.__chart__||{x:0,y:0,k:1},s(t)}).tween("zoom:zoom",function(){var n=C[0],r=C[1],i=v?v[0]:n/2,o=v?v[1]:r/2,a=ru.interpolateZoom([(i-k.x)/k.k,(o-k.y)/k.k,n/k.k],[(i-e.x)/e.k,(o-e.y)/e.k,n/e.k]);return function(e){var r=a(e),u=n/r[2];this.__chart__=k={x:i-r[0]*u,y:o-r[1]*u,k:u},l(t)}}).each("interrupt.zoom",function(){c(t)}).each("end.zoom",function(){c(t)}):(this.__chart__=k,s(t),l(t),c(t))})},t.translate=function(e){return arguments.length?(k={x:+e[0],y:+e[1],k:k.k},u(),t):[k.x,k.y]},t.scale=function(e){return arguments.length?(k={x:k.x,y:k.y,k:+e},u(),t):k.k},t.scaleExtent=function(e){return arguments.length?(T=null==e?Vu:[+e[0],+e[1]],t):T},t.center=function(e){return arguments.length?(m=e&&[+e[0],+e[1]],t):m},t.size=function(e){return arguments.length?(C=e&&[+e[0],+e[1]],t):C},t.duration=function(e){return arguments.length?(j=+e,t):j},t.x=function(e){return arguments.length?(w=e,x=e.copy(),k={x:0,y:0,k:1},t):w},t.y=function(e){return arguments.length?(M=e,_=e.copy(),k={x:0,y:0,k:1},t):M},ru.rebind(t,L,"on")};var Bu,$u,Vu=[0,1/0];ru.color=ue,ue.prototype.toString=function(){return this.rgb()+""},ru.hsl=se;var Uu=se.prototype=new ue;Uu.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new se(this.h,this.s,this.l/t)},Uu.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new se(this.h,this.s,t*this.l)},Uu.rgb=function(){return le(this.h,this.s,this.l)},ru.hcl=ce;var Wu=ce.prototype=new ue;Wu.brighter=function(t){return new ce(this.h,this.c,Math.min(100,this.l+Yu*(arguments.length?t:1)))},Wu.darker=function(t){return new ce(this.h,this.c,Math.max(0,this.l-Yu*(arguments.length?t:1)))},Wu.rgb=function(){return fe(this.h,this.c,this.l).rgb()},ru.lab=he;var Yu=18,Xu=.95047,Ju=1,Zu=1.08883,Ku=he.prototype=new ue;Ku.brighter=function(t){return new he(Math.min(100,this.l+Yu*(arguments.length?t:1)),this.a,this.b)},Ku.darker=function(t){return new he(Math.max(0,this.l-Yu*(arguments.length?t:1)),this.a,this.b)},Ku.rgb=function(){return pe(this.l,this.a,this.b)},ru.rgb=ye;var Gu=ye.prototype=new ue;Gu.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,n=this.g,r=this.b,i=30;return e||n||r?(e&&i>e&&(e=i),n&&i>n&&(n=i),r&&i>r&&(r=i),new ye(Math.min(255,e/t),Math.min(255,n/t),Math.min(255,r/t))):new ye(i,i,i)},Gu.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new ye(t*this.r,t*this.g,t*this.b)},Gu.hsl=function(){return Me(this.r,this.g,this.b)},Gu.toString=function(){return"#"+we(this.r)+we(this.g)+we(this.b)};var Qu=ru.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});Qu.forEach(function(t,e){Qu.set(t,be(e))}),ru.functor=Se,ru.xhr=Te(b),ru.dsv=function(t,e){function n(t,n,o){arguments.length<3&&(o=n,n=null);var a=je(t,e,null==n?r:i(n),o);return a.row=function(t){return arguments.length?a.response(null==(n=t)?r:i(t)):n},a}function r(t){return n.parse(t.responseText)}function i(t){return function(e){return n.parse(e.responseText,t)}}function o(e){return e.map(a).join(t)}function a(t){return u.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}var u=new RegExp('["'+t+"\n]"),s=t.charCodeAt(0);return n.parse=function(t,e){var r;return n.parseRows(t,function(t,n){if(r)return r(t,n-1);var i=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");r=e?function(t,n){return e(i(t),n)}:i})},n.parseRows=function(t,e){function n(){if(c>=l)return a;if(i)return i=!1,o;var e=c;if(34===t.charCodeAt(e)){for(var n=e;n++<l;)if(34===t.charCodeAt(n)){if(34!==t.charCodeAt(n+1))break;++n}c=n+2;var r=t.charCodeAt(n+1);return 13===r?(i=!0,10===t.charCodeAt(n+2)&&++c):10===r&&(i=!0),t.slice(e+1,n).replace(/""/g,'"')}for(;l>c;){var r=t.charCodeAt(c++),u=1;if(10===r)i=!0;else if(13===r)i=!0,10===t.charCodeAt(c)&&(++c,++u);else if(r!==s)continue;return t.slice(e,c-u)}return t.slice(e)}for(var r,i,o={},a={},u=[],l=t.length,c=0,f=0;(r=n())!==a;){for(var h=[];r!==o&&r!==a;)h.push(r),r=n();e&&null==(h=e(h,f++))||u.push(h)}return u},n.format=function(e){if(Array.isArray(e[0]))return n.formatRows(e);var r=new y,i=[];return e.forEach(function(t){for(var e in t)r.has(e)||i.push(r.add(e))}),[i.map(a).join(t)].concat(e.map(function(e){return i.map(function(t){return a(e[t])}).join(t)})).join("\n")},n.formatRows=function(t){return t.map(o).join("\n")},n},ru.csv=ru.dsv(",","text/csv"),ru.tsv=ru.dsv(" ","text/tab-separated-values");var ts,es,ns,rs,is,os=this[w(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};ru.timer=function(t,e,n){var r=arguments.length;2>r&&(e=0),3>r&&(n=Date.now());var i=n+e,o={c:t,t:i,f:!1,n:null};es?es.n=o:ts=o,es=o,ns||(rs=clearTimeout(rs),ns=1,os(Oe))},ru.timer.flush=function(){qe(),De()},ru.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var as=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(Fe);ru.formatPrefix=function(t,e){var n=0;return t&&(0>t&&(t*=-1),e&&(t=ru.round(t,Le(t,e))),n=1+Math.floor(1e-12+Math.log(t)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),as[8+n/3]};var us=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,ss=ru.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=ru.round(t,Le(t,e))).toFixed(Math.max(0,Math.min(20,Le(t*(1+1e-15),e))))}}),ls=ru.time={},cs=Date;Ie.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){fs.setUTCDate.apply(this._,arguments)},setDay:function(){fs.setUTCDay.apply(this._,arguments)},setFullYear:function(){fs.setUTCFullYear.apply(this._,arguments)},setHours:function(){fs.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){fs.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){fs.setUTCMinutes.apply(this._,arguments)},setMonth:function(){fs.setUTCMonth.apply(this._,arguments)},setSeconds:function(){fs.setUTCSeconds.apply(this._,arguments)},setTime:function(){fs.setTime.apply(this._,arguments)}};var fs=Date.prototype;ls.year=Pe(function(t){return t=ls.day(t),t.setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),ls.years=ls.year.range,ls.years.utc=ls.year.utc.range,ls.day=Pe(function(t){var e=new cs(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),ls.days=ls.day.range,ls.days.utc=ls.day.utc.range,ls.dayOfYear=function(t){var e=ls.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var n=ls[t]=Pe(function(t){return(t=ls.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var n=ls.year(t).getDay();return Math.floor((ls.dayOfYear(t)+(n+e)%7)/7)-(n!==e)});ls[t+"s"]=n.range,ls[t+"s"].utc=n.utc.range,ls[t+"OfYear"]=function(t){var n=ls.year(t).getDay();return Math.floor((ls.dayOfYear(t)+(n+e)%7)/7)}}),ls.week=ls.sunday,ls.weeks=ls.sunday.range,ls.weeks.utc=ls.sunday.utc.range,ls.weekOfYear=ls.sundayOfYear;var hs={"-":"",_:" ",0:"0"},ps=/^\s*\d+/,ds=/^%/;ru.locale=function(t){return{numberFormat:ze(t),timeFormat:Be(t)}};var gs=ru.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});ru.format=gs.numberFormat,ru.geo={},cn.prototype={s:0,t:0,add:function(t){fn(t,this.t,vs),fn(vs.s,this.s,this),this.s?this.t+=vs.t:this.s=vs.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var vs=new cn;ru.geo.stream=function(t,e){t&&ms.hasOwnProperty(t.type)?ms[t.type](t,e):hn(t,e)};var ms={Feature:function(t,e){hn(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)hn(n[r].geometry,e)}},ys={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){pn(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)pn(n[r],e,0)},Polygon:function(t,e){dn(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)dn(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)hn(n[r],e)}};ru.geo.area=function(t){return bs=0,ru.geo.stream(t,ws),bs};var bs,xs=new cn,ws={sphere:function(){bs+=4*qu},point:_,lineStart:_,lineEnd:_,polygonStart:function(){xs.reset(),ws.lineStart=gn},polygonEnd:function(){var t=2*xs;bs+=0>t?4*qu+t:t,ws.lineStart=ws.lineEnd=ws.point=_}};ru.geo.bounds=function(){function t(t,e){b.push(x=[c=t,h=t]),f>e&&(f=e),e>p&&(p=e)}function e(e,n){var r=vn([e*zu,n*zu]);if(m){var i=yn(m,r),o=[i[1],-i[0],0],a=yn(o,i);wn(a),a=_n(a);var s=e-d,l=s>0?1:-1,g=a[0]*Ru*l,v=gu(s)>180;if(v^(g>l*d&&l*e>g)){var y=a[1]*Ru;y>p&&(p=y)}else if(g=(g+360)%360-180,v^(g>l*d&&l*e>g)){var y=-a[1]*Ru;f>y&&(f=y)}else f>n&&(f=n),n>p&&(p=n);v?d>e?u(c,e)>u(c,h)&&(h=e):u(e,h)>u(c,h)&&(c=e):h>=c?(c>e&&(c=e),e>h&&(h=e)):e>d?u(c,e)>u(c,h)&&(h=e):u(e,h)>u(c,h)&&(c=e)}else t(e,n);m=r,d=e}function n(){w.point=e}function r(){x[0]=c,x[1]=h,w.point=t,m=null}function i(t,n){if(m){var r=t-d;y+=gu(r)>180?r+(r>0?360:-360):r}else g=t,v=n;ws.point(t,n),e(t,n)}function o(){ws.lineStart()}function a(){i(g,v),ws.lineEnd(),gu(y)>Nu&&(c=-(h=180)),x[0]=c,x[1]=h,m=null}function u(t,e){return(e-=t)<0?e+360:e}function s(t,e){return t[0]-e[0]}function l(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}var c,f,h,p,d,g,v,m,y,b,x,w={point:t,lineStart:n,lineEnd:r,polygonStart:function(){w.point=i,w.lineStart=o,w.lineEnd=a,y=0,ws.polygonStart()},polygonEnd:function(){ws.polygonEnd(),w.point=t,w.lineStart=n,w.lineEnd=r,0>xs?(c=-(h=180),f=-(p=90)):y>Nu?p=90:-Nu>y&&(f=-90),x[0]=c,x[1]=h}};return function(t){p=h=-(c=f=1/0),b=[],ru.geo.stream(t,w);var e=b.length;if(e){b.sort(s);for(var n,r=1,i=b[0],o=[i];e>r;++r)n=b[r],l(n[0],i)||l(n[1],i)?(u(i[0],n[1])>u(i[0],i[1])&&(i[1]=n[1]),u(n[0],i[1])>u(i[0],i[1])&&(i[0]=n[0])):o.push(i=n);for(var a,n,d=-1/0,e=o.length-1,r=0,i=o[e];e>=r;i=n,++r)n=o[r],(a=u(i[1],n[0]))>d&&(d=a,c=n[0],h=i[1])}return b=x=null,1/0===c||1/0===f?[[0/0,0/0],[0/0,0/0]]:[[c,f],[h,p]]}}(),ru.geo.centroid=function(t){_s=Ms=ks=Es=Cs=Ss=Ts=js=As=Ns=Os=0,ru.geo.stream(t,qs);var e=As,n=Ns,r=Os,i=e*e+n*n+r*r;return Ou>i&&(e=Ss,n=Ts,r=js,Nu>Ms&&(e=ks,n=Es,r=Cs),i=e*e+n*n+r*r,Ou>i)?[0/0,0/0]:[Math.atan2(n,e)*Ru,ne(r/Math.sqrt(i))*Ru]};var _s,Ms,ks,Es,Cs,Ss,Ts,js,As,Ns,Os,qs={sphere:_,point:kn,lineStart:Cn,lineEnd:Sn,polygonStart:function(){qs.lineStart=Tn},polygonEnd:function(){qs.lineStart=Cn}},Ds=Dn(An,Rn,Pn,[-qu,-qu/2]),Ls=1e9;ru.geo.clipExtent=function(){var t,e,n,r,i,o,a={stream:function(t){return i&&(i.valid=!1),i=o(t),i.valid=!0,i},extent:function(u){return arguments.length?(o=Vn(t=+u[0][0],e=+u[0][1],n=+u[1][0],r=+u[1][1]),i&&(i.valid=!1,i=null),a):[[t,e],[n,r]]}};return a.extent([[0,0],[960,500]])},(ru.geo.conicEqualArea=function(){return Un(Wn)}).raw=Wn,ru.geo.albers=function(){return ru.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},ru.geo.albersUsa=function(){function t(t){var o=t[0],a=t[1];return e=null,n(o,a),e||(r(o,a),e)||i(o,a),e}var e,n,r,i,o=ru.geo.albers(),a=ru.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),u=ru.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s={point:function(t,n){e=[t,n]}};return t.invert=function(t){var e=o.scale(),n=o.translate(),r=(t[0]-n[0])/e,i=(t[1]-n[1])/e;return(i>=.12&&.234>i&&r>=-.425&&-.214>r?a:i>=.166&&.234>i&&r>=-.214&&-.115>r?u:o).invert(t)},t.stream=function(t){var e=o.stream(t),n=a.stream(t),r=u.stream(t);return{point:function(t,i){e.point(t,i),n.point(t,i),r.point(t,i)},sphere:function(){e.sphere(),n.sphere(),r.sphere()},lineStart:function(){e.lineStart(),n.lineStart(),r.lineStart()},lineEnd:function(){e.lineEnd(),n.lineEnd(),r.lineEnd()},polygonStart:function(){e.polygonStart(),n.polygonStart(),r.polygonStart()},polygonEnd:function(){e.polygonEnd(),n.polygonEnd(),r.polygonEnd()}}},t.precision=function(e){return arguments.length?(o.precision(e),a.precision(e),u.precision(e),t):o.precision()},t.scale=function(e){return arguments.length?(o.scale(e),a.scale(.35*e),u.scale(e),t.translate(o.translate())):o.scale()
-},t.translate=function(e){if(!arguments.length)return o.translate();var l=o.scale(),c=+e[0],f=+e[1];return n=o.translate(e).clipExtent([[c-.455*l,f-.238*l],[c+.455*l,f+.238*l]]).stream(s).point,r=a.translate([c-.307*l,f+.201*l]).clipExtent([[c-.425*l+Nu,f+.12*l+Nu],[c-.214*l-Nu,f+.234*l-Nu]]).stream(s).point,i=u.translate([c-.205*l,f+.212*l]).clipExtent([[c-.214*l+Nu,f+.166*l+Nu],[c-.115*l-Nu,f+.234*l-Nu]]).stream(s).point,t},t.scale(1070)};var Fs,zs,Rs,Is,Ps,Hs,Bs={point:_,lineStart:_,lineEnd:_,polygonStart:function(){zs=0,Bs.lineStart=Yn},polygonEnd:function(){Bs.lineStart=Bs.lineEnd=Bs.point=_,Fs+=gu(zs/2)}},$s={point:Xn,lineStart:_,lineEnd:_,polygonStart:_,polygonEnd:_},Vs={point:Kn,lineStart:Gn,lineEnd:Qn,polygonStart:function(){Vs.lineStart=tr},polygonEnd:function(){Vs.point=Kn,Vs.lineStart=Gn,Vs.lineEnd=Qn}};ru.geo.path=function(){function t(t){return t&&("function"==typeof u&&o.pointRadius(+u.apply(this,arguments)),a&&a.valid||(a=i(o)),ru.geo.stream(t,a)),o.result()}function e(){return a=null,t}var n,r,i,o,a,u=4.5;return t.area=function(t){return Fs=0,ru.geo.stream(t,i(Bs)),Fs},t.centroid=function(t){return ks=Es=Cs=Ss=Ts=js=As=Ns=Os=0,ru.geo.stream(t,i(Vs)),Os?[As/Os,Ns/Os]:js?[Ss/js,Ts/js]:Cs?[ks/Cs,Es/Cs]:[0/0,0/0]},t.bounds=function(t){return Ps=Hs=-(Rs=Is=1/0),ru.geo.stream(t,i($s)),[[Rs,Is],[Ps,Hs]]},t.projection=function(t){return arguments.length?(i=(n=t)?t.stream||rr(t):b,e()):n},t.context=function(t){return arguments.length?(o=null==(r=t)?new Jn:new er(t),"function"!=typeof u&&o.pointRadius(u),e()):r},t.pointRadius=function(e){return arguments.length?(u="function"==typeof e?e:(o.pointRadius(+e),+e),t):u},t.projection(ru.geo.albersUsa()).context(null)},ru.geo.transform=function(t){return{stream:function(e){var n=new ir(e);for(var r in t)n[r]=t[r];return n}}},ir.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},ru.geo.projection=ar,ru.geo.projectionMutator=ur,(ru.geo.equirectangular=function(){return ar(lr)}).raw=lr.invert=lr,ru.geo.rotation=function(t){function e(e){return e=t(e[0]*zu,e[1]*zu),e[0]*=Ru,e[1]*=Ru,e}return t=fr(t[0]%360*zu,t[1]*zu,t.length>2?t[2]*zu:0),e.invert=function(e){return e=t.invert(e[0]*zu,e[1]*zu),e[0]*=Ru,e[1]*=Ru,e},e},cr.invert=lr,ru.geo.circle=function(){function t(){var t="function"==typeof r?r.apply(this,arguments):r,e=fr(-t[0]*zu,-t[1]*zu,0).invert,i=[];return n(null,null,1,{point:function(t,n){i.push(t=e(t,n)),t[0]*=Ru,t[1]*=Ru}}),{type:"Polygon",coordinates:[i]}}var e,n,r=[0,0],i=6;return t.origin=function(e){return arguments.length?(r=e,t):r},t.angle=function(r){return arguments.length?(n=gr((e=+r)*zu,i*zu),t):e},t.precision=function(r){return arguments.length?(n=gr(e*zu,(i=+r)*zu),t):i},t.angle(90)},ru.geo.distance=function(t,e){var n,r=(e[0]-t[0])*zu,i=t[1]*zu,o=e[1]*zu,a=Math.sin(r),u=Math.cos(r),s=Math.sin(i),l=Math.cos(i),c=Math.sin(o),f=Math.cos(o);return Math.atan2(Math.sqrt((n=f*a)*n+(n=l*c-s*f*u)*n),s*c+l*f*u)},ru.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return ru.range(Math.ceil(o/v)*v,i,v).map(h).concat(ru.range(Math.ceil(l/m)*m,s,m).map(p)).concat(ru.range(Math.ceil(r/d)*d,n,d).filter(function(t){return gu(t%v)>Nu}).map(c)).concat(ru.range(Math.ceil(u/g)*g,a,g).filter(function(t){return gu(t%m)>Nu}).map(f))}var n,r,i,o,a,u,s,l,c,f,h,p,d=10,g=d,v=90,m=360,y=2.5;return t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[h(o).concat(p(s).slice(1),h(i).reverse().slice(1),p(l).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()},t.majorExtent=function(e){return arguments.length?(o=+e[0][0],i=+e[1][0],l=+e[0][1],s=+e[1][1],o>i&&(e=o,o=i,i=e),l>s&&(e=l,l=s,s=e),t.precision(y)):[[o,l],[i,s]]},t.minorExtent=function(e){return arguments.length?(r=+e[0][0],n=+e[1][0],u=+e[0][1],a=+e[1][1],r>n&&(e=r,r=n,n=e),u>a&&(e=u,u=a,a=e),t.precision(y)):[[r,u],[n,a]]},t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()},t.majorStep=function(e){return arguments.length?(v=+e[0],m=+e[1],t):[v,m]},t.minorStep=function(e){return arguments.length?(d=+e[0],g=+e[1],t):[d,g]},t.precision=function(e){return arguments.length?(y=+e,c=mr(u,a,90),f=yr(r,n,y),h=mr(l,s,90),p=yr(o,i,y),t):y},t.majorExtent([[-180,-90+Nu],[180,90-Nu]]).minorExtent([[-180,-80-Nu],[180,80+Nu]])},ru.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[e||r.apply(this,arguments),n||i.apply(this,arguments)]}}var e,n,r=br,i=xr;return t.distance=function(){return ru.geo.distance(e||r.apply(this,arguments),n||i.apply(this,arguments))},t.source=function(n){return arguments.length?(r=n,e="function"==typeof n?null:n,t):r},t.target=function(e){return arguments.length?(i=e,n="function"==typeof e?null:e,t):i},t.precision=function(){return arguments.length?t:0},t},ru.geo.interpolate=function(t,e){return wr(t[0]*zu,t[1]*zu,e[0]*zu,e[1]*zu)},ru.geo.length=function(t){return Us=0,ru.geo.stream(t,Ws),Us};var Us,Ws={sphere:_,point:_,lineStart:_r,lineEnd:_,polygonStart:_,polygonEnd:_},Ys=Mr(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(ru.geo.azimuthalEqualArea=function(){return ar(Ys)}).raw=Ys;var Xs=Mr(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},b);(ru.geo.azimuthalEquidistant=function(){return ar(Xs)}).raw=Xs,(ru.geo.conicConformal=function(){return Un(kr)}).raw=kr,(ru.geo.conicEquidistant=function(){return Un(Er)}).raw=Er;var Js=Mr(function(t){return 1/t},Math.atan);(ru.geo.gnomonic=function(){return ar(Js)}).raw=Js,Cr.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Fu]},(ru.geo.mercator=function(){return Sr(Cr)}).raw=Cr;var Zs=Mr(function(){return 1},Math.asin);(ru.geo.orthographic=function(){return ar(Zs)}).raw=Zs;var Ks=Mr(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(ru.geo.stereographic=function(){return ar(Ks)}).raw=Ks,Tr.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Fu]},(ru.geo.transverseMercator=function(){var t=Sr(Tr),e=t.center,n=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])},t.rotate=function(t){return t?n([t[0],t[1],t.length>2?t[2]+90:90]):(t=n(),[t[0],t[1],t[2]-90])},n([0,0,90])}).raw=Tr,ru.geom={},ru.geom.hull=function(t){function e(data){if(data.length<3)return[];var t,e=Se(n),i=Se(r),o=data.length,a=[],u=[];for(t=0;o>t;t++)a.push([+e.call(this,data[t],t),+i.call(this,data[t],t),t]);for(a.sort(Or),t=0;o>t;t++)u.push([a[t][0],-a[t][1]]);var s=Nr(a),l=Nr(u),c=l[0]===s[0],f=l[l.length-1]===s[s.length-1],h=[];for(t=s.length-1;t>=0;--t)h.push(data[a[s[t]][2]]);for(t=+c;t<l.length-f;++t)h.push(data[a[l[t]][2]]);return h}var n=jr,r=Ar;return arguments.length?e(t):(e.x=function(t){return arguments.length?(n=t,e):n},e.y=function(t){return arguments.length?(r=t,e):r},e)},ru.geom.polygon=function(t){return xu(t,Gs),t};var Gs=ru.geom.polygon.prototype=[];Gs.area=function(){for(var t,e=-1,n=this.length,r=this[n-1],i=0;++e<n;)t=r,r=this[e],i+=t[1]*r[0]-t[0]*r[1];return.5*i},Gs.centroid=function(t){var e,n,r=-1,i=this.length,o=0,a=0,u=this[i-1];for(arguments.length||(t=-1/(6*this.area()));++r<i;)e=u,u=this[r],n=e[0]*u[1]-u[0]*e[1],o+=(e[0]+u[0])*n,a+=(e[1]+u[1])*n;return[o*t,a*t]},Gs.clip=function(t){for(var e,n,r,i,o,a,u=Lr(t),s=-1,l=this.length-Lr(this),c=this[l-1];++s<l;){for(e=t.slice(),t.length=0,i=this[s],o=e[(r=e.length-u)-1],n=-1;++n<r;)a=e[n],qr(a,c,i)?(qr(o,c,i)||t.push(Dr(o,a,c,i)),t.push(a)):qr(o,c,i)&&t.push(Dr(o,a,c,i)),o=a;u&&t.push(t[0]),c=i}return t};var Qs,tl,el,nl,rl,il=[],ol=[];$r.prototype.prepare=function(){for(var t,e=this.edges,n=e.length;n--;)t=e[n].edge,t.b&&t.a||e.splice(n,1);return e.sort(Ur),e.length},ei.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},ni.prototype={insert:function(t,e){var n,r,i;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;n=t}else this._?(t=ai(this._),e.P=null,e.N=t,t.P=t.L=e,n=t):(e.P=e.N=null,this._=e,n=null);for(e.L=e.R=null,e.U=n,e.C=!0,t=e;n&&n.C;)r=n.U,n===r.L?(i=r.R,i&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.R&&(ii(this,n),t=n,n=t.U),n.C=!1,r.C=!0,oi(this,r))):(i=r.L,i&&i.C?(n.C=i.C=!1,r.C=!0,t=r):(t===n.L&&(oi(this,n),t=n,n=t.U),n.C=!1,r.C=!0,ii(this,r))),n=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,n,r,i=t.U,o=t.L,a=t.R;if(n=o?a?ai(a):o:a,i?i.L===t?i.L=n:i.R=n:this._=n,o&&a?(r=n.C,n.C=t.C,n.L=o,o.U=n,n!==a?(i=n.U,n.U=t.U,t=n.R,i.L=t,n.R=a,a.U=n):(n.U=i,i=n,t=n.R)):(r=t.C,t=n),t&&(t.U=i),!r){if(t&&t.C)return void(t.C=!1);do{if(t===this._)break;if(t===i.L){if(e=i.R,e.C&&(e.C=!1,i.C=!0,ii(this,i),e=i.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,oi(this,e),e=i.R),e.C=i.C,i.C=e.R.C=!1,ii(this,i),t=this._;break}}else if(e=i.L,e.C&&(e.C=!1,i.C=!0,oi(this,i),e=i.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,ii(this,e),e=i.L),e.C=i.C,i.C=e.L.C=!1,oi(this,i),t=this._;break}e.C=!0,t=i,i=i.U}while(!t.C);t&&(t.C=!1)}}},ru.geom.voronoi=function(t){function e(data){var t=new Array(data.length),e=u[0][0],r=u[0][1],i=u[1][0],o=u[1][1];return ui(n(data),u).cells.forEach(function(n,a){var u=n.edges,s=n.site,l=t[a]=u.length?u.map(function(t){var e=t.start();return[e.x,e.y]}):s.x>=e&&s.x<=i&&s.y>=r&&s.y<=o?[[e,o],[i,o],[i,r],[e,r]]:[];l.point=data[a]}),t}function n(data){return data.map(function(t,e){return{x:Math.round(o(t,e)/Nu)*Nu,y:Math.round(a(t,e)/Nu)*Nu,i:e}})}var r=jr,i=Ar,o=r,a=i,u=al;return t?e(t):(e.links=function(data){return ui(n(data)).edges.filter(function(t){return t.l&&t.r}).map(function(t){return{source:data[t.l.i],target:data[t.r.i]}})},e.triangles=function(data){var t=[];return ui(n(data)).cells.forEach(function(e,n){for(var r,i,o=e.site,a=e.edges.sort(Ur),u=-1,s=a.length,l=a[s-1].edge,c=l.l===o?l.r:l.l;++u<s;)r=l,i=c,l=a[u].edge,c=l.l===o?l.r:l.l,n<i.i&&n<c.i&&li(o,i,c)<0&&t.push([data[n],data[i.i],data[c.i]])}),t},e.x=function(t){return arguments.length?(o=Se(r=t),e):r},e.y=function(t){return arguments.length?(a=Se(i=t),e):i},e.clipExtent=function(t){return arguments.length?(u=null==t?al:t,e):u===al?null:u},e.size=function(t){return arguments.length?e.clipExtent(t&&[[0,0],t]):u===al?null:u&&u[1]},e)};var al=[[-1e6,-1e6],[1e6,1e6]];ru.geom.delaunay=function(t){return ru.geom.voronoi().triangles(t)},ru.geom.quadtree=function(t,e,n,r,i){function o(data){function t(t,e,n,r,i,a,u,s){if(!isNaN(n)&&!isNaN(r))if(t.leaf){var l=t.x,c=t.y;if(null!=l)if(gu(l-n)+gu(c-r)<.01)o(t,e,n,r,i,a,u,s);else{var f=t.point;t.x=t.y=t.point=null,o(t,f,l,c,i,a,u,s),o(t,e,n,r,i,a,u,s)}else t.x=n,t.y=r,t.point=e}else o(t,e,n,r,i,a,u,s)}function o(e,n,r,i,o,a,u,s){var l=.5*(o+u),c=.5*(a+s),f=r>=l,h=i>=c,p=h<<1|f;e.leaf=!1,e=e.nodes[p]||(e.nodes[p]=hi()),f?o=l:u=l,h?a=c:s=c,t(e,n,r,i,o,a,u,s)}var l,c,f,h,p,d,g,v,m,y=Se(u),b=Se(s);if(null!=e)d=e,g=n,v=r,m=i;else if(v=m=-(d=g=1/0),c=[],f=[],p=data.length,a)for(h=0;p>h;++h)l=data[h],l.x<d&&(d=l.x),l.y<g&&(g=l.y),l.x>v&&(v=l.x),l.y>m&&(m=l.y),c.push(l.x),f.push(l.y);else for(h=0;p>h;++h){var x=+y(l=data[h],h),w=+b(l,h);d>x&&(d=x),g>w&&(g=w),x>v&&(v=x),w>m&&(m=w),c.push(x),f.push(w)}var _=v-d,M=m-g;_>M?m=g+_:v=d+M;var k=hi();if(k.add=function(e){t(k,e,+y(e,++h),+b(e,h),d,g,v,m)},k.visit=function(t){pi(t,k,d,g,v,m)},k.find=function(t){return di(k,t[0],t[1],d,g,v,m)},h=-1,null==e){for(;++h<p;)t(k,data[h],c[h],f[h],d,g,v,m);--h}else data.forEach(k.add);return c=f=data=l=null,k}var a,u=jr,s=Ar;return(a=arguments.length)?(u=ci,s=fi,3===a&&(i=n,r=e,n=e=0),o(t)):(o.x=function(t){return arguments.length?(u=t,o):u},o.y=function(t){return arguments.length?(s=t,o):s},o.extent=function(t){return arguments.length?(null==t?e=n=r=i=null:(e=+t[0][0],n=+t[0][1],r=+t[1][0],i=+t[1][1]),o):null==e?null:[[e,n],[r,i]]},o.size=function(t){return arguments.length?(null==t?e=n=r=i=null:(e=n=0,r=+t[0],i=+t[1]),o):null==e?null:[r-e,i-n]},o)},ru.interpolateRgb=gi,ru.interpolateObject=vi,ru.interpolateNumber=mi,ru.interpolateString=yi;var ul=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,sl=new RegExp(ul.source,"g");ru.interpolate=bi,ru.interpolators=[function(t,e){var n=typeof e;return("string"===n?Qu.has(e)||/^(#|rgb\(|hsl\()/.test(e)?gi:yi:e instanceof ue?gi:Array.isArray(e)?xi:"object"===n&&isNaN(e)?vi:mi)(t,e)}],ru.interpolateArray=xi;var ll=function(){return b},cl=ru.map({linear:ll,poly:Si,quad:function(){return ki},cubic:function(){return Ei},sin:function(){return Ti},exp:function(){return ji},circle:function(){return Ai},elastic:Ni,back:Oi,bounce:function(){return qi}}),fl=ru.map({"in":b,out:_i,"in-out":Mi,"out-in":function(t){return Mi(_i(t))}});ru.ease=function(t){var e=t.indexOf("-"),n=e>=0?t.slice(0,e):t,r=e>=0?t.slice(e+1):"in";return n=cl.get(n)||ll,r=fl.get(r)||b,wi(r(n.apply(null,iu.call(arguments,1))))},ru.interpolateHcl=Di,ru.interpolateHsl=Li,ru.interpolateLab=Fi,ru.interpolateRound=zi,ru.transform=function(t){var e=au.createElementNS(ru.ns.prefix.svg,"g");return(ru.transform=function(t){if(null!=t){e.setAttribute("transform",t);var n=e.transform.baseVal.consolidate()}return new Ri(n?n.matrix:hl)})(t)},Ri.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var hl={a:1,b:0,c:0,d:1,e:0,f:0};ru.interpolateTransform=Bi,ru.layout={},ru.layout.bundle=function(){return function(t){for(var e=[],n=-1,r=t.length;++n<r;)e.push(Ui(t[n]));return e}},ru.layout.chord=function(){function t(){var t,l,f,h,p,d={},g=[],v=ru.range(o),m=[];for(n=[],r=[],t=0,h=-1;++h<o;){for(l=0,p=-1;++p<o;)l+=i[h][p];g.push(l),m.push(ru.range(o)),t+=l}for(a&&v.sort(function(t,e){return a(g[t],g[e])}),u&&m.forEach(function(t,e){t.sort(function(t,n){return u(i[e][t],i[e][n])})}),t=(Du-c*o)/t,l=0,h=-1;++h<o;){for(f=l,p=-1;++p<o;){var y=v[h],b=m[y][p],x=i[y][b],w=l,_=l+=x*t;d[y+"-"+b]={index:y,subindex:b,startAngle:w,endAngle:_,value:x}}r[y]={index:y,startAngle:f,endAngle:l,value:(l-f)/t},l+=c}for(h=-1;++h<o;)for(p=h-1;++p<o;){var M=d[h+"-"+p],k=d[p+"-"+h];(M.value||k.value)&&n.push(M.value<k.value?{source:k,target:M}:{source:M,target:k})}s&&e()}function e(){n.sort(function(t,e){return s((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)})}var n,r,i,o,a,u,s,l={},c=0;return l.matrix=function(t){return arguments.length?(o=(i=t)&&i.length,n=r=null,l):i},l.padding=function(t){return arguments.length?(c=t,n=r=null,l):c},l.sortGroups=function(t){return arguments.length?(a=t,n=r=null,l):a},l.sortSubgroups=function(t){return arguments.length?(u=t,n=null,l):u},l.sortChords=function(t){return arguments.length?(s=t,n&&e(),l):s},l.chords=function(){return n||t(),n},l.groups=function(){return r||t(),r},l},ru.layout.force=function(){function t(t){return function(e,n,r,i){if(e.point!==t){var o=e.cx-t.x,a=e.cy-t.y,u=i-n,s=o*o+a*a;if(s>u*u/v){if(d>s){var l=e.charge/s;t.px-=o*l,t.py-=a*l}return!0}if(e.point&&s&&d>s){var l=e.pointCharge/s;t.px-=o*l,t.py-=a*l}}return!e.charge}}function e(t){t.px=ru.event.x,t.py=ru.event.y,u.resume()}var n,r,i,o,a,u={},s=ru.dispatch("start","tick","end"),l=[1,1],c=.9,f=pl,h=dl,p=-30,d=gl,g=.1,v=.64,m=[],y=[];return u.tick=function(){if((r*=.99)<.005)return s.end({type:"end",alpha:r=0}),!0;var e,n,u,f,h,d,v,b,x,w=m.length,_=y.length;for(n=0;_>n;++n)u=y[n],f=u.source,h=u.target,b=h.x-f.x,x=h.y-f.y,(d=b*b+x*x)&&(d=r*o[n]*((d=Math.sqrt(d))-i[n])/d,b*=d,x*=d,h.x-=b*(v=f.weight/(h.weight+f.weight)),h.y-=x*v,f.x+=b*(v=1-v),f.y+=x*v);if((v=r*g)&&(b=l[0]/2,x=l[1]/2,n=-1,v))for(;++n<w;)u=m[n],u.x+=(b-u.x)*v,u.y+=(x-u.y)*v;if(p)for(Gi(e=ru.geom.quadtree(m),r,a),n=-1;++n<w;)(u=m[n]).fixed||e.visit(t(u));for(n=-1;++n<w;)u=m[n],u.fixed?(u.x=u.px,u.y=u.py):(u.x-=(u.px-(u.px=u.x))*c,u.y-=(u.py-(u.py=u.y))*c);s.tick({type:"tick",alpha:r})},u.nodes=function(t){return arguments.length?(m=t,u):m},u.links=function(t){return arguments.length?(y=t,u):y},u.size=function(t){return arguments.length?(l=t,u):l},u.linkDistance=function(t){return arguments.length?(f="function"==typeof t?t:+t,u):f},u.distance=u.linkDistance,u.linkStrength=function(t){return arguments.length?(h="function"==typeof t?t:+t,u):h},u.friction=function(t){return arguments.length?(c=+t,u):c},u.charge=function(t){return arguments.length?(p="function"==typeof t?t:+t,u):p},u.chargeDistance=function(t){return arguments.length?(d=t*t,u):Math.sqrt(d)},u.gravity=function(t){return arguments.length?(g=+t,u):g},u.theta=function(t){return arguments.length?(v=t*t,u):Math.sqrt(v)},u.alpha=function(t){return arguments.length?(t=+t,r?r=t>0?t:0:t>0&&(s.start({type:"start",alpha:r=t}),ru.timer(u.tick)),u):r},u.start=function(){function t(t,r){if(!n){for(n=new Array(s),u=0;s>u;++u)n[u]=[];for(u=0;c>u;++u){var i=y[u];n[i.source.index].push(i.target),n[i.target.index].push(i.source)}}for(var o,a=n[e],u=-1,l=a.length;++u<l;)if(!isNaN(o=a[u][t]))return o;return Math.random()*r}var e,n,r,s=m.length,c=y.length,d=l[0],g=l[1];for(e=0;s>e;++e)(r=m[e]).index=e,r.weight=0;for(e=0;c>e;++e)r=y[e],"number"==typeof r.source&&(r.source=m[r.source]),"number"==typeof r.target&&(r.target=m[r.target]),++r.source.weight,++r.target.weight;for(e=0;s>e;++e)r=m[e],isNaN(r.x)&&(r.x=t("x",d)),isNaN(r.y)&&(r.y=t("y",g)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(i=[],"function"==typeof f)for(e=0;c>e;++e)i[e]=+f.call(this,y[e],e);else for(e=0;c>e;++e)i[e]=f;if(o=[],"function"==typeof h)for(e=0;c>e;++e)o[e]=+h.call(this,y[e],e);else for(e=0;c>e;++e)o[e]=h;if(a=[],"function"==typeof p)for(e=0;s>e;++e)a[e]=+p.call(this,m[e],e);else for(e=0;s>e;++e)a[e]=p;return u.resume()},u.resume=function(){return u.alpha(.1)},u.stop=function(){return u.alpha(0)},u.drag=function(){return n||(n=ru.behavior.drag().origin(b).on("dragstart.force",Xi).on("drag.force",e).on("dragend.force",Ji)),arguments.length?void this.on("mouseover.force",Zi).on("mouseout.force",Ki).call(n):n},ru.rebind(u,s,"on")};var pl=20,dl=1,gl=1/0;ru.layout.hierarchy=function(){function t(i){var o,a=[i],u=[];for(i.depth=0;null!=(o=a.pop());)if(u.push(o),(l=n.call(t,o,o.depth))&&(s=l.length)){for(var s,l,c;--s>=0;)a.push(c=l[s]),c.parent=o,c.depth=o.depth+1;r&&(o.value=0),o.children=l}else r&&(o.value=+r.call(t,o,o.depth)||0),delete o.children;return eo(i,function(t){var n,i;e&&(n=t.children)&&n.sort(e),r&&(i=t.parent)&&(i.value+=t.value)}),u}var e=io,n=no,r=ro;return t.sort=function(n){return arguments.length?(e=n,t):e},t.children=function(e){return arguments.length?(n=e,t):n},t.value=function(e){return arguments.length?(r=e,t):r},t.revalue=function(e){return r&&(to(e,function(t){t.children&&(t.value=0)}),eo(e,function(e){var n;e.children||(e.value=+r.call(t,e,e.depth)||0),(n=e.parent)&&(n.value+=e.value)})),e},t},ru.layout.partition=function(){function t(e,n,r,i){var o=e.children;if(e.x=n,e.y=e.depth*i,e.dx=r,e.dy=i,o&&(a=o.length)){var a,u,s,l=-1;for(r=e.value?r/e.value:0;++l<a;)t(u=o[l],n,s=u.value*r,i),n+=s}}function e(t){var n=t.children,r=0;if(n&&(i=n.length))for(var i,o=-1;++o<i;)r=Math.max(r,e(n[o]));return 1+r}function n(n,o){var a=r.call(this,n,o);return t(a[0],0,i[0],i[1]/e(a[0])),a}var r=ru.layout.hierarchy(),i=[1,1];return n.size=function(t){return arguments.length?(i=t,n):i},Qi(n,r)},ru.layout.pie=function(){function t(data){var a,u=data.length,s=data.map(function(n,r){return+e.call(t,n,r)}),l=+("function"==typeof r?r.apply(this,arguments):r),c=("function"==typeof i?i.apply(this,arguments):i)-l,f=Math.min(Math.abs(c)/u,+("function"==typeof o?o.apply(this,arguments):o)),h=f*(0>c?-1:1),p=(c-u*h)/ru.sum(s),d=ru.range(u),g=[];return null!=n&&d.sort(n===vl?function(t,e){return s[e]-s[t]}:function(t,e){return n(data[t],data[e])}),d.forEach(function(t){g[t]={data:data[t],value:a=s[t],startAngle:l,endAngle:l+=a*p+h,padAngle:f}}),g}var e=Number,n=vl,r=0,i=Du,o=0;return t.value=function(n){return arguments.length?(e=n,t):e},t.sort=function(e){return arguments.length?(n=e,t):n},t.startAngle=function(e){return arguments.length?(r=e,t):r},t.endAngle=function(e){return arguments.length?(i=e,t):i},t.padAngle=function(e){return arguments.length?(o=e,t):o},t};var vl={};ru.layout.stack=function(){function t(data,u){if(!(f=data.length))return data;var s=data.map(function(n,r){return e.call(t,n,r)}),l=s.map(function(e){return e.map(function(e,n){return[o.call(t,e,n),a.call(t,e,n)]})}),c=n.call(t,l,u);s=ru.permute(s,c),l=ru.permute(l,c);var f,h,p,d,g=r.call(t,l,u),v=s[0].length;for(p=0;v>p;++p)for(i.call(t,s[0][p],d=g[p],l[0][p][1]),h=1;f>h;++h)i.call(t,s[h][p],d+=l[h-1][p][1],l[h][p][1]);return data}var e=b,n=lo,r=co,i=so,o=ao,a=uo;return t.values=function(n){return arguments.length?(e=n,t):e},t.order=function(e){return arguments.length?(n="function"==typeof e?e:ml.get(e)||lo,t):n},t.offset=function(e){return arguments.length?(r="function"==typeof e?e:yl.get(e)||co,t):r},t.x=function(e){return arguments.length?(o=e,t):o},t.y=function(e){return arguments.length?(a=e,t):a},t.out=function(e){return arguments.length?(i=e,t):i},t};var ml=ru.map({"inside-out":function(data){var t,e,n=data.length,r=data.map(fo),i=data.map(ho),o=ru.range(n).sort(function(t,e){return r[t]-r[e]}),a=0,u=0,s=[],l=[];for(t=0;n>t;++t)e=o[t],u>a?(a+=i[e],s.push(e)):(u+=i[e],l.push(e));return l.reverse().concat(s)},reverse:function(data){return ru.range(data.length).reverse()},"default":lo}),yl=ru.map({silhouette:function(data){var t,e,n,r=data.length,i=data[0].length,o=[],a=0,u=[];for(e=0;i>e;++e){for(t=0,n=0;r>t;t++)n+=data[t][e][1];n>a&&(a=n),o.push(n)}for(e=0;i>e;++e)u[e]=(a-o[e])/2;return u},wiggle:function(data){var t,e,n,r,i,o,a,u,s,l=data.length,c=data[0],f=c.length,h=[];for(h[0]=u=s=0,e=1;f>e;++e){for(t=0,r=0;l>t;++t)r+=data[t][e][1];for(t=0,i=0,a=c[e][0]-c[e-1][0];l>t;++t){for(n=0,o=(data[t][e][1]-data[t][e-1][1])/(2*a);t>n;++n)o+=(data[n][e][1]-data[n][e-1][1])/a;i+=o*data[t][e][1]}h[e]=u-=r?i/r*a:0,s>u&&(s=u)}for(e=0;f>e;++e)h[e]-=s;return h},expand:function(data){var t,e,n,r=data.length,i=data[0].length,o=1/r,a=[];for(e=0;i>e;++e){for(t=0,n=0;r>t;t++)n+=data[t][e][1];if(n)for(t=0;r>t;t++)data[t][e][1]/=n;else for(t=0;r>t;t++)data[t][e][1]=o}for(e=0;i>e;++e)a[e]=0;return a},zero:co});ru.layout.histogram=function(){function t(data,t){for(var o,a,u=[],s=data.map(n,this),l=r.call(this,s,t),c=i.call(this,l,s,t),t=-1,f=s.length,h=c.length-1,p=e?1:1/f;++t<h;)o=u[t]=[],o.dx=c[t+1]-(o.x=c[t]),o.y=0;if(h>0)for(t=-1;++t<f;)a=s[t],a>=l[0]&&a<=l[1]&&(o=u[ru.bisect(c,a,1,h)-1],o.y+=p,o.push(data[t]));return u}var e=!0,n=Number,r=mo,i=go;return t.value=function(e){return arguments.length?(n=e,t):n},t.range=function(e){return arguments.length?(r=Se(e),t):r},t.bins=function(e){return arguments.length?(i="number"==typeof e?function(t){return vo(t,e)}:Se(e),t):i},t.frequency=function(n){return arguments.length?(e=!!n,t):e},t},ru.layout.pack=function(){function t(t,o){var a=n.call(this,t,o),u=a[0],s=i[0],l=i[1],c=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(u.x=u.y=0,eo(u,function(t){t.r=+c(t.value)}),eo(u,_o),r){var f=r*(e?1:Math.max(2*u.r/s,2*u.r/l))/2;eo(u,function(t){t.r+=f}),eo(u,_o),eo(u,function(t){t.r-=f})}return Eo(u,s/2,l/2,e?1:1/Math.max(2*u.r/s,2*u.r/l)),a}var e,n=ru.layout.hierarchy().sort(yo),r=0,i=[1,1];return t.size=function(e){return arguments.length?(i=e,t):i},t.radius=function(n){return arguments.length?(e=null==n||"function"==typeof n?n:+n,t):e},t.padding=function(e){return arguments.length?(r=+e,t):r},Qi(t,n)},ru.layout.tree=function(){function t(t,i){var c=a.call(this,t,i),f=c[0],h=e(f);if(eo(h,n),h.parent.m=-h.z,to(h,r),l)to(f,o);else{var p=f,d=f,g=f;to(f,function(t){t.x<p.x&&(p=t),t.x>d.x&&(d=t),t.depth>g.depth&&(g=t)});var v=u(p,d)/2-p.x,m=s[0]/(d.x+u(d,p)/2+v),y=s[1]/(g.depth||1);to(f,function(t){t.x=(t.x+v)*m,t.y=t.depth*y})}return c}function e(t){for(var e,n={A:null,children:[t]},r=[n];null!=(e=r.pop());)for(var i,o=e.children,a=0,u=o.length;u>a;++a)r.push((o[a]=i={_:o[a],parent:e,children:(i=o[a].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:a}).a=i);return n.children[0]}function n(t){var e=t.children,n=t.parent.children,r=t.i?n[t.i-1]:null;if(e.length){No(t);var o=(e[0].z+e[e.length-1].z)/2;r?(t.z=r.z+u(t._,r._),t.m=t.z-o):t.z=o}else r&&(t.z=r.z+u(t._,r._));t.parent.A=i(t,r,t.parent.A||n[0])}function r(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function i(t,e,n){if(e){for(var r,i=t,o=t,a=e,s=i.parent.children[0],l=i.m,c=o.m,f=a.m,h=s.m;a=jo(a),i=To(i),a&&i;)s=To(s),o=jo(o),o.a=t,r=a.z+f-i.z-l+u(a._,i._),r>0&&(Ao(Oo(a,t,n),t,r),l+=r,c+=r),f+=a.m,l+=i.m,h+=s.m,c+=o.m;a&&!jo(o)&&(o.t=a,o.m+=f-c),i&&!To(s)&&(s.t=i,s.m+=l-h,n=t)}return n}function o(t){t.x*=s[0],t.y=t.depth*s[1]}var a=ru.layout.hierarchy().sort(null).value(null),u=So,s=[1,1],l=null;return t.separation=function(e){return arguments.length?(u=e,t):u},t.size=function(e){return arguments.length?(l=null==(s=e)?o:null,t):l?null:s},t.nodeSize=function(e){return arguments.length?(l=null==(s=e)?null:o,t):l?s:null},Qi(t,a)},ru.layout.cluster=function(){function t(t,o){var a,u=e.call(this,t,o),s=u[0],l=0;eo(s,function(t){var e=t.children;e&&e.length?(t.x=Do(e),t.y=qo(e)):(t.x=a?l+=n(t,a):0,t.y=0,a=t)});var c=Lo(s),f=Fo(s),h=c.x-n(c,f)/2,p=f.x+n(f,c)/2;return eo(s,i?function(t){t.x=(t.x-s.x)*r[0],t.y=(s.y-t.y)*r[1]}:function(t){t.x=(t.x-h)/(p-h)*r[0],t.y=(1-(s.y?t.y/s.y:1))*r[1]}),u}var e=ru.layout.hierarchy().sort(null).value(null),n=So,r=[1,1],i=!1;return t.separation=function(e){return arguments.length?(n=e,t):n},t.size=function(e){return arguments.length?(i=null==(r=e),t):i?null:r},t.nodeSize=function(e){return arguments.length?(i=null!=(r=e),t):i?r:null},Qi(t,e)},ru.layout.treemap=function(){function t(t,e){for(var n,r,i=-1,o=t.length;++i<o;)r=(n=t[i]).value*(0>e?0:e),n.area=isNaN(r)||0>=r?0:r}function e(n){var o=n.children;if(o&&o.length){var a,u,s,l=f(n),c=[],h=o.slice(),d=1/0,g="slice"===p?l.dx:"dice"===p?l.dy:"slice-dice"===p?1&n.depth?l.dy:l.dx:Math.min(l.dx,l.dy);for(t(h,l.dx*l.dy/n.value),c.area=0;(s=h.length)>0;)c.push(a=h[s-1]),c.area+=a.area,"squarify"!==p||(u=r(c,g))<=d?(h.pop(),d=u):(c.area-=c.pop().area,i(c,g,l,!1),g=Math.min(l.dx,l.dy),c.length=c.area=0,d=1/0);c.length&&(i(c,g,l,!0),c.length=c.area=0),o.forEach(e)}}function n(e){var r=e.children;if(r&&r.length){var o,a=f(e),u=r.slice(),s=[];for(t(u,a.dx*a.dy/e.value),s.area=0;o=u.pop();)s.push(o),s.area+=o.area,null!=o.z&&(i(s,o.z?a.dx:a.dy,a,!u.length),s.length=s.area=0);r.forEach(n)}}function r(t,e){for(var n,r=t.area,i=0,o=1/0,a=-1,u=t.length;++a<u;)(n=t[a].area)&&(o>n&&(o=n),n>i&&(i=n));return r*=r,e*=e,r?Math.max(e*i*d/r,r/(e*o*d)):1/0}function i(t,e,n,r){var i,o=-1,a=t.length,u=n.x,l=n.y,c=e?s(t.area/e):0;if(e==n.dx){for((r||c>n.dy)&&(c=n.dy);++o<a;)i=t[o],i.x=u,i.y=l,i.dy=c,u+=i.dx=Math.min(n.x+n.dx-u,c?s(i.area/c):0);i.z=!0,i.dx+=n.x+n.dx-u,n.y+=c,n.dy-=c}else{for((r||c>n.dx)&&(c=n.dx);++o<a;)i=t[o],i.x=u,i.y=l,i.dx=c,l+=i.dy=Math.min(n.y+n.dy-l,c?s(i.area/c):0);i.z=!1,i.dy+=n.y+n.dy-l,n.x+=c,n.dx-=c}}function o(r){var i=a||u(r),o=i[0];return o.x=0,o.y=0,o.dx=l[0],o.dy=l[1],a&&u.revalue(o),t([o],o.dx*o.dy/o.value),(a?n:e)(o),h&&(a=i),i}var a,u=ru.layout.hierarchy(),s=Math.round,l=[1,1],c=null,f=zo,h=!1,p="squarify",d=.5*(1+Math.sqrt(5));return o.size=function(t){return arguments.length?(l=t,o):l},o.padding=function(t){function e(e){var n=t.call(o,e,e.depth);return null==n?zo(e):Ro(e,"number"==typeof n?[n,n,n,n]:n)}function n(e){return Ro(e,t)}if(!arguments.length)return c;var r;return f=null==(c=t)?zo:"function"==(r=typeof t)?e:"number"===r?(t=[t,t,t,t],n):n,o},o.round=function(t){return arguments.length?(s=t?Math.round:Number,o):s!=Number},o.sticky=function(t){return arguments.length?(h=t,a=null,o):h},o.ratio=function(t){return arguments.length?(d=t,o):d},o.mode=function(t){return arguments.length?(p=t+"",o):p},Qi(o,u)},ru.random={normal:function(t,e){var n=arguments.length;return 2>n&&(e=1),1>n&&(t=0),function(){var n,r,i;do n=2*Math.random()-1,r=2*Math.random()-1,i=n*n+r*r;while(!i||i>1);return t+e*n*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=ru.random.normal.apply(ru,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=ru.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,n=0;t>n;n++)e+=Math.random();return e}}},ru.scale={};var bl={floor:b,ceil:b};ru.scale.linear=function(){return Uo([0,1],[0,1],bi,!1)};var xl={s:1,g:1,p:1,r:1,e:1};ru.scale.log=function(){return Qo(ru.scale.linear().domain([0,1]),10,!0,[1,10])};var wl=ru.format(".0e"),_l={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};ru.scale.pow=function(){return ta(ru.scale.linear(),1,[0,1])},ru.scale.sqrt=function(){return ru.scale.pow().exponent(.5)},ru.scale.ordinal=function(){return na([],{t:"range",a:[[]]})},ru.scale.category10=function(){return ru.scale.ordinal().range(Ml)},ru.scale.category20=function(){return ru.scale.ordinal().range(kl)},ru.scale.category20b=function(){return ru.scale.ordinal().range(El)},ru.scale.category20c=function(){return ru.scale.ordinal().range(Cl)};var Ml=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(xe),kl=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(xe),El=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(xe),Cl=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(xe);ru.scale.quantile=function(){return ra([],[])},ru.scale.quantize=function(){return ia(0,1,[0,1])},ru.scale.threshold=function(){return oa([.5],[0,1])},ru.scale.identity=function(){return aa([0,1])},ru.svg={},ru.svg.arc=function(){function t(){var t=Math.max(0,+n.apply(this,arguments)),l=Math.max(0,+r.apply(this,arguments)),c=a.apply(this,arguments)-Fu,f=u.apply(this,arguments)-Fu,h=Math.abs(f-c),p=c>f?0:1;if(t>l&&(d=l,l=t,t=d),h>=Lu)return e(l,p)+(t?e(t,1-p):"")+"Z";var d,g,v,m,y,b,x,w,_,M,k,E,C=0,S=0,T=[];if((m=(+s.apply(this,arguments)||0)/2)&&(v=o===Sl?Math.sqrt(t*t+l*l):+o.apply(this,arguments),p||(S*=-1),l&&(S=ne(v/l*Math.sin(m))),t&&(C=ne(v/t*Math.sin(m)))),l){y=l*Math.cos(c+S),b=l*Math.sin(c+S),x=l*Math.cos(f-S),w=l*Math.sin(f-S);var j=Math.abs(f-c-2*S)<=qu?0:1;if(S&&pa(y,b,x,w)===p^j){var A=(c+f)/2;y=l*Math.cos(A),b=l*Math.sin(A),x=w=null}}else y=b=0;if(t){_=t*Math.cos(f-C),M=t*Math.sin(f-C),k=t*Math.cos(c+C),E=t*Math.sin(c+C);var N=Math.abs(c-f+2*C)<=qu?0:1;if(C&&pa(_,M,k,E)===1-p^N){var O=(c+f)/2;_=t*Math.cos(O),M=t*Math.sin(O),k=E=null}}else _=M=0;if((d=Math.min(Math.abs(l-t)/2,+i.apply(this,arguments)))>.001){g=l>t^p?0:1;var q=null==k?[_,M]:null==x?[y,b]:Dr([y,b],[k,E],[x,w],[_,M]),D=y-q[0],L=b-q[1],F=x-q[0],z=w-q[1],R=1/Math.sin(Math.acos((D*F+L*z)/(Math.sqrt(D*D+L*L)*Math.sqrt(F*F+z*z)))/2),I=Math.sqrt(q[0]*q[0]+q[1]*q[1]);if(null!=x){var P=Math.min(d,(l-I)/(R+1)),H=da(null==k?[_,M]:[k,E],[y,b],l,P,p),B=da([x,w],[_,M],l,P,p);d===P?T.push("M",H[0],"A",P,",",P," 0 0,",g," ",H[1],"A",l,",",l," 0 ",1-p^pa(H[1][0],H[1][1],B[1][0],B[1][1]),",",p," ",B[1],"A",P,",",P," 0 0,",g," ",B[0]):T.push("M",H[0],"A",P,",",P," 0 1,",g," ",B[0])}else T.push("M",y,",",b);if(null!=k){var $=Math.min(d,(t-I)/(R-1)),V=da([y,b],[k,E],t,-$,p),U=da([_,M],null==x?[y,b]:[x,w],t,-$,p);d===$?T.push("L",U[0],"A",$,",",$," 0 0,",g," ",U[1],"A",t,",",t," 0 ",p^pa(U[1][0],U[1][1],V[1][0],V[1][1]),",",1-p," ",V[1],"A",$,",",$," 0 0,",g," ",V[0]):T.push("L",U[0],"A",$,",",$," 0 0,",g," ",V[0])}else T.push("L",_,",",M)}else T.push("M",y,",",b),null!=x&&T.push("A",l,",",l," 0 ",j,",",p," ",x,",",w),T.push("L",_,",",M),null!=k&&T.push("A",t,",",t," 0 ",N,",",1-p," ",k,",",E);
-return T.push("Z"),T.join("")}function e(t,e){return"M0,"+t+"A"+t+","+t+" 0 1,"+e+" 0,"+-t+"A"+t+","+t+" 0 1,"+e+" 0,"+t}var n=sa,r=la,i=ua,o=Sl,a=ca,u=fa,s=ha;return t.innerRadius=function(e){return arguments.length?(n=Se(e),t):n},t.outerRadius=function(e){return arguments.length?(r=Se(e),t):r},t.cornerRadius=function(e){return arguments.length?(i=Se(e),t):i},t.padRadius=function(e){return arguments.length?(o=e==Sl?Sl:Se(e),t):o},t.startAngle=function(e){return arguments.length?(a=Se(e),t):a},t.endAngle=function(e){return arguments.length?(u=Se(e),t):u},t.padAngle=function(e){return arguments.length?(s=Se(e),t):s},t.centroid=function(){var t=(+n.apply(this,arguments)+ +r.apply(this,arguments))/2,e=(+a.apply(this,arguments)+ +u.apply(this,arguments))/2-Fu;return[Math.cos(e)*t,Math.sin(e)*t]},t};var Sl="auto";ru.svg.line=function(){return ga(b)};var Tl=ru.map({linear:va,"linear-closed":ma,step:ya,"step-before":ba,"step-after":xa,basis:Ca,"basis-open":Sa,"basis-closed":Ta,bundle:ja,cardinal:Ma,"cardinal-open":wa,"cardinal-closed":_a,monotone:La});Tl.forEach(function(t,e){e.key=t,e.closed=/-closed$/.test(t)});var jl=[0,2/3,1/3,0],Al=[0,1/3,2/3,0],Nl=[0,1/6,2/3,1/6];ru.svg.line.radial=function(){var t=ga(Fa);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},ba.reverse=xa,xa.reverse=ba,ru.svg.area=function(){return za(b)},ru.svg.area.radial=function(){var t=za(Fa);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},ru.svg.chord=function(){function t(t,u){var s=e(this,o,t,u),l=e(this,a,t,u);return"M"+s.p0+r(s.r,s.p1,s.a1-s.a0)+(n(s,l)?i(s.r,s.p1,s.r,s.p0):i(s.r,s.p1,l.r,l.p0)+r(l.r,l.p1,l.a1-l.a0)+i(l.r,l.p1,s.r,s.p0))+"Z"}function e(t,e,n,r){var i=e.call(t,n,r),o=u.call(t,i,r),a=s.call(t,i,r)-Fu,c=l.call(t,i,r)-Fu;return{r:o,a0:a,a1:c,p0:[o*Math.cos(a),o*Math.sin(a)],p1:[o*Math.cos(c),o*Math.sin(c)]}}function n(t,e){return t.a0==e.a0&&t.a1==e.a1}function r(t,e,n){return"A"+t+","+t+" 0 "+ +(n>qu)+",1 "+e}function i(t,e,n,r){return"Q 0,0 "+r}var o=br,a=xr,u=Ra,s=ca,l=fa;return t.radius=function(e){return arguments.length?(u=Se(e),t):u},t.source=function(e){return arguments.length?(o=Se(e),t):o},t.target=function(e){return arguments.length?(a=Se(e),t):a},t.startAngle=function(e){return arguments.length?(s=Se(e),t):s},t.endAngle=function(e){return arguments.length?(l=Se(e),t):l},t},ru.svg.diagonal=function(){function t(t,i){var o=e.call(this,t,i),a=n.call(this,t,i),u=(o.y+a.y)/2,s=[o,{x:o.x,y:u},{x:a.x,y:u},a];return s=s.map(r),"M"+s[0]+"C"+s[1]+" "+s[2]+" "+s[3]}var e=br,n=xr,r=Ia;return t.source=function(n){return arguments.length?(e=Se(n),t):e},t.target=function(e){return arguments.length?(n=Se(e),t):n},t.projection=function(e){return arguments.length?(r=e,t):r},t},ru.svg.diagonal.radial=function(){var t=ru.svg.diagonal(),e=Ia,n=t.projection;return t.projection=function(t){return arguments.length?n(Pa(e=t)):e},t},ru.svg.symbol=function(){function t(t,r){return(Ol.get(e.call(this,t,r))||$a)(n.call(this,t,r))}var e=Ba,n=Ha;return t.type=function(n){return arguments.length?(e=Se(n),t):e},t.size=function(e){return arguments.length?(n=Se(e),t):n},t};var Ol=ru.map({circle:$a,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*Dl)),n=e*Dl;return"M0,"+-e+"L"+n+",0 0,"+e+" "+-n+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/ql),n=e*ql/2;return"M0,"+n+"L"+e+","+-n+" "+-e+","+-n+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/ql),n=e*ql/2;return"M0,"+-n+"L"+e+","+n+" "+-e+","+n+"Z"}});ru.svg.symbolTypes=Ol.keys();var ql=Math.sqrt(3),Dl=Math.tan(30*zu);ku.transition=function(t){for(var e,n,r=Ll||++Il,i=Xa(t),o=[],a=Fl||{time:Date.now(),ease:Ci,delay:0,duration:250},u=-1,s=this.length;++u<s;){o.push(e=[]);for(var l=this[u],c=-1,f=l.length;++c<f;)(n=l[c])&&Ja(n,c,i,r,a),e.push(n)}return Ua(o,i,r)},ku.interrupt=function(t){return this.each(null==t?zl:Va(Xa(t)))};var Ll,Fl,zl=Va(Xa()),Rl=[],Il=0;Rl.call=ku.call,Rl.empty=ku.empty,Rl.node=ku.node,Rl.size=ku.size,ru.transition=function(t,e){return t&&t.transition?Ll?t.transition(e):t:ru.selection().transition(t)},ru.transition.prototype=Rl,Rl.select=function(t){var e,n,r,i=this.id,o=this.namespace,a=[];t=j(t);for(var u=-1,s=this.length;++u<s;){a.push(e=[]);for(var l=this[u],c=-1,f=l.length;++c<f;)(r=l[c])&&(n=t.call(r,r.__data__,c,u))?("__data__"in r&&(n.__data__=r.__data__),Ja(n,c,o,i,r[o][i]),e.push(n)):e.push(null)}return Ua(a,o,i)},Rl.selectAll=function(t){var e,n,r,i,o,a=this.id,u=this.namespace,s=[];t=A(t);for(var l=-1,c=this.length;++l<c;)for(var f=this[l],h=-1,p=f.length;++h<p;)if(r=f[h]){o=r[u][a],n=t.call(r,r.__data__,h,l),s.push(e=[]);for(var d=-1,g=n.length;++d<g;)(i=n[d])&&Ja(i,d,u,a,o),e.push(i)}return Ua(s,u,a)},Rl.filter=function(t){var e,n,r,i=[];"function"!=typeof t&&(t=B(t));for(var o=0,a=this.length;a>o;o++){i.push(e=[]);for(var n=this[o],u=0,s=n.length;s>u;u++)(r=n[u])&&t.call(r,r.__data__,u,o)&&e.push(r)}return Ua(i,this.namespace,this.id)},Rl.tween=function(t,e){var n=this.id,r=this.namespace;return arguments.length<2?this.node()[r][n].tween.get(t):V(this,null==e?function(e){e[r][n].tween.remove(t)}:function(i){i[r][n].tween.set(t,e)})},Rl.attr=function(t,e){function n(){this.removeAttribute(u)}function r(){this.removeAttributeNS(u.space,u.local)}function i(t){return null==t?n:(t+="",function(){var e,n=this.getAttribute(u);return n!==t&&(e=a(n,t),function(t){this.setAttribute(u,e(t))})})}function o(t){return null==t?r:(t+="",function(){var e,n=this.getAttributeNS(u.space,u.local);return n!==t&&(e=a(n,t),function(t){this.setAttributeNS(u.space,u.local,e(t))})})}if(arguments.length<2){for(e in t)this.attr(e,t[e]);return this}var a="transform"==t?Bi:bi,u=ru.ns.qualify(t);return Wa(this,"attr."+t,e,u.local?o:i)},Rl.attrTween=function(t,e){function n(t,n){var r=e.call(this,t,n,this.getAttribute(i));return r&&function(t){this.setAttribute(i,r(t))}}function r(t,n){var r=e.call(this,t,n,this.getAttributeNS(i.space,i.local));return r&&function(t){this.setAttributeNS(i.space,i.local,r(t))}}var i=ru.ns.qualify(t);return this.tween("attr."+t,i.local?r:n)},Rl.style=function(t,e,r){function i(){this.style.removeProperty(t)}function o(e){return null==e?i:(e+="",function(){var i,o=n(this).getComputedStyle(this,null).getPropertyValue(t);return o!==e&&(i=bi(o,e),function(e){this.style.setProperty(t,i(e),r)})})}var a=arguments.length;if(3>a){if("string"!=typeof t){2>a&&(e="");for(r in t)this.style(r,t[r],e);return this}r=""}return Wa(this,"style."+t,e,o)},Rl.styleTween=function(t,e,r){function i(i,o){var a=e.call(this,i,o,n(this).getComputedStyle(this,null).getPropertyValue(t));return a&&function(e){this.style.setProperty(t,a(e),r)}}return arguments.length<3&&(r=""),this.tween("style."+t,i)},Rl.text=function(t){return Wa(this,"text",t,Ya)},Rl.remove=function(){var t=this.namespace;return this.each("end.transition",function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)})},Rl.ease=function(t){var e=this.id,n=this.namespace;return arguments.length<1?this.node()[n][e].ease:("function"!=typeof t&&(t=ru.ease.apply(ru,arguments)),V(this,function(r){r[n][e].ease=t}))},Rl.delay=function(t){var e=this.id,n=this.namespace;return arguments.length<1?this.node()[n][e].delay:V(this,"function"==typeof t?function(r,i,o){r[n][e].delay=+t.call(r,r.__data__,i,o)}:(t=+t,function(r){r[n][e].delay=t}))},Rl.duration=function(t){var e=this.id,n=this.namespace;return arguments.length<1?this.node()[n][e].duration:V(this,"function"==typeof t?function(r,i,o){r[n][e].duration=Math.max(1,t.call(r,r.__data__,i,o))}:(t=Math.max(1,t),function(r){r[n][e].duration=t}))},Rl.each=function(t,e){var n=this.id,r=this.namespace;if(arguments.length<2){var i=Fl,o=Ll;try{Ll=n,V(this,function(e,i,o){Fl=e[r][n],t.call(e,e.__data__,i,o)})}finally{Fl=i,Ll=o}}else V(this,function(i){var o=i[r][n];(o.event||(o.event=ru.dispatch("start","end","interrupt"))).on(t,e)});return this},Rl.transition=function(){for(var t,e,n,r,i=this.id,o=++Il,a=this.namespace,u=[],s=0,l=this.length;l>s;s++){u.push(t=[]);for(var e=this[s],c=0,f=e.length;f>c;c++)(n=e[c])&&(r=n[a][i],Ja(n,c,a,o,{time:r.time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration})),t.push(n)}return Ua(u,a,o)},ru.svg.axis=function(){function t(t){t.each(function(){var t,l=ru.select(this),c=this.__chart__||n,f=this.__chart__=n.copy(),h=null==s?f.ticks?f.ticks.apply(f,u):f.domain():s,p=null==e?f.tickFormat?f.tickFormat.apply(f,u):b:e,d=l.selectAll(".tick").data(h,f),g=d.enter().insert("g",".domain").attr("class","tick").style("opacity",Nu),v=ru.transition(d.exit()).style("opacity",Nu).remove(),m=ru.transition(d.order()).style("opacity",1),y=Math.max(i,0)+a,x=Po(f),w=l.selectAll(".domain").data([0]),_=(w.enter().append("path").attr("class","domain"),ru.transition(w));g.append("line"),g.append("text");var M,k,E,C,S=g.select("line"),T=m.select("line"),j=d.select("text").text(p),A=g.select("text"),N=m.select("text"),O="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r?(t=Za,M="x",E="y",k="x2",C="y2",j.attr("dy",0>O?"0em":".71em").style("text-anchor","middle"),_.attr("d","M"+x[0]+","+O*o+"V0H"+x[1]+"V"+O*o)):(t=Ka,M="y",E="x",k="y2",C="x2",j.attr("dy",".32em").style("text-anchor",0>O?"end":"start"),_.attr("d","M"+O*o+","+x[0]+"H0V"+x[1]+"H"+O*o)),S.attr(C,O*i),A.attr(E,O*y),T.attr(k,0).attr(C,O*i),N.attr(M,0).attr(E,O*y),f.rangeBand){var q=f,D=q.rangeBand()/2;c=f=function(t){return q(t)+D}}else c.rangeBand?c=f:v.call(t,f,c);g.call(t,c,f),m.call(t,f,f)})}var e,n=ru.scale.linear(),r=Pl,i=6,o=6,a=3,u=[10],s=null;return t.scale=function(e){return arguments.length?(n=e,t):n},t.orient=function(e){return arguments.length?(r=e in Hl?e+"":Pl,t):r},t.ticks=function(){return arguments.length?(u=arguments,t):u},t.tickValues=function(e){return arguments.length?(s=e,t):s},t.tickFormat=function(n){return arguments.length?(e=n,t):e},t.tickSize=function(e){var n=arguments.length;return n?(i=+e,o=+arguments[n-1],t):i},t.innerTickSize=function(e){return arguments.length?(i=+e,t):i},t.outerTickSize=function(e){return arguments.length?(o=+e,t):o},t.tickPadding=function(e){return arguments.length?(a=+e,t):a},t.tickSubdivide=function(){return arguments.length&&t},t};var Pl="bottom",Hl={top:1,right:1,bottom:1,left:1};ru.svg.brush=function(){function t(n){n.each(function(){var n=ru.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",o).on("touchstart.brush",o),a=n.selectAll(".background").data([0]);a.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),n.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var u=n.selectAll(".resize").data(g,b);u.exit().remove(),u.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return Bl[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),u.style("display",t.empty()?"none":null);var s,f=ru.transition(n),h=ru.transition(a);l&&(s=Po(l),h.attr("x",s[0]).attr("width",s[1]-s[0]),r(f)),c&&(s=Po(c),h.attr("y",s[0]).attr("height",s[1]-s[0]),i(f)),e(f)})}function e(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+f[+/e$/.test(t)]+","+h[+/^s/.test(t)]+")"})}function r(t){t.select(".extent").attr("x",f[0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",f[1]-f[0])}function i(t){t.select(".extent").attr("y",h[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function o(){function o(){32==ru.event.keyCode&&(j||(b=null,N[0]-=f[1],N[1]-=h[1],j=2),E())}function g(){32==ru.event.keyCode&&2==j&&(N[0]+=f[1],N[1]+=h[1],j=0,E())}function v(){var t=ru.mouse(w),n=!1;x&&(t[0]+=x[0],t[1]+=x[1]),j||(ru.event.altKey?(b||(b=[(f[0]+f[1])/2,(h[0]+h[1])/2]),N[0]=f[+(t[0]<b[0])],N[1]=h[+(t[1]<b[1])]):b=null),S&&m(t,l,0)&&(r(k),n=!0),T&&m(t,c,1)&&(i(k),n=!0),n&&(e(k),M({type:"brush",mode:j?"move":"resize"}))}function m(t,e,n){var r,i,o=Po(e),s=o[0],l=o[1],c=N[n],g=n?h:f,v=g[1]-g[0];return j&&(s-=c,l-=v+c),r=(n?d:p)?Math.max(s,Math.min(l,t[n])):t[n],j?i=(r+=c)+v:(b&&(c=Math.max(s,Math.min(l,2*b[n]-r))),r>c?(i=r,r=c):i=c),g[0]!=r||g[1]!=i?(n?u=null:a=null,g[0]=r,g[1]=i,!0):void 0}function y(){v(),k.style("pointer-events","all").selectAll(".resize").style("display",t.empty()?"none":null),ru.select("body").style("cursor",null),O.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),A(),M({type:"brushend"})}var b,x,w=this,_=ru.select(ru.event.target),M=s.of(w,arguments),k=ru.select(w),C=_.datum(),S=!/^(n|s)$/.test(C)&&l,T=!/^(e|w)$/.test(C)&&c,j=_.classed("extent"),A=Z(w),N=ru.mouse(w),O=ru.select(n(w)).on("keydown.brush",o).on("keyup.brush",g);if(ru.event.changedTouches?O.on("touchmove.brush",v).on("touchend.brush",y):O.on("mousemove.brush",v).on("mouseup.brush",y),k.interrupt().selectAll("*").interrupt(),j)N[0]=f[0]-N[0],N[1]=h[0]-N[1];else if(C){var q=+/w$/.test(C),D=+/^n/.test(C);x=[f[1-q]-N[0],h[1-D]-N[1]],N[0]=f[q],N[1]=h[D]}else ru.event.altKey&&(b=N.slice());k.style("pointer-events","none").selectAll(".resize").style("display",null),ru.select("body").style("cursor",_.style("cursor")),M({type:"brushstart"}),v()}var a,u,s=S(t,"brushstart","brush","brushend"),l=null,c=null,f=[0,0],h=[0,0],p=!0,d=!0,g=$l[0];return t.event=function(t){t.each(function(){var t=s.of(this,arguments),e={x:f,y:h,i:a,j:u},n=this.__chart__||e;this.__chart__=e,Ll?ru.select(this).transition().each("start.brush",function(){a=n.i,u=n.j,f=n.x,h=n.y,t({type:"brushstart"})}).tween("brush:brush",function(){var n=xi(f,e.x),r=xi(h,e.y);return a=u=null,function(i){f=e.x=n(i),h=e.y=r(i),t({type:"brush",mode:"resize"})}}).each("end.brush",function(){a=e.i,u=e.j,t({type:"brush",mode:"resize"}),t({type:"brushend"})}):(t({type:"brushstart"}),t({type:"brush",mode:"resize"}),t({type:"brushend"}))})},t.x=function(e){return arguments.length?(l=e,g=$l[!l<<1|!c],t):l},t.y=function(e){return arguments.length?(c=e,g=$l[!l<<1|!c],t):c},t.clamp=function(e){return arguments.length?(l&&c?(p=!!e[0],d=!!e[1]):l?p=!!e:c&&(d=!!e),t):l&&c?[p,d]:l?p:c?d:null},t.extent=function(e){var n,r,i,o,s;return arguments.length?(l&&(n=e[0],r=e[1],c&&(n=n[0],r=r[0]),a=[n,r],l.invert&&(n=l(n),r=l(r)),n>r&&(s=n,n=r,r=s),(n!=f[0]||r!=f[1])&&(f=[n,r])),c&&(i=e[0],o=e[1],l&&(i=i[1],o=o[1]),u=[i,o],c.invert&&(i=c(i),o=c(o)),i>o&&(s=i,i=o,o=s),(i!=h[0]||o!=h[1])&&(h=[i,o])),t):(l&&(a?(n=a[0],r=a[1]):(n=f[0],r=f[1],l.invert&&(n=l.invert(n),r=l.invert(r)),n>r&&(s=n,n=r,r=s))),c&&(u?(i=u[0],o=u[1]):(i=h[0],o=h[1],c.invert&&(i=c.invert(i),o=c.invert(o)),i>o&&(s=i,i=o,o=s))),l&&c?[[n,i],[r,o]]:l?[n,r]:c&&[i,o])},t.clear=function(){return t.empty()||(f=[0,0],h=[0,0],a=u=null),t},t.empty=function(){return!!l&&f[0]==f[1]||!!c&&h[0]==h[1]},ru.rebind(t,s,"on")};var Bl={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},$l=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Vl=ls.format=gs.timeFormat,Ul=Vl.utc,Wl=Ul("%Y-%m-%dT%H:%M:%S.%LZ");Vl.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Ga:Wl,Ga.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},Ga.toString=Wl.toString,ls.second=Pe(function(t){return new cs(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),ls.seconds=ls.second.range,ls.seconds.utc=ls.second.utc.range,ls.minute=Pe(function(t){return new cs(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),ls.minutes=ls.minute.range,ls.minutes.utc=ls.minute.utc.range,ls.hour=Pe(function(t){var e=t.getTimezoneOffset()/60;return new cs(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),ls.hours=ls.hour.range,ls.hours.utc=ls.hour.utc.range,ls.month=Pe(function(t){return t=ls.day(t),t.setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),ls.months=ls.month.range,ls.months.utc=ls.month.utc.range;var Yl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Xl=[[ls.second,1],[ls.second,5],[ls.second,15],[ls.second,30],[ls.minute,1],[ls.minute,5],[ls.minute,15],[ls.minute,30],[ls.hour,1],[ls.hour,3],[ls.hour,6],[ls.hour,12],[ls.day,1],[ls.day,2],[ls.week,1],[ls.month,1],[ls.month,3],[ls.year,1]],Jl=Vl.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",An]]),Zl={range:function(t,e,n){return ru.range(Math.ceil(t/n)*n,+e,n).map(tu)},floor:b,ceil:b};Xl.year=ls.year,ls.scale=function(){return Qa(ru.scale.linear(),Xl,Jl)};var Kl=Xl.map(function(t){return[t[0].utc,t[1]]}),Gl=Ul.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",An]]);Kl.year=ls.year.utc,ls.scale.utc=function(){return Qa(ru.scale.linear(),Kl,Gl)},ru.text=Te(function(t){return t.responseText}),ru.json=function(t,e){return je(t,"application/json",eu,e)},ru.html=function(t,e){return je(t,"text/html",nu,e)},ru.xml=Te(function(t){return t.responseXML}),"function"==typeof define&&define.amd?define(ru):"object"==typeof e&&e.exports&&(e.exports=ru),this.d3=ru}()},{}],57:[function(t,e,n){function r(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function i(){var t=arguments,e=this.useColors;if(t[0]=(e?"%c":"")+this.namespace+(e?" %c":" ")+t[0]+(e?"%c ":" ")+"+"+n.humanize(this.diff),!e)return t;var r="color: "+this.color;t=[t[0],r,"color: inherit"].concat(Array.prototype.slice.call(t,1));var i=0,o=0;return t[0].replace(/%[a-z%]/g,function(t){"%%"!==t&&(i++,"%c"===t&&(o=i))}),t.splice(o,0,r),t}function o(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(t){try{null==t?l.removeItem("debug"):l.debug=t}catch(e){}}function u(){var t;try{t=l.debug}catch(e){}return t}function s(){try{return window.localStorage}catch(t){}}n=e.exports=t("./debug"),n.log=o,n.formatArgs=i,n.save=a,n.load=u,n.useColors=r;var l;l="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:s(),n.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],n.formatters.j=function(t){return JSON.stringify(t)},n.enable(u())},{"./debug":58}],58:[function(t,e,n){function r(){return n.colors[c++%n.colors.length]}function i(t){function e(){}function i(){var t=i,e=+new Date,o=e-(l||e);t.diff=o,t.prev=l,t.curr=e,l=e,null==t.useColors&&(t.useColors=n.useColors()),null==t.color&&t.useColors&&(t.color=r());var a=Array.prototype.slice.call(arguments);a[0]=n.coerce(a[0]),"string"!=typeof a[0]&&(a=["%o"].concat(a));var u=0;a[0]=a[0].replace(/%([a-z%])/g,function(e,r){if("%%"===e)return e;u++;var i=n.formatters[r];if("function"==typeof i){var o=a[u];e=i.call(t,o),a.splice(u,1),u--}return e}),"function"==typeof n.formatArgs&&(a=n.formatArgs.apply(t,a));var s=i.log||n.log||console.log.bind(console);s.apply(t,a)}e.enabled=!1,i.enabled=!0;var o=n.enabled(t)?i:e;return o.namespace=t,o}function o(t){n.save(t);for(var e=(t||"").split(/[\s,]+/),r=e.length,i=0;r>i;i++)e[i]&&(t=e[i].replace(/\*/g,".*?"),"-"===t[0]?n.skips.push(new RegExp("^"+t.substr(1)+"$")):n.names.push(new RegExp("^"+t+"$")))}function a(){n.enable("")}function u(t){var e,r;for(e=0,r=n.skips.length;r>e;e++)if(n.skips[e].test(t))return!1;for(e=0,r=n.names.length;r>e;e++)if(n.names[e].test(t))return!0;return!1}function s(t){return t instanceof Error?t.stack||t.message:t}n=e.exports=i,n.coerce=s,n.disable=a,n.enable=o,n.enabled=u,n.humanize=t("ms"),n.names=[],n.skips=[],n.formatters={};var l,c=0},{ms:59}],59:[function(t,e){function n(t){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*c;case"days":case"day":case"d":return n*l;case"hours":case"hour":case"hrs":case"hr":case"h":return n*s;case"minutes":case"minute":case"mins":case"min":case"m":return n*u;case"seconds":case"second":case"secs":case"sec":case"s":return n*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n}}}function r(t){return t>=l?Math.round(t/l)+"d":t>=s?Math.round(t/s)+"h":t>=u?Math.round(t/u)+"m":t>=a?Math.round(t/a)+"s":t+"ms"}function i(t){return o(t,l,"day")||o(t,s,"hour")||o(t,u,"minute")||o(t,a,"second")||t+" ms"}function o(t,e,n){return e>t?void 0:1.5*e>t?Math.floor(t/e)+" "+n:Math.ceil(t/e)+" "+n+"s"}var a=1e3,u=60*a,s=60*u,l=24*s,c=365.25*l;e.exports=function(t,e){return e=e||{},"string"==typeof t?n(t):e["long"]?i(t):r(t)}},{}],60:[function(t,e,n){(function(r){!function(t){if("object"==typeof n&&"undefined"!=typeof e)e.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var i;"undefined"!=typeof window?i=window:"undefined"!=typeof r?i=r:"undefined"!=typeof self&&(i=self),i.jade=t()}}(function(){return function e(n,r,i){function o(u,s){if(!r[u]){if(!n[u]){var l="function"==typeof t&&t;if(!s&&l)return l(u,!0);if(a)return a(u,!0);var c=new Error("Cannot find module '"+u+"'");throw c.code="MODULE_NOT_FOUND",c}var f=r[u]={exports:{}};n[u][0].call(f.exports,function(t){var e=n[u][1][t];return o(e?e:t)},f,f.exports,e,n,r,i)}return r[u].exports}for(var a="function"==typeof t&&t,u=0;u<i.length;u++)o(i[u]);return o}({1:[function(t,e,n){"use strict";function r(t){return null!=t&&""!==t}function i(t){return(Array.isArray(t)?t.map(i):t&&"object"==typeof t?Object.keys(t).filter(function(e){return t[e]}):[t]).filter(r).join(" ")}n.merge=function o(t,e){if(1===arguments.length){for(var n=t[0],i=1;i<t.length;i++)n=o(n,t[i]);return n}var a=t["class"],u=e["class"];(a||u)&&(a=a||[],u=u||[],Array.isArray(a)||(a=[a]),Array.isArray(u)||(u=[u]),t["class"]=a.concat(u).filter(r));for(var s in e)"class"!=s&&(t[s]=e[s]);return t},n.joinClasses=i,n.cls=function(t,e){for(var r=[],o=0;o<t.length;o++)r.push(e&&e[o]?n.escape(i([t[o]])):i(t[o]));var a=i(r);return a.length?' class="'+a+'"':""},n.style=function(t){return t&&"object"==typeof t?Object.keys(t).map(function(e){return e+":"+t[e]}).join(";"):t},n.attr=function(t,e,r,i){return"style"===t&&(e=n.style(e)),"boolean"==typeof e||null==e?e?" "+(i?t:t+'="'+t+'"'):"":0==t.indexOf("data")&&"string"!=typeof e?(-1!==JSON.stringify(e).indexOf("&")&&console.warn("Since Jade 2.0.0, ampersands (`&`) in data attributes will be escaped to `&amp;`"),e&&"function"==typeof e.toISOString&&console.warn("Jade will eliminate the double quotes around dates in ISO form after 2.0.0")," "+t+"='"+JSON.stringify(e).replace(/'/g,"&apos;")+"'"):r?(e&&"function"==typeof e.toISOString&&console.warn("Jade will stringify dates in ISO form after 2.0.0")," "+t+'="'+n.escape(e)+'"'):(e&&"function"==typeof e.toISOString&&console.warn("Jade will stringify dates in ISO form after 2.0.0")," "+t+'="'+e+'"')},n.attrs=function(t,e){var r=[],o=Object.keys(t);if(o.length)for(var a=0;a<o.length;++a){var u=o[a],s=t[u];"class"==u?(s=i(s))&&r.push(" "+u+'="'+s+'"'):r.push(n.attr(u,s,!1,e))}return r.join("")},n.escape=function(t){var e=String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");return e===""+t?t:e},n.rethrow=function a(e,n,r,i){if(!(e instanceof Error))throw e;if(!("undefined"==typeof window&&n||i))throw e.message+=" on line "+r,e;try{i=i||t("fs").readFileSync(n,"utf8")}catch(o){a(e,null,r)}var u=3,s=i.split("\n"),l=Math.max(r-u,0),c=Math.min(s.length,r+u),u=s.slice(l,c).map(function(t,e){var n=e+l+1;return(n==r?" > ":" ")+n+"| "+t}).join("\n");throw e.path=n,e.message=(n||"Jade")+":"+r+"\n"+u+"\n\n"+e.message,e}},{fs:2}],2:[function(){},{}]},{},[1])(1)})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{fs:55}],61:[function(t,e){!function(t,n){"object"==typeof e&&"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}:n(t)}("undefined"!=typeof window?window:this,function(t,e){function n(t){var e=t.length,n=Q.type(t);return"function"===n||Q.isWindow(t)?!1:1===t.nodeType&&e?!0:"array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t}function r(t,e,n){if(Q.isFunction(e))return Q.grep(t,function(t,r){return!!e.call(t,r,t)!==n});if(e.nodeType)return Q.grep(t,function(t){return t===e!==n});if("string"==typeof e){if(ue.test(e))return Q.filter(e,t,n);e=Q.filter(e,t)}return Q.grep(t,function(t){return W.call(e,t)>=0!==n})}function i(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}function o(t){var e=de[t]={};return Q.each(t.match(pe)||[],function(t,n){e[n]=!0}),e}function a(){K.removeEventListener("DOMContentLoaded",a,!1),t.removeEventListener("load",a,!1),Q.ready()}function u(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=Q.expando+u.uid++}function s(t,e,data){var n;if(void 0===data&&1===t.nodeType)if(n="data-"+e.replace(xe,"-$1").toLowerCase(),data=t.getAttribute(n),"string"==typeof data){try{data="true"===data?!0:"false"===data?!1:"null"===data?null:+data+""===data?+data:be.test(data)?Q.parseJSON(data):data}catch(r){}ye.set(t,e,data)}else data=void 0;return data}function l(){return!0}function c(){return!1}function f(){try{return K.activeElement}catch(t){}}function h(t,e){return Q.nodeName(t,"table")&&Q.nodeName(11!==e.nodeType?e:e.firstChild,"tr")?t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody")):t}function p(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function d(t){var e=Fe.exec(t.type);return e?t.type=e[1]:t.removeAttribute("type"),t}function g(t,e){for(var n=0,r=t.length;r>n;n++)me.set(t[n],"globalEval",!e||me.get(e[n],"globalEval"))}function v(t,e){var n,r,i,o,a,u,s,l;if(1===e.nodeType){if(me.hasData(t)&&(o=me.access(t),a=me.set(e,o),l=o.events)){delete a.handle,a.events={};for(i in l)for(n=0,r=l[i].length;r>n;n++)Q.event.add(e,i,l[i][n])}ye.hasData(t)&&(u=ye.access(t),s=Q.extend({},u),ye.set(e,s))}}function m(t,e){var n=t.getElementsByTagName?t.getElementsByTagName(e||"*"):t.querySelectorAll?t.querySelectorAll(e||"*"):[];return void 0===e||e&&Q.nodeName(t,e)?Q.merge([t],n):n}function y(t,e){var n=e.nodeName.toLowerCase();"input"===n&&ke.test(t.type)?e.checked=t.checked:("input"===n||"textarea"===n)&&(e.defaultValue=t.defaultValue)}function b(e,n){var r,i=Q(n.createElement(e)).appendTo(n.body),o=t.getDefaultComputedStyle&&(r=t.getDefaultComputedStyle(i[0]))?r.display:Q.css(i[0],"display");return i.detach(),o}function x(t){var e=K,n=Pe[t];return n||(n=b(t,e),"none"!==n&&n||(Ie=(Ie||Q("<iframe frameborder='0' width='0' height='0'/>")).appendTo(e.documentElement),e=Ie[0].contentDocument,e.write(),e.close(),n=b(t,e),Ie.detach()),Pe[t]=n),n}function w(t,e,n){var r,i,o,a,u=t.style;return n=n||$e(t),n&&(a=n.getPropertyValue(e)||n[e]),n&&(""!==a||Q.contains(t.ownerDocument,t)||(a=Q.style(t,e)),Be.test(a)&&He.test(e)&&(r=u.width,i=u.minWidth,o=u.maxWidth,u.minWidth=u.maxWidth=u.width=a,a=n.width,u.width=r,u.minWidth=i,u.maxWidth=o)),void 0!==a?a+"":a}function _(t,e){return{get:function(){return t()?void delete this.get:(this.get=e).apply(this,arguments)}}}function M(t,e){if(e in t)return e;for(var n=e[0].toUpperCase()+e.slice(1),r=e,i=Je.length;i--;)if(e=Je[i]+n,e in t)return e;return r}function k(t,e,n){var r=Ue.exec(e);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):e}function E(t,e,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===e?1:0,a=0;4>o;o+=2)"margin"===n&&(a+=Q.css(t,n+_e[o],!0,i)),r?("content"===n&&(a-=Q.css(t,"padding"+_e[o],!0,i)),"margin"!==n&&(a-=Q.css(t,"border"+_e[o]+"Width",!0,i))):(a+=Q.css(t,"padding"+_e[o],!0,i),"padding"!==n&&(a+=Q.css(t,"border"+_e[o]+"Width",!0,i)));return a}function C(t,e,n){var r=!0,i="width"===e?t.offsetWidth:t.offsetHeight,o=$e(t),a="border-box"===Q.css(t,"boxSizing",!1,o);if(0>=i||null==i){if(i=w(t,e,o),(0>i||null==i)&&(i=t.style[e]),Be.test(i))return i;r=a&&(Z.boxSizingReliable()||i===t.style[e]),i=parseFloat(i)||0}return i+E(t,e,n||(a?"border":"content"),r,o)+"px"}function S(t,e){for(var n,r,i,o=[],a=0,u=t.length;u>a;a++)r=t[a],r.style&&(o[a]=me.get(r,"olddisplay"),n=r.style.display,e?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&Me(r)&&(o[a]=me.access(r,"olddisplay",x(r.nodeName)))):(i=Me(r),"none"===n&&i||me.set(r,"olddisplay",i?n:Q.css(r,"display"))));for(a=0;u>a;a++)r=t[a],r.style&&(e&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=e?o[a]||"":"none"));return t}function T(t,e,n,r,i){return new T.prototype.init(t,e,n,r,i)}function j(){return setTimeout(function(){Ze=void 0}),Ze=Q.now()}function A(t,e){var n,r=0,i={height:t};for(e=e?1:0;4>r;r+=2-e)n=_e[r],i["margin"+n]=i["padding"+n]=t;return e&&(i.opacity=i.width=t),i}function N(t,e,n){for(var r,i=(nn[e]||[]).concat(nn["*"]),o=0,a=i.length;a>o;o++)if(r=i[o].call(n,e,t))return r}function O(t,e,n){var r,i,o,a,u,s,l,c,f=this,h={},p=t.style,d=t.nodeType&&Me(t),g=me.get(t,"fxshow");n.queue||(u=Q._queueHooks(t,"fx"),null==u.unqueued&&(u.unqueued=0,s=u.empty.fire,u.empty.fire=function(){u.unqueued||s()}),u.unqueued++,f.always(function(){f.always(function(){u.unqueued--,Q.queue(t,"fx").length||u.empty.fire()})})),1===t.nodeType&&("height"in e||"width"in e)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],l=Q.css(t,"display"),c="none"===l?me.get(t,"olddisplay")||x(t.nodeName):l,"inline"===c&&"none"===Q.css(t,"float")&&(p.display="inline-block")),n.overflow&&(p.overflow="hidden",f.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in e)if(i=e[r],Ge.exec(i)){if(delete e[r],o=o||"toggle"===i,i===(d?"hide":"show")){if("show"!==i||!g||void 0===g[r])continue;d=!0}h[r]=g&&g[r]||Q.style(t,r)}else l=void 0;if(Q.isEmptyObject(h))"inline"===("none"===l?x(t.nodeName):l)&&(p.display=l);else{g?"hidden"in g&&(d=g.hidden):g=me.access(t,"fxshow",{}),o&&(g.hidden=!d),d?Q(t).show():f.done(function(){Q(t).hide()}),f.done(function(){var e;me.remove(t,"fxshow");for(e in h)Q.style(t,e,h[e])});for(r in h)a=N(d?g[r]:0,r,f),r in g||(g[r]=a.start,d&&(a.end=a.start,a.start="width"===r||"height"===r?1:0))}}function q(t,e){var n,r,i,o,a;for(n in t)if(r=Q.camelCase(n),i=e[r],o=t[n],Q.isArray(o)&&(i=o[1],o=t[n]=o[0]),n!==r&&(t[r]=o,delete t[n]),a=Q.cssHooks[r],a&&"expand"in a){o=a.expand(o),delete t[r];for(n in o)n in t||(t[n]=o[n],e[n]=i)}else e[r]=i}function D(t,e,n){var r,i,o=0,a=en.length,u=Q.Deferred().always(function(){delete s.elem}),s=function(){if(i)return!1;for(var e=Ze||j(),n=Math.max(0,l.startTime+l.duration-e),r=n/l.duration||0,o=1-r,a=0,s=l.tweens.length;s>a;a++)l.tweens[a].run(o);return u.notifyWith(t,[l,o,n]),1>o&&s?n:(u.resolveWith(t,[l]),!1)},l=u.promise({elem:t,props:Q.extend({},e),opts:Q.extend(!0,{specialEasing:{}},n),originalProperties:e,originalOptions:n,startTime:Ze||j(),duration:n.duration,tweens:[],createTween:function(e,n){var r=Q.Tween(t,l.opts,e,n,l.opts.specialEasing[e]||l.opts.easing);
-return l.tweens.push(r),r},stop:function(e){var n=0,r=e?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return e?u.resolveWith(t,[l,e]):u.rejectWith(t,[l,e]),this}}),c=l.props;for(q(c,l.opts.specialEasing);a>o;o++)if(r=en[o].call(l,t,c,l.opts))return r;return Q.map(c,N,l),Q.isFunction(l.opts.start)&&l.opts.start.call(t,l),Q.fx.timer(Q.extend(s,{elem:t,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function L(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var r,i=0,o=e.toLowerCase().match(pe)||[];if(Q.isFunction(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(t[r]=t[r]||[]).unshift(n)):(t[r]=t[r]||[]).push(n)}}function F(t,e,n,r){function i(u){var s;return o[u]=!0,Q.each(t[u]||[],function(t,u){var l=u(e,n,r);return"string"!=typeof l||a||o[l]?a?!(s=l):void 0:(e.dataTypes.unshift(l),i(l),!1)}),s}var o={},a=t===xn;return i(e.dataTypes[0])||!o["*"]&&i("*")}function z(t,e){var n,r,i=Q.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((i[n]?t:r||(r={}))[n]=e[n]);return r&&Q.extend(!0,t,r),t}function R(t,e,n){for(var r,i,o,a,u=t.contents,s=t.dataTypes;"*"===s[0];)s.shift(),void 0===r&&(r=t.mimeType||e.getResponseHeader("Content-Type"));if(r)for(i in u)if(u[i]&&u[i].test(r)){s.unshift(i);break}if(s[0]in n)o=s[0];else{for(i in n){if(!s[0]||t.converters[i+" "+s[0]]){o=i;break}a||(a=i)}o=o||a}return o?(o!==s[0]&&s.unshift(o),n[o]):void 0}function I(t,e,n,r){var i,o,a,u,s,l={},c=t.dataTypes.slice();if(c[1])for(a in t.converters)l[a.toLowerCase()]=t.converters[a];for(o=c.shift();o;)if(t.responseFields[o]&&(n[t.responseFields[o]]=e),!s&&r&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),s=o,o=c.shift())if("*"===o)o=s;else if("*"!==s&&s!==o){if(a=l[s+" "+o]||l["* "+o],!a)for(i in l)if(u=i.split(" "),u[1]===o&&(a=l[s+" "+u[0]]||l["* "+u[0]])){a===!0?a=l[i]:l[i]!==!0&&(o=u[0],c.unshift(u[1]));break}if(a!==!0)if(a&&t["throws"])e=a(e);else try{e=a(e)}catch(f){return{state:"parsererror",error:a?f:"No conversion from "+s+" to "+o}}}return{state:"success",data:e}}function P(t,e,n,r){var i;if(Q.isArray(e))Q.each(e,function(e,i){n||En.test(t)?r(t,i):P(t+"["+("object"==typeof i?e:"")+"]",i,n,r)});else if(n||"object"!==Q.type(e))r(t,e);else for(i in e)P(t+"["+i+"]",e[i],n,r)}function H(t){return Q.isWindow(t)?t:9===t.nodeType&&t.defaultView}var B=[],$=B.slice,V=B.concat,U=B.push,W=B.indexOf,Y={},X=Y.toString,J=Y.hasOwnProperty,Z={},K=t.document,G="2.1.3",Q=function(t,e){return new Q.fn.init(t,e)},te=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,ee=/^-ms-/,ne=/-([\da-z])/gi,re=function(t,e){return e.toUpperCase()};Q.fn=Q.prototype={jquery:G,constructor:Q,selector:"",length:0,toArray:function(){return $.call(this)},get:function(t){return null!=t?0>t?this[t+this.length]:this[t]:$.call(this)},pushStack:function(t){var e=Q.merge(this.constructor(),t);return e.prevObject=this,e.context=this.context,e},each:function(t,e){return Q.each(this,t,e)},map:function(t){return this.pushStack(Q.map(this,function(e,n){return t.call(e,n,e)}))},slice:function(){return this.pushStack($.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(t){var e=this.length,n=+t+(0>t?e:0);return this.pushStack(n>=0&&e>n?[this[n]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:U,sort:B.sort,splice:B.splice},Q.extend=Q.fn.extend=function(){var t,e,n,r,i,o,a=arguments[0]||{},u=1,s=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[u]||{},u++),"object"==typeof a||Q.isFunction(a)||(a={}),u===s&&(a=this,u--);s>u;u++)if(null!=(t=arguments[u]))for(e in t)n=a[e],r=t[e],a!==r&&(l&&r&&(Q.isPlainObject(r)||(i=Q.isArray(r)))?(i?(i=!1,o=n&&Q.isArray(n)?n:[]):o=n&&Q.isPlainObject(n)?n:{},a[e]=Q.extend(l,o,r)):void 0!==r&&(a[e]=r));return a},Q.extend({expando:"jQuery"+(G+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isFunction:function(t){return"function"===Q.type(t)},isArray:Array.isArray,isWindow:function(t){return null!=t&&t===t.window},isNumeric:function(t){return!Q.isArray(t)&&t-parseFloat(t)+1>=0},isPlainObject:function(t){return"object"!==Q.type(t)||t.nodeType||Q.isWindow(t)?!1:t.constructor&&!J.call(t.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},type:function(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?Y[X.call(t)]||"object":typeof t},globalEval:function(t){var e,n=eval;t=Q.trim(t),t&&(1===t.indexOf("use strict")?(e=K.createElement("script"),e.text=t,K.head.appendChild(e).parentNode.removeChild(e)):n(t))},camelCase:function(t){return t.replace(ee,"ms-").replace(ne,re)},nodeName:function(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()},each:function(t,e,r){var i,o=0,a=t.length,u=n(t);if(r){if(u)for(;a>o&&(i=e.apply(t[o],r),i!==!1);o++);else for(o in t)if(i=e.apply(t[o],r),i===!1)break}else if(u)for(;a>o&&(i=e.call(t[o],o,t[o]),i!==!1);o++);else for(o in t)if(i=e.call(t[o],o,t[o]),i===!1)break;return t},trim:function(t){return null==t?"":(t+"").replace(te,"")},makeArray:function(t,e){var r=e||[];return null!=t&&(n(Object(t))?Q.merge(r,"string"==typeof t?[t]:t):U.call(r,t)),r},inArray:function(t,e,n){return null==e?-1:W.call(e,t,n)},merge:function(t,e){for(var n=+e.length,r=0,i=t.length;n>r;r++)t[i++]=e[r];return t.length=i,t},grep:function(t,e,n){for(var r,i=[],o=0,a=t.length,u=!n;a>o;o++)r=!e(t[o],o),r!==u&&i.push(t[o]);return i},map:function(t,e,r){var i,o=0,a=t.length,u=n(t),s=[];if(u)for(;a>o;o++)i=e(t[o],o,r),null!=i&&s.push(i);else for(o in t)i=e(t[o],o,r),null!=i&&s.push(i);return V.apply([],s)},guid:1,proxy:function(t,e){var n,r,i;return"string"==typeof e&&(n=t[e],e=t,t=n),Q.isFunction(t)?(r=$.call(arguments,2),i=function(){return t.apply(e||this,r.concat($.call(arguments)))},i.guid=t.guid=t.guid||Q.guid++,i):void 0},now:Date.now,support:Z}),Q.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(t,e){Y["[object "+e+"]"]=e.toLowerCase()});var ie=function(t){function e(t,e,n,r){var i,o,a,u,s,l,f,p,d,g;if((e?e.ownerDocument||e:P)!==O&&N(e),e=e||O,n=n||[],u=e.nodeType,"string"!=typeof t||!t||1!==u&&9!==u&&11!==u)return n;if(!r&&D){if(11!==u&&(i=ye.exec(t)))if(a=i[1]){if(9===u){if(o=e.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(e.ownerDocument&&(o=e.ownerDocument.getElementById(a))&&R(e,o)&&o.id===a)return n.push(o),n}else{if(i[2])return G.apply(n,e.getElementsByTagName(t)),n;if((a=i[3])&&w.getElementsByClassName)return G.apply(n,e.getElementsByClassName(a)),n}if(w.qsa&&(!L||!L.test(t))){if(p=f=I,d=e,g=1!==u&&t,1===u&&"object"!==e.nodeName.toLowerCase()){for(l=E(t),(f=e.getAttribute("id"))?p=f.replace(xe,"\\$&"):e.setAttribute("id",p),p="[id='"+p+"'] ",s=l.length;s--;)l[s]=p+h(l[s]);d=be.test(t)&&c(e.parentNode)||e,g=l.join(",")}if(g)try{return G.apply(n,d.querySelectorAll(g)),n}catch(v){}finally{f||e.removeAttribute("id")}}}return S(t.replace(se,"$1"),e,n,r)}function n(){function t(n,r){return e.push(n+" ")>_.cacheLength&&delete t[e.shift()],t[n+" "]=r}var e=[];return t}function r(t){return t[I]=!0,t}function i(t){var e=O.createElement("div");try{return!!t(e)}catch(n){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function o(t,e){for(var n=t.split("|"),r=t.length;r--;)_.attrHandle[n[r]]=e}function a(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||Y)-(~t.sourceIndex||Y);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function u(t){return function(e){var n=e.nodeName.toLowerCase();return"input"===n&&e.type===t}}function s(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function l(t){return r(function(e){return e=+e,r(function(n,r){for(var i,o=t([],n.length,e),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function c(t){return t&&"undefined"!=typeof t.getElementsByTagName&&t}function f(){}function h(t){for(var e=0,n=t.length,r="";n>e;e++)r+=t[e].value;return r}function p(t,e,n){var r=e.dir,i=n&&"parentNode"===r,o=B++;return e.first?function(e,n,o){for(;e=e[r];)if(1===e.nodeType||i)return t(e,n,o)}:function(e,n,a){var u,s,l=[H,o];if(a){for(;e=e[r];)if((1===e.nodeType||i)&&t(e,n,a))return!0}else for(;e=e[r];)if(1===e.nodeType||i){if(s=e[I]||(e[I]={}),(u=s[r])&&u[0]===H&&u[1]===o)return l[2]=u[2];if(s[r]=l,l[2]=t(e,n,a))return!0}}}function d(t){return t.length>1?function(e,n,r){for(var i=t.length;i--;)if(!t[i](e,n,r))return!1;return!0}:t[0]}function g(t,n,r){for(var i=0,o=n.length;o>i;i++)e(t,n[i],r);return r}function v(t,e,n,r,i){for(var o,a=[],u=0,s=t.length,l=null!=e;s>u;u++)(o=t[u])&&(!n||n(o,r,i))&&(a.push(o),l&&e.push(u));return a}function m(t,e,n,i,o,a){return i&&!i[I]&&(i=m(i)),o&&!o[I]&&(o=m(o,a)),r(function(r,a,u,s){var l,c,f,h=[],p=[],d=a.length,m=r||g(e||"*",u.nodeType?[u]:u,[]),y=!t||!r&&e?m:v(m,h,t,u,s),b=n?o||(r?t:d||i)?[]:a:y;if(n&&n(y,b,u,s),i)for(l=v(b,p),i(l,[],u,s),c=l.length;c--;)(f=l[c])&&(b[p[c]]=!(y[p[c]]=f));if(r){if(o||t){if(o){for(l=[],c=b.length;c--;)(f=b[c])&&l.push(y[c]=f);o(null,b=[],l,s)}for(c=b.length;c--;)(f=b[c])&&(l=o?te(r,f):h[c])>-1&&(r[l]=!(a[l]=f))}}else b=v(b===a?b.splice(d,b.length):b),o?o(null,a,b,s):G.apply(a,b)})}function y(t){for(var e,n,r,i=t.length,o=_.relative[t[0].type],a=o||_.relative[" "],u=o?1:0,s=p(function(t){return t===e},a,!0),l=p(function(t){return te(e,t)>-1},a,!0),c=[function(t,n,r){var i=!o&&(r||n!==T)||((e=n).nodeType?s(t,n,r):l(t,n,r));return e=null,i}];i>u;u++)if(n=_.relative[t[u].type])c=[p(d(c),n)];else{if(n=_.filter[t[u].type].apply(null,t[u].matches),n[I]){for(r=++u;i>r&&!_.relative[t[r].type];r++);return m(u>1&&d(c),u>1&&h(t.slice(0,u-1).concat({value:" "===t[u-2].type?"*":""})).replace(se,"$1"),n,r>u&&y(t.slice(u,r)),i>r&&y(t=t.slice(r)),i>r&&h(t))}c.push(n)}return d(c)}function b(t,n){var i=n.length>0,o=t.length>0,a=function(r,a,u,s,l){var c,f,h,p=0,d="0",g=r&&[],m=[],y=T,b=r||o&&_.find.TAG("*",l),x=H+=null==y?1:Math.random()||.1,w=b.length;for(l&&(T=a!==O&&a);d!==w&&null!=(c=b[d]);d++){if(o&&c){for(f=0;h=t[f++];)if(h(c,a,u)){s.push(c);break}l&&(H=x)}i&&((c=!h&&c)&&p--,r&&g.push(c))}if(p+=d,i&&d!==p){for(f=0;h=n[f++];)h(g,m,a,u);if(r){if(p>0)for(;d--;)g[d]||m[d]||(m[d]=Z.call(s));m=v(m)}G.apply(s,m),l&&!r&&m.length>0&&p+n.length>1&&e.uniqueSort(s)}return l&&(H=x,T=y),g};return i?r(a):a}var x,w,_,M,k,E,C,S,T,j,A,N,O,q,D,L,F,z,R,I="sizzle"+1*new Date,P=t.document,H=0,B=0,$=n(),V=n(),U=n(),W=function(t,e){return t===e&&(A=!0),0},Y=1<<31,X={}.hasOwnProperty,J=[],Z=J.pop,K=J.push,G=J.push,Q=J.slice,te=function(t,e){for(var n=0,r=t.length;r>n;n++)if(t[n]===e)return n;return-1},ee="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",ne="[\\x20\\t\\r\\n\\f]",re="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ie=re.replace("w","w#"),oe="\\["+ne+"*("+re+")(?:"+ne+"*([*^$|!~]?=)"+ne+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ie+"))|)"+ne+"*\\]",ae=":("+re+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+oe+")*)|.*)\\)|)",ue=new RegExp(ne+"+","g"),se=new RegExp("^"+ne+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ne+"+$","g"),le=new RegExp("^"+ne+"*,"+ne+"*"),ce=new RegExp("^"+ne+"*([>+~]|"+ne+")"+ne+"*"),fe=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),he=new RegExp(ae),pe=new RegExp("^"+ie+"$"),de={ID:new RegExp("^#("+re+")"),CLASS:new RegExp("^\\.("+re+")"),TAG:new RegExp("^("+re.replace("w","w*")+")"),ATTR:new RegExp("^"+oe),PSEUDO:new RegExp("^"+ae),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+ee+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},ge=/^(?:input|select|textarea|button)$/i,ve=/^h\d$/i,me=/^[^{]+\{\s*\[native \w/,ye=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,be=/[+~]/,xe=/'|\\/g,we=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),_e=function(t,e,n){var r="0x"+e-65536;return r!==r||n?e:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},Me=function(){N()};try{G.apply(J=Q.call(P.childNodes),P.childNodes),J[P.childNodes.length].nodeType}catch(ke){G={apply:J.length?function(t,e){K.apply(t,Q.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}w=e.support={},k=e.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return e?"HTML"!==e.nodeName:!1},N=e.setDocument=function(t){var e,n,r=t?t.ownerDocument||t:P;return r!==O&&9===r.nodeType&&r.documentElement?(O=r,q=r.documentElement,n=r.defaultView,n&&n!==n.top&&(n.addEventListener?n.addEventListener("unload",Me,!1):n.attachEvent&&n.attachEvent("onunload",Me)),D=!k(r),w.attributes=i(function(t){return t.className="i",!t.getAttribute("className")}),w.getElementsByTagName=i(function(t){return t.appendChild(r.createComment("")),!t.getElementsByTagName("*").length}),w.getElementsByClassName=me.test(r.getElementsByClassName),w.getById=i(function(t){return q.appendChild(t).id=I,!r.getElementsByName||!r.getElementsByName(I).length}),w.getById?(_.find.ID=function(t,e){if("undefined"!=typeof e.getElementById&&D){var n=e.getElementById(t);return n&&n.parentNode?[n]:[]}},_.filter.ID=function(t){var e=t.replace(we,_e);return function(t){return t.getAttribute("id")===e}}):(delete _.find.ID,_.filter.ID=function(t){var e=t.replace(we,_e);return function(t){var n="undefined"!=typeof t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}}),_.find.TAG=w.getElementsByTagName?function(t,e){return"undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t):w.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,r=[],i=0,o=e.getElementsByTagName(t);if("*"===t){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},_.find.CLASS=w.getElementsByClassName&&function(t,e){return D?e.getElementsByClassName(t):void 0},F=[],L=[],(w.qsa=me.test(r.querySelectorAll))&&(i(function(t){q.appendChild(t).innerHTML="<a id='"+I+"'></a><select id='"+I+"-\f]' msallowcapture=''><option selected=''></option></select>",t.querySelectorAll("[msallowcapture^='']").length&&L.push("[*^$]="+ne+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||L.push("\\["+ne+"*(?:value|"+ee+")"),t.querySelectorAll("[id~="+I+"-]").length||L.push("~="),t.querySelectorAll(":checked").length||L.push(":checked"),t.querySelectorAll("a#"+I+"+*").length||L.push(".#.+[+~]")}),i(function(t){var e=r.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&L.push("name"+ne+"*[*^$|!~]?="),t.querySelectorAll(":enabled").length||L.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),L.push(",.*:")})),(w.matchesSelector=me.test(z=q.matches||q.webkitMatchesSelector||q.mozMatchesSelector||q.oMatchesSelector||q.msMatchesSelector))&&i(function(t){w.disconnectedMatch=z.call(t,"div"),z.call(t,"[s!='']:x"),F.push("!=",ae)}),L=L.length&&new RegExp(L.join("|")),F=F.length&&new RegExp(F.join("|")),e=me.test(q.compareDocumentPosition),R=e||me.test(q.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},W=e?function(t,e){if(t===e)return A=!0,0;var n=!t.compareDocumentPosition-!e.compareDocumentPosition;return n?n:(n=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1,1&n||!w.sortDetached&&e.compareDocumentPosition(t)===n?t===r||t.ownerDocument===P&&R(P,t)?-1:e===r||e.ownerDocument===P&&R(P,e)?1:j?te(j,t)-te(j,e):0:4&n?-1:1)}:function(t,e){if(t===e)return A=!0,0;var n,i=0,o=t.parentNode,u=e.parentNode,s=[t],l=[e];if(!o||!u)return t===r?-1:e===r?1:o?-1:u?1:j?te(j,t)-te(j,e):0;if(o===u)return a(t,e);for(n=t;n=n.parentNode;)s.unshift(n);for(n=e;n=n.parentNode;)l.unshift(n);for(;s[i]===l[i];)i++;return i?a(s[i],l[i]):s[i]===P?-1:l[i]===P?1:0},r):O},e.matches=function(t,n){return e(t,null,null,n)},e.matchesSelector=function(t,n){if((t.ownerDocument||t)!==O&&N(t),n=n.replace(fe,"='$1']"),!(!w.matchesSelector||!D||F&&F.test(n)||L&&L.test(n)))try{var r=z.call(t,n);if(r||w.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(i){}return e(n,O,null,[t]).length>0},e.contains=function(t,e){return(t.ownerDocument||t)!==O&&N(t),R(t,e)},e.attr=function(t,e){(t.ownerDocument||t)!==O&&N(t);var n=_.attrHandle[e.toLowerCase()],r=n&&X.call(_.attrHandle,e.toLowerCase())?n(t,e,!D):void 0;return void 0!==r?r:w.attributes||!D?t.getAttribute(e):(r=t.getAttributeNode(e))&&r.specified?r.value:null},e.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},e.uniqueSort=function(t){var e,n=[],r=0,i=0;if(A=!w.detectDuplicates,j=!w.sortStable&&t.slice(0),t.sort(W),A){for(;e=t[i++];)e===t[i]&&(r=n.push(i));for(;r--;)t.splice(n[r],1)}return j=null,t},M=e.getText=function(t){var e,n="",r=0,i=t.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=M(t)}else if(3===i||4===i)return t.nodeValue}else for(;e=t[r++];)n+=M(e);return n},_=e.selectors={cacheLength:50,createPseudo:r,match:de,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(we,_e),t[3]=(t[3]||t[4]||t[5]||"").replace(we,_e),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||e.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&e.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return de.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&he.test(n)&&(e=E(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(we,_e).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=$[t+" "];return e||(e=new RegExp("(^|"+ne+")"+t+"("+ne+"|$)"))&&$(t,function(t){return e.test("string"==typeof t.className&&t.className||"undefined"!=typeof t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,n,r){return function(i){var o=e.attr(i,t);return null==o?"!="===n:n?(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o.replace(ue," ")+" ").indexOf(r)>-1:"|="===n?o===r||o.slice(0,r.length+1)===r+"-":!1):!0}},CHILD:function(t,e,n,r,i){var o="nth"!==t.slice(0,3),a="last"!==t.slice(-4),u="of-type"===e;return 1===r&&0===i?function(t){return!!t.parentNode}:function(e,n,s){var l,c,f,h,p,d,g=o!==a?"nextSibling":"previousSibling",v=e.parentNode,m=u&&e.nodeName.toLowerCase(),y=!s&&!u;if(v){if(o){for(;g;){for(f=e;f=f[g];)if(u?f.nodeName.toLowerCase()===m:1===f.nodeType)return!1;d=g="only"===t&&!d&&"nextSibling"}return!0}if(d=[a?v.firstChild:v.lastChild],a&&y){for(c=v[I]||(v[I]={}),l=c[t]||[],p=l[0]===H&&l[1],h=l[0]===H&&l[2],f=p&&v.childNodes[p];f=++p&&f&&f[g]||(h=p=0)||d.pop();)if(1===f.nodeType&&++h&&f===e){c[t]=[H,p,h];break}}else if(y&&(l=(e[I]||(e[I]={}))[t])&&l[0]===H)h=l[1];else for(;(f=++p&&f&&f[g]||(h=p=0)||d.pop())&&((u?f.nodeName.toLowerCase()!==m:1!==f.nodeType)||!++h||(y&&((f[I]||(f[I]={}))[t]=[H,h]),f!==e)););return h-=i,h===r||h%r===0&&h/r>=0}}},PSEUDO:function(t,n){var i,o=_.pseudos[t]||_.setFilters[t.toLowerCase()]||e.error("unsupported pseudo: "+t);return o[I]?o(n):o.length>1?(i=[t,t,"",n],_.setFilters.hasOwnProperty(t.toLowerCase())?r(function(t,e){for(var r,i=o(t,n),a=i.length;a--;)r=te(t,i[a]),t[r]=!(e[r]=i[a])}):function(t){return o(t,0,i)}):o}},pseudos:{not:r(function(t){var e=[],n=[],i=C(t.replace(se,"$1"));return i[I]?r(function(t,e,n,r){for(var o,a=i(t,null,r,[]),u=t.length;u--;)(o=a[u])&&(t[u]=!(e[u]=o))}):function(t,r,o){return e[0]=t,i(e,null,o,n),e[0]=null,!n.pop()}}),has:r(function(t){return function(n){return e(t,n).length>0}}),contains:r(function(t){return t=t.replace(we,_e),function(e){return(e.textContent||e.innerText||M(e)).indexOf(t)>-1}}),lang:r(function(t){return pe.test(t||"")||e.error("unsupported lang: "+t),t=t.replace(we,_e).toLowerCase(),function(e){var n;do if(n=D?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return n=n.toLowerCase(),n===t||0===n.indexOf(t+"-");while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===q},focus:function(t){return t===O.activeElement&&(!O.hasFocus||O.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return t.disabled===!1},disabled:function(t){return t.disabled===!0},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,t.selected===!0},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!_.pseudos.empty(t)},header:function(t){return ve.test(t.nodeName)},input:function(t){return ge.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:l(function(){return[0]}),last:l(function(t,e){return[e-1]}),eq:l(function(t,e,n){return[0>n?n+e:n]}),even:l(function(t,e){for(var n=0;e>n;n+=2)t.push(n);return t}),odd:l(function(t,e){for(var n=1;e>n;n+=2)t.push(n);return t}),lt:l(function(t,e,n){for(var r=0>n?n+e:n;--r>=0;)t.push(r);return t}),gt:l(function(t,e,n){for(var r=0>n?n+e:n;++r<e;)t.push(r);return t})}},_.pseudos.nth=_.pseudos.eq;for(x in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})_.pseudos[x]=u(x);for(x in{submit:!0,reset:!0})_.pseudos[x]=s(x);return f.prototype=_.filters=_.pseudos,_.setFilters=new f,E=e.tokenize=function(t,n){var r,i,o,a,u,s,l,c=V[t+" "];if(c)return n?0:c.slice(0);for(u=t,s=[],l=_.preFilter;u;){(!r||(i=le.exec(u)))&&(i&&(u=u.slice(i[0].length)||u),s.push(o=[])),r=!1,(i=ce.exec(u))&&(r=i.shift(),o.push({value:r,type:i[0].replace(se," ")}),u=u.slice(r.length));for(a in _.filter)!(i=de[a].exec(u))||l[a]&&!(i=l[a](i))||(r=i.shift(),o.push({value:r,type:a,matches:i}),u=u.slice(r.length));if(!r)break}return n?u.length:u?e.error(t):V(t,s).slice(0)},C=e.compile=function(t,e){var n,r=[],i=[],o=U[t+" "];if(!o){for(e||(e=E(t)),n=e.length;n--;)o=y(e[n]),o[I]?r.push(o):i.push(o);o=U(t,b(i,r)),o.selector=t}return o},S=e.select=function(t,e,n,r){var i,o,a,u,s,l="function"==typeof t&&t,f=!r&&E(t=l.selector||t);if(n=n||[],1===f.length){if(o=f[0]=f[0].slice(0),o.length>2&&"ID"===(a=o[0]).type&&w.getById&&9===e.nodeType&&D&&_.relative[o[1].type]){if(e=(_.find.ID(a.matches[0].replace(we,_e),e)||[])[0],!e)return n;l&&(e=e.parentNode),t=t.slice(o.shift().value.length)}for(i=de.needsContext.test(t)?0:o.length;i--&&(a=o[i],!_.relative[u=a.type]);)if((s=_.find[u])&&(r=s(a.matches[0].replace(we,_e),be.test(o[0].type)&&c(e.parentNode)||e))){if(o.splice(i,1),t=r.length&&h(o),!t)return G.apply(n,r),n;break}}return(l||C(t,f))(r,e,!D,n,be.test(t)&&c(e.parentNode)||e),n},w.sortStable=I.split("").sort(W).join("")===I,w.detectDuplicates=!!A,N(),w.sortDetached=i(function(t){return 1&t.compareDocumentPosition(O.createElement("div"))}),i(function(t){return t.innerHTML="<a href='#'></a>","#"===t.firstChild.getAttribute("href")})||o("type|href|height|width",function(t,e,n){return n?void 0:t.getAttribute(e,"type"===e.toLowerCase()?1:2)}),w.attributes&&i(function(t){return t.innerHTML="<input/>",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")})||o("value",function(t,e,n){return n||"input"!==t.nodeName.toLowerCase()?void 0:t.defaultValue}),i(function(t){return null==t.getAttribute("disabled")})||o(ee,function(t,e,n){var r;return n?void 0:t[e]===!0?e.toLowerCase():(r=t.getAttributeNode(e))&&r.specified?r.value:null}),e}(t);Q.find=ie,Q.expr=ie.selectors,Q.expr[":"]=Q.expr.pseudos,Q.unique=ie.uniqueSort,Q.text=ie.getText,Q.isXMLDoc=ie.isXML,Q.contains=ie.contains;var oe=Q.expr.match.needsContext,ae=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,ue=/^.[^:#\[\.,]*$/;Q.filter=function(t,e,n){var r=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===r.nodeType?Q.find.matchesSelector(r,t)?[r]:[]:Q.find.matches(t,Q.grep(e,function(t){return 1===t.nodeType}))},Q.fn.extend({find:function(t){var e,n=this.length,r=[],i=this;if("string"!=typeof t)return this.pushStack(Q(t).filter(function(){for(e=0;n>e;e++)if(Q.contains(i[e],this))return!0}));for(e=0;n>e;e++)Q.find(t,i[e],r);return r=this.pushStack(n>1?Q.unique(r):r),r.selector=this.selector?this.selector+" "+t:t,r},filter:function(t){return this.pushStack(r(this,t||[],!1))},not:function(t){return this.pushStack(r(this,t||[],!0))},is:function(t){return!!r(this,"string"==typeof t&&oe.test(t)?Q(t):t||[],!1).length}});var se,le=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,ce=Q.fn.init=function(t,e){var n,r;if(!t)return this;if("string"==typeof t){if(n="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:le.exec(t),!n||!n[1]&&e)return!e||e.jquery?(e||se).find(t):this.constructor(e).find(t);if(n[1]){if(e=e instanceof Q?e[0]:e,Q.merge(this,Q.parseHTML(n[1],e&&e.nodeType?e.ownerDocument||e:K,!0)),ae.test(n[1])&&Q.isPlainObject(e))for(n in e)Q.isFunction(this[n])?this[n](e[n]):this.attr(n,e[n]);return this}return r=K.getElementById(n[2]),r&&r.parentNode&&(this.length=1,this[0]=r),this.context=K,this.selector=t,this}return t.nodeType?(this.context=this[0]=t,this.length=1,this):Q.isFunction(t)?"undefined"!=typeof se.ready?se.ready(t):t(Q):(void 0!==t.selector&&(this.selector=t.selector,this.context=t.context),Q.makeArray(t,this))};ce.prototype=Q.fn,se=Q(K);var fe=/^(?:parents|prev(?:Until|All))/,he={children:!0,contents:!0,next:!0,prev:!0};Q.extend({dir:function(t,e,n){for(var r=[],i=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(i&&Q(t).is(n))break;r.push(t)}return r},sibling:function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n}}),Q.fn.extend({has:function(t){var e=Q(t,this),n=e.length;return this.filter(function(){for(var t=0;n>t;t++)if(Q.contains(this,e[t]))return!0})},closest:function(t,e){for(var n,r=0,i=this.length,o=[],a=oe.test(t)||"string"!=typeof t?Q(t,e||this.context):0;i>r;r++)for(n=this[r];n&&n!==e;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&Q.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?Q.unique(o):o)},index:function(t){return t?"string"==typeof t?W.call(Q(t),this[0]):W.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(Q.unique(Q.merge(this.get(),Q(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),Q.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return Q.dir(t,"parentNode")},parentsUntil:function(t,e,n){return Q.dir(t,"parentNode",n)},next:function(t){return i(t,"nextSibling")},prev:function(t){return i(t,"previousSibling")},nextAll:function(t){return Q.dir(t,"nextSibling")},prevAll:function(t){return Q.dir(t,"previousSibling")},nextUntil:function(t,e,n){return Q.dir(t,"nextSibling",n)},prevUntil:function(t,e,n){return Q.dir(t,"previousSibling",n)},siblings:function(t){return Q.sibling((t.parentNode||{}).firstChild,t)},children:function(t){return Q.sibling(t.firstChild)},contents:function(t){return t.contentDocument||Q.merge([],t.childNodes)}},function(t,e){Q.fn[t]=function(n,r){var i=Q.map(this,e,n);return"Until"!==t.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=Q.filter(r,i)),this.length>1&&(he[t]||Q.unique(i),fe.test(t)&&i.reverse()),this.pushStack(i)}});var pe=/\S+/g,de={};Q.Callbacks=function(t){t="string"==typeof t?de[t]||o(t):Q.extend({},t);var e,n,r,i,a,u,s=[],l=!t.once&&[],c=function(data){for(e=t.memory&&data,n=!0,u=i||0,i=0,a=s.length,r=!0;s&&a>u;u++)if(s[u].apply(data[0],data[1])===!1&&t.stopOnFalse){e=!1;break}r=!1,s&&(l?l.length&&c(l.shift()):e?s=[]:f.disable())},f={add:function(){if(s){var n=s.length;!function o(e){Q.each(e,function(e,n){var r=Q.type(n);"function"===r?t.unique&&f.has(n)||s.push(n):n&&n.length&&"string"!==r&&o(n)})}(arguments),r?a=s.length:e&&(i=n,c(e))}return this},remove:function(){return s&&Q.each(arguments,function(t,e){for(var n;(n=Q.inArray(e,s,n))>-1;)s.splice(n,1),r&&(a>=n&&a--,u>=n&&u--)}),this},has:function(t){return t?Q.inArray(t,s)>-1:!(!s||!s.length)},empty:function(){return s=[],a=0,this},disable:function(){return s=l=e=void 0,this},disabled:function(){return!s},lock:function(){return l=void 0,e||f.disable(),this},locked:function(){return!l},fireWith:function(t,e){return!s||n&&!l||(e=e||[],e=[t,e.slice?e.slice():e],r?l.push(e):c(e)),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!n}};return f},Q.extend({Deferred:function(t){var e=[["resolve","done",Q.Callbacks("once memory"),"resolved"],["reject","fail",Q.Callbacks("once memory"),"rejected"],["notify","progress",Q.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var t=arguments;return Q.Deferred(function(n){Q.each(e,function(e,o){var a=Q.isFunction(t[e])&&t[e];i[o[1]](function(){var t=a&&a.apply(this,arguments);t&&Q.isFunction(t.promise)?t.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o[0]+"With"](this===r?n.promise():this,a?[t]:arguments)})}),t=null}).promise()},promise:function(t){return null!=t?Q.extend(t,r):r}},i={};return r.pipe=r.then,Q.each(e,function(t,o){var a=o[2],u=o[3];r[o[1]]=a.add,u&&a.add(function(){n=u},e[1^t][2].disable,e[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),t&&t.call(i,i),i},when:function(t){var e,n,r,i=0,o=$.call(arguments),a=o.length,u=1!==a||t&&Q.isFunction(t.promise)?a:0,s=1===u?t:Q.Deferred(),l=function(t,n,r){return function(i){n[t]=this,r[t]=arguments.length>1?$.call(arguments):i,r===e?s.notifyWith(n,r):--u||s.resolveWith(n,r)}};if(a>1)for(e=new Array(a),n=new Array(a),r=new Array(a);a>i;i++)o[i]&&Q.isFunction(o[i].promise)?o[i].promise().done(l(i,r,o)).fail(s.reject).progress(l(i,n,e)):--u;return u||s.resolveWith(r,o),s.promise()}});var ge;Q.fn.ready=function(t){return Q.ready.promise().done(t),this},Q.extend({isReady:!1,readyWait:1,holdReady:function(t){t?Q.readyWait++:Q.ready(!0)},ready:function(t){(t===!0?--Q.readyWait:Q.isReady)||(Q.isReady=!0,t!==!0&&--Q.readyWait>0||(ge.resolveWith(K,[Q]),Q.fn.triggerHandler&&(Q(K).triggerHandler("ready"),Q(K).off("ready"))))}}),Q.ready.promise=function(e){return ge||(ge=Q.Deferred(),"complete"===K.readyState?setTimeout(Q.ready):(K.addEventListener("DOMContentLoaded",a,!1),t.addEventListener("load",a,!1))),ge.promise(e)},Q.ready.promise();var ve=Q.access=function(t,e,n,r,i,o,a){var u=0,s=t.length,l=null==n;if("object"===Q.type(n)){i=!0;for(u in n)Q.access(t,e,u,n[u],!0,o,a)}else if(void 0!==r&&(i=!0,Q.isFunction(r)||(a=!0),l&&(a?(e.call(t,r),e=null):(l=e,e=function(t,e,n){return l.call(Q(t),n)})),e))for(;s>u;u++)e(t[u],n,a?r:r.call(t[u],u,e(t[u],n)));return i?t:l?e.call(t):s?e(t[0],n):o};Q.acceptData=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType},u.uid=1,u.accepts=Q.acceptData,u.prototype={key:function(t){if(!u.accepts(t))return 0;var e={},n=t[this.expando];if(!n){n=u.uid++;try{e[this.expando]={value:n},Object.defineProperties(t,e)}catch(r){e[this.expando]=n,Q.extend(t,e)}}return this.cache[n]||(this.cache[n]={}),n
-},set:function(t,data,e){var n,r=this.key(t),i=this.cache[r];if("string"==typeof data)i[data]=e;else if(Q.isEmptyObject(i))Q.extend(this.cache[r],data);else for(n in data)i[n]=data[n];return i},get:function(t,e){var n=this.cache[this.key(t)];return void 0===e?n:n[e]},access:function(t,e,n){var r;return void 0===e||e&&"string"==typeof e&&void 0===n?(r=this.get(t,e),void 0!==r?r:this.get(t,Q.camelCase(e))):(this.set(t,e,n),void 0!==n?n:e)},remove:function(t,e){var n,r,i,o=this.key(t),a=this.cache[o];if(void 0===e)this.cache[o]={};else{Q.isArray(e)?r=e.concat(e.map(Q.camelCase)):(i=Q.camelCase(e),e in a?r=[e,i]:(r=i,r=r in a?[r]:r.match(pe)||[])),n=r.length;for(;n--;)delete a[r[n]]}},hasData:function(t){return!Q.isEmptyObject(this.cache[t[this.expando]]||{})},discard:function(t){t[this.expando]&&delete this.cache[t[this.expando]]}};var me=new u,ye=new u,be=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,xe=/([A-Z])/g;Q.extend({hasData:function(t){return ye.hasData(t)||me.hasData(t)},data:function(t,e,data){return ye.access(t,e,data)},removeData:function(t,e){ye.remove(t,e)},_data:function(t,e,data){return me.access(t,e,data)},_removeData:function(t,e){me.remove(t,e)}}),Q.fn.extend({data:function(t,e){var n,r,data,i=this[0],o=i&&i.attributes;if(void 0===t){if(this.length&&(data=ye.get(i),1===i.nodeType&&!me.get(i,"hasDataAttrs"))){for(n=o.length;n--;)o[n]&&(r=o[n].name,0===r.indexOf("data-")&&(r=Q.camelCase(r.slice(5)),s(i,r,data[r])));me.set(i,"hasDataAttrs",!0)}return data}return"object"==typeof t?this.each(function(){ye.set(this,t)}):ve(this,function(e){var data,n=Q.camelCase(t);if(i&&void 0===e){if(data=ye.get(i,t),void 0!==data)return data;if(data=ye.get(i,n),void 0!==data)return data;if(data=s(i,n,void 0),void 0!==data)return data}else this.each(function(){var data=ye.get(this,n);ye.set(this,n,e),-1!==t.indexOf("-")&&void 0!==data&&ye.set(this,t,e)})},null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each(function(){ye.remove(this,t)})}}),Q.extend({queue:function(t,e,data){var n;return t?(e=(e||"fx")+"queue",n=me.get(t,e),data&&(!n||Q.isArray(data)?n=me.access(t,e,Q.makeArray(data)):n.push(data)),n||[]):void 0},dequeue:function(t,e){e=e||"fx";var n=Q.queue(t,e),r=n.length,i=n.shift(),o=Q._queueHooks(t,e),a=function(){Q.dequeue(t,e)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===e&&n.unshift("inprogress"),delete o.stop,i.call(t,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return me.get(t,n)||me.access(t,n,{empty:Q.Callbacks("once memory").add(function(){me.remove(t,[e+"queue",n])})})}}),Q.fn.extend({queue:function(t,data){var e=2;return"string"!=typeof t&&(data=t,t="fx",e--),arguments.length<e?Q.queue(this[0],t):void 0===data?this:this.each(function(){var e=Q.queue(this,t,data);Q._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&Q.dequeue(this,t)})},dequeue:function(t){return this.each(function(){Q.dequeue(this,t)})},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var n,r=1,i=Q.Deferred(),o=this,a=this.length,u=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";a--;)n=me.get(o[a],t+"queueHooks"),n&&n.empty&&(r++,n.empty.add(u));return u(),i.promise(e)}});var we=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,_e=["Top","Right","Bottom","Left"],Me=function(t,e){return t=e||t,"none"===Q.css(t,"display")||!Q.contains(t.ownerDocument,t)},ke=/^(?:checkbox|radio)$/i;!function(){var t=K.createDocumentFragment(),e=t.appendChild(K.createElement("div")),n=K.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),e.appendChild(n),Z.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="<textarea>x</textarea>",Z.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var Ee="undefined";Z.focusinBubbles="onfocusin"in t;var Ce=/^key/,Se=/^(?:mouse|pointer|contextmenu)|click/,Te=/^(?:focusinfocus|focusoutblur)$/,je=/^([^.]*)(?:\.(.+)|)$/;Q.event={global:{},add:function(t,e,n,data,r){var i,o,a,u,s,l,c,f,h,p,d,g=me.get(t);if(g)for(n.handler&&(i=n,n=i.handler,r=i.selector),n.guid||(n.guid=Q.guid++),(u=g.events)||(u=g.events={}),(o=g.handle)||(o=g.handle=function(e){return typeof Q!==Ee&&Q.event.triggered!==e.type?Q.event.dispatch.apply(t,arguments):void 0}),e=(e||"").match(pe)||[""],s=e.length;s--;)a=je.exec(e[s])||[],h=d=a[1],p=(a[2]||"").split(".").sort(),h&&(c=Q.event.special[h]||{},h=(r?c.delegateType:c.bindType)||h,c=Q.event.special[h]||{},l=Q.extend({type:h,origType:d,data:data,handler:n,guid:n.guid,selector:r,needsContext:r&&Q.expr.match.needsContext.test(r),namespace:p.join(".")},i),(f=u[h])||(f=u[h]=[],f.delegateCount=0,c.setup&&c.setup.call(t,data,p,o)!==!1||t.addEventListener&&t.addEventListener(h,o,!1)),c.add&&(c.add.call(t,l),l.handler.guid||(l.handler.guid=n.guid)),r?f.splice(f.delegateCount++,0,l):f.push(l),Q.event.global[h]=!0)},remove:function(t,e,n,r,i){var o,a,u,s,l,c,f,h,p,d,g,v=me.hasData(t)&&me.get(t);if(v&&(s=v.events)){for(e=(e||"").match(pe)||[""],l=e.length;l--;)if(u=je.exec(e[l])||[],p=g=u[1],d=(u[2]||"").split(".").sort(),p){for(f=Q.event.special[p]||{},p=(r?f.delegateType:f.bindType)||p,h=s[p]||[],u=u[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=h.length;o--;)c=h[o],!i&&g!==c.origType||n&&n.guid!==c.guid||u&&!u.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(h.splice(o,1),c.selector&&h.delegateCount--,f.remove&&f.remove.call(t,c));a&&!h.length&&(f.teardown&&f.teardown.call(t,d,v.handle)!==!1||Q.removeEvent(t,p,v.handle),delete s[p])}else for(p in s)Q.event.remove(t,p+e[l],n,r,!0);Q.isEmptyObject(s)&&(delete v.handle,me.remove(t,"events"))}},trigger:function(e,data,n,r){var i,o,a,u,s,l,c,f=[n||K],h=J.call(e,"type")?e.type:e,p=J.call(e,"namespace")?e.namespace.split("."):[];if(o=a=n=n||K,3!==n.nodeType&&8!==n.nodeType&&!Te.test(h+Q.event.triggered)&&(h.indexOf(".")>=0&&(p=h.split("."),h=p.shift(),p.sort()),s=h.indexOf(":")<0&&"on"+h,e=e[Q.expando]?e:new Q.Event(h,"object"==typeof e&&e),e.isTrigger=r?2:3,e.namespace=p.join("."),e.namespace_re=e.namespace?new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),data=null==data?[e]:Q.makeArray(data,[e]),c=Q.event.special[h]||{},r||!c.trigger||c.trigger.apply(n,data)!==!1)){if(!r&&!c.noBubble&&!Q.isWindow(n)){for(u=c.delegateType||h,Te.test(u+h)||(o=o.parentNode);o;o=o.parentNode)f.push(o),a=o;a===(n.ownerDocument||K)&&f.push(a.defaultView||a.parentWindow||t)}for(i=0;(o=f[i++])&&!e.isPropagationStopped();)e.type=i>1?u:c.bindType||h,l=(me.get(o,"events")||{})[e.type]&&me.get(o,"handle"),l&&l.apply(o,data),l=s&&o[s],l&&l.apply&&Q.acceptData(o)&&(e.result=l.apply(o,data),e.result===!1&&e.preventDefault());return e.type=h,r||e.isDefaultPrevented()||c._default&&c._default.apply(f.pop(),data)!==!1||!Q.acceptData(n)||s&&Q.isFunction(n[h])&&!Q.isWindow(n)&&(a=n[s],a&&(n[s]=null),Q.event.triggered=h,n[h](),Q.event.triggered=void 0,a&&(n[s]=a)),e.result}},dispatch:function(t){t=Q.event.fix(t);var e,n,r,i,o,a=[],u=$.call(arguments),s=(me.get(this,"events")||{})[t.type]||[],l=Q.event.special[t.type]||{};if(u[0]=t,t.delegateTarget=this,!l.preDispatch||l.preDispatch.call(this,t)!==!1){for(a=Q.event.handlers.call(this,t,s),e=0;(i=a[e++])&&!t.isPropagationStopped();)for(t.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!t.isImmediatePropagationStopped();)(!t.namespace_re||t.namespace_re.test(o.namespace))&&(t.handleObj=o,t.data=o.data,r=((Q.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,u),void 0!==r&&(t.result=r)===!1&&(t.preventDefault(),t.stopPropagation()));return l.postDispatch&&l.postDispatch.call(this,t),t.result}},handlers:function(t,e){var n,r,i,o,a=[],u=e.delegateCount,s=t.target;if(u&&s.nodeType&&(!t.button||"click"!==t.type))for(;s!==this;s=s.parentNode||this)if(s.disabled!==!0||"click"!==t.type){for(r=[],n=0;u>n;n++)o=e[n],i=o.selector+" ",void 0===r[i]&&(r[i]=o.needsContext?Q(i,this).index(s)>=0:Q.find(i,this,null,[s]).length),r[i]&&r.push(o);r.length&&a.push({elem:s,handlers:r})}return u<e.length&&a.push({elem:this,handlers:e.slice(u)}),a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(t,e){return null==t.which&&(t.which=null!=e.charCode?e.charCode:e.keyCode),t}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(t,e){var n,r,i,o=e.button;return null==t.pageX&&null!=e.clientX&&(n=t.target.ownerDocument||K,r=n.documentElement,i=n.body,t.pageX=e.clientX+(r&&r.scrollLeft||i&&i.scrollLeft||0)-(r&&r.clientLeft||i&&i.clientLeft||0),t.pageY=e.clientY+(r&&r.scrollTop||i&&i.scrollTop||0)-(r&&r.clientTop||i&&i.clientTop||0)),t.which||void 0===o||(t.which=1&o?1:2&o?3:4&o?2:0),t}},fix:function(t){if(t[Q.expando])return t;var e,n,r,i=t.type,o=t,a=this.fixHooks[i];for(a||(this.fixHooks[i]=a=Se.test(i)?this.mouseHooks:Ce.test(i)?this.keyHooks:{}),r=a.props?this.props.concat(a.props):this.props,t=new Q.Event(o),e=r.length;e--;)n=r[e],t[n]=o[n];return t.target||(t.target=K),3===t.target.nodeType&&(t.target=t.target.parentNode),a.filter?a.filter(t,o):t},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==f()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===f()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&Q.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(t){return Q.nodeName(t.target,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}},simulate:function(t,e,n,r){var i=Q.extend(new Q.Event,n,{type:t,isSimulated:!0,originalEvent:{}});r?Q.event.trigger(i,null,e):Q.event.dispatch.call(e,i),i.isDefaultPrevented()&&n.preventDefault()}},Q.removeEvent=function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n,!1)},Q.Event=function(t,e){return this instanceof Q.Event?(t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&t.returnValue===!1?l:c):this.type=t,e&&Q.extend(this,e),this.timeStamp=t&&t.timeStamp||Q.now(),void(this[Q.expando]=!0)):new Q.Event(t,e)},Q.Event.prototype={isDefaultPrevented:c,isPropagationStopped:c,isImmediatePropagationStopped:c,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=l,t&&t.preventDefault&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=l,t&&t.stopPropagation&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=l,t&&t.stopImmediatePropagation&&t.stopImmediatePropagation(),this.stopPropagation()}},Q.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(t,e){Q.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,r=this,i=t.relatedTarget,o=t.handleObj;return(!i||i!==r&&!Q.contains(r,i))&&(t.type=o.origType,n=o.handler.apply(this,arguments),t.type=e),n}}}),Z.focusinBubbles||Q.each({focus:"focusin",blur:"focusout"},function(t,e){var n=function(t){Q.event.simulate(e,t.target,Q.event.fix(t),!0)};Q.event.special[e]={setup:function(){var r=this.ownerDocument||this,i=me.access(r,e);i||r.addEventListener(t,n,!0),me.access(r,e,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=me.access(r,e)-1;i?me.access(r,e,i):(r.removeEventListener(t,n,!0),me.remove(r,e))}}}),Q.fn.extend({on:function(t,e,data,n,r){var i,o;if("object"==typeof t){"string"!=typeof e&&(data=data||e,e=void 0);for(o in t)this.on(o,e,data,t[o],r);return this}if(null==data&&null==n?(n=e,data=e=void 0):null==n&&("string"==typeof e?(n=data,data=void 0):(n=data,data=e,e=void 0)),n===!1)n=c;else if(!n)return this;return 1===r&&(i=n,n=function(t){return Q().off(t),i.apply(this,arguments)},n.guid=i.guid||(i.guid=Q.guid++)),this.each(function(){Q.event.add(this,t,n,data,e)})},one:function(t,e,data,n){return this.on(t,e,data,n,1)},off:function(t,e,n){var r,i;if(t&&t.preventDefault&&t.handleObj)return r=t.handleObj,Q(t.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof t){for(i in t)this.off(i,e,t[i]);return this}return(e===!1||"function"==typeof e)&&(n=e,e=void 0),n===!1&&(n=c),this.each(function(){Q.event.remove(this,t,n,e)})},trigger:function(t,data){return this.each(function(){Q.event.trigger(t,data,this)})},triggerHandler:function(t,data){var e=this[0];return e?Q.event.trigger(t,data,e,!0):void 0}});var Ae=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Ne=/<([\w:]+)/,Oe=/<|&#?\w+;/,qe=/<(?:script|style|link)/i,De=/checked\s*(?:[^=]|=\s*.checked.)/i,Le=/^$|\/(?:java|ecma)script/i,Fe=/^true\/(.*)/,ze=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Re={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};Re.optgroup=Re.option,Re.tbody=Re.tfoot=Re.colgroup=Re.caption=Re.thead,Re.th=Re.td,Q.extend({clone:function(t,e,n){var r,i,o,a,u=t.cloneNode(!0),s=Q.contains(t.ownerDocument,t);if(!(Z.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||Q.isXMLDoc(t)))for(a=m(u),o=m(t),r=0,i=o.length;i>r;r++)y(o[r],a[r]);if(e)if(n)for(o=o||m(t),a=a||m(u),r=0,i=o.length;i>r;r++)v(o[r],a[r]);else v(t,u);return a=m(u,"script"),a.length>0&&g(a,!s&&m(t,"script")),u},buildFragment:function(t,e,n,r){for(var i,o,a,u,s,l,c=e.createDocumentFragment(),f=[],h=0,p=t.length;p>h;h++)if(i=t[h],i||0===i)if("object"===Q.type(i))Q.merge(f,i.nodeType?[i]:i);else if(Oe.test(i)){for(o=o||c.appendChild(e.createElement("div")),a=(Ne.exec(i)||["",""])[1].toLowerCase(),u=Re[a]||Re._default,o.innerHTML=u[1]+i.replace(Ae,"<$1></$2>")+u[2],l=u[0];l--;)o=o.lastChild;Q.merge(f,o.childNodes),o=c.firstChild,o.textContent=""}else f.push(e.createTextNode(i));for(c.textContent="",h=0;i=f[h++];)if((!r||-1===Q.inArray(i,r))&&(s=Q.contains(i.ownerDocument,i),o=m(c.appendChild(i),"script"),s&&g(o),n))for(l=0;i=o[l++];)Le.test(i.type||"")&&n.push(i);return c},cleanData:function(t){for(var data,e,n,r,i=Q.event.special,o=0;void 0!==(e=t[o]);o++){if(Q.acceptData(e)&&(r=e[me.expando],r&&(data=me.cache[r]))){if(data.events)for(n in data.events)i[n]?Q.event.remove(e,n):Q.removeEvent(e,n,data.handle);me.cache[r]&&delete me.cache[r]}delete ye.cache[e[ye.expando]]}}}),Q.fn.extend({text:function(t){return ve(this,function(t){return void 0===t?Q.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=t)})},null,t,arguments.length)},append:function(){return this.domManip(arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=h(this,t);e.appendChild(t)}})},prepend:function(){return this.domManip(arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=h(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return this.domManip(arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return this.domManip(arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},remove:function(t,e){for(var n,r=t?Q.filter(t,this):this,i=0;null!=(n=r[i]);i++)e||1!==n.nodeType||Q.cleanData(m(n)),n.parentNode&&(e&&Q.contains(n.ownerDocument,n)&&g(m(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(Q.cleanData(m(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null==t?!1:t,e=null==e?t:e,this.map(function(){return Q.clone(this,t,e)})},html:function(t){return ve(this,function(t){var e=this[0]||{},n=0,r=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!qe.test(t)&&!Re[(Ne.exec(t)||["",""])[1].toLowerCase()]){t=t.replace(Ae,"<$1></$2>");try{for(;r>n;n++)e=this[n]||{},1===e.nodeType&&(Q.cleanData(m(e,!1)),e.innerHTML=t);e=0}catch(i){}}e&&this.empty().append(t)},null,t,arguments.length)},replaceWith:function(){var t=arguments[0];return this.domManip(arguments,function(e){t=this.parentNode,Q.cleanData(m(this)),t&&t.replaceChild(e,this)}),t&&(t.length||t.nodeType)?this:this.remove()},detach:function(t){return this.remove(t,!0)},domManip:function(t,e){t=V.apply([],t);var n,r,i,o,a,u,s=0,l=this.length,c=this,f=l-1,h=t[0],g=Q.isFunction(h);if(g||l>1&&"string"==typeof h&&!Z.checkClone&&De.test(h))return this.each(function(n){var r=c.eq(n);g&&(t[0]=h.call(this,n,r.html())),r.domManip(t,e)});if(l&&(n=Q.buildFragment(t,this[0].ownerDocument,!1,this),r=n.firstChild,1===n.childNodes.length&&(n=r),r)){for(i=Q.map(m(n,"script"),p),o=i.length;l>s;s++)a=n,s!==f&&(a=Q.clone(a,!0,!0),o&&Q.merge(i,m(a,"script"))),e.call(this[s],a,s);if(o)for(u=i[i.length-1].ownerDocument,Q.map(i,d),s=0;o>s;s++)a=i[s],Le.test(a.type||"")&&!me.access(a,"globalEval")&&Q.contains(u,a)&&(a.src?Q._evalUrl&&Q._evalUrl(a.src):Q.globalEval(a.textContent.replace(ze,"")))}return this}}),Q.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(t,e){Q.fn[t]=function(t){for(var n,r=[],i=Q(t),o=i.length-1,a=0;o>=a;a++)n=a===o?this:this.clone(!0),Q(i[a])[e](n),U.apply(r,n.get());return this.pushStack(r)}});var Ie,Pe={},He=/^margin/,Be=new RegExp("^("+we+")(?!px)[a-z%]+$","i"),$e=function(e){return e.ownerDocument.defaultView.opener?e.ownerDocument.defaultView.getComputedStyle(e,null):t.getComputedStyle(e,null)};!function(){function e(){a.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",a.innerHTML="",i.appendChild(o);var e=t.getComputedStyle(a,null);n="1%"!==e.top,r="4px"===e.width,i.removeChild(o)}var n,r,i=K.documentElement,o=K.createElement("div"),a=K.createElement("div");a.style&&(a.style.backgroundClip="content-box",a.cloneNode(!0).style.backgroundClip="",Z.clearCloneStyle="content-box"===a.style.backgroundClip,o.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",o.appendChild(a),t.getComputedStyle&&Q.extend(Z,{pixelPosition:function(){return e(),n},boxSizingReliable:function(){return null==r&&e(),r},reliableMarginRight:function(){var e,n=a.appendChild(K.createElement("div"));return n.style.cssText=a.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",n.style.marginRight=n.style.width="0",a.style.width="1px",i.appendChild(o),e=!parseFloat(t.getComputedStyle(n,null).marginRight),i.removeChild(o),a.removeChild(n),e}}))}(),Q.swap=function(t,e,n,r){var i,o,a={};for(o in e)a[o]=t.style[o],t.style[o]=e[o];i=n.apply(t,r||[]);for(o in e)t.style[o]=a[o];return i};var Ve=/^(none|table(?!-c[ea]).+)/,Ue=new RegExp("^("+we+")(.*)$","i"),We=new RegExp("^([+-])=("+we+")","i"),Ye={position:"absolute",visibility:"hidden",display:"block"},Xe={letterSpacing:"0",fontWeight:"400"},Je=["Webkit","O","Moz","ms"];Q.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=w(t,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(t,e,n,r){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var i,o,a,u=Q.camelCase(e),s=t.style;return e=Q.cssProps[u]||(Q.cssProps[u]=M(s,u)),a=Q.cssHooks[e]||Q.cssHooks[u],void 0===n?a&&"get"in a&&void 0!==(i=a.get(t,!1,r))?i:s[e]:(o=typeof n,"string"===o&&(i=We.exec(n))&&(n=(i[1]+1)*i[2]+parseFloat(Q.css(t,e)),o="number"),null!=n&&n===n&&("number"!==o||Q.cssNumber[u]||(n+="px"),Z.clearCloneStyle||""!==n||0!==e.indexOf("background")||(s[e]="inherit"),a&&"set"in a&&void 0===(n=a.set(t,n,r))||(s[e]=n)),void 0)}},css:function(t,e,n,r){var i,o,a,u=Q.camelCase(e);return e=Q.cssProps[u]||(Q.cssProps[u]=M(t.style,u)),a=Q.cssHooks[e]||Q.cssHooks[u],a&&"get"in a&&(i=a.get(t,!0,n)),void 0===i&&(i=w(t,e,r)),"normal"===i&&e in Xe&&(i=Xe[e]),""===n||n?(o=parseFloat(i),n===!0||Q.isNumeric(o)?o||0:i):i}}),Q.each(["height","width"],function(t,e){Q.cssHooks[e]={get:function(t,n,r){return n?Ve.test(Q.css(t,"display"))&&0===t.offsetWidth?Q.swap(t,Ye,function(){return C(t,e,r)}):C(t,e,r):void 0},set:function(t,n,r){var i=r&&$e(t);return k(t,n,r?E(t,e,r,"border-box"===Q.css(t,"boxSizing",!1,i),i):0)}}}),Q.cssHooks.marginRight=_(Z.reliableMarginRight,function(t,e){return e?Q.swap(t,{display:"inline-block"},w,[t,"marginRight"]):void 0}),Q.each({margin:"",padding:"",border:"Width"},function(t,e){Q.cssHooks[t+e]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];4>r;r++)i[t+_e[r]+e]=o[r]||o[r-2]||o[0];return i}},He.test(t)||(Q.cssHooks[t+e].set=k)}),Q.fn.extend({css:function(t,e){return ve(this,function(t,e,n){var r,i,o={},a=0;if(Q.isArray(e)){for(r=$e(t),i=e.length;i>a;a++)o[e[a]]=Q.css(t,e[a],!1,r);return o}return void 0!==n?Q.style(t,e,n):Q.css(t,e)},t,e,arguments.length>1)},show:function(){return S(this,!0)},hide:function(){return S(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each(function(){Me(this)?Q(this).show():Q(this).hide()})}}),Q.Tween=T,T.prototype={constructor:T,init:function(t,e,n,r,i,o){this.elem=t,this.prop=n,this.easing=i||"swing",this.options=e,this.start=this.now=this.cur(),this.end=r,this.unit=o||(Q.cssNumber[n]?"":"px")},cur:function(){var t=T.propHooks[this.prop];return t&&t.get?t.get(this):T.propHooks._default.get(this)},run:function(t){var e,n=T.propHooks[this.prop];return this.pos=e=this.options.duration?Q.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):T.propHooks._default.set(this),this}},T.prototype.init.prototype=T.prototype,T.propHooks={_default:{get:function(t){var e;return null==t.elem[t.prop]||t.elem.style&&null!=t.elem.style[t.prop]?(e=Q.css(t.elem,t.prop,""),e&&"auto"!==e?e:0):t.elem[t.prop]},set:function(t){Q.fx.step[t.prop]?Q.fx.step[t.prop](t):t.elem.style&&(null!=t.elem.style[Q.cssProps[t.prop]]||Q.cssHooks[t.prop])?Q.style(t.elem,t.prop,t.now+t.unit):t.elem[t.prop]=t.now}}},T.propHooks.scrollTop=T.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},Q.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2}},Q.fx=T.prototype.init,Q.fx.step={};var Ze,Ke,Ge=/^(?:toggle|show|hide)$/,Qe=new RegExp("^(?:([+-])=|)("+we+")([a-z%]*)$","i"),tn=/queueHooks$/,en=[O],nn={"*":[function(t,e){var n=this.createTween(t,e),r=n.cur(),i=Qe.exec(e),o=i&&i[3]||(Q.cssNumber[t]?"":"px"),a=(Q.cssNumber[t]||"px"!==o&&+r)&&Qe.exec(Q.css(n.elem,t)),u=1,s=20;if(a&&a[3]!==o){o=o||a[3],i=i||[],a=+r||1;do u=u||".5",a/=u,Q.style(n.elem,t,a+o);while(u!==(u=n.cur()/r)&&1!==u&&--s)}return i&&(a=n.start=+a||+r||0,n.unit=o,n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]),n}]};Q.Animation=Q.extend(D,{tweener:function(t,e){Q.isFunction(t)?(e=t,t=["*"]):t=t.split(" ");for(var n,r=0,i=t.length;i>r;r++)n=t[r],nn[n]=nn[n]||[],nn[n].unshift(e)},prefilter:function(t,e){e?en.unshift(t):en.push(t)}}),Q.speed=function(t,e,n){var r=t&&"object"==typeof t?Q.extend({},t):{complete:n||!n&&e||Q.isFunction(t)&&t,duration:t,easing:n&&e||e&&!Q.isFunction(e)&&e};return r.duration=Q.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in Q.fx.speeds?Q.fx.speeds[r.duration]:Q.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){Q.isFunction(r.old)&&r.old.call(this),r.queue&&Q.dequeue(this,r.queue)},r},Q.fn.extend({fadeTo:function(t,e,n,r){return this.filter(Me).css("opacity",0).show().end().animate({opacity:e},t,n,r)},animate:function(t,e,n,r){var i=Q.isEmptyObject(t),o=Q.speed(e,n,r),a=function(){var e=D(this,Q.extend({},t),o);(i||me.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(t,e,n){var r=function(t){var e=t.stop;delete t.stop,e(n)};return"string"!=typeof t&&(n=e,e=t,t=void 0),e&&t!==!1&&this.queue(t||"fx",[]),this.each(function(){var e=!0,i=null!=t&&t+"queueHooks",o=Q.timers,data=me.get(this);if(i)data[i]&&data[i].stop&&r(data[i]);else for(i in data)data[i]&&data[i].stop&&tn.test(i)&&r(data[i]);for(i=o.length;i--;)o[i].elem!==this||null!=t&&o[i].queue!==t||(o[i].anim.stop(n),e=!1,o.splice(i,1));(e||!n)&&Q.dequeue(this,t)})},finish:function(t){return t!==!1&&(t=t||"fx"),this.each(function(){var e,data=me.get(this),n=data[t+"queue"],r=data[t+"queueHooks"],i=Q.timers,o=n?n.length:0;for(data.finish=!0,Q.queue(this,t,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===t&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;o>e;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete data.finish})}}),Q.each(["toggle","show","hide"],function(t,e){var n=Q.fn[e];Q.fn[e]=function(t,r,i){return null==t||"boolean"==typeof t?n.apply(this,arguments):this.animate(A(e,!0),t,r,i)}}),Q.each({slideDown:A("show"),slideUp:A("hide"),slideToggle:A("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(t,e){Q.fn[t]=function(t,n,r){return this.animate(e,t,n,r)}}),Q.timers=[],Q.fx.tick=function(){var t,e=0,n=Q.timers;for(Ze=Q.now();e<n.length;e++)t=n[e],t()||n[e]!==t||n.splice(e--,1);n.length||Q.fx.stop(),Ze=void 0},Q.fx.timer=function(t){Q.timers.push(t),t()?Q.fx.start():Q.timers.pop()},Q.fx.interval=13,Q.fx.start=function(){Ke||(Ke=setInterval(Q.fx.tick,Q.fx.interval))},Q.fx.stop=function(){clearInterval(Ke),Ke=null},Q.fx.speeds={slow:600,fast:200,_default:400},Q.fn.delay=function(t,e){return t=Q.fx?Q.fx.speeds[t]||t:t,e=e||"fx",this.queue(e,function(e,n){var r=setTimeout(e,t);n.stop=function(){clearTimeout(r)}})},function(){var t=K.createElement("input"),e=K.createElement("select"),n=e.appendChild(K.createElement("option"));t.type="checkbox",Z.checkOn=""!==t.value,Z.optSelected=n.selected,e.disabled=!0,Z.optDisabled=!n.disabled,t=K.createElement("input"),t.value="t",t.type="radio",Z.radioValue="t"===t.value}();var rn,on,an=Q.expr.attrHandle;Q.fn.extend({attr:function(t,e){return ve(this,Q.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each(function(){Q.removeAttr(this,t)})}}),Q.extend({attr:function(t,e,n){var r,i,o=t.nodeType;if(t&&3!==o&&8!==o&&2!==o)return typeof t.getAttribute===Ee?Q.prop(t,e,n):(1===o&&Q.isXMLDoc(t)||(e=e.toLowerCase(),r=Q.attrHooks[e]||(Q.expr.match.bool.test(e)?on:rn)),void 0===n?r&&"get"in r&&null!==(i=r.get(t,e))?i:(i=Q.find.attr(t,e),null==i?void 0:i):null!==n?r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:(t.setAttribute(e,n+""),n):void Q.removeAttr(t,e))},removeAttr:function(t,e){var n,r,i=0,o=e&&e.match(pe);if(o&&1===t.nodeType)for(;n=o[i++];)r=Q.propFix[n]||n,Q.expr.match.bool.test(n)&&(t[r]=!1),t.removeAttribute(n)},attrHooks:{type:{set:function(t,e){if(!Z.radioValue&&"radio"===e&&Q.nodeName(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}}}),on={set:function(t,e,n){return e===!1?Q.removeAttr(t,n):t.setAttribute(n,n),n}},Q.each(Q.expr.match.bool.source.match(/\w+/g),function(t,e){var n=an[e]||Q.find.attr;an[e]=function(t,e,r){var i,o;return r||(o=an[e],an[e]=i,i=null!=n(t,e,r)?e.toLowerCase():null,an[e]=o),i}});var un=/^(?:input|select|textarea|button)$/i;Q.fn.extend({prop:function(t,e){return ve(this,Q.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each(function(){delete this[Q.propFix[t]||t]})}}),Q.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(t,e,n){var r,i,o,a=t.nodeType;if(t&&3!==a&&8!==a&&2!==a)return o=1!==a||!Q.isXMLDoc(t),o&&(e=Q.propFix[e]||e,i=Q.propHooks[e]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:t[e]=n:i&&"get"in i&&null!==(r=i.get(t,e))?r:t[e]},propHooks:{tabIndex:{get:function(t){return t.hasAttribute("tabindex")||un.test(t.nodeName)||t.href?t.tabIndex:-1}}}}),Z.optSelected||(Q.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null}}),Q.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){Q.propFix[this.toLowerCase()]=this});var sn=/[\t\r\n\f]/g;Q.fn.extend({addClass:function(t){var e,n,r,i,o,a,u="string"==typeof t&&t,s=0,l=this.length;if(Q.isFunction(t))return this.each(function(e){Q(this).addClass(t.call(this,e,this.className))});if(u)for(e=(t||"").match(pe)||[];l>s;s++)if(n=this[s],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(sn," "):" ")){for(o=0;i=e[o++];)r.indexOf(" "+i+" ")<0&&(r+=i+" ");a=Q.trim(r),n.className!==a&&(n.className=a)}return this},removeClass:function(t){var e,n,r,i,o,a,u=0===arguments.length||"string"==typeof t&&t,s=0,l=this.length;if(Q.isFunction(t))return this.each(function(e){Q(this).removeClass(t.call(this,e,this.className))});if(u)for(e=(t||"").match(pe)||[];l>s;s++)if(n=this[s],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(sn," "):"")){for(o=0;i=e[o++];)for(;r.indexOf(" "+i+" ")>=0;)r=r.replace(" "+i+" "," ");a=t?Q.trim(r):"",n.className!==a&&(n.className=a)}return this},toggleClass:function(t,e){var n=typeof t;return"boolean"==typeof e&&"string"===n?e?this.addClass(t):this.removeClass(t):this.each(Q.isFunction(t)?function(n){Q(this).toggleClass(t.call(this,n,this.className,e),e)}:function(){if("string"===n)for(var e,r=0,i=Q(this),o=t.match(pe)||[];e=o[r++];)i.hasClass(e)?i.removeClass(e):i.addClass(e);else(n===Ee||"boolean"===n)&&(this.className&&me.set(this,"__className__",this.className),this.className=this.className||t===!1?"":me.get(this,"__className__")||"")})},hasClass:function(t){for(var e=" "+t+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(sn," ").indexOf(e)>=0)return!0;return!1}});var ln=/\r/g;Q.fn.extend({val:function(t){var e,n,r,i=this[0];{if(arguments.length)return r=Q.isFunction(t),this.each(function(n){var i;1===this.nodeType&&(i=r?t.call(this,n,Q(this).val()):t,null==i?i="":"number"==typeof i?i+="":Q.isArray(i)&&(i=Q.map(i,function(t){return null==t?"":t+""})),e=Q.valHooks[this.type]||Q.valHooks[this.nodeName.toLowerCase()],e&&"set"in e&&void 0!==e.set(this,i,"value")||(this.value=i))});if(i)return e=Q.valHooks[i.type]||Q.valHooks[i.nodeName.toLowerCase()],e&&"get"in e&&void 0!==(n=e.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(ln,""):null==n?"":n)}}}),Q.extend({valHooks:{option:{get:function(t){var e=Q.find.attr(t,"value");return null!=e?e:Q.trim(Q.text(t))}},select:{get:function(t){for(var e,n,r=t.options,i=t.selectedIndex,o="select-one"===t.type||0>i,a=o?null:[],u=o?i+1:r.length,s=0>i?u:o?i:0;u>s;s++)if(n=r[s],!(!n.selected&&s!==i||(Z.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&Q.nodeName(n.parentNode,"optgroup"))){if(e=Q(n).val(),o)return e;a.push(e)}return a},set:function(t,e){for(var n,r,i=t.options,o=Q.makeArray(e),a=i.length;a--;)r=i[a],(r.selected=Q.inArray(r.value,o)>=0)&&(n=!0);return n||(t.selectedIndex=-1),o}}}}),Q.each(["radio","checkbox"],function(){Q.valHooks[this]={set:function(t,e){return Q.isArray(e)?t.checked=Q.inArray(Q(t).val(),e)>=0:void 0}},Z.checkOn||(Q.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})}),Q.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(t,e){Q.fn[e]=function(data,t){return arguments.length>0?this.on(e,null,data,t):this.trigger(e)
-}}),Q.fn.extend({hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)},bind:function(t,data,e){return this.on(t,null,data,e)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,data,n){return this.on(e,t,data,n)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)}});var cn=Q.now(),fn=/\?/;Q.parseJSON=function(data){return JSON.parse(data+"")},Q.parseXML=function(data){var t,e;if(!data||"string"!=typeof data)return null;try{e=new DOMParser,t=e.parseFromString(data,"text/xml")}catch(n){t=void 0}return(!t||t.getElementsByTagName("parsererror").length)&&Q.error("Invalid XML: "+data),t};var hn=/#.*$/,pn=/([?&])_=[^&]*/,dn=/^(.*?):[ \t]*([^\r\n]*)$/gm,gn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,yn=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,bn={},xn={},wn="*/".concat("*"),_n=t.location.href,Mn=yn.exec(_n.toLowerCase())||[];Q.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:_n,type:"GET",isLocal:gn.test(Mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":wn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":Q.parseJSON,"text xml":Q.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?z(z(t,Q.ajaxSettings),e):z(Q.ajaxSettings,t)},ajaxPrefilter:L(bn),ajaxTransport:L(xn),ajax:function(t,e){function n(t,e,n,a){var s,c,m,y,x,_=e;2!==b&&(b=2,u&&clearTimeout(u),r=void 0,o=a||"",w.readyState=t>0?4:0,s=t>=200&&300>t||304===t,n&&(y=R(f,w,n)),y=I(f,y,w,s),s?(f.ifModified&&(x=w.getResponseHeader("Last-Modified"),x&&(Q.lastModified[i]=x),x=w.getResponseHeader("etag"),x&&(Q.etag[i]=x)),204===t||"HEAD"===f.type?_="nocontent":304===t?_="notmodified":(_=y.state,c=y.data,m=y.error,s=!m)):(m=_,(t||!_)&&(_="error",0>t&&(t=0))),w.status=t,w.statusText=(e||_)+"",s?d.resolveWith(h,[c,_,w]):d.rejectWith(h,[w,_,m]),w.statusCode(v),v=void 0,l&&p.trigger(s?"ajaxSuccess":"ajaxError",[w,f,s?c:m]),g.fireWith(h,[w,_]),l&&(p.trigger("ajaxComplete",[w,f]),--Q.active||Q.event.trigger("ajaxStop")))}"object"==typeof t&&(e=t,t=void 0),e=e||{};var r,i,o,a,u,s,l,c,f=Q.ajaxSetup({},e),h=f.context||f,p=f.context&&(h.nodeType||h.jquery)?Q(h):Q.event,d=Q.Deferred(),g=Q.Callbacks("once memory"),v=f.statusCode||{},m={},y={},b=0,x="canceled",w={readyState:0,getResponseHeader:function(t){var e;if(2===b){if(!a)for(a={};e=dn.exec(o);)a[e[1].toLowerCase()]=e[2];e=a[t.toLowerCase()]}return null==e?null:e},getAllResponseHeaders:function(){return 2===b?o:null},setRequestHeader:function(t,e){var n=t.toLowerCase();return b||(t=y[n]=y[n]||t,m[t]=e),this},overrideMimeType:function(t){return b||(f.mimeType=t),this},statusCode:function(t){var e;if(t)if(2>b)for(e in t)v[e]=[v[e],t[e]];else w.always(t[w.status]);return this},abort:function(t){var e=t||x;return r&&r.abort(e),n(0,e),this}};if(d.promise(w).complete=g.add,w.success=w.done,w.error=w.fail,f.url=((t||f.url||_n)+"").replace(hn,"").replace(mn,Mn[1]+"//"),f.type=e.method||e.type||f.method||f.type,f.dataTypes=Q.trim(f.dataType||"*").toLowerCase().match(pe)||[""],null==f.crossDomain&&(s=yn.exec(f.url.toLowerCase()),f.crossDomain=!(!s||s[1]===Mn[1]&&s[2]===Mn[2]&&(s[3]||("http:"===s[1]?"80":"443"))===(Mn[3]||("http:"===Mn[1]?"80":"443")))),f.data&&f.processData&&"string"!=typeof f.data&&(f.data=Q.param(f.data,f.traditional)),F(bn,f,e,w),2===b)return w;l=Q.event&&f.global,l&&0===Q.active++&&Q.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!vn.test(f.type),i=f.url,f.hasContent||(f.data&&(i=f.url+=(fn.test(i)?"&":"?")+f.data,delete f.data),f.cache===!1&&(f.url=pn.test(i)?i.replace(pn,"$1_="+cn++):i+(fn.test(i)?"&":"?")+"_="+cn++)),f.ifModified&&(Q.lastModified[i]&&w.setRequestHeader("If-Modified-Since",Q.lastModified[i]),Q.etag[i]&&w.setRequestHeader("If-None-Match",Q.etag[i])),(f.data&&f.hasContent&&f.contentType!==!1||e.contentType)&&w.setRequestHeader("Content-Type",f.contentType),w.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+wn+"; q=0.01":""):f.accepts["*"]);for(c in f.headers)w.setRequestHeader(c,f.headers[c]);if(f.beforeSend&&(f.beforeSend.call(h,w,f)===!1||2===b))return w.abort();x="abort";for(c in{success:1,error:1,complete:1})w[c](f[c]);if(r=F(xn,f,e,w)){w.readyState=1,l&&p.trigger("ajaxSend",[w,f]),f.async&&f.timeout>0&&(u=setTimeout(function(){w.abort("timeout")},f.timeout));try{b=1,r.send(m,n)}catch(_){if(!(2>b))throw _;n(-1,_)}}else n(-1,"No Transport");return w},getJSON:function(t,data,e){return Q.get(t,data,e,"json")},getScript:function(t,e){return Q.get(t,void 0,e,"script")}}),Q.each(["get","post"],function(t,e){Q[e]=function(t,data,n,r){return Q.isFunction(data)&&(r=r||n,n=data,data=void 0),Q.ajax({url:t,type:e,dataType:r,data:data,success:n})}}),Q._evalUrl=function(t){return Q.ajax({url:t,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},Q.fn.extend({wrapAll:function(t){var e;return Q.isFunction(t)?this.each(function(e){Q(this).wrapAll(t.call(this,e))}):(this[0]&&(e=Q(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t}).append(this)),this)},wrapInner:function(t){return this.each(Q.isFunction(t)?function(e){Q(this).wrapInner(t.call(this,e))}:function(){var e=Q(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)})},wrap:function(t){var e=Q.isFunction(t);return this.each(function(n){Q(this).wrapAll(e?t.call(this,n):t)})},unwrap:function(){return this.parent().each(function(){Q.nodeName(this,"body")||Q(this).replaceWith(this.childNodes)}).end()}}),Q.expr.filters.hidden=function(t){return t.offsetWidth<=0&&t.offsetHeight<=0},Q.expr.filters.visible=function(t){return!Q.expr.filters.hidden(t)};var kn=/%20/g,En=/\[\]$/,Cn=/\r?\n/g,Sn=/^(?:submit|button|image|reset|file)$/i,Tn=/^(?:input|select|textarea|keygen)/i;Q.param=function(t,e){var n,r=[],i=function(t,e){e=Q.isFunction(e)?e():null==e?"":e,r[r.length]=encodeURIComponent(t)+"="+encodeURIComponent(e)};if(void 0===e&&(e=Q.ajaxSettings&&Q.ajaxSettings.traditional),Q.isArray(t)||t.jquery&&!Q.isPlainObject(t))Q.each(t,function(){i(this.name,this.value)});else for(n in t)P(n,t[n],e,i);return r.join("&").replace(kn,"+")},Q.fn.extend({serialize:function(){return Q.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=Q.prop(this,"elements");return t?Q.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!Q(this).is(":disabled")&&Tn.test(this.nodeName)&&!Sn.test(t)&&(this.checked||!ke.test(t))}).map(function(t,e){var n=Q(this).val();return null==n?null:Q.isArray(n)?Q.map(n,function(t){return{name:e.name,value:t.replace(Cn,"\r\n")}}):{name:e.name,value:n.replace(Cn,"\r\n")}}).get()}}),Q.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(t){}};var jn=0,An={},Nn={0:200,1223:204},On=Q.ajaxSettings.xhr();t.attachEvent&&t.attachEvent("onunload",function(){for(var t in An)An[t]()}),Z.cors=!!On&&"withCredentials"in On,Z.ajax=On=!!On,Q.ajaxTransport(function(t){var e;return Z.cors||On&&!t.crossDomain?{send:function(n,r){var i,o=t.xhr(),a=++jn;if(o.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(i in t.xhrFields)o[i]=t.xhrFields[i];t.mimeType&&o.overrideMimeType&&o.overrideMimeType(t.mimeType),t.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(i in n)o.setRequestHeader(i,n[i]);e=function(t){return function(){e&&(delete An[a],e=o.onload=o.onerror=null,"abort"===t?o.abort():"error"===t?r(o.status,o.statusText):r(Nn[o.status]||o.status,o.statusText,"string"==typeof o.responseText?{text:o.responseText}:void 0,o.getAllResponseHeaders()))}},o.onload=e(),o.onerror=e("error"),e=An[a]=e("abort");try{o.send(t.hasContent&&t.data||null)}catch(u){if(e)throw u}},abort:function(){e&&e()}}:void 0}),Q.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(t){return Q.globalEval(t),t}}}),Q.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),Q.ajaxTransport("script",function(t){if(t.crossDomain){var e,n;return{send:function(r,i){e=Q("<script>").prop({async:!0,charset:t.scriptCharset,src:t.url}).on("load error",n=function(t){e.remove(),n=null,t&&i("error"===t.type?404:200,t.type)}),K.head.appendChild(e[0])},abort:function(){n&&n()}}}});var qn=[],Dn=/(=)\?(?=&|$)|\?\?/;Q.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=qn.pop()||Q.expando+"_"+cn++;return this[t]=!0,t}}),Q.ajaxPrefilter("json jsonp",function(e,n,r){var i,o,a,u=e.jsonp!==!1&&(Dn.test(e.url)?"url":"string"==typeof e.data&&!(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(e.data)&&"data");return u||"jsonp"===e.dataTypes[0]?(i=e.jsonpCallback=Q.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,u?e[u]=e[u].replace(Dn,"$1"+i):e.jsonp!==!1&&(e.url+=(fn.test(e.url)?"&":"?")+e.jsonp+"="+i),e.converters["script json"]=function(){return a||Q.error(i+" was not called"),a[0]},e.dataTypes[0]="json",o=t[i],t[i]=function(){a=arguments},r.always(function(){t[i]=o,e[i]&&(e.jsonpCallback=n.jsonpCallback,qn.push(i)),a&&Q.isFunction(o)&&o(a[0]),a=o=void 0}),"script"):void 0}),Q.parseHTML=function(data,t,e){if(!data||"string"!=typeof data)return null;"boolean"==typeof t&&(e=t,t=!1),t=t||K;var n=ae.exec(data),r=!e&&[];return n?[t.createElement(n[1])]:(n=Q.buildFragment([data],t,r),r&&r.length&&Q(r).remove(),Q.merge([],n.childNodes))};var Ln=Q.fn.load;Q.fn.load=function(t,e,n){if("string"!=typeof t&&Ln)return Ln.apply(this,arguments);var r,i,o,a=this,u=t.indexOf(" ");return u>=0&&(r=Q.trim(t.slice(u)),t=t.slice(0,u)),Q.isFunction(e)?(n=e,e=void 0):e&&"object"==typeof e&&(i="POST"),a.length>0&&Q.ajax({url:t,type:i,dataType:"html",data:e}).done(function(t){o=arguments,a.html(r?Q("<div>").append(Q.parseHTML(t)).find(r):t)}).complete(n&&function(t,e){a.each(n,o||[t.responseText,e,t])}),this},Q.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){Q.fn[e]=function(t){return this.on(e,t)}}),Q.expr.filters.animated=function(t){return Q.grep(Q.timers,function(e){return t===e.elem}).length};var Fn=t.document.documentElement;Q.offset={setOffset:function(t,e,n){var r,i,o,a,u,s,l,c=Q.css(t,"position"),f=Q(t),h={};"static"===c&&(t.style.position="relative"),u=f.offset(),o=Q.css(t,"top"),s=Q.css(t,"left"),l=("absolute"===c||"fixed"===c)&&(o+s).indexOf("auto")>-1,l?(r=f.position(),a=r.top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(s)||0),Q.isFunction(e)&&(e=e.call(t,n,u)),null!=e.top&&(h.top=e.top-u.top+a),null!=e.left&&(h.left=e.left-u.left+i),"using"in e?e.using.call(t,h):f.css(h)}},Q.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){Q.offset.setOffset(this,t,e)});var e,n,r=this[0],i={top:0,left:0},o=r&&r.ownerDocument;if(o)return e=o.documentElement,Q.contains(e,r)?(typeof r.getBoundingClientRect!==Ee&&(i=r.getBoundingClientRect()),n=H(o),{top:i.top+n.pageYOffset-e.clientTop,left:i.left+n.pageXOffset-e.clientLeft}):i},position:function(){if(this[0]){var t,e,n=this[0],r={top:0,left:0};return"fixed"===Q.css(n,"position")?e=n.getBoundingClientRect():(t=this.offsetParent(),e=this.offset(),Q.nodeName(t[0],"html")||(r=t.offset()),r.top+=Q.css(t[0],"borderTopWidth",!0),r.left+=Q.css(t[0],"borderLeftWidth",!0)),{top:e.top-r.top-Q.css(n,"marginTop",!0),left:e.left-r.left-Q.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||Fn;t&&!Q.nodeName(t,"html")&&"static"===Q.css(t,"position");)t=t.offsetParent;return t||Fn})}}),Q.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r="pageYOffset"===n;Q.fn[e]=function(i){return ve(this,function(e,i,o){var a=H(e);return void 0===o?a?a[n]:e[i]:void(a?a.scrollTo(r?t.pageXOffset:o,r?o:t.pageYOffset):e[i]=o)},e,i,arguments.length,null)}}),Q.each(["top","left"],function(t,e){Q.cssHooks[e]=_(Z.pixelPosition,function(t,n){return n?(n=w(t,e),Be.test(n)?Q(t).position()[e]+"px":n):void 0})}),Q.each({Height:"height",Width:"width"},function(t,e){Q.each({padding:"inner"+t,content:e,"":"outer"+t},function(n,r){Q.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),a=n||(r===!0||i===!0?"margin":"border");return ve(this,function(e,n,r){var i;return Q.isWindow(e)?e.document.documentElement["client"+t]:9===e.nodeType?(i=e.documentElement,Math.max(e.body["scroll"+t],i["scroll"+t],e.body["offset"+t],i["offset"+t],i["client"+t])):void 0===r?Q.css(e,n,a):Q.style(e,n,r,a)},e,o?r:void 0,o,null)}})}),Q.fn.size=function(){return this.length},Q.fn.andSelf=Q.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return Q});var zn=t.jQuery,Rn=t.$;return Q.noConflict=function(e){return t.$===Q&&(t.$=Rn),e&&t.jQuery===Q&&(t.jQuery=zn),Q},typeof e===Ee&&(t.jQuery=t.$=Q),Q})},{}],62:[function(t,e,n){(function(t){(function(){function r(t,e,n){for(var r=(n||0)-1,i=t?t.length:0;++r<i;)if(t[r]===e)return r;return-1}function i(t,e){var n=typeof e;if(t=t.cache,"boolean"==n||null==e)return t[e]?0:-1;"number"!=n&&"string"!=n&&(n="object");var i="number"==n?e:x+e;return t=(t=t[n])&&t[i],"object"==n?t&&r(t,e)>-1?0:-1:t?0:-1}function o(t){var e=this.cache,n=typeof t;if("boolean"==n||null==t)e[t]=!0;else{"number"!=n&&"string"!=n&&(n="object");var r="number"==n?t:x+t,i=e[n]||(e[n]={});"object"==n?(i[r]||(i[r]=[])).push(t):i[r]=!0}}function a(t){return t.charCodeAt(0)}function u(t,e){for(var n=t.criteria,r=e.criteria,i=-1,o=n.length;++i<o;){var a=n[i],u=r[i];if(a!==u){if(a>u||"undefined"==typeof a)return 1;if(u>a||"undefined"==typeof u)return-1}}return t.index-e.index}function s(t){var e=-1,n=t.length,r=t[0],i=t[n/2|0],a=t[n-1];if(r&&"object"==typeof r&&i&&"object"==typeof i&&a&&"object"==typeof a)return!1;var u=f();u["false"]=u["null"]=u["true"]=u.undefined=!1;var s=f();for(s.array=t,s.cache=u,s.push=o;++e<n;)s.push(t[e]);return s}function l(t){return"\\"+Z[t]}function c(){return m.pop()||[]}function f(){return y.pop()||{array:null,cache:null,criteria:null,"false":!1,index:0,"null":!1,number:null,object:null,push:null,string:null,"true":!1,undefined:!1,value:null}}function h(t){t.length=0,m.length<_&&m.push(t)}function p(t){var e=t.cache;e&&p(e),t.array=t.cache=t.criteria=t.object=t.number=t.string=t.value=null,y.length<_&&y.push(t)}function d(t,e,n){e||(e=0),"undefined"==typeof n&&(n=t?t.length:0);for(var r=-1,i=n-e||0,o=Array(0>i?0:i);++r<i;)o[r]=t[e+r];return o}function g(t){function e(t){return t&&"object"==typeof t&&!Gr(t)&&Dr.call(t,"__wrapped__")?t:new n(t)}function n(t,e){this.__chain__=!!e,this.__wrapped__=t}function o(t){function e(){if(r){var t=d(r);Lr.apply(t,arguments)}if(this instanceof e){var o=y(n.prototype),a=n.apply(o,t||arguments);return Ae(a)?a:o}return n.apply(i,t||arguments)}var n=t[0],r=t[2],i=t[4];return Kr(e,t),e}function m(t,e,n,r,i){if(n){var o=n(t);if("undefined"!=typeof o)return o}var a=Ae(t);if(!a)return t;var u=Sr.call(t);if(!W[u])return t;var s=Jr[u];switch(u){case I:case P:return new s(+t);case B:case U:return new s(t);case V:return o=s(t.source,T.exec(t)),o.lastIndex=t.lastIndex,o}var l=Gr(t);if(e){var f=!r;r||(r=c()),i||(i=c());for(var p=r.length;p--;)if(r[p]==t)return i[p];o=l?s(t.length):{}}else o=l?d(t):oi({},t);return l&&(Dr.call(t,"index")&&(o.index=t.index),Dr.call(t,"input")&&(o.input=t.input)),e?(r.push(t),i.push(o),(l?Ze:si)(t,function(t,a){o[a]=m(t,e,n,r,i)}),f&&(h(r),h(i)),o):o}function y(t){return Ae(t)?Pr(t):{}}function _(t,e,n){if("function"!=typeof t)return Gn;if("undefined"==typeof e||!("prototype"in t))return t;var r=t.__bindData__;if("undefined"==typeof r&&(Zr.funcNames&&(r=!t.name),r=r||!Zr.funcDecomp,!r)){var i=Or.call(t);Zr.funcNames||(r=!j.test(i)),r||(r=q.test(i),Kr(t,r))}if(r===!1||r!==!0&&1&r[1])return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,o){return t.call(e,n,r,i,o)}}return Ln(t,e)}function Z(t){function e(){var t=s?a:this;if(i){var p=d(i);Lr.apply(p,arguments)}if((o||c)&&(p||(p=d(arguments)),o&&Lr.apply(p,o),c&&p.length<u))return r|=16,Z([n,f?r:-4&r,p,null,a,u]);if(p||(p=arguments),l&&(n=t[h]),this instanceof e){t=y(n.prototype);var g=n.apply(t,p);return Ae(g)?g:t}return n.apply(t,p)}var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],u=t[5],s=1&r,l=2&r,c=4&r,f=8&r,h=n;return Kr(e,t),e}function G(t,e){var n=-1,o=se(),a=t?t.length:0,u=a>=w&&o===r,l=[];if(u){var c=s(e);c?(o=i,e=c):u=!1}for(;++n<a;){var f=t[n];o(e,f)<0&&l.push(f)}return u&&p(e),l}function Q(t,e,n,r){for(var i=(r||0)-1,o=t?t.length:0,a=[];++i<o;){var u=t[i];if(u&&"object"==typeof u&&"number"==typeof u.length&&(Gr(u)||he(u))){e||(u=Q(u,e,n));var s=-1,l=u.length,c=a.length;for(a.length+=l;++s<l;)a[c++]=u[s]}else n||a.push(u)}return a}function te(t,e,n,r,i,o){if(n){var a=n(t,e);if("undefined"!=typeof a)return!!a}if(t===e)return 0!==t||1/t==1/e;var u=typeof t,s=typeof e;if(!(t!==t||t&&J[u]||e&&J[s]))return!1;if(null==t||null==e)return t===e;var l=Sr.call(t),f=Sr.call(e);if(l==z&&(l=$),f==z&&(f=$),l!=f)return!1;switch(l){case I:case P:return+t==+e;case B:return t!=+t?e!=+e:0==t?1/t==1/e:t==+e;case V:case U:return t==_r(e)}var p=l==R;if(!p){var d=Dr.call(t,"__wrapped__"),g=Dr.call(e,"__wrapped__");if(d||g)return te(d?t.__wrapped__:t,g?e.__wrapped__:e,n,r,i,o);if(l!=$)return!1;var v=t.constructor,m=e.constructor;if(v!=m&&!(je(v)&&v instanceof v&&je(m)&&m instanceof m)&&"constructor"in t&&"constructor"in e)return!1}var y=!i;i||(i=c()),o||(o=c());for(var b=i.length;b--;)if(i[b]==t)return o[b]==e;var x=0;if(a=!0,i.push(t),o.push(e),p){if(b=t.length,x=e.length,a=x==b,a||r)for(;x--;){var w=b,_=e[x];if(r)for(;w--&&!(a=te(t[w],_,n,r,i,o)););else if(!(a=te(t[x],_,n,r,i,o)))break}}else ui(e,function(e,u,s){return Dr.call(s,u)?(x++,a=Dr.call(t,u)&&te(t[u],e,n,r,i,o)):void 0}),a&&!r&&ui(t,function(t,e,n){return Dr.call(n,e)?a=--x>-1:void 0});return i.pop(),o.pop(),y&&(h(i),h(o)),a}function ee(t,e,n,r,i){(Gr(e)?Ze:si)(e,function(e,o){var a,u,s=e,l=t[o];if(e&&((u=Gr(e))||li(e))){for(var c=r.length;c--;)if(a=r[c]==e){l=i[c];break}if(!a){var f;n&&(s=n(l,e),(f="undefined"!=typeof s)&&(l=s)),f||(l=u?Gr(l)?l:[]:li(l)?l:{}),r.push(e),i.push(l),f||ee(l,e,n,r,i)}}else n&&(s=n(l,e),"undefined"==typeof s&&(s=e)),"undefined"!=typeof s&&(l=s);t[o]=l})}function re(t,e){return t+Nr(Xr()*(e-t+1))}function ie(t,e,n){var o=-1,a=se(),u=t?t.length:0,l=[],f=!e&&u>=w&&a===r,d=n||f?c():l;if(f){var g=s(d);a=i,d=g}for(;++o<u;){var v=t[o],m=n?n(v,o,t):v;(e?!o||d[d.length-1]!==m:a(d,m)<0)&&((n||f)&&d.push(m),l.push(v))}return f?(h(d.array),p(d)):n&&h(d),l}function oe(t){return function(n,r,i){var o={};r=e.createCallback(r,i,3);var a=-1,u=n?n.length:0;if("number"==typeof u)for(;++a<u;){var s=n[a];t(o,s,r(s,a,n),n)}else si(n,function(e,n,i){t(o,e,r(e,n,i),i)});return o}}function ae(t,e,n,r,i,a){var u=1&e,s=2&e,l=4&e,c=16&e,f=32&e;if(!s&&!je(t))throw new Mr;c&&!n.length&&(e&=-17,c=n=!1),f&&!r.length&&(e&=-33,f=r=!1);var h=t&&t.__bindData__;if(h&&h!==!0)return h=d(h),h[2]&&(h[2]=d(h[2])),h[3]&&(h[3]=d(h[3])),!u||1&h[1]||(h[4]=i),!u&&1&h[1]&&(e|=8),!l||4&h[1]||(h[5]=a),c&&Lr.apply(h[2]||(h[2]=[]),n),f&&Rr.apply(h[3]||(h[3]=[]),r),h[1]|=e,ae.apply(null,h);var p=1==e||17===e?o:Z;return p([t,e,n,r,i,a])}function ue(t){return ei[t]}function se(){var t=(t=e.indexOf)===yn?r:t;return t}function le(t){return"function"==typeof t&&Tr.test(t)}function ce(t){var e,n;return t&&Sr.call(t)==$&&(e=t.constructor,!je(e)||e instanceof e)?(ui(t,function(t,e){n=e}),"undefined"==typeof n||Dr.call(t,n)):!1}function fe(t){return ni[t]}function he(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Sr.call(t)==z||!1}function pe(t,e,n,r){return"boolean"!=typeof e&&null!=e&&(r=n,n=e,e=!1),m(t,e,"function"==typeof n&&_(n,r,1))}function de(t,e,n){return m(t,!0,"function"==typeof e&&_(e,n,1))}function ge(t,e){var n=y(t);return e?oi(n,e):n}function ve(t,n,r){var i;return n=e.createCallback(n,r,3),si(t,function(t,e,r){return n(t,e,r)?(i=e,!1):void 0}),i}function me(t,n,r){var i;return n=e.createCallback(n,r,3),be(t,function(t,e,r){return n(t,e,r)?(i=e,!1):void 0}),i}function ye(t,e,n){var r=[];ui(t,function(t,e){r.push(e,t)});var i=r.length;for(e=_(e,n,3);i--&&e(r[i--],r[i],t)!==!1;);return t}function be(t,e,n){var r=ti(t),i=r.length;for(e=_(e,n,3);i--;){var o=r[i];if(e(t[o],o,t)===!1)break}return t}function xe(t){var e=[];return ui(t,function(t,n){je(t)&&e.push(n)}),e.sort()}function we(t,e){return t?Dr.call(t,e):!1}function _e(t){for(var e=-1,n=ti(t),r=n.length,i={};++e<r;){var o=n[e];i[t[o]]=o}return i}function Me(t){return t===!0||t===!1||t&&"object"==typeof t&&Sr.call(t)==I||!1}function ke(t){return t&&"object"==typeof t&&Sr.call(t)==P||!1}function Ee(t){return t&&1===t.nodeType||!1}function Ce(t){var e=!0;if(!t)return e;var n=Sr.call(t),r=t.length;return n==R||n==U||n==z||n==$&&"number"==typeof r&&je(t.splice)?!r:(si(t,function(){return e=!1}),e)}function Se(t,e,n,r){return te(t,e,"function"==typeof n&&_(n,r,2))}function Te(t){return Br(t)&&!$r(parseFloat(t))}function je(t){return"function"==typeof t}function Ae(t){return!(!t||!J[typeof t])}function Ne(t){return qe(t)&&t!=+t}function Oe(t){return null===t}function qe(t){return"number"==typeof t||t&&"object"==typeof t&&Sr.call(t)==B||!1}function De(t){return t&&"object"==typeof t&&Sr.call(t)==V||!1}function Le(t){return"string"==typeof t||t&&"object"==typeof t&&Sr.call(t)==U||!1}function Fe(t){return"undefined"==typeof t}function ze(t,n,r){var i={};return n=e.createCallback(n,r,3),si(t,function(t,e,r){i[e]=n(t,e,r)}),i}function Re(t){var e=arguments,n=2;if(!Ae(t))return t;if("number"!=typeof e[2]&&(n=e.length),n>3&&"function"==typeof e[n-2])var r=_(e[--n-1],e[n--],2);else n>2&&"function"==typeof e[n-1]&&(r=e[--n]);for(var i=d(arguments,1,n),o=-1,a=c(),u=c();++o<n;)ee(t,i[o],r,a,u);return h(a),h(u),t}function Ie(t,n,r){var i={};if("function"!=typeof n){var o=[];ui(t,function(t,e){o.push(e)}),o=G(o,Q(arguments,!0,!1,1));for(var a=-1,u=o.length;++a<u;){var s=o[a];i[s]=t[s]}}else n=e.createCallback(n,r,3),ui(t,function(t,e,r){n(t,e,r)||(i[e]=t)});return i}function Pe(t){for(var e=-1,n=ti(t),r=n.length,i=dr(r);++e<r;){var o=n[e];i[e]=[o,t[o]]}return i}function He(t,n,r){var i={};if("function"!=typeof n)for(var o=-1,a=Q(arguments,!0,!1,1),u=Ae(t)?a.length:0;++o<u;){var s=a[o];s in t&&(i[s]=t[s])}else n=e.createCallback(n,r,3),ui(t,function(t,e,r){n(t,e,r)&&(i[e]=t)});return i}function Be(t,n,r,i){var o=Gr(t);if(null==r)if(o)r=[];else{var a=t&&t.constructor,u=a&&a.prototype;r=y(u)}return n&&(n=e.createCallback(n,i,4),(o?Ze:si)(t,function(t,e,i){return n(r,t,e,i)})),r}function $e(t){for(var e=-1,n=ti(t),r=n.length,i=dr(r);++e<r;)i[e]=t[n[e]];return i}function Ve(t){for(var e=arguments,n=-1,r=Q(e,!0,!1,1),i=e[2]&&e[2][e[1]]===t?1:r.length,o=dr(i);++n<i;)o[n]=t[r[n]];return o}function Ue(t,e,n){var r=-1,i=se(),o=t?t.length:0,a=!1;return n=(0>n?Ur(0,o+n):n)||0,Gr(t)?a=i(t,e,n)>-1:"number"==typeof o?a=(Le(t)?t.indexOf(e,n):i(t,e,n))>-1:si(t,function(t){return++r>=n?!(a=t===e):void 0}),a}function We(t,n,r){var i=!0;n=e.createCallback(n,r,3);var o=-1,a=t?t.length:0;if("number"==typeof a)for(;++o<a&&(i=!!n(t[o],o,t)););else si(t,function(t,e,r){return i=!!n(t,e,r)});return i}function Ye(t,n,r){var i=[];n=e.createCallback(n,r,3);var o=-1,a=t?t.length:0;if("number"==typeof a)for(;++o<a;){var u=t[o];n(u,o,t)&&i.push(u)}else si(t,function(t,e,r){n(t,e,r)&&i.push(t)});return i}function Xe(t,n,r){n=e.createCallback(n,r,3);var i=-1,o=t?t.length:0;if("number"!=typeof o){var a;return si(t,function(t,e,r){return n(t,e,r)?(a=t,!1):void 0}),a}for(;++i<o;){var u=t[i];if(n(u,i,t))return u}}function Je(t,n,r){var i;return n=e.createCallback(n,r,3),Ke(t,function(t,e,r){return n(t,e,r)?(i=t,!1):void 0}),i}function Ze(t,e,n){var r=-1,i=t?t.length:0;if(e=e&&"undefined"==typeof n?e:_(e,n,3),"number"==typeof i)for(;++r<i&&e(t[r],r,t)!==!1;);else si(t,e);return t}function Ke(t,e,n){var r=t?t.length:0;if(e=e&&"undefined"==typeof n?e:_(e,n,3),"number"==typeof r)for(;r--&&e(t[r],r,t)!==!1;);else{var i=ti(t);r=i.length,si(t,function(t,n,o){return n=i?i[--r]:--r,e(o[n],n,o)})}return t}function Ge(t,e){var n=d(arguments,2),r=-1,i="function"==typeof e,o=t?t.length:0,a=dr("number"==typeof o?o:0);return Ze(t,function(t){a[++r]=(i?e:t[e]).apply(t,n)}),a}function Qe(t,n,r){var i=-1,o=t?t.length:0;if(n=e.createCallback(n,r,3),"number"==typeof o)for(var a=dr(o);++i<o;)a[i]=n(t[i],i,t);else a=[],si(t,function(t,e,r){a[++i]=n(t,e,r)});return a}function tn(t,n,r){var i=-1/0,o=i;if("function"!=typeof n&&r&&r[n]===t&&(n=null),null==n&&Gr(t))for(var u=-1,s=t.length;++u<s;){var l=t[u];l>o&&(o=l)}else n=null==n&&Le(t)?a:e.createCallback(n,r,3),Ze(t,function(t,e,r){var a=n(t,e,r);a>i&&(i=a,o=t)});return o}function en(t,n,r){var i=1/0,o=i;if("function"!=typeof n&&r&&r[n]===t&&(n=null),null==n&&Gr(t))for(var u=-1,s=t.length;++u<s;){var l=t[u];o>l&&(o=l)}else n=null==n&&Le(t)?a:e.createCallback(n,r,3),Ze(t,function(t,e,r){var a=n(t,e,r);i>a&&(i=a,o=t)});return o}function nn(t,n,r,i){if(!t)return r;var o=arguments.length<3;n=e.createCallback(n,i,4);var a=-1,u=t.length;if("number"==typeof u)for(o&&(r=t[++a]);++a<u;)r=n(r,t[a],a,t);else si(t,function(t,e,i){r=o?(o=!1,t):n(r,t,e,i)});return r}function rn(t,n,r,i){var o=arguments.length<3;return n=e.createCallback(n,i,4),Ke(t,function(t,e,i){r=o?(o=!1,t):n(r,t,e,i)}),r}function on(t,n,r){return n=e.createCallback(n,r,3),Ye(t,function(t,e,r){return!n(t,e,r)})}function an(t,e,n){if(t&&"number"!=typeof t.length&&(t=$e(t)),null==e||n)return t?t[re(0,t.length-1)]:v;var r=un(t);return r.length=Wr(Ur(0,e),r.length),r}function un(t){var e=-1,n=t?t.length:0,r=dr("number"==typeof n?n:0);return Ze(t,function(t){var n=re(0,++e);r[e]=r[n],r[n]=t}),r}function sn(t){var e=t?t.length:0;return"number"==typeof e?e:ti(t).length}function ln(t,n,r){var i;n=e.createCallback(n,r,3);var o=-1,a=t?t.length:0;if("number"==typeof a)for(;++o<a&&!(i=n(t[o],o,t)););else si(t,function(t,e,r){return!(i=n(t,e,r))});return!!i}function cn(t,n,r){var i=-1,o=Gr(n),a=t?t.length:0,s=dr("number"==typeof a?a:0);for(o||(n=e.createCallback(n,r,3)),Ze(t,function(t,e,r){var a=s[++i]=f();o?a.criteria=Qe(n,function(e){return t[e]}):(a.criteria=c())[0]=n(t,e,r),a.index=i,a.value=t}),a=s.length,s.sort(u);a--;){var l=s[a];s[a]=l.value,o||h(l.criteria),p(l)}return s}function fn(t){return t&&"number"==typeof t.length?d(t):$e(t)}function hn(t){for(var e=-1,n=t?t.length:0,r=[];++e<n;){var i=t[e];i&&r.push(i)}return r}function pn(t){return G(t,Q(arguments,!0,!0,1))}function dn(t,n,r){var i=-1,o=t?t.length:0;for(n=e.createCallback(n,r,3);++i<o;)if(n(t[i],i,t))return i;return-1}function gn(t,n,r){var i=t?t.length:0;for(n=e.createCallback(n,r,3);i--;)if(n(t[i],i,t))return i;return-1}function vn(t,n,r){var i=0,o=t?t.length:0;if("number"!=typeof n&&null!=n){var a=-1;for(n=e.createCallback(n,r,3);++a<o&&n(t[a],a,t);)i++}else if(i=n,null==i||r)return t?t[0]:v;return d(t,0,Wr(Ur(0,i),o))}function mn(t,e,n,r){return"boolean"!=typeof e&&null!=e&&(r=n,n="function"!=typeof e&&r&&r[e]===t?null:e,e=!1),null!=n&&(t=Qe(t,n,r)),Q(t,e)}function yn(t,e,n){if("number"==typeof n){var i=t?t.length:0;n=0>n?Ur(0,i+n):n||0}else if(n){var o=Sn(t,e);return t[o]===e?o:-1}return r(t,e,n)}function bn(t,n,r){var i=0,o=t?t.length:0;if("number"!=typeof n&&null!=n){var a=o;for(n=e.createCallback(n,r,3);a--&&n(t[a],a,t);)i++}else i=null==n||r?1:n||i;return d(t,0,Wr(Ur(0,o-i),o))}function xn(){for(var t=[],e=-1,n=arguments.length,o=c(),a=se(),u=a===r,l=c();++e<n;){var f=arguments[e];(Gr(f)||he(f))&&(t.push(f),o.push(u&&f.length>=w&&s(e?t[e]:l)))}var d=t[0],g=-1,v=d?d.length:0,m=[];t:for(;++g<v;){var y=o[0];if(f=d[g],(y?i(y,f):a(l,f))<0){for(e=n,(y||l).push(f);--e;)if(y=o[e],(y?i(y,f):a(t[e],f))<0)continue t;m.push(f)}}for(;n--;)y=o[n],y&&p(y);return h(o),h(l),m}function wn(t,n,r){var i=0,o=t?t.length:0;if("number"!=typeof n&&null!=n){var a=o;for(n=e.createCallback(n,r,3);a--&&n(t[a],a,t);)i++}else if(i=n,null==i||r)return t?t[o-1]:v;return d(t,Ur(0,o-i))}function _n(t,e,n){var r=t?t.length:0;for("number"==typeof n&&(r=(0>n?Ur(0,r+n):Wr(n,r-1))+1);r--;)if(t[r]===e)return r;return-1}function Mn(t){for(var e=arguments,n=0,r=e.length,i=t?t.length:0;++n<r;)for(var o=-1,a=e[n];++o<i;)t[o]===a&&(zr.call(t,o--,1),i--);return t}function kn(t,e,n){t=+t||0,n="number"==typeof n?n:+n||1,null==e&&(e=t,t=0);for(var r=-1,i=Ur(0,jr((e-t)/(n||1))),o=dr(i);++r<i;)o[r]=t,t+=n;return o}function En(t,n,r){var i=-1,o=t?t.length:0,a=[];for(n=e.createCallback(n,r,3);++i<o;){var u=t[i];n(u,i,t)&&(a.push(u),zr.call(t,i--,1),o--)}return a}function Cn(t,n,r){if("number"!=typeof n&&null!=n){var i=0,o=-1,a=t?t.length:0;for(n=e.createCallback(n,r,3);++o<a&&n(t[o],o,t);)i++}else i=null==n||r?1:Ur(0,n);return d(t,i)}function Sn(t,n,r,i){var o=0,a=t?t.length:o;for(r=r?e.createCallback(r,i,1):Gn,n=r(n);a>o;){var u=o+a>>>1;r(t[u])<n?o=u+1:a=u}return o}function Tn(){return ie(Q(arguments,!0,!0))}function jn(t,n,r,i){return"boolean"!=typeof n&&null!=n&&(i=r,r="function"!=typeof n&&i&&i[n]===t?null:n,n=!1),null!=r&&(r=e.createCallback(r,i,3)),ie(t,n,r)}function An(t){return G(t,d(arguments,1))}function Nn(){for(var t=-1,e=arguments.length;++t<e;){var n=arguments[t];if(Gr(n)||he(n))var r=r?ie(G(r,n).concat(G(n,r))):n}return r||[]}function On(){for(var t=arguments.length>1?arguments:arguments[0],e=-1,n=t?tn(pi(t,"length")):0,r=dr(0>n?0:n);++e<n;)r[e]=pi(t,e);return r}function qn(t,e){var n=-1,r=t?t.length:0,i={};for(e||!r||Gr(t[0])||(e=[]);++n<r;){var o=t[n];e?i[o]=e[n]:o&&(i[o[0]]=o[1])}return i}function Dn(t,e){if(!je(e))throw new Mr;return function(){return--t<1?e.apply(this,arguments):void 0}}function Ln(t,e){return arguments.length>2?ae(t,17,d(arguments,2),null,e):ae(t,1,null,null,e)}function Fn(t){for(var e=arguments.length>1?Q(arguments,!0,!1,1):xe(t),n=-1,r=e.length;++n<r;){var i=e[n];t[i]=ae(t[i],1,null,null,t)}return t}function zn(t,e){return arguments.length>2?ae(e,19,d(arguments,2),null,t):ae(e,3,null,null,t)}function Rn(){for(var t=arguments,e=t.length;e--;)if(!je(t[e]))throw new Mr;return function(){for(var e=arguments,n=t.length;n--;)e=[t[n].apply(this,e)];return e[0]}}function In(t,e){return e="number"==typeof e?e:+e||t.length,ae(t,4,null,null,null,e)}function Pn(t,e,n){var r,i,o,a,u,s,l,c=0,f=!1,h=!0;if(!je(t))throw new Mr;if(e=Ur(0,e)||0,n===!0){var p=!0;h=!1}else Ae(n)&&(p=n.leading,f="maxWait"in n&&(Ur(e,n.maxWait)||0),h="trailing"in n?n.trailing:h);var d=function(){var n=e-(gi()-a);if(0>=n){i&&Ar(i);var f=l;i=s=l=v,f&&(c=gi(),o=t.apply(u,r),s||i||(r=u=null))}else s=Fr(d,n)},g=function(){s&&Ar(s),i=s=l=v,(h||f!==e)&&(c=gi(),o=t.apply(u,r),s||i||(r=u=null))};return function(){if(r=arguments,a=gi(),u=this,l=h&&(s||!p),f===!1)var n=p&&!s;else{i||p||(c=a);var v=f-(a-c),m=0>=v;m?(i&&(i=Ar(i)),c=a,o=t.apply(u,r)):i||(i=Fr(g,v))}return m&&s?s=Ar(s):s||e===f||(s=Fr(d,e)),n&&(m=!0,o=t.apply(u,r)),!m||s||i||(r=u=null),o}}function Hn(t){if(!je(t))throw new Mr;var e=d(arguments,1);return Fr(function(){t.apply(v,e)},1)}function Bn(t,e){if(!je(t))throw new Mr;var n=d(arguments,2);return Fr(function(){t.apply(v,n)},e)}function $n(t,e){if(!je(t))throw new Mr;var n=function(){var r=n.cache,i=e?e.apply(this,arguments):x+arguments[0];return Dr.call(r,i)?r[i]:r[i]=t.apply(this,arguments)};return n.cache={},n}function Vn(t){var e,n;if(!je(t))throw new Mr;return function(){return e?n:(e=!0,n=t.apply(this,arguments),t=null,n)}}function Un(t){return ae(t,16,d(arguments,1))}function Wn(t){return ae(t,32,null,d(arguments,1))}function Yn(t,e,n){var r=!0,i=!0;
-if(!je(t))throw new Mr;return n===!1?r=!1:Ae(n)&&(r="leading"in n?n.leading:r,i="trailing"in n?n.trailing:i),Y.leading=r,Y.maxWait=e,Y.trailing=i,Pn(t,e,Y)}function Xn(t,e){return ae(e,16,[t])}function Jn(t){return function(){return t}}function Zn(t,e,n){var r=typeof t;if(null==t||"function"==r)return _(t,e,n);if("object"!=r)return nr(t);var i=ti(t),o=i[0],a=t[o];return 1!=i.length||a!==a||Ae(a)?function(e){for(var n=i.length,r=!1;n--&&(r=te(e[i[n]],t[i[n]],null,!0)););return r}:function(t){var e=t[o];return a===e&&(0!==a||1/a==1/e)}}function Kn(t){return null==t?"":_r(t).replace(ii,ue)}function Gn(t){return t}function Qn(t,r,i){var o=!0,a=r&&xe(r);r&&(i||a.length)||(null==i&&(i=r),u=n,r=t,t=e,a=xe(r)),i===!1?o=!1:Ae(i)&&"chain"in i&&(o=i.chain);var u=t,s=je(u);Ze(a,function(e){var n=t[e]=r[e];s&&(u.prototype[e]=function(){var e=this.__chain__,r=this.__wrapped__,i=[r];Lr.apply(i,arguments);var a=n.apply(t,i);if(o||e){if(r===a&&Ae(a))return this;a=new u(a),a.__chain__=e}return a})})}function tr(){return t._=Cr,this}function er(){}function nr(t){return function(e){return e[t]}}function rr(t,e,n){var r=null==t,i=null==e;if(null==n&&("boolean"==typeof t&&i?(n=t,t=1):i||"boolean"!=typeof e||(n=e,i=!0)),r&&i&&(e=1),t=+t||0,i?(e=t,t=0):e=+e||0,n||t%1||e%1){var o=Xr();return Wr(t+o*(e-t+parseFloat("1e-"+((o+"").length-1))),e)}return re(t,e)}function ir(t,e){if(t){var n=t[e];return je(n)?t[e]():n}}function or(t,data,n){var r=e.templateSettings;t=_r(t||""),n=ai({},n,r);var i,o=ai({},n.imports,r.imports),a=ti(o),u=$e(o),s=0,c=n.interpolate||O,f="__p += '",h=wr((n.escape||O).source+"|"+c.source+"|"+(c===A?S:O).source+"|"+(n.evaluate||O).source+"|$","g");t.replace(h,function(e,n,r,o,a,u){return r||(r=o),f+=t.slice(s,u).replace(D,l),n&&(f+="' +\n__e("+n+") +\n'"),a&&(i=!0,f+="';\n"+a+";\n__p += '"),r&&(f+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),s=u+e.length,e}),f+="';\n";var p=n.variable,d=p;d||(p="obj",f="with ("+p+") {\n"+f+"\n}\n"),f=(i?f.replace(k,""):f).replace(E,"$1").replace(C,"$1;"),f="function("+p+") {\n"+(d?"":p+" || ("+p+" = {});\n")+"var __t, __p = '', __e = _.escape"+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var g="\n/*\n//# sourceURL="+(n.sourceURL||"/lodash/template/source["+F++ +"]")+"\n*/";try{var m=mr(a,"return "+f+g).apply(v,u)}catch(y){throw y.source=f,y}return data?m(data):(m.source=f,m)}function ar(t,e,n){t=(t=+t)>-1?t:0;var r=-1,i=dr(t);for(e=_(e,n,1);++r<t;)i[r]=e(r);return i}function ur(t){return null==t?"":_r(t).replace(ri,fe)}function sr(t){var e=++b;return _r(null==t?"":t)+e}function lr(t){return t=new n(t),t.__chain__=!0,t}function cr(t,e){return e(t),t}function fr(){return this.__chain__=!0,this}function hr(){return _r(this.__wrapped__)}function pr(){return this.__wrapped__}t=t?ne.defaults(K.Object(),t,ne.pick(K,L)):K;var dr=t.Array,gr=t.Boolean,vr=t.Date,mr=t.Function,yr=t.Math,br=t.Number,xr=t.Object,wr=t.RegExp,_r=t.String,Mr=t.TypeError,kr=[],Er=xr.prototype,Cr=t._,Sr=Er.toString,Tr=wr("^"+_r(Sr).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),jr=yr.ceil,Ar=t.clearTimeout,Nr=yr.floor,Or=mr.prototype.toString,qr=le(qr=xr.getPrototypeOf)&&qr,Dr=Er.hasOwnProperty,Lr=kr.push,Fr=t.setTimeout,zr=kr.splice,Rr=kr.unshift,Ir=function(){try{var t={},e=le(e=xr.defineProperty)&&e,n=e(t,t,t)&&e}catch(r){}return n}(),Pr=le(Pr=xr.create)&&Pr,Hr=le(Hr=dr.isArray)&&Hr,Br=t.isFinite,$r=t.isNaN,Vr=le(Vr=xr.keys)&&Vr,Ur=yr.max,Wr=yr.min,Yr=t.parseInt,Xr=yr.random,Jr={};Jr[R]=dr,Jr[I]=gr,Jr[P]=vr,Jr[H]=mr,Jr[$]=xr,Jr[B]=br,Jr[V]=wr,Jr[U]=_r,n.prototype=e.prototype;var Zr=e.support={};Zr.funcDecomp=!le(t.WinRTError)&&q.test(g),Zr.funcNames="string"==typeof mr.name,e.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:A,variable:"",imports:{_:e}},Pr||(y=function(){function e(){}return function(n){if(Ae(n)){e.prototype=n;var r=new e;e.prototype=null}return r||t.Object()}}());var Kr=Ir?function(t,e){X.value=e,Ir(t,"__bindData__",X)}:er,Gr=Hr||function(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Sr.call(t)==R||!1},Qr=function(t){var e,n=t,r=[];if(!n)return r;if(!J[typeof t])return r;for(e in n)Dr.call(n,e)&&r.push(e);return r},ti=Vr?function(t){return Ae(t)?Vr(t):[]}:Qr,ei={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ni=_e(ei),ri=wr("("+ti(ni).join("|")+")","g"),ii=wr("["+ti(ei).join("")+"]","g"),oi=function(t,e,n){var r,i=t,o=i;if(!i)return o;var a=arguments,u=0,s="number"==typeof n?2:a.length;if(s>3&&"function"==typeof a[s-2])var l=_(a[--s-1],a[s--],2);else s>2&&"function"==typeof a[s-1]&&(l=a[--s]);for(;++u<s;)if(i=a[u],i&&J[typeof i])for(var c=-1,f=J[typeof i]&&ti(i),h=f?f.length:0;++c<h;)r=f[c],o[r]=l?l(o[r],i[r]):i[r];return o},ai=function(t,e,n){var r,i=t,o=i;if(!i)return o;for(var a=arguments,u=0,s="number"==typeof n?2:a.length;++u<s;)if(i=a[u],i&&J[typeof i])for(var l=-1,c=J[typeof i]&&ti(i),f=c?c.length:0;++l<f;)r=c[l],"undefined"==typeof o[r]&&(o[r]=i[r]);return o},ui=function(t,e,n){var r,i=t,o=i;if(!i)return o;if(!J[typeof i])return o;e=e&&"undefined"==typeof n?e:_(e,n,3);for(r in i)if(e(i[r],r,t)===!1)return o;return o},si=function(t,e,n){var r,i=t,o=i;if(!i)return o;if(!J[typeof i])return o;e=e&&"undefined"==typeof n?e:_(e,n,3);for(var a=-1,u=J[typeof i]&&ti(i),s=u?u.length:0;++a<s;)if(r=u[a],e(i[r],r,t)===!1)return o;return o},li=qr?function(t){if(!t||Sr.call(t)!=$)return!1;var e=t.valueOf,n=le(e)&&(n=qr(e))&&qr(n);return n?t==n||qr(t)==n:ce(t)}:ce,ci=oe(function(t,e,n){Dr.call(t,n)?t[n]++:t[n]=1}),fi=oe(function(t,e,n){(Dr.call(t,n)?t[n]:t[n]=[]).push(e)}),hi=oe(function(t,e,n){t[n]=e}),pi=Qe,di=Ye,gi=le(gi=vr.now)&&gi||function(){return(new vr).getTime()},vi=8==Yr(M+"08")?Yr:function(t,e){return Yr(Le(t)?t.replace(N,""):t,e||0)};return e.after=Dn,e.assign=oi,e.at=Ve,e.bind=Ln,e.bindAll=Fn,e.bindKey=zn,e.chain=lr,e.compact=hn,e.compose=Rn,e.constant=Jn,e.countBy=ci,e.create=ge,e.createCallback=Zn,e.curry=In,e.debounce=Pn,e.defaults=ai,e.defer=Hn,e.delay=Bn,e.difference=pn,e.filter=Ye,e.flatten=mn,e.forEach=Ze,e.forEachRight=Ke,e.forIn=ui,e.forInRight=ye,e.forOwn=si,e.forOwnRight=be,e.functions=xe,e.groupBy=fi,e.indexBy=hi,e.initial=bn,e.intersection=xn,e.invert=_e,e.invoke=Ge,e.keys=ti,e.map=Qe,e.mapValues=ze,e.max=tn,e.memoize=$n,e.merge=Re,e.min=en,e.omit=Ie,e.once=Vn,e.pairs=Pe,e.partial=Un,e.partialRight=Wn,e.pick=He,e.pluck=pi,e.property=nr,e.pull=Mn,e.range=kn,e.reject=on,e.remove=En,e.rest=Cn,e.shuffle=un,e.sortBy=cn,e.tap=cr,e.throttle=Yn,e.times=ar,e.toArray=fn,e.transform=Be,e.union=Tn,e.uniq=jn,e.values=$e,e.where=di,e.without=An,e.wrap=Xn,e.xor=Nn,e.zip=On,e.zipObject=qn,e.collect=Qe,e.drop=Cn,e.each=Ze,e.eachRight=Ke,e.extend=oi,e.methods=xe,e.object=qn,e.select=Ye,e.tail=Cn,e.unique=jn,e.unzip=On,Qn(e),e.clone=pe,e.cloneDeep=de,e.contains=Ue,e.escape=Kn,e.every=We,e.find=Xe,e.findIndex=dn,e.findKey=ve,e.findLast=Je,e.findLastIndex=gn,e.findLastKey=me,e.has=we,e.identity=Gn,e.indexOf=yn,e.isArguments=he,e.isArray=Gr,e.isBoolean=Me,e.isDate=ke,e.isElement=Ee,e.isEmpty=Ce,e.isEqual=Se,e.isFinite=Te,e.isFunction=je,e.isNaN=Ne,e.isNull=Oe,e.isNumber=qe,e.isObject=Ae,e.isPlainObject=li,e.isRegExp=De,e.isString=Le,e.isUndefined=Fe,e.lastIndexOf=_n,e.mixin=Qn,e.noConflict=tr,e.noop=er,e.now=gi,e.parseInt=vi,e.random=rr,e.reduce=nn,e.reduceRight=rn,e.result=ir,e.runInContext=g,e.size=sn,e.some=ln,e.sortedIndex=Sn,e.template=or,e.unescape=ur,e.uniqueId=sr,e.all=We,e.any=ln,e.detect=Xe,e.findWhere=Xe,e.foldl=nn,e.foldr=rn,e.include=Ue,e.inject=nn,Qn(function(){var t={};return si(e,function(n,r){e.prototype[r]||(t[r]=n)}),t}(),!1),e.first=vn,e.last=wn,e.sample=an,e.take=vn,e.head=vn,si(e,function(t,r){var i="sample"!==r;e.prototype[r]||(e.prototype[r]=function(e,r){var o=this.__chain__,a=t(this.__wrapped__,e,r);return o||null!=e&&(!r||i&&"function"==typeof e)?new n(a,o):a})}),e.VERSION="2.4.1",e.prototype.chain=fr,e.prototype.toString=hr,e.prototype.value=pr,e.prototype.valueOf=pr,Ze(["join","pop","shift"],function(t){var r=kr[t];e.prototype[t]=function(){var t=this.__chain__,e=r.apply(this.__wrapped__,arguments);return t?new n(e,t):e}}),Ze(["push","reverse","sort","unshift"],function(t){var n=kr[t];e.prototype[t]=function(){return n.apply(this.__wrapped__,arguments),this}}),Ze(["concat","slice","splice"],function(t){var r=kr[t];e.prototype[t]=function(){return new n(r.apply(this.__wrapped__,arguments),this.__chain__)}}),e}var v,m=[],y=[],b=0,x=+new Date+"",w=75,_=40,M=" \f \n\r\u2028\u2029 ᠎              ",k=/\b__p \+= '';/g,E=/\b(__p \+=) '' \+/g,C=/(__e\(.*?\)|\b__t\)) \+\n'';/g,S=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,T=/\w*$/,j=/^\s*function[ \n\r\t]+\w/,A=/<%=([\s\S]+?)%>/g,N=RegExp("^["+M+"]*0+(?=.$)"),O=/($^)/,q=/\bthis\b/,D=/['\n\r\t\u2028\u2029\\]/g,L=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"],F=0,z="[object Arguments]",R="[object Array]",I="[object Boolean]",P="[object Date]",H="[object Function]",B="[object Number]",$="[object Object]",V="[object RegExp]",U="[object String]",W={};W[H]=!1,W[z]=W[R]=W[I]=W[P]=W[B]=W[$]=W[V]=W[U]=!0;var Y={leading:!1,maxWait:0,trailing:!1},X={configurable:!1,enumerable:!1,value:null,writable:!1},J={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},Z={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},K=J[typeof window]&&window||this,G=J[typeof n]&&n&&!n.nodeType&&n,Q=J[typeof e]&&e&&!e.nodeType&&e,te=Q&&Q.exports===G&&G,ee=J[typeof t]&&t;!ee||ee.global!==ee&&ee.window!==ee||(K=ee);var ne=g();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(K._=ne,define(function(){return ne})):G&&Q?te?(Q.exports=ne)._=ne:G._=ne:K._=ne}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],63:[function(t,e){{var n=t("ampersand-view"),r=t("./sidebar"),i=t("./chart"),o=t("jquery");t("debug")("view:app"),e.exports=n.extend({template:t("./templates/app.jade"),props:{chartView:"object",menuOpen:{type:"boolean","default":!1}},events:{"click .navbar-right label":"navButtonClicked","click [data-hook=menu-toggle]":"menuToggled"},bindings:{"model.chart.subSampled":{type:"toggle",hook:"sample-warning"},menuOpen:{type:"booleanClass",selector:"#wrapper",name:"active"}},subviews:{sidebar:{hook:"sidebar",waitFor:"model.sidebar",prepareView:function(t){return new r({el:t,model:this.model.sidebar})}},chart:{hook:"chart",waitFor:"model.chart",prepareView:function(t){return this.chartView=new i({el:t,model:this.model.chart}),this.chartView}}},statChanged:function(){this.model.chart.recalcXDomain=!0,this.chartView.render()},render:function(){this.renderWithTemplate(this.model)},navButtonClicked:function(t){var e=o(t.target).find("input"),n=e.attr("name"),r=e.val();this.model.chart[n]=r,this.model.chart.recalcXDomain="xSetting"===n,this.chartView.render()},menuToggled:function(){this.toggle("menuOpen")}})}},{"./chart":64,"./sidebar":67,"./templates/app.jade":69,"ampersand-view":33,debug:57,jquery:61}],64:[function(t,e){{var n=t("ampersand-view"),r=t("./viz"),i=t("./empty");t("d3"),t("jquery"),t("debug")("view:chart"),e.exports=n.extend({props:{vizView:{type:"any","default":null},emptyView:{type:"any","default":null},activeView:{type:"string","default":"empty",values:["empty","viz"]}},template:t("./templates/chart.jade"),bindings:{activeView:{type:"switch",cases:{empty:"[data-hook=empty]",viz:"[data-hook=graph]"}}},render:function(){this.activeView=this.model.empty?"empty":"viz",this.vizView?(this.vizView.data={series:this.model.series.filter(function(t){return t.selected}),model:this.model},this.vizView.redraw()):(this.renderWithTemplate(this.model),this.vizView=new r({width:"auto",height:600,renderMode:"svg",className:"multiline",debounceRender:!1,vizFn:t("./viz/d3-multiline"),data:{series:this.model.series.filter(function(t){return t.selected}),model:this.model}}),this.emptyView=new i,this.renderSubview(this.emptyView,"[data-hook=empty]"),this.renderSubview(this.vizView,"[data-hook=graph]"))}})}},{"./empty":65,"./templates/chart.jade":70,"./viz":75,"./viz/d3-multiline":76,"ampersand-view":33,d3:56,debug:57,jquery:61}],65:[function(t,e){{var n=t("ampersand-view");t("debug")("view:empty"),e.exports=n.extend({template:t("./templates/empty.jade"),autorender:!0})}},{"./templates/empty.jade":71,"ampersand-view":33,debug:57}],66:[function(t,e){{var n=t("ampersand-view"),r=t("ampersand-subcollection"),i=t("./stat"),o=t("jquery");t("lodash"),t("debug")("view:panel"),e.exports=n.extend({props:{indicator:{type:"string","default":"none",values:["none","some","all"]},statViews:"object",filteredStats:"object"},template:t("./templates/panel.jade"),events:{"click a":"collapsibleToggle","click [data-hook=caret]":"collapsibleToggle","click [data-hook=indicator]":"indicatorClicked"},bindings:{indicator:{type:function(t){switch($el=o(t),$el.removeClass(),this.model.selected){case"all":$el.addClass("fa fa-circle");break;case"some":$el.addClass("fa fa-adjust");break;case"none":$el.addClass("fa fa-circle-o")}},hook:"indicator"},"model.open":{type:"booleanClass",hook:"caret",yes:"fa-caret-up",no:"fa-caret-down"}},initialize:function(){this.filteredStats=new r(this.model.stats,{comparator:function(t){return t.name}})},render:function(){this.renderWithTemplate(this.model),this.statViews=this.renderCollection(this.filteredStats,i,this.queryByHook("stats"))},indicatorClicked:function(){var t="all"!==this.model.selected;switch(this.filteredStats.each(function(e){e.selected=t}),this.model.selected){case"all":case"some":this.collapsibleOpen();break;case"none":this.collapsibleClose()}this.model.app.clearSelectionState(),this.statChanged(null,{propagate:!0})},statChanged:function(t,e){e=e||{},this.indicator=this.model.selected,e.propagate&&this.parent.parent.statChanged(t,e)},collapsibleToggle:function(t){this.model.open?this.collapsibleClose(t):this.collapsibleOpen(t)},collapsibleClose:function(){o(this.query(".collapse")).collapse("hide"),this.model.open=!1},collapsibleOpen:function(){o(this.query(".collapse")).collapse("show"),this.model.open=!0},resetStats:function(){this.filteredStats.configure({},!0)},filterStats:function(t){this.filteredStats.configure({filter:function(e){return-1!==e.name.search(new RegExp(t),"gi")}},!0),0===this.filteredStats.length?this.collapsibleClose():this.collapsibleOpen()}})}},{"./stat":68,"./templates/panel.jade":72,"ampersand-subcollection":27,"ampersand-view":33,debug:57,jquery:61,lodash:62}],67:[function(t,e){{var n=t("ampersand-view"),r=t("./panel"),i=t("lodash");t("debug")("view:sidebar"),e.exports=n.extend({props:{panelViews:"object"},template:t("./templates/sidebar.jade"),events:{"click [data-hook=button]":"clearClicked","input [data-hook=input]":"inputChanged"},bindings:{"model.search.content":{type:"value",hook:"input"}},render:function(){this.renderWithTemplate(this.model),this.panelViews=this.renderCollection(this.model.panels,r,this.queryByHook("panels"))},closeAndReset:function(){i.each(this.panelViews.views,function(t){t.collapsibleClose(),t.resetStats()})},clearClicked:function(){this.model.search.content="",this.closeAndReset(),this.queryByHook("button").blur()},filterPanels:function(t){i.each(this.panelViews.views,function(e){e.filterStats(t)})},statChanged:function(t,e){this.parent.statChanged(t,e),e.all&&i.each(this.panelViews.views,function(e){e.statChanged(t,{all:!1,propagate:!1})})},inputChanged:i.debounce(function(){var t=this.queryByHook("input").value;this.model.search.content=t,""===t.trim()?this.closeAndReset():this.filterPanels(t)},200,{leading:!1,trailing:!0})})}},{"./panel":66,"./templates/sidebar.jade":73,"ampersand-view":33,debug:57,lodash:62}],68:[function(t,e){{var n=t("ampersand-view");t("debug")("view:stat"),e.exports=n.extend({template:t("./templates/stat.jade"),render:function(){this.renderWithTemplate(this.model)},events:{click:"clicked"},bindings:{"model.selected":{type:"booleanClass",hook:"circle",yes:"fa-circle",no:"fa-circle-o"}},clicked:function(t){t.shiftKey?this.model.app.toggleAllExcept(this.model):(this.model.app.clearSelectionState(),this.model.toggle("selected")),this.parent.parent.statChanged(this,{all:t.shiftKey,propagate:!0})}})}},{"./templates/stat.jade":74,"ampersand-view":33,debug:57}],69:[function(t,e){t("jade/runtime");e.exports=function(){var t=[];return t.push('<div id="app"><nav id="navbar" role="navigation" class="navbar navbar-default"><div class="container-fluid"><div class="navbar-header"><div class="navbar-brand"> <div data-hook="menu-toggle" class="brand-image"></div></div></div><ul class="nav navbar-right"><li data-hook="sample-warning" class="navbar-text"><div title="warning: more series data points than pixels. data is being sub-sampled to improve performance. To avoid sub-sampling, increase the browser window width or zoom in." class="alert alert-warning"><i id="menubtn" class="fa fa-warning"></i><span>sub-sampling</span></div></li><li class="navbar-text"><i id="menubtn" class="fa fa-clock-o"></i><span>x-axis</span><div data-toggle="buttons" data-hook="xSetting" class="btn-group"><label class="btn btn-default active"><input type="radio" name="xSetting" id="relative" value="relative" checked="checked"/>relative</label><label class="btn btn-default"><input type="radio" name="xSetting" id="absolute" value="absolute"/>absolute</label></div></li><li class="navbar-text"><i id="menubtn" class="fa fa-line-chart"></i><span>y-axis</span><div data-toggle="buttons" data-hook="ySetting" class="btn-group"><label class="btn btn-default active"><input type="radio" name="ySetting" value="linear" checked="checked"/>linear</label><label class="btn btn-default"><input type="radio" name="ySetting" value="log-scale"/>log-scale</label></div></li></ul></div></nav><div id="wrapper"><div id="sidebar-wrapper"><div class="sidebar-nav"><div data-hook="sidebar"></div></div></div><div class="container-fluid"><div class="row"><div class="col-md-12"><div data-hook="chart"></div></div></div></div></div></div>'),t.join("")}},{"jade/runtime":60}],70:[function(t,e){t("jade/runtime");e.exports=function(){var t=[];return t.push('<div><div class="container-fluid"><div class="row"><div class="col-md-12"><div data-hook="empty"></div><div data-hook="graph"></div></div></div></div></div>'),t.join("")}},{"jade/runtime":60}],71:[function(t,e){t("jade/runtime");e.exports=function(){var t=[];return t.push('<div class="instructions"><dl class="dl-horizontal"><dt><h1><span class="searchbox">mem|&nbsp;</span><i class="fa fa-search"></i></h1></dt><dd>filter stats by typing in the text box</dd><dt><h1> <u>cursor</u><i class="fa fa-caret-down"></i></h1></dt><dd>open/close group panels</dd><dt><h1><i class="fa fa-circle-o"></i><i class="fa fa-adjust"> </i><i class="fa fa-circle"> </i></h1></dt><dd>click to toggle individual stats or the entire group</dd><dt><h1><i class="fa fa-expand"></i><i class="fa fa-arrows-h"> </i><i class="fa fa-compress"> </i></h1></dt><dd>zoom with two-finger scroll or mouse wheel, pan with click+drag</dd><dt><h1>x<i class="fa fa-clock-o"></i>y<i class="fa fa-line-chart"> </i></h1></dt><dd>change x/y axis scaling with buttons at the top</dd></dl></div>'),t.join("")}},{"jade/runtime":60}],72:[function(t,e){var n=t("jade/runtime");e.exports=function(t){var e,r=[],i=t||{};return function(t,i){r.push('<div class="panel panel-default"><div class="panel-heading">'),i&&r.push('<span class="suptitle">'+n.escape(null==(e=i)?"":e)+"</span>"),r.push('<h4 class="panel-title"><i data-hook="indicator" class="fa fa-circle-o"></i><a data-toggle="collapse" data-parent="#panel-accordion">'+n.escape(null==(e=t)?"":e)+'</a><div class="pull-right"><i data-hook="caret" class="fa"></i></div></h4></div><div class="panel-collapse collapse"><div class="panel-body"><ul data-hook="stats" class="stats"></ul></div></div></div>')}.call(this,"subtitle"in i?i.subtitle:"undefined"!=typeof subtitle?subtitle:void 0,"suptitle"in i?i.suptitle:"undefined"!=typeof suptitle?suptitle:void 0),r.join("")}},{"jade/runtime":60}],73:[function(t,e){t("jade/runtime");e.exports=function(){var t=[];return t.push('<ul class="sidebar-nav"><li><div class="input-group"><input data-hook="input" type="text" class="form-control"/><span class="input-group-btn"><button data-hook="button" type="button" class="btn btn-default">Clear</button></span></div></li><li><div data-hook="panels" id="panel-accordion" class="panel-group"></div></li></ul>'),t.join("")}},{"jade/runtime":60}],74:[function(t,e){var n=t("jade/runtime");e.exports=function(t){var e,r=[],i=t||{};return function(t,i){r.push('<li class="stat"><i data-hook="circle"'+n.attr("style","color:"+t,!0,!1)+' class="fa fa-circle"></i>'+n.escape(null==(e=i)?"":e)+"</li>")}.call(this,"color"in i?i.color:"undefined"!=typeof color?color:void 0,"name"in i?i.name:"undefined"!=typeof name?name:void 0),r.join("")}},{"jade/runtime":60}],75:[function(t,e){{var n=t("ampersand-view"),r=t("lodash"),i=t("jquery");t("debug")("view:viz")}e.exports=n.extend({_values:{},_autoWidth:!1,_autoHeight:!1,props:{data:"any",className:"any",vizFn:"any",debounceRender:{type:"boolean","default":!0},renderMode:{type:"string",values:["canvas","svg","html"],"default":"svg"},width:{type:"any","default":"auto"},height:{type:"any","default":400}},bindings:{width:[{type:"attribute",name:"width",hook:"viz-container"}],height:{type:"attribute",name:"height",hook:"viz-container"},className:{type:"attribute",name:"class",hook:"viz-container"}},initialize:function(){switch(("auto"===this.width||void 0===this.width)&&(this._autoWidth=!0,this.width=0),("auto"===this.height||void 0===this.height)&&(this._autoHeight=!0,this.height=0),(this._autoWidth||this._autoHeight)&&(this.debounceRender?window.addEventListener("resize",r.debounce(this.redraw.bind(this),100)):window.addEventListener("resize",this.redraw.bind(this))),this.renderMode){case"canvas":this.template='<canvas data-hook="viz-container" id="canvas"></canvas>';break;case"svg":this.template='<svg data-hook="viz-container"></svg>';break;case"html":this.template='<div data-hook="viz-container"></div>'}},_measure:function(){this.el&&(this._autoWidth&&(this.width=i(this.el).parent().width()),this._autoHeight&&(this.height=i(this.el).parent().height()))},_chooseDataSource:function(){void 0!==this.model?this.data=this.model.toJSON():void 0!==this.collection&&(this.data=this.collection.toJSON())},remove:function(){return window.removeEventListener("resize",this._onResize),this},transform:function(data){return data},render:function(){return this._chooseDataSource(),this.data=this.transform(this.data),this.renderWithTemplate(this),this._measure(),this.vizFn&&(this.vizFn=this.vizFn({width:this.width,height:this.height,data:this.data,el:this.el})),this},redraw:function(){this._chooseDataSource(),this.data=this.transform(this.data),this._measure(),this.vizFn&&this.vizFn({width:this.width,height:this.height,data:this.data,el:this.el})}}),e.exports.create=function(t,n){return e.exports.extend({className:t,vizFn:n})}},{"ampersand-view":33,debug:57,jquery:61,lodash:62}],76:[function(t,e){{var n=t("d3"),r=t("lodash");t("debug")("viz:d3-multiline")}n.selection.prototype.moveToFront=function(){return this.each(function(){this.parentNode.appendChild(this)})},e.exports=function(t){function e(e){if(e){if(t=e,f=t.width-c.left-c.right,h=t.height-c.top-c.bottom,data=t.data,d=data.model,g=d.serialize(),F=data.series,0===F.length?T.style("visibility","hidden"):T.style("visibility","visible"),T.attr({width:f,height:h}),"relative"===g.xSetting?(v=function(t){return t.xrel},x=y,w.tickFormat(n.format(","))):(v=function(t){return t.x},x=m,w.tickFormat(b)),x.range([0,f]),(r.isEqual(x.domain(),[0,1])||r.isEqual(x.domain(),[new Date(0),new Date(1)])||g.recalcXDomain)&&(z=[n.min(F,function(t){return n.min(t.data,function(t){return v(t)})}),n.max(F,function(t){return n.max(t.data,function(t){return v(t)})})],x.domain(z),S.x(x)),F.length>0){var i=r.find(F,function(t){return t.data.length>1}).data;L=i?x(v(i[1]))-x(v(i[0])):1}else L=1;d.subSampled=g.allowSampling&&1>L,"linear"===g.ySetting?(k=_,k.domain([n.min(F,function(t){return n.min(t.data,function(t){return t.y})}),n.max(F,function(t){return n.max(t.data,function(t){return t.y})})])):(k=M,k.domain([.1,n.max(F,function(t){return n.max(t.data,function(t){return t.y})})])),k.range([h,0])}T.selectAll(".x").call(w.scale(x)),T.selectAll(".y").call(E.scale(k)),q=T.selectAll(".serie").data(F,function(t){return t.cid}),q.enter().append("g").attr("class","serie").append("path").attr("class","line").style("stroke",function(t){return t.color}),q.exit().remove(),q.selectAll(".line").attr("d",function(t){return C(v)(o(t.data))}),L>6?(D=q.selectAll(".point").data(function(t){return o(t.data).map(function(e){return{x:v(e),y:e.y,c:t.color}})}),D.enter().append("circle").attr("class","point").attr("r","3px").style("fill",function(t){return t.c}),D.exit().remove(),D.attr("cx",function(t){return x(t.x)}).attr("cy",function(t){return k(t.y)})):q.selectAll(".point").remove(),j.attr("x2",f),A.attr("y2",h+20),R.attr("width",f).attr("height",h).moveToFront()}function i(data){var t=x.domain(),e=s(v)(data,t[0]),n=s(v)(data,t[1]);return data.slice(e,n)}function o(data){data=i(data);var t=1/L;return g.allowSampling&&t>1?data.filter(function(e,n){return n%Math.ceil(t)===0}):data}function a(t,e){var n=o(e.data),r=x.invert(t),i=s(v)(n,r),a=n[i-1],u=n[i];return void 0===a?u:void 0===u?a:r-v(a)>v(u)-r?u:a}function u(){var t=n.mouse(this),e=t[0],r=t[1],i=F.map(function(t){return a(e,t)}),o=i.map(function(t){return t?Math.pow(e-x(v(t)),2)+Math.pow(r-k(t.y),2):1/0}),u=o.indexOf(Math.min.apply(Math,o)),s=F[u],l=i[u];N.attr("transform","translate("+x(v(l))+","+k(l.y)+")").moveToFront(),N.select("circle").attr("stroke",s.color),N.select("text.name").text(s.name),N.select("text.value").text(n.format(",")(l.y)),O.attr("transform","translate("+x(v(l))+","+(h+34)+")").text("relative"===g.xSetting?n.format(",")(v(l)):n.time.format("%b %d %H:%M:%S")(v(l))).moveToFront(),j.attr("y1",k(l.y)).attr("y2",k(l.y)),A.attr("x1",x(v(l))).attr("x2",x(v(l)))}function s(t){return n.bisector(function(e){return t(e)}).left}function l(){d.recalcXDomain=!1,e(t)}var c={top:80,right:20,bottom:60,left:100},f=t.width-c.left-c.right,h=t.height-c.top-c.bottom,data=t.data,p=t.el,d=data.model,g=d.serialize(),v=function(t){return t.x},m=n.time.scale(),y=n.scale.linear(),b=n.time.format.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%b %e %H:%M",function(t){return t.getMinutes()}],["%b %e %H:%M",function(t){return t.getHours()}],["%b %e",function(t){return t.getDay()&&1!=t.getDate()}],["%b %e",function(t){return 1!=t.getDate()}],["%Y",function(t){return t.getMonth()}],["%Y",function(){return!0}]]),x="relative"===g.xSetting?y:m,w=n.svg.axis().scale(x).ticks(10).orient("bottom"),_=n.scale.linear().range([h,0]),M=n.scale.log().clamp(!0).range([h,0]).nice(),k="linear"===g.ySetting?_:M,E=n.svg.axis().scale(k).orient("left"),C=function(t){return n.svg.line().x(function(e){return x(t(e))}).y(function(t){return k(t.y)})},S=n.behavior.zoom().scaleExtent([1,50]).x(x).on("zoom",l),T=n.select(p).append("g").attr("transform","translate("+c.left+","+c.top+")").call(S);T.append("g").attr("class","x axis").attr("transform","translate(0,"+h+")"),T.append("g").attr("class","y axis");var j=T.append("line").style("stroke","#ddd").style("display","none").attr("class","x cross").attr("x1",0),A=T.append("line").style("stroke","#ddd").style("display","none").attr("class","x cross").attr("y1",0),N=T.append("g").attr("class","focus").style("display","none");N.append("circle").attr("r",6).attr("fill","none").attr("stroke-width",2);var O=T.append("text").attr("text-anchor","middle").attr("class","xlabel").attr("font-size","0.8em").attr("fill","#bbb");N.append("text").attr("class","name").attr("fill","black").attr("x",9).attr("dy","-.8em"),N.append("text").attr("class","value").attr("fill","black").attr("font-size","20px").attr("x",8).attr("dy","-1.2em");var q,D,L,F,z,R=T.append("rect").attr("class","windshield").style("opacity",0).on("mouseover",function(){j.style("display",null),A.style("display",null),N.style("display",null),O.style("display",null)}).on("mouseout",function(){N.style("display","none"),j.style("display","none"),A.style("display","none"),O.style("display","none")}).on("mousemove",u);return e}},{d3:56,debug:57,lodash:62}]},{},[1]);
+!function t(e,n,r){function o(a,s){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[a]={exports:{}};e[a][0].call(c.exports,function(t){var n=e[a][1][t];return o(n?n:t)},c,c.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(t,e,n){{var r=(window.$=window.jQuery=t("jquery"),t("../views/app")),o=t("../models/app");t("debug")("index")}t("bootstrap/js/dropdown"),t("bootstrap/js/collapse"),t("bootstrap/js/transition"),t("bootstrap/js/button");var data="### INSERT DATA HERE ###",i=window.app=new o(data,{parse:!0}),a=document.getElementById("app"),s=new r({model:i,el:a});s.render()},{"../models/app":2,"../views/app":282,"bootstrap/js/button":270,"bootstrap/js/collapse":271,"bootstrap/js/dropdown":272,"bootstrap/js/transition":273,debug:276,jquery:280}],2:[function(t,e,n){{var r=t("ampersand-state"),o=t("./chart"),i=t("./stat-collection"),a=t("./sidebar"),s=t("lodash"),u=t("debug")("model:app");e.exports=r.extend({children:{sidebar:a,chart:o},collections:{stats:i},props:{selectionState:{type:"array","default":function(){return[]}}},parse:function(t,e){var n=(new Date).getFullYear(),r={},o=s.map(t.series,function(t){if(-1!==t.key.indexOf(":"))var e=t.key.split(":"),o=e[0].trim(),i=e[1].trim();else var o="stats",i=t.key;var data=s.sortBy(s.map(t.values,function(t,e){var r=e.split(" ");r.splice(2,0,n.toString());var o=r.join(" ");return{x:new Date(o),y:t}}),"x"),a=Math.min.apply(null,data.map(function(t){return t.x}));return data.forEach(function(t){t.xrel=(t.x-a)/1e3}),r[o]=!0,{group:o,name:i,data:data}});r=s.keys(r).map(function(t){return{title:t}});var i={stats:o,sidebar:{panels:r}};return i},initialize:function(t,e){var n=this.sidebar.panels;n.each(function(t){t.app=this}.bind(this)),this.stats.each(function(t){t.app=this,n.get(t.group).stats.add(t)}.bind(this))},clearSelectionState:function(){this.selectionState=[],u("clear")},toggleAllExcept:function(t){this.stats.filter(function(e){return e!==t}).some(function(t){return t.selected});0!==this.selectionState.length&&t.selected?(this.stats.each(function(t,e){t.selected=this.selectionState.length?this.selectionState[e]:!0}.bind(this)),this.clearSelectionState()):(this.selectionState=this.stats.map(function(t){return t.selected}),this.stats.each(function(e){e.selected=e===t}))}})}},{"./chart":3,"./sidebar":7,"./stat-collection":8,"ampersand-state":47,debug:276,lodash:281}],3:[function(t,e,n){{var r=t("ampersand-state"),o=t("lodash");t("debug")("model:chart"),e.exports=r.extend({props:{xSetting:{type:"string","default":"relative",values:["relative","absolute"]},ySetting:{type:"string","default":"linear",values:["linear","log-scale"]},allowSampling:{type:"boolean","default":!0},subSampled:{type:"boolean","default":!1},recalcXDomain:{type:"boolean","default":!0}},derived:{series:{deps:["parent"],cache:!1,fn:function(){var t=this.parent.stats.filter(function(t){return t.selected}).map(function(t){return o.pick(t,["color","data","name","cid","selected"])});return t}},empty:{deps:["parent","series"],cache:!1,fn:function(){return 0===this.series.length}}}})}},{"ampersand-state":47,debug:276,lodash:281}],4:[function(t,e,n){{var r=t("d3");e.exports=function(){function t(){var t=r.scale.category20();return t}var e;return{getInstance:function(){return e||(e=t()),e}}}()}},{d3:275}],5:[function(t,e,n){{var r=t("ampersand-state"),o=t("./stat-collection");t("debug")("model:panel"),e.exports=r.extend({collections:{stats:o},props:{title:{type:"string",required:!0},open:{type:"boolean","default":!1},app:{type:"object"}},derived:{selected:{deps:["stats"],cache:!1,fn:function(){var t=this.stats.filter(function(t){return t.selected});return t.length===this.stats.length?"all":0===t.length?"none":"some"}},suptitle:{deps:["title"],cache:!1,fn:function(){var t=this.title.split(" ");return t.length>1?t[0]:""}},subtitle:{deps:["title"],fn:function(){var t=this.title.split(" ");return t.length>1?t[1]:this.title}}}})}},{"./stat-collection":8,"ampersand-state":47,debug:276}],6:[function(t,e,n){{var r=t("ampersand-state");t("debug")("model:search"),e.exports=r.extend({props:{content:{type:"string","default":""}},derived:{empty:{deps:["content"],fn:function(){return""===this.content}}}})}},{"ampersand-state":47,debug:276}],7:[function(t,e,n){{var r=t("ampersand-state"),o=t("ampersand-collection"),i=t("./search"),a=t("./panel"),s=(t("lodash"),t("debug")("model:sidebar"),o.extend({mainIndex:"title",model:a}));e.exports=r.extend({children:{search:i},collections:{panels:s}})}},{"./panel":5,"./search":6,"ampersand-collection":12,"ampersand-state":47,debug:276,lodash:281}],8:[function(t,e,n){{var r=t("ampersand-collection"),o=t("ampersand-collection-underscore-mixin"),i=t("./stat");e.exports=r.extend(o,{comparator:"name",model:i})}},{"./stat":9,"ampersand-collection":12,"ampersand-collection-underscore-mixin":10}],9:[function(t,e,n){{var r=t("ampersand-state"),o=t("./colors").getInstance();t("debug")("model:stat"),e.exports=r.extend({props:{name:{type:"string","default":""},group:{type:"string","default":""},selected:{type:"boolean","default":!1},data:{type:"object"},app:{type:"object"}},derived:{color:{cache:!0,fn:function(){return o(this.cid)}}}})}},{"./colors":4,"ampersand-state":47,debug:276}],10:[function(t,e,n){"undefined"!=typeof window&&(window.ampersand=window.ampersand||{},window.ampersand["ampersand-collection-underscore-mixin"]=window.ampersand["ampersand-collection-underscore-mixin"]||[],window.ampersand["ampersand-collection-underscore-mixin"].push("1.0.4"));var r=t("underscore"),o=[].slice,i={},a=["forEach","each","map","collect","reduce","foldl","inject","reduceRight","foldr","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max","min","toArray","size","first","head","take","initial","rest","tail","drop","last","without","difference","indexOf","shuffle","lastIndexOf","isEmpty","chain","sample","partition"];r.each(a,function(t){r[t]&&(i[t]=function(){var e=o.call(arguments);return e.unshift(this.models),r[t].apply(r,e)})});var s=["groupBy","countBy","sortBy","indexBy"];r.each(s,function(t){r[t]&&(i[t]=function(e,n){var o=r.isFunction(e)?e:function(t){return t.get?t.get(e):t[e]};return r[t](this.models,o,n)})}),i.where=function(t,e){return r.isEmpty(t)?e?void 0:[]:this[e?"find":"filter"](function(e){var n;for(var r in t)if(n=e.get?e.get(r):e[r],t[r]!==n)return!1;return!0})},i.findWhere=function(t){return this.where(t,!0)},i.pluck=function(t){return r.invoke(this.models,"get",t)},e.exports=i},{underscore:11}],11:[function(t,e,n){(function(){function t(t){function e(e,n,r,o,i,a){for(;i>=0&&a>i;i+=t){var s=o?o[i]:i;r=n(r,e[s],s,e)}return r}return function(n,r,o,i){r=b(r,i,4);var a=!S(n)&&w.keys(n),s=(a||n).length,u=t>0?0:s-1;return arguments.length<3&&(o=n[a?a[u]:u],u+=t),e(n,r,o,a,u,s)}}function r(t){return function(e,n,r){n=_(n,r);for(var o=C(e),i=t>0?0:o-1;i>=0&&o>i;i+=t)if(n(e[i],i,e))return i;return-1}}function o(t,e,n){return function(r,o,i){var a=0,s=C(r);if("number"==typeof i)t>0?a=i>=0?i:Math.max(i+s,a):s=i>=0?Math.min(i+1,s):i+s+1;else if(n&&i&&s)return i=n(r,o),r[i]===o?i:-1;if(o!==o)return i=e(d.call(r,a,s),w.isNaN),i>=0?i+a:-1;for(i=t>0?a:s-1;i>=0&&s>i;i+=t)if(r[i]===o)return i;return-1}}function i(t,e){var n=q.length,r=t.constructor,o=w.isFunction(r)&&r.prototype||l,i="constructor";for(w.has(t,i)&&!w.contains(e,i)&&e.push(i);n--;)i=q[n],i in t&&t[i]!==o[i]&&!w.contains(e,i)&&e.push(i)}var a=this,s=a._,u=Array.prototype,l=Object.prototype,c=Function.prototype,f=u.push,d=u.slice,h=l.toString,p=l.hasOwnProperty,m=Array.isArray,g=Object.keys,v=c.bind,y=Object.create,x=function(){},w=function(t){return t instanceof w?t:this instanceof w?void(this._wrapped=t):new w(t)};"undefined"!=typeof n?("undefined"!=typeof e&&e.exports&&(n=e.exports=w),n._=w):a._=w,w.VERSION="1.8.3";var b=function(t,e,n){if(void 0===e)return t;switch(null==n?3:n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)};case 4:return function(n,r,o,i){return t.call(e,n,r,o,i)}}return function(){return t.apply(e,arguments)}},_=function(t,e,n){return null==t?w.identity:w.isFunction(t)?b(t,e,n):w.isObject(t)?w.matcher(t):w.property(t)};w.iteratee=function(t,e){return _(t,e,1/0)};var k=function(t,e){return function(n){var r=arguments.length;if(2>r||null==n)return n;for(var o=1;r>o;o++)for(var i=arguments[o],a=t(i),s=a.length,u=0;s>u;u++){var l=a[u];e&&void 0!==n[l]||(n[l]=i[l])}return n}},j=function(t){if(!w.isObject(t))return{};if(y)return y(t);x.prototype=t;var e=new x;return x.prototype=null,e},M=function(t){return function(e){return null==e?void 0:e[t]}},E=Math.pow(2,53)-1,C=M("length"),S=function(t){var e=C(t);return"number"==typeof e&&e>=0&&E>=e};w.each=w.forEach=function(t,e,n){e=b(e,n);var r,o;if(S(t))for(r=0,o=t.length;o>r;r++)e(t[r],r,t);else{var i=w.keys(t);for(r=0,o=i.length;o>r;r++)e(t[i[r]],i[r],t)}return t},w.map=w.collect=function(t,e,n){e=_(e,n);for(var r=!S(t)&&w.keys(t),o=(r||t).length,i=Array(o),a=0;o>a;a++){var s=r?r[a]:a;i[a]=e(t[s],s,t)}return i},w.reduce=w.foldl=w.inject=t(1),w.reduceRight=w.foldr=t(-1),w.find=w.detect=function(t,e,n){var r;return r=S(t)?w.findIndex(t,e,n):w.findKey(t,e,n),void 0!==r&&-1!==r?t[r]:void 0},w.filter=w.select=function(t,e,n){var r=[];return e=_(e,n),w.each(t,function(t,n,o){e(t,n,o)&&r.push(t)}),r},w.reject=function(t,e,n){return w.filter(t,w.negate(_(e)),n)},w.every=w.all=function(t,e,n){e=_(e,n);for(var r=!S(t)&&w.keys(t),o=(r||t).length,i=0;o>i;i++){var a=r?r[i]:i;if(!e(t[a],a,t))return!1}return!0},w.some=w.any=function(t,e,n){e=_(e,n);for(var r=!S(t)&&w.keys(t),o=(r||t).length,i=0;o>i;i++){var a=r?r[i]:i;if(e(t[a],a,t))return!0}return!1},w.contains=w.includes=w.include=function(t,e,n,r){return S(t)||(t=w.values(t)),("number"!=typeof n||r)&&(n=0),w.indexOf(t,e,n)>=0},w.invoke=function(t,e){var n=d.call(arguments,2),r=w.isFunction(e);return w.map(t,function(t){var o=r?e:t[e];return null==o?o:o.apply(t,n)})},w.pluck=function(t,e){return w.map(t,w.property(e))},w.where=function(t,e){return w.filter(t,w.matcher(e))},w.findWhere=function(t,e){return w.find(t,w.matcher(e))},w.max=function(t,e,n){var r,o,i=-(1/0),a=-(1/0);if(null==e&&null!=t){t=S(t)?t:w.values(t);for(var s=0,u=t.length;u>s;s++)r=t[s],r>i&&(i=r)}else e=_(e,n),w.each(t,function(t,n,r){o=e(t,n,r),(o>a||o===-(1/0)&&i===-(1/0))&&(i=t,a=o)});return i},w.min=function(t,e,n){var r,o,i=1/0,a=1/0;if(null==e&&null!=t){t=S(t)?t:w.values(t);for(var s=0,u=t.length;u>s;s++)r=t[s],i>r&&(i=r)}else e=_(e,n),w.each(t,function(t,n,r){o=e(t,n,r),(a>o||o===1/0&&i===1/0)&&(i=t,a=o)});return i},w.shuffle=function(t){for(var e,n=S(t)?t:w.values(t),r=n.length,o=Array(r),i=0;r>i;i++)e=w.random(0,i),e!==i&&(o[i]=o[e]),o[e]=n[i];return o},w.sample=function(t,e,n){return null==e||n?(S(t)||(t=w.values(t)),t[w.random(t.length-1)]):w.shuffle(t).slice(0,Math.max(0,e))},w.sortBy=function(t,e,n){return e=_(e,n),w.pluck(w.map(t,function(t,n,r){return{value:t,index:n,criteria:e(t,n,r)}}).sort(function(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(r>n||void 0===r)return-1}return t.index-e.index}),"value")};var A=function(t){return function(e,n,r){var o={};return n=_(n,r),w.each(e,function(r,i){var a=n(r,i,e);t(o,r,a)}),o}};w.groupBy=A(function(t,e,n){w.has(t,n)?t[n].push(e):t[n]=[e]}),w.indexBy=A(function(t,e,n){t[n]=e}),w.countBy=A(function(t,e,n){w.has(t,n)?t[n]++:t[n]=1}),w.toArray=function(t){return t?w.isArray(t)?d.call(t):S(t)?w.map(t,w.identity):w.values(t):[]},w.size=function(t){return null==t?0:S(t)?t.length:w.keys(t).length},w.partition=function(t,e,n){e=_(e,n);var r=[],o=[];return w.each(t,function(t,n,i){(e(t,n,i)?r:o).push(t)}),[r,o]},w.first=w.head=w.take=function(t,e,n){return null==t?void 0:null==e||n?t[0]:w.initial(t,t.length-e)},w.initial=function(t,e,n){return d.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))},w.last=function(t,e,n){return null==t?void 0:null==e||n?t[t.length-1]:w.rest(t,Math.max(0,t.length-e))},w.rest=w.tail=w.drop=function(t,e,n){return d.call(t,null==e||n?1:e)},w.compact=function(t){return w.filter(t,w.identity)};var T=function(t,e,n,r){for(var o=[],i=0,a=r||0,s=C(t);s>a;a++){var u=t[a];if(S(u)&&(w.isArray(u)||w.isArguments(u))){e||(u=T(u,e,n));var l=0,c=u.length;for(o.length+=c;c>l;)o[i++]=u[l++]}else n||(o[i++]=u)}return o};w.flatten=function(t,e){return T(t,e,!1)},w.without=function(t){return w.difference(t,d.call(arguments,1))},w.uniq=w.unique=function(t,e,n,r){w.isBoolean(e)||(r=n,n=e,e=!1),null!=n&&(n=_(n,r));for(var o=[],i=[],a=0,s=C(t);s>a;a++){var u=t[a],l=n?n(u,a,t):u;e?(a&&i===l||o.push(u),i=l):n?w.contains(i,l)||(i.push(l),o.push(u)):w.contains(o,u)||o.push(u)}return o},w.union=function(){return w.uniq(T(arguments,!0,!0))},w.intersection=function(t){for(var e=[],n=arguments.length,r=0,o=C(t);o>r;r++){var i=t[r];if(!w.contains(e,i)){for(var a=1;n>a&&w.contains(arguments[a],i);a++);a===n&&e.push(i)}}return e},w.difference=function(t){var e=T(arguments,!0,!0,1);return w.filter(t,function(t){return!w.contains(e,t)})},w.zip=function(){return w.unzip(arguments)},w.unzip=function(t){for(var e=t&&w.max(t,C).length||0,n=Array(e),r=0;e>r;r++)n[r]=w.pluck(t,r);return n},w.object=function(t,e){for(var n={},r=0,o=C(t);o>r;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n},w.findIndex=r(1),w.findLastIndex=r(-1),w.sortedIndex=function(t,e,n,r){n=_(n,r,1);for(var o=n(e),i=0,a=C(t);a>i;){var s=Math.floor((i+a)/2);n(t[s])<o?i=s+1:a=s}return i},w.indexOf=o(1,w.findIndex,w.sortedIndex),w.lastIndexOf=o(-1,w.findLastIndex),w.range=function(t,e,n){null==e&&(e=t||0,t=0),n=n||1;for(var r=Math.max(Math.ceil((e-t)/n),0),o=Array(r),i=0;r>i;i++,t+=n)o[i]=t;return o};var N=function(t,e,n,r,o){if(!(r instanceof e))return t.apply(n,o);var i=j(t.prototype),a=t.apply(i,o);return w.isObject(a)?a:i};w.bind=function(t,e){if(v&&t.bind===v)return v.apply(t,d.call(arguments,1));if(!w.isFunction(t))throw new TypeError("Bind must be called on a function");var n=d.call(arguments,2),r=function(){return N(t,r,e,this,n.concat(d.call(arguments)))};return r},w.partial=function(t){var e=d.call(arguments,1),n=function(){for(var r=0,o=e.length,i=Array(o),a=0;o>a;a++)i[a]=e[a]===w?arguments[r++]:e[a];for(;r<arguments.length;)i.push(arguments[r++]);return N(t,n,this,this,i)};return n},w.bindAll=function(t){var e,n,r=arguments.length;if(1>=r)throw new Error("bindAll must be passed function names");for(e=1;r>e;e++)n=arguments[e],t[n]=w.bind(t[n],t);return t},w.memoize=function(t,e){var n=function(r){var o=n.cache,i=""+(e?e.apply(this,arguments):r);return w.has(o,i)||(o[i]=t.apply(this,arguments)),o[i]};return n.cache={},n},w.delay=function(t,e){var n=d.call(arguments,2);return setTimeout(function(){return t.apply(null,n)},e)},w.defer=w.partial(w.delay,w,1),w.throttle=function(t,e,n){var r,o,i,a=null,s=0;n||(n={});var u=function(){s=n.leading===!1?0:w.now(),a=null,i=t.apply(r,o),a||(r=o=null)};return function(){var l=w.now();s||n.leading!==!1||(s=l);var c=e-(l-s);return r=this,o=arguments,0>=c||c>e?(a&&(clearTimeout(a),a=null),s=l,i=t.apply(r,o),a||(r=o=null)):a||n.trailing===!1||(a=setTimeout(u,c)),i}},w.debounce=function(t,e,n){var r,o,i,a,s,u=function(){var l=w.now()-a;e>l&&l>=0?r=setTimeout(u,e-l):(r=null,n||(s=t.apply(i,o),r||(i=o=null)))};return function(){i=this,o=arguments,a=w.now();var l=n&&!r;return r||(r=setTimeout(u,e)),l&&(s=t.apply(i,o),i=o=null),s}},w.wrap=function(t,e){return w.partial(e,t)},w.negate=function(t){return function(){return!t.apply(this,arguments)}},w.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}},w.after=function(t,e){return function(){return--t<1?e.apply(this,arguments):void 0}},w.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),1>=t&&(e=null),n}},w.once=w.partial(w.before,2);var O=!{toString:null}.propertyIsEnumerable("toString"),q=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];w.keys=function(t){if(!w.isObject(t))return[];if(g)return g(t);var e=[];for(var n in t)w.has(t,n)&&e.push(n);return O&&i(t,e),e},w.allKeys=function(t){if(!w.isObject(t))return[];var e=[];for(var n in t)e.push(n);return O&&i(t,e),e},w.values=function(t){for(var e=w.keys(t),n=e.length,r=Array(n),o=0;n>o;o++)r[o]=t[e[o]];return r},w.mapObject=function(t,e,n){e=_(e,n);for(var r,o=w.keys(t),i=o.length,a={},s=0;i>s;s++)r=o[s],a[r]=e(t[r],r,t);return a},w.pairs=function(t){for(var e=w.keys(t),n=e.length,r=Array(n),o=0;n>o;o++)r[o]=[e[o],t[e[o]]];return r},w.invert=function(t){for(var e={},n=w.keys(t),r=0,o=n.length;o>r;r++)e[t[n[r]]]=n[r];return e},w.functions=w.methods=function(t){var e=[];for(var n in t)w.isFunction(t[n])&&e.push(n);return e.sort()},w.extend=k(w.allKeys),w.extendOwn=w.assign=k(w.keys),w.findKey=function(t,e,n){e=_(e,n);for(var r,o=w.keys(t),i=0,a=o.length;a>i;i++)if(r=o[i],e(t[r],r,t))return r},w.pick=function(t,e,n){var r,o,i={},a=t;if(null==a)return i;w.isFunction(e)?(o=w.allKeys(a),r=b(e,n)):(o=T(arguments,!1,!1,1),r=function(t,e,n){return e in n},a=Object(a));for(var s=0,u=o.length;u>s;s++){var l=o[s],c=a[l];r(c,l,a)&&(i[l]=c)}return i},w.omit=function(t,e,n){if(w.isFunction(e))e=w.negate(e);else{var r=w.map(T(arguments,!1,!1,1),String);e=function(t,e){return!w.contains(r,e)}}return w.pick(t,e,n)},w.defaults=k(w.allKeys,!0),w.create=function(t,e){var n=j(t);return e&&w.extendOwn(n,e),n},w.clone=function(t){return w.isObject(t)?w.isArray(t)?t.slice():w.extend({},t):t},w.tap=function(t,e){return e(t),t},w.isMatch=function(t,e){var n=w.keys(e),r=n.length;if(null==t)return!r;for(var o=Object(t),i=0;r>i;i++){var a=n[i];if(e[a]!==o[a]||!(a in o))return!1}return!0};var D=function(t,e,n,r){if(t===e)return 0!==t||1/t===1/e;if(null==t||null==e)return t===e;t instanceof w&&(t=t._wrapped),e instanceof w&&(e=e._wrapped);var o=h.call(t);if(o!==h.call(e))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!==+t?+e!==+e:0===+t?1/+t===1/e:+t===+e;case"[object Date]":case"[object Boolean]":return+t===+e}var i="[object Array]"===o;if(!i){if("object"!=typeof t||"object"!=typeof e)return!1;var a=t.constructor,s=e.constructor;if(a!==s&&!(w.isFunction(a)&&a instanceof a&&w.isFunction(s)&&s instanceof s)&&"constructor"in t&&"constructor"in e)return!1}n=n||[],r=r||[];for(var u=n.length;u--;)if(n[u]===t)return r[u]===e;if(n.push(t),r.push(e),i){if(u=t.length,u!==e.length)return!1;for(;u--;)if(!D(t[u],e[u],n,r))return!1}else{var l,c=w.keys(t);if(u=c.length,w.keys(e).length!==u)return!1;for(;u--;)if(l=c[u],!w.has(e,l)||!D(t[l],e[l],n,r))return!1}return n.pop(),r.pop(),!0};w.isEqual=function(t,e){return D(t,e)},w.isEmpty=function(t){return null==t?!0:S(t)&&(w.isArray(t)||w.isString(t)||w.isArguments(t))?0===t.length:0===w.keys(t).length},w.isElement=function(t){return!(!t||1!==t.nodeType)},w.isArray=m||function(t){return"[object Array]"===h.call(t)},w.isObject=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},w.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(t){w["is"+t]=function(e){return h.call(e)==="[object "+t+"]"}}),w.isArguments(arguments)||(w.isArguments=function(t){return w.has(t,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(w.isFunction=function(t){return"function"==typeof t||!1}),w.isFinite=function(t){return isFinite(t)&&!isNaN(parseFloat(t))},w.isNaN=function(t){return w.isNumber(t)&&t!==+t},w.isBoolean=function(t){return t===!0||t===!1||"[object Boolean]"===h.call(t)},w.isNull=function(t){return null===t},w.isUndefined=function(t){return void 0===t},w.has=function(t,e){return null!=t&&p.call(t,e)},w.noConflict=function(){return a._=s,this},w.identity=function(t){return t},w.constant=function(t){return function(){return t}},w.noop=function(){},w.property=M,w.propertyOf=function(t){return null==t?function(){}:function(e){return t[e]}},w.matcher=w.matches=function(t){return t=w.extendOwn({},t),function(e){return w.isMatch(e,t)}},w.times=function(t,e,n){var r=Array(Math.max(0,t));e=b(e,n,1);for(var o=0;t>o;o++)r[o]=e(o);return r},w.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))},w.now=Date.now||function(){return(new Date).getTime()};var L={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},F=w.invert(L),z=function(t){var e=function(e){return t[e]},n="(?:"+w.keys(t).join("|")+")",r=RegExp(n),o=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(o,e):t}};w.escape=z(L),w.unescape=z(F),w.result=function(t,e,n){var r=null==t?void 0:t[e];return void 0===r&&(r=n),w.isFunction(r)?r.call(t):r};var R=0;w.uniqueId=function(t){var e=++R+"";return t?t+e:e},w.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var P=/(.)^/,I={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},H=/\\|'|\r|\n|\u2028|\u2029/g,$=function(t){return"\\"+I[t]};w.template=function(t,e,n){!e&&n&&(e=n),e=w.defaults({},e,w.templateSettings);var r=RegExp([(e.escape||P).source,(e.interpolate||P).source,(e.evaluate||P).source].join("|")+"|$","g"),o=0,i="__p+='";t.replace(r,function(e,n,r,a,s){return i+=t.slice(o,s).replace(H,$),o=s+e.length,n?i+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?i+="'+\n((__t=("+r+"))==null?'':__t)+\n'":a&&(i+="';\n"+a+"\n__p+='"),e}),i+="';\n",e.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var a=new Function(e.variable||"obj","_",i)}catch(s){throw s.source=i,s}var u=function(data){return a.call(this,data,w)},l=e.variable||"obj";return u.source="function("+l+"){\n"+i+"}",u},w.chain=function(t){var e=w(t);return e._chain=!0,e};var B=function(t,e){return t._chain?w(e).chain():e};w.mixin=function(t){w.each(w.functions(t),function(e){var n=w[e]=t[e];w.prototype[e]=function(){var t=[this._wrapped];return f.apply(t,arguments),B(this,n.apply(w,t))}})},w.mixin(w),w.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=u[t];w.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],B(this,n)}}),w.each(["concat","join","slice"],function(t){var e=u[t];w.prototype[t]=function(){return B(this,e.apply(this._wrapped,arguments))}}),w.prototype.value=function(){return this._wrapped},w.prototype.valueOf=w.prototype.toJSON=w.prototype.value,w.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return w})}).call(this)},{}],12:[function(t,e,n){function r(t,e){if(e||(e={}),e.model&&(this.model=e.model),e.comparator&&(this.comparator=e.comparator),e.parent&&(this.parent=e.parent),!this.mainIndex){var n=this.model&&this.model.prototype&&this.model.prototype.idAttribute;this.mainIndex=n||"id"}this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,u({silent:!0},e))}var o=t("ampersand-events"),i=t("ampersand-class-extend"),a=t("lodash.isarray"),s=t("lodash.bind"),u=t("lodash.assign"),l=[].slice;u(r.prototype,o,{initialize:function(){},isModel:function(t){return this.model&&t instanceof this.model},add:function(t,e){return this.set(t,u({merge:!1,add:!0,remove:!1},e))},parse:function(t,e){return t},serialize:function(){return this.map(function(t){if(t.serialize)return t.serialize();var e={};return u(e,t),delete e.collection,e})},toJSON:function(){return this.serialize()},set:function(t,e){e=u({add:!0,remove:!0,merge:!0},e),e.parse&&(t=this.parse(t,e));var n=!a(t);t=n?t?[t]:[]:t.slice();var r,o,i,s,l,c,f,d=e.at,h=this.comparator&&null==d&&e.sort!==!1,p="string"==typeof this.comparator?this.comparator:null,m=[],g=[],v={},y=e.add,x=e.merge,w=e.remove,b=!h&&y&&w?[]:!1,_=this.model&&this.model.prototype||Object.prototype;for(c=0,f=t.length;f>c;c++){if(i=t[c]||{},r=this.isModel(i)?o=i:_.generateId?_.generateId(i):i[this.mainIndex],s=this.get(r))w&&(v[s.cid||s[this.mainIndex]]=!0),x&&(i=i===o?o.attributes:i,e.parse&&(i=s.parse(i,e)),s.set?(s.set(i,e),h&&!l&&s.hasChanged(p)&&(l=!0)):u(s,i)),t[c]=s;else if(y){if(o=t[c]=this._prepareModel(i,e),!o)continue;m.push(o),this._addReference(o,e)}o=s||o,o&&(b&&(o.isNew&&o.isNew()||!o[this.mainIndex]||!v[o.cid||o[this.mainIndex]])&&b.push(o),v[o[this.mainIndex]]=!0)}if(w){for(c=0,f=this.length;f>c;c++)o=this.models[c],v[o.cid||o[this.mainIndex]]||g.push(o);g.length&&this.remove(g,e)}if(m.length||b&&b.length)if(h&&(l=!0),null!=d)for(c=0,f=m.length;f>c;c++)this.models.splice(d+c,0,m[c]);else{var k=b||m;for(c=0,f=k.length;f>c;c++)this.models.push(k[c])}if(l&&this.sort({silent:!0}),!e.silent){for(c=0,f=m.length;f>c;c++)o=m[c],o.trigger?o.trigger("add",o,this,e):this.trigger("add",o,this,e);(l||b&&b.length)&&this.trigger("sort",this,e)}return n?t[0]:t},get:function(t,e){if(null!=t){var n=this._indexes[e||this.mainIndex];return n&&(n[t]||n[t[this.mainIndex]])||this._indexes.cid[t]||this._indexes.cid[t.cid]}},at:function(t){return this.models[t]},remove:function(t,e){var n,r,o,i,s=!a(t);for(t=s?[t]:l.call(t),e||(e={}),n=0,r=t.length;r>n;n++)o=t[n]=this.get(t[n]),o&&(this._deIndex(o),i=this.models.indexOf(o),this.models.splice(i,1),e.silent||(e.index=i,o.trigger?o.trigger("remove",o,this,e):this.trigger("remove",o,this,e)),this._removeReference(o,e));return s?t[0]:t},reset:function(t,e){e||(e={});for(var n=0,r=this.models.length;r>n;n++)this._removeReference(this.models[n],e);return e.previousModels=this.models,this._reset(),t=this.add(t,u({silent:!0},e)),e.silent||this.trigger("reset",this,e),t},sort:function(t){var e=this;if(!this.comparator)throw new Error("Cannot sort a set without a comparator");return t||(t={}),this.models.sort("string"==typeof this.comparator?function(t,n){return t.get?(t=t.get(e.comparator),n=n.get(e.comparator)):(t=t[e.comparator],n=n[e.comparator]),t>n||void 0===t?1:n>t||void 0===n?-1:0}:1===this.comparator.length?function(t,n){return t=e.comparator(t),n=e.comparator(n),t>n||void 0===t?1:n>t||void 0===n?-1:0}:s(this.comparator,this)),t.silent||this.trigger("sort",this,t),this},_reset:function(){var t=l.call(this.indexes||[]),e=0;t.push(this.mainIndex),t.push("cid");var n=t.length;for(this.models=[],this._indexes={};n>e;e++)this._indexes[t[e]]={}},_prepareModel:function(t,e){if(!this.model)return t;if(this.isModel(t))return t.collection||(t.collection=this),t;e=e?u({},e):{},e.collection=this;var n=new this.model(t,e);return n.validationError?(this.trigger("invalid",this,n.validationError,e),!1):n},_deIndex:function(t,e,n){var r;if(void 0!==e){if(void 0===this._indexes[e])throw new Error("Given attribute is not an index");return void delete this._indexes[e][n]}for(e in this._indexes)r=t.hasOwnProperty(e)?t[e]:t.get&&t.get(e),delete this._indexes[e][r]},_index:function(t,e){var n;if(void 0!==e){if(void 0===this._indexes[e])throw new Error("Given attribute is not an index");return n=t[e]||t.get&&t.get(e),void(n&&(this._indexes[e][n]=t))}for(e in this._indexes)n=t.hasOwnProperty(e)?t[e]:t.get&&t.get(e),null!=n&&(this._indexes[e][n]=t)},_addReference:function(t,e){this._index(t),t.collection||(t.collection=this),t.on&&t.on("all",this._onModelEvent,this)},_removeReference:function(t,e){this===t.collection&&delete t.collection,this._deIndex(t),t.off&&t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,n,r){var o=t.split(":")[0],i=t.split(":")[1];("add"!==o&&"remove"!==o||n===this)&&("destroy"===o&&this.remove(e,r),e&&"change"===o&&i&&this._indexes[i]&&(this._deIndex(e,i,e.previousAttributes()[i]),this._index(e,i)),this.trigger.apply(this,arguments))}}),Object.defineProperties(r.prototype,{length:{get:function(){return this.models.length}},isCollection:{value:!0}});var c=["indexOf","lastIndexOf","every","some","forEach","map","filter","reduce","reduceRight"];c.forEach(function(t){r.prototype[t]=function(){return this.models[t].apply(this.models,arguments)}}),r.prototype.each=r.prototype.forEach,r.extend=i,e.exports=r},{"ampersand-class-extend":13,"ampersand-events":14,"lodash.assign":30,"lodash.bind":40,"lodash.isarray":46}],13:[function(t,e,n){var r=t("lodash.assign"),o=function(t){var e,n=this,o=[].slice.call(arguments);e=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return n.apply(this,arguments)},r(e,n);var i=function(){this.constructor=e};return i.prototype=n.prototype,e.prototype=new i,t&&(o.unshift(e.prototype),r.apply(null,o)),e.__super__=n.prototype,e};e.exports=o},{"lodash.assign":30}],14:[function(t,e,n){"undefined"!=typeof window&&(window.ampersand=window.ampersand||{},window.ampersand["ampersand-events"]=window.ampersand["ampersand-events"]||[],window.ampersand["ampersand-events"].push("1.1.1"));var r=t("lodash.once"),o=t("lodash.uniqueid"),i=t("lodash.keys"),a=t("lodash.isempty"),s=t("lodash.foreach"),u=(t("lodash.bind"),t("lodash.assign")),l=Array.prototype.slice,c=/\s+/,f={on:function(t,e,n){if(!d(this,"on",t,[e,n])||!e)return this;this._events||(this._events={});var r=this._events[t]||(this._events[t]=[]);return r.push({callback:e,context:n,ctx:n||this}),this},once:function(t,e,n){if(!d(this,"once",t,[e,n])||!e)return this;var o=this,i=r(function(){o.off(t,i),e.apply(this,arguments)});return i._callback=e,this.on(t,i,n)},off:function(t,e,n){var r,o,a,s,u,l,c,f;if(!this._events||!d(this,"off",t,[e,n]))return this;if(!t&&!e&&!n)return this._events=void 0,this;for(s=t?[t]:i(this._events),u=0,l=s.length;l>u;u++)if(t=s[u],a=this._events[t]){if(this._events[t]=r=[],e||n)for(c=0,f=a.length;f>c;c++)o=a[c],(e&&e!==o.callback&&e!==o.callback._callback||n&&n!==o.context)&&r.push(o);r.length||delete this._events[t]}return this},trigger:function(t){if(!this._events)return this;var e=l.call(arguments,1);if(!d(this,"trigger",t,e))return this;var n=this._events[t],r=this._events.all;return n&&h(n,e),r&&h(r,arguments),this},stopListening:function(t,e,n){var r=this._listeningTo;if(!r)return this;var o=!e&&!n;n||"object"!=typeof e||(n=this),t&&((r={})[t._listenId]=t);for(var i in r)t=r[i],t.off(e,n,this),(o||a(t._events))&&delete this._listeningTo[i];return this},createEmitter:function(t){return u(t||{},f)}};f.bind=f.on,f.unbind=f.off;var d=function(t,e,n,r){if(!n)return!0;if("object"==typeof n){for(var o in n)t[e].apply(t,[o,n[o]].concat(r));return!1}if(c.test(n)){for(var i=n.split(c),a=0,s=i.length;s>a;a++)t[e].apply(t,[i[a]].concat(r));return!1}return!0},h=function(t,e){var n,r=-1,o=t.length,i=e[0],a=e[1],s=e[2];switch(e.length){case 0:for(;++r<o;)(n=t[r]).callback.call(n.ctx);return;case 1:for(;++r<o;)(n=t[r]).callback.call(n.ctx,i);return;case 2:for(;++r<o;)(n=t[r]).callback.call(n.ctx,i,a);return;case 3:for(;++r<o;)(n=t[r]).callback.call(n.ctx,i,a,s);return;default:for(;++r<o;)(n=t[r]).callback.apply(n.ctx,e);return}},p={listenTo:"on",listenToOnce:"once"};s(p,function(t,e){f[e]=function(e,n,r,i){var a=this._listeningTo||(this._listeningTo={}),s=e._listenId||(e._listenId=o("l"));return a[s]=e,r||"object"!=typeof n||(r=this),e[t](n,r,this),this}}),f.listenToAndRun=function(t,e,n){return f.listenTo.apply(this,arguments),n||"object"!=typeof e||(n=this),n.apply(this),this},e.exports=f},{"lodash.assign":30,"lodash.bind":40,"lodash.foreach":15,"lodash.isempty":19,"lodash.keys":23,"lodash.once":26,"lodash.uniqueid":28}],15:[function(t,e,n){function r(t,e){return function(n,r,o){return"function"==typeof r&&void 0===o&&s(n)?t(n,r):e(n,a(r,o,3))}}var o=t("lodash._arrayeach"),i=t("lodash._baseeach"),a=t("lodash._bindcallback"),s=t("lodash.isarray"),u=r(o,i);e.exports=u},{"lodash._arrayeach":16,"lodash._baseeach":17,"lodash._bindcallback":18,"lodash.isarray":46}],16:[function(t,e,n){function r(t,e){for(var n=-1,r=t.length;++n<r&&e(t[n],n,t)!==!1;);return t}e.exports=r;
+
+},{}],17:[function(t,e,n){function r(t,e){return h(t,e,c)}function o(t){return function(e){return null==e?void 0:e[t]}}function i(t,e){return function(n,r){var o=n?p(n):0;if(!s(o))return t(n,r);for(var i=e?o:-1,a=u(n);(e?i--:++i<o)&&r(a[i],i,a)!==!1;);return n}}function a(t){return function(e,n,r){for(var o=u(e),i=r(e),a=i.length,s=t?a:-1;t?s--:++s<a;){var l=i[s];if(n(o[l],l,o)===!1)break}return e}}function s(t){return"number"==typeof t&&t>-1&&t%1==0&&f>=t}function u(t){return l(t)?t:Object(t)}function l(t){var e=typeof t;return"function"==e||!!t&&"object"==e}var c=t("lodash.keys"),f=Math.pow(2,53)-1,d=i(r),h=a(),p=o("length");e.exports=d},{"lodash.keys":23}],18:[function(t,e,n){function r(t,e,n){if("function"!=typeof t)return o;if(void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 3:return function(n,r,o){return t.call(e,n,r,o)};case 4:return function(n,r,o,i){return t.call(e,n,r,o,i)};case 5:return function(n,r,o,i,a){return t.call(e,n,r,o,i,a)}}return function(){return t.apply(e,arguments)}}function o(t){return t}e.exports=r},{}],19:[function(t,e,n){function r(t){return!!t&&"object"==typeof t}function o(t){return function(e){return null==e?void 0:e[t]}}function i(t){return"number"==typeof t&&t>-1&&t%1==0&&d>=t}function a(t){if(null==t)return!0;var e=h(t);return i(e)&&(u(t)||c(t)||s(t)||r(t)&&l(t.splice))?!e:!f(t).length}var s=t("lodash.isarguments"),u=t("lodash.isarray"),l=t("lodash.isfunction"),c=t("lodash.isstring"),f=t("lodash.keys"),d=Math.pow(2,53)-1,h=o("length");e.exports=a},{"lodash.isarguments":20,"lodash.isarray":46,"lodash.isfunction":21,"lodash.isstring":22,"lodash.keys":23}],20:[function(t,e,n){function r(t){return!!t&&"object"==typeof t}function o(t){return"number"==typeof t&&t>-1&&t%1==0&&l>=t}function i(t){var e=r(t)?t.length:void 0;return o(e)&&u.call(t)==a}var a="[object Arguments]",s=Object.prototype,u=s.toString,l=Math.pow(2,53)-1;e.exports=i},{}],21:[function(t,e,n){(function(t){function n(t){return"function"==typeof t||!1}function r(t){return"string"==typeof t?t:null==t?"":t+""}function o(t){return!!t&&"object"==typeof t}function i(t){return null==t?!1:h.call(t)==s?p.test(d.call(t)):o(t)&&c.test(t)}function a(t){return t=r(t),t&&l.test(t)?t.replace(u,"\\$&"):t}var s="[object Function]",u=/[.*+?^${}()|[\]\/\\]/g,l=RegExp(u.source),c=/^\[object .+?Constructor\]$/,f=Object.prototype,d=Function.prototype.toString,h=f.toString,p=RegExp("^"+a(h).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),m=i(m=t.Uint8Array)&&m,g=n(/x/)||m&&!n(m)?function(t){return h.call(t)==s}:n;e.exports=g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],22:[function(t,e,n){function r(t){return!!t&&"object"==typeof t}function o(t){return"string"==typeof t||r(t)&&s.call(t)==i}var i="[object String]",a=Object.prototype,s=a.toString;e.exports=o},{}],23:[function(t,e,n){function r(t,e){return t=+t,e=null==e?m:e,t>-1&&t%1==0&&e>t}function o(t){return"number"==typeof t&&t>-1&&t%1==0&&m>=t}function i(t){for(var e=s(t),n=e.length,i=n&&t.length,a=i&&o(i)&&(l(t)||g.nonEnumArgs&&u(t)),c=-1,f=[];++c<n;){var h=e[c];(a&&r(h,i)||d.call(t,h))&&f.push(h)}return f}function a(t){var e=typeof t;return"function"==e||!!t&&"object"==e}function s(t){if(null==t)return[];a(t)||(t=Object(t));var e=t.length;e=e&&o(e)&&(l(t)||g.nonEnumArgs&&u(t))&&e||0;for(var n=t.constructor,i=-1,s="function"==typeof n&&n.prototype===t,c=Array(e),f=e>0;++i<e;)c[i]=i+"";for(var h in t)f&&r(h,e)||"constructor"==h&&(s||!d.call(t,h))||c.push(h);return c}var u=t("lodash.isarguments"),l=t("lodash.isarray"),c=t("lodash.isnative"),f=Object.prototype,d=f.hasOwnProperty,h=f.propertyIsEnumerable,p=c(p=Object.keys)&&p,m=Math.pow(2,53)-1,g={};!function(t){var e=function(){this.x=t},n=[];e.prototype={valueOf:t,y:t};for(var r in new e)n.push(r);try{g.nonEnumArgs=!h.call(arguments,1)}catch(o){g.nonEnumArgs=!0}}(1,0);var v=p?function(t){if(t)var e=t.constructor,n=t.length;return"function"==typeof e&&e.prototype===t||"function"!=typeof t&&o(n)?i(t):a(t)?p(t):[]}:i;e.exports=v},{"lodash.isarguments":24,"lodash.isarray":46,"lodash.isnative":25}],24:[function(t,e,n){e.exports=t(20)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],25:[function(t,e,n){function r(t){return"string"==typeof t?t:null==t?"":t+""}function o(t){return!!t&&"object"==typeof t}function i(t){return null==t?!1:h.call(t)==s?p.test(d.call(t)):o(t)&&c.test(t)}function a(t){return t=r(t),t&&l.test(t)?t.replace(u,"\\$&"):t}var s="[object Function]",u=/[.*+?^${}()|[\]\/\\]/g,l=RegExp(u.source),c=/^\[object .+?Constructor\]$/,f=Object.prototype,d=Function.prototype.toString,h=f.toString,p=RegExp("^"+a(h).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=i},{}],26:[function(t,e,n){function r(t){return o(2,t)}var o=t("lodash.before");e.exports=r},{"lodash.before":27}],27:[function(t,e,n){function r(t,e){var n;if("function"!=typeof e){if("function"!=typeof t)throw new TypeError(o);var r=t;t=e,e=r}return function(){return--t>0&&(n=e.apply(this,arguments)),1>=t&&(e=null),n}}var o="Expected a function";e.exports=r},{}],28:[function(t,e,n){function r(t){var e=++i;return o(t)+e}var o=t("lodash._basetostring"),i=0;e.exports=r},{"lodash._basetostring":29}],29:[function(t,e,n){function r(t){return"string"==typeof t?t:null==t?"":t+""}e.exports=r},{}],30:[function(t,e,n){function r(t,e,n){var r=c(e);h.apply(r,p(e));for(var o=-1,i=r.length;++o<i;){var a=r[o],s=t[a],u=n(s,e[a],a,t,e);(u===u?u===s:s!==s)&&(void 0!==s||a in t)||(t[a]=u)}return t}function o(t){return i(t)?t:Object(t)}function i(t){var e=typeof t;return"function"==e||!!t&&"object"==e}function a(t){return function(){return t}}var s=t("lodash._baseassign"),u=t("lodash._createassigner"),l=t("lodash.isnative"),c=t("lodash.keys"),f=Array.prototype,d=l(d=Object.getOwnPropertySymbols)&&d,h=f.push,p=d?function(t){return d(o(t))}:a([]),m=u(function(t,e,n){return n?r(t,e,n):s(t,e)});e.exports=m},{"lodash._baseassign":31,"lodash._createassigner":33,"lodash.isnative":37,"lodash.keys":38}],31:[function(t,e,n){function r(t){return o(t)?t:Object(t)}function o(t){var e=typeof t;return"function"==e||!!t&&"object"==e}function i(t){return function(){return t}}var a=t("lodash._basecopy"),s=t("lodash.isnative"),u=t("lodash.keys"),l=s(l=Object.getOwnPropertySymbols)&&l,c=s(Object.preventExtensions=Object.preventExtensions)&&c,f=function(){var t={1:0},e=c&&s(e=Object.assign)&&e;try{e(c(t),"xo")}catch(n){}return!t[1]&&e}(),d=f||function(t,e){return null==e?t:a(e,h(e),a(e,u(e),t))},h=l?function(t){return l(r(t))}:i([]);e.exports=d},{"lodash._basecopy":32,"lodash.isnative":37,"lodash.keys":38}],32:[function(t,e,n){function r(t,e,n){n||(n={});for(var r=-1,o=e.length;++r<o;){var i=e[r];n[i]=t[i]}return n}e.exports=r},{}],33:[function(t,e,n){function r(t){return a(function(e,n){var r=-1,a=null==e?0:n.length,s=a>2&&n[a-2],u=a>2&&n[2],l=a>1&&n[a-1];for("function"==typeof s?(s=o(s,l,5),a-=2):(s="function"==typeof l?l:null,a-=s?1:0),u&&i(n[0],n[1],u)&&(s=3>a?null:s,a=1);++r<a;){var c=n[r];c&&t(e,c,s)}return e})}var o=t("lodash._bindcallback"),i=t("lodash._isiterateecall"),a=t("lodash.restparam");e.exports=r},{"lodash._bindcallback":34,"lodash._isiterateecall":35,"lodash.restparam":36}],34:[function(t,e,n){e.exports=t(18)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/node_modules/lodash._bindcallback/index.js":18}],35:[function(t,e,n){function r(t){return function(e){return null==e?void 0:e[t]}}function o(t,e){return t=+t,e=null==e?u:e,t>-1&&t%1==0&&e>t}function i(t,e,n){if(!s(n))return!1;var r=typeof e;if("number"==r)var i=l(n),u=a(i)&&o(e,i);else u="string"==r&&e in n;if(u){var c=n[e];return t===t?t===c:c!==c}return!1}function a(t){return"number"==typeof t&&t>-1&&t%1==0&&u>=t}function s(t){var e=typeof t;return"function"==e||!!t&&"object"==e}var u=Math.pow(2,53)-1,l=r("length");e.exports=i},{}],36:[function(t,e,n){function r(t,e){if("function"!=typeof t)throw new TypeError(o);return e=i(void 0===e?t.length-1:+e||0,0),function(){for(var n=arguments,r=-1,o=i(n.length-e,0),a=Array(o);++r<o;)a[r]=n[e+r];switch(e){case 0:return t.call(this,a);case 1:return t.call(this,n[0],a);case 2:return t.call(this,n[0],n[1],a)}var s=Array(e+1);for(r=-1;++r<e;)s[r]=n[r];return s[e]=a,t.apply(this,s)}}var o="Expected a function",i=Math.max;e.exports=r},{}],37:[function(t,e,n){e.exports=t(25)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/node_modules/lodash.isnative/index.js":25}],38:[function(t,e,n){e.exports=t(23)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/index.js":23,"lodash.isarguments":39,"lodash.isarray":46,"lodash.isnative":37}],39:[function(t,e,n){e.exports=t(20)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],40:[function(t,e,n){var r=t("lodash._createwrapper"),o=t("lodash._replaceholders"),i=t("lodash.restparam"),a=1,s=32,u=i(function(t,e,n){var i=a;if(n.length){var l=o(n,u.placeholder);i|=s}return r(t,i,e,n,l)});u.placeholder={},e.exports=u},{"lodash._createwrapper":41,"lodash._replaceholders":44,"lodash.restparam":45}],41:[function(t,e,n){(function(n){function r(t,e,n){for(var r=n.length,o=-1,i=M(t.length-r,0),a=-1,s=e.length,u=Array(i+s);++a<s;)u[a]=e[a];for(;++o<r;)u[n[o]]=t[o];for(;i--;)u[a++]=t[o++];return u}function o(t,e,n){for(var r=-1,o=n.length,i=-1,a=M(t.length-o,0),s=-1,u=e.length,l=Array(a+u);++i<a;)l[i]=t[i];for(var c=i;++s<u;)l[c+s]=e[s];for(;++r<o;)l[c+n[r]]=t[i++];return l}function i(t,e){function r(){var i=this&&this!==n&&this instanceof r?o:t;return i.apply(e,arguments)}var o=a(t);return r}function a(t){return function(){var e=p(t.prototype),n=t.apply(e,arguments);return d(n)?n:e}}function s(t,e,i,u,l,c,d,p,j,E){function C(){for(var y=arguments.length,x=y,w=Array(y);x--;)w[x]=arguments[x];if(u&&(w=r(w,u,l)),c&&(w=o(w,c,d)),N||q){var k=C.placeholder,F=m(w,k);if(y-=F.length,E>y){var z=p?h(p):null,R=M(E-y,0),P=N?F:null,I=N?null:F,H=N?w:null,$=N?null:w;e|=N?b:_,e&=~(N?_:b),O||(e&=~(g|v));var B=s(t,e,i,H,P,$,I,z,j,R);return B.placeholder=k,B}}var V=A?i:this;T&&(t=V[L]),p&&(w=f(w,p)),S&&j<w.length&&(w.length=j);var U=this&&this!==n&&this instanceof C?D||a(t):t;return U.apply(V,w)}var S=e&k,A=e&g,T=e&v,N=e&x,O=e&y,q=e&w,D=!T&&a(t),L=t;return C}function u(t,e,r,o){function i(){for(var e=-1,a=arguments.length,l=-1,c=o.length,f=Array(a+c);++l<c;)f[l]=o[l];for(;a--;)f[l++]=arguments[++e];var d=this&&this!==n&&this instanceof i?u:t;return d.apply(s?r:this,f)}var s=e&g,u=a(t);return i}function l(t,e,n,r,o,a,l,c){var f=e&v;if(!f&&"function"!=typeof t)throw new TypeError(j);var d=r?r.length:0;if(d||(e&=~(b|_),r=o=null),d-=o?o.length:0,e&_){var h=r,p=o;r=o=null}var m=[t,e,n,r,o,h,p,a,l,c];if(m[9]=null==c?f?0:t.length:M(c-d,0)||0,e==g)var y=i(m[0],m[2]);else y=e!=b&&e!=(g|b)||m[4].length?s.apply(void 0,m):u.apply(void 0,m);return y}function c(t,e){return t=+t,e=null==e?C:e,t>-1&&t%1==0&&e>t}function f(t,e){for(var n=t.length,r=E(e.length,n),o=h(t);r--;){var i=e[r];t[r]=c(i,n)?o[i]:void 0}return t}function d(t){var e=typeof t;return"function"==e||!!t&&"object"==e}var h=t("lodash._arraycopy"),p=t("lodash._basecreate"),m=t("lodash._replaceholders"),g=1,v=2,y=4,x=8,w=16,b=32,_=64,k=128,j="Expected a function",M=Math.max,E=Math.min,C=Math.pow(2,53)-1;e.exports=l}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"lodash._arraycopy":42,"lodash._basecreate":43,"lodash._replaceholders":44}],42:[function(t,e,n){function r(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}e.exports=r},{}],43:[function(t,e,n){(function(t){function n(t){var e=typeof t;return"function"==e||!!t&&"object"==e}var r=function(){function e(){}return function(r){if(n(r)){e.prototype=r;var o=new e;e.prototype=null}return o||t.Object()}}();e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],44:[function(t,e,n){function r(t,e){for(var n=-1,r=t.length,i=-1,a=[];++n<r;)t[n]===e&&(t[n]=o,a[++i]=n);return a}var o="__lodash_placeholder__";e.exports=r},{}],45:[function(t,e,n){e.exports=t(36)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/node_modules/lodash.restparam/index.js":36}],46:[function(t,e,n){function r(t){return"string"==typeof t?t:null==t?"":t+""}function o(t){return!!t&&"object"==typeof t}function i(t){return"number"==typeof t&&t>-1&&t%1==0&&y>=t}function a(t){return null==t?!1:m.call(t)==l?g.test(p.call(t)):o(t)&&d.test(t)}function s(t){return t=r(t),t&&f.test(t)?t.replace(c,"\\$&"):t}var u="[object Array]",l="[object Function]",c=/[.*+?^${}()|[\]\/\\]/g,f=RegExp(c.source),d=/^\[object .+?Constructor\]$/,h=Object.prototype,p=Function.prototype.toString,m=h.toString,g=RegExp("^"+s(m).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),v=a(v=Array.isArray)&&v,y=Math.pow(2,53)-1,x=v||function(t){return o(t)&&i(t.length)&&m.call(t)==u};e.exports=x},{}],47:[function(t,e,n){function r(t,e){e||(e={}),this.cid||(this.cid=s("state")),this._events={},this._values={},this._definition=Object.create(this._definition),e.parse&&(t=this.parse(t,e)),this.parent=e.parent,this.collection=e.collection,this._keyTree=new T,this._initCollections(),this._initChildren(),this._cache={},this._previousAttributes={},t&&this.set(t,u({silent:!0,initial:!0},e)),this._changed={},this._derived&&this._initDerived(),e.init!==!1&&this.initialize.apply(this,arguments)}function o(t,e,n,r){var o,i,a=t._definition[e]={};if(h(n))o=t._ensureValidType(n),o&&(a.type=o);else{if(m(n)&&(i=n,n={type:i[0],required:i[1],"default":i[2]}),o=t._ensureValidType(n.type),o&&(a.type=o),n.required&&(a.required=!0),n["default"]&&"object"==typeof n["default"])throw new TypeError("The default value for "+e+" cannot be an object/array, must be a value or a function which returns a value/object/array");a["default"]=n["default"],a.allowNull=n.allowNull?n.allowNull:!1,n.setOnce&&(a.setOnce=!0),a.required&&v(a["default"])&&!a.setOnce&&(a["default"]=t._getDefaultForType(o)),a.test=n.test,a.values=n.values}return r&&(a.session=!0),Object.defineProperty(t,e,{set:function(t){this.set(e,t)},get:function(){var t=this._values[e],n=this._dataTypes[a.type];return"undefined"!=typeof t?(n&&n.get&&(t=n.get(t)),t):(t=j(a,"default"),this._values[e]=t,t)}}),a}function i(t,e,n){var r=t._derived[e]={fn:y(n)?n:n.fn,cache:n.cache!==!1,depList:n.deps||[]};f(r.depList,function(n){t._deps[n]=S(t._deps[n]||[],[e])}),Object.defineProperty(t,e,{get:function(){return this._getDerivedProperty(e)},set:function(){throw new TypeError('"'+e+"\" is a derived property, it can't be set directly.")}})}function a(t){var e,n=this,r=[].slice.call(arguments);e=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return n.apply(this,arguments)},u(e,n);var a=function(){this.constructor=e};if(a.prototype=n.prototype,e.prototype=new a,e.prototype._derived=u({},n.prototype._derived),e.prototype._deps=u({},n.prototype._deps),e.prototype._definition=u({},n.prototype._definition),e.prototype._collections=u({},n.prototype._collections),e.prototype._children=u({},n.prototype._children),e.prototype._dataTypes=u({},n.prototype._dataTypes||q),t){var s=["dataTypes","props","session","derived","collections","children"];r.forEach(function(t){t.dataTypes&&f(t.dataTypes,function(t,n){e.prototype._dataTypes[n]=t}),t.props&&f(t.props,function(t,n){o(e.prototype,n,t)}),t.session&&f(t.session,function(t,n){o(e.prototype,n,t,!0)}),t.derived&&f(t.derived,function(t,n){i(e.prototype,n,t)}),t.collections&&f(t.collections,function(t,n){e.prototype._collections[n]=t}),t.children&&f(t.children,function(t,n){e.prototype._children[n]=t}),u(e.prototype,l(t,s))})}return e.__super__=n.prototype,e}"undefined"!=typeof window&&(window.ampersand=window.ampersand||{},window.ampersand["ampersand-state"]=window.ampersand["ampersand-state"]||[],window.ampersand["ampersand-state"].push("4.5.3"));var s=t("lodash.uniqueid"),u=t("lodash.assign"),l=t("lodash.omit"),c=t("lodash.escape"),f=t("lodash.foreach"),d=t("lodash.includes"),h=t("lodash.isstring"),p=t("lodash.isobject"),m=t("lodash.isarray"),g=t("lodash.isdate"),v=t("lodash.isundefined"),y=t("lodash.isfunction"),x=t("lodash.isnull"),w=t("lodash.isempty"),b=t("lodash.isequal"),_=t("lodash.clone"),k=t("lodash.has"),j=t("lodash.result"),M=t("lodash.keys"),E=t("lodash.bind"),C=t("lodash.defaults"),S=t("lodash.union"),A=t("ampersand-events"),T=t("key-tree-store"),N=t("array-next"),O=/^change:/;u(r.prototype,A,{extraProperties:"ignore",idAttribute:"id",namespaceAttribute:"namespace",typeAttribute:"modelType",initialize:function(){return this},getId:function(){return this[this.idAttribute]},getNamespace:function(){return this[this.namespaceAttribute]},getType:function(){return this[this.typeAttribute]},isNew:function(){return null==this.getId()},escape:function(t){return c(this.get(t))},isValid:function(t){return this._validate({},u(t||{},{validate:!0}))},parse:function(t,e){return t},serialize:function(){var t=this.getAttributes({props:!0},!0);return f(this._children,function(e,n){t[n]=this[n].serialize()},this),f(this._collections,function(e,n){t[n]=this[n].serialize()},this),t},set:function(t,e,n){var r,o,i,a,s,u,l,c,h,m,g,y,w,b,_,k,j=this,M=this.extraProperties;if(p(t)||null===t?(h=t,n=e):(h={},h[t]=e),n=n||{},!this._validate(h,n))return!1;y=n.unset,g=n.silent,b=n.initial,o=[],r=this._changing,this._changing=!0,r||(this._previousAttributes=this.attributes,this._changed={});for(c in h){if(a=h[c],i=typeof a,w=this._values[c],s=this._definition[c],!s){if(this._children[c]||this._collections[c]){this[c].set(a,n);continue}if("ignore"===M)continue;if("reject"===M)throw new TypeError('No "'+c+'" property defined on '+(this.type||"this")+' model and extraProperties not set to "ignore" or "allow"');if("allow"===M)s=this._createPropertyDefinition(c,"any");else if(M)throw new TypeError('Invalid value for extraProperties: "'+M+'"')}if(k=this._getCompareForType(s.type),m=this._dataTypes[s.type],m&&m.set&&(u=m.set(a),a=u.val,i=u.type),s.test&&(l=s.test.call(this,a,i)))throw new TypeError("Property '"+c+"' failed validation with error: "+l);if(v(a)&&s.required)throw new TypeError("Required property '"+c+"' must be of type "+s.type+". Tried to set "+a);if(x(a)&&s.required&&!s.allowNull)throw new TypeError("Property '"+c+"' must be of type "+s.type+" (cannot be null). Tried to set "+a);if(s.type&&"any"!==s.type&&s.type!==i&&!x(a)&&!v(a))throw new TypeError("Property '"+c+"' must be of type "+s.type+". Tried to set "+a);if(s.values&&!d(s.values,a))throw new TypeError("Property '"+c+"' must be one of values: "+s.values.join(", ")+". Tried to set "+a);if(_=!k(w,a,c),s.setOnce&&void 0!==w&&_&&!b)throw new TypeError("Property '"+c+"' can only be set once.");_?(o.push({prev:w,val:a,key:c}),j._changed[c]=a):delete j._changed[c]}if(f(o,function(t){j._previousAttributes[t.key]=t.prev,y?delete j._values[t.key]:j._values[t.key]=t.val}),!g&&o.length&&(j._pending=!0),g||f(o,function(t){j.trigger("change:"+t.key,j,t.val,n)}),r)return this;if(!g)for(;this._pending;)this._pending=!1,this.trigger("change",this,n);return this._pending=!1,this._changing=!1,this},get:function(t){return this[t]},toggle:function(t){var e=this._definition[t];if("boolean"===e.type)this[t]=!this[t];else{if(!e||!e.values)throw new TypeError("Can only toggle properties that are type `boolean` or have `values` array.");this[t]=N(e.values,this[t])}return this},previousAttributes:function(){return _(this._previousAttributes)},hasChanged:function(t){return null==t?!w(this._changed):k(this._changed,t)},changedAttributes:function(t){if(!t)return this.hasChanged()?_(this._changed):!1;var e,n,r,o=!1,i=this._changing?this._previousAttributes:this.attributes;for(var a in t)n=this._definition[a],n&&(r=this._getCompareForType(n.type),r(i[a],e=t[a])||((o||(o={}))[a]=e));return o},toJSON:function(){return this.serialize()},unset:function(t,e){t=Array.isArray(t)?t:[t],f(t,function(t){var n,r=this._definition[t];return r.required?(n=j(r,"default"),this.set(t,n,e)):this.set(t,n,u({},e,{unset:!0}))},this)},clear:function(t){var e=this;return f(M(this.attributes),function(n){e.unset(n,t)}),this},previous:function(t){return null!=t&&Object.keys(this._previousAttributes).length?this._previousAttributes[t]:null},_getDefaultForType:function(t){var e=this._dataTypes[t];return e&&e["default"]},_getCompareForType:function(t){var e=this._dataTypes[t];return e&&e.compare?E(e.compare,this):b},_validate:function(t,e){if(!e.validate||!this.validate)return!0;t=u({},this.attributes,t);var n=this.validationError=this.validate(t,e)||null;return n?(this.trigger("invalid",this,n,u(e||{},{validationError:n})),!1):!0},_createPropertyDefinition:function(t,e,n){return o(this,t,e,n)},_ensureValidType:function(t){return d(["string","number","boolean","array","object","date","any"].concat(M(this._dataTypes)),t)?t:void 0},getAttributes:function(t,e){t||(t={}),C(t,{session:!1,props:!1,derived:!1});var n,r,o,i={};for(r in this._definition)o=this._definition[r],(t.session&&o.session||t.props&&!o.session)&&(n=e?this._values[r]:this[r],"undefined"==typeof n&&(n=j(o,"default")),"undefined"!=typeof n&&(i[r]=n));if(t.derived)for(r in this._derived)i[r]=this[r];return i},_initDerived:function(){var t=this;f(this._derived,function(e,n){var r=t._derived[n];r.deps=r.depList;var o=function(e){e=e||{};var o=r.fn.call(t);t._cache[n]===o&&r.cache||(r.cache&&(t._previousAttributes[n]=t._cache[n]),t._cache[n]=o,t.trigger("change:"+n,t,t._cache[n]))};r.deps.forEach(function(e){t._keyTree.add(e,o)})}),this.on("all",function(e){O.test(e)&&t._keyTree.get(e.split(":")[1]).forEach(function(t){t()})},this)},_getDerivedProperty:function(t,e){return this._derived[t].cache?((e||!this._cache.hasOwnProperty(t))&&(this._cache[t]=this._derived[t].fn.apply(this)),this._cache[t]):this._derived[t].fn.apply(this)},_initCollections:function(){var t;if(this._collections)for(t in this._collections)this[t]=new this._collections[t](null,{parent:this})},_initChildren:function(){var t;if(this._children)for(t in this._children)this[t]=new this._children[t]({},{parent:this}),this.listenTo(this[t],"all",this._getEventBubblingHandler(t))},_getEventBubblingHandler:function(t){return E(function(e,n,r){O.test(e)?this.trigger("change:"+t+"."+e.split(":")[1],n,r):"change"===e&&this.trigger("change",this)},this)},_verifyRequired:function(){var t=this.attributes;for(var e in this._definition)if(this._definition[e].required&&"undefined"==typeof t[e])return!1;return!0}}),Object.defineProperties(r.prototype,{attributes:{get:function(){return this.getAttributes({props:!0,session:!0})}},all:{get:function(){return this.getAttributes({session:!0,props:!0,derived:!0})}},isState:{get:function(){return!0},set:function(){}}});var q={string:{"default":function(){return""}},date:{set:function(t){var e;if(null==t)e="object";else if(g(t))e="date",t=t.valueOf();else try{var n=new Date(t).valueOf();if(isNaN(n)&&(n=new Date(parseInt(t,10)).valueOf(),isNaN(n)))throw TypeError;t=n,e="date"}catch(r){e=typeof t}return{val:t,type:e}},get:function(t){return null==t?t:new Date(t)},"default":function(){return new Date}},array:{set:function(t){return{val:t,type:m(t)?"array":typeof t}},"default":function(){return[]}},object:{set:function(t){var e=typeof t;return"object"!==e&&v(t)&&(t=null,e="object"),{val:t,type:e}},"default":function(){return{}}},state:{set:function(t){var e=t instanceof r||t&&t.isState;return e?{val:t,type:"state"}:{val:t,type:typeof t}},compare:function(t,e,n){var r=t===e;return r||(t&&this.stopListening(t),null!=e&&this.listenTo(e,"all",this._getEventBubblingHandler(n))),r}}};r.extend=a,e.exports=r},{"ampersand-events":48,"array-next":51,"key-tree-store":52,"lodash.assign":53,"lodash.bind":61,"lodash.clone":67,"lodash.defaults":77,"lodash.escape":79,"lodash.foreach":81,"lodash.has":85,"lodash.includes":90,"lodash.isarray":94,"lodash.isdate":95,"lodash.isempty":96,"lodash.isequal":98,"lodash.isfunction":102,"lodash.isnull":103,"lodash.isobject":104,"lodash.isstring":105,"lodash.isundefined":106,"lodash.keys":107,"lodash.omit":110,"lodash.result":126,"lodash.union":131,"lodash.uniqueid":140}],48:[function(t,e,n){e.exports=t(14)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/ampersand-events.js":14,"lodash.assign":53,"lodash.bind":61,"lodash.foreach":81,"lodash.isempty":96,"lodash.keys":107,"lodash.once":49,"lodash.uniqueid":140}],49:[function(t,e,n){e.exports=t(26)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.once/index.js":26,"lodash.before":50}],50:[function(t,e,n){e.exports=t(27)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.once/node_modules/lodash.before/index.js":27}],51:[function(t,e,n){e.exports=function(t,e){var n=t.length,r=t.indexOf(e)+1;return r>n-1&&(r=0),t[r]}},{}],52:[function(t,e,n){function r(){this.storage={}}var o=Array.prototype.slice;r.prototype.add=function(t,e){var n=this.storage[t]||(this.storage[t]=[]);n.push(e)},r.prototype.remove=function(t){var e,n;for(e in this.storage)n=this.storage[e],n.some(function(e,r){return e===t?(n.splice(r,1),!0):void 0})},r.prototype.get=function(t){var e,n=[];for(e in this.storage)t&&t!==e&&0!==e.indexOf(t+".")||(n=n.concat(this.storage[e]));return n},r.prototype.getGrouped=function(t){var e,n={};for(e in this.storage)t&&t!==e&&0!==e.indexOf(t+".")||(n[e]=o.call(this.storage[e]));return n},r.prototype.getAll=function(t){var e,n={};for(e in this.storage)(t===e||0===e.indexOf(t+"."))&&(n[e]=o.call(this.storage[e]));return n},r.prototype.run=function(t,e){var n=o.call(arguments,2);this.get(t).forEach(function(t){t.apply(e||this,n)})},e.exports=r},{}],53:[function(t,e,n){e.exports=t(30)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/index.js":30,"lodash._baseassign":54,"lodash._createassigner":56,"lodash.isnative":60,"lodash.keys":107}],54:[function(t,e,n){e.exports=t(31)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._baseassign/index.js":31,"lodash._basecopy":55,"lodash.isnative":60,"lodash.keys":107}],55:[function(t,e,n){e.exports=t(32)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._baseassign/node_modules/lodash._basecopy/index.js":32}],56:[function(t,e,n){e.exports=t(33)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/index.js":33,"lodash._bindcallback":57,"lodash._isiterateecall":58,"lodash.restparam":59}],57:[function(t,e,n){e.exports=t(18)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/node_modules/lodash._bindcallback/index.js":18}],58:[function(t,e,n){e.exports=t(35)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/node_modules/lodash._isiterateecall/index.js":35}],59:[function(t,e,n){e.exports=t(36)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/node_modules/lodash.restparam/index.js":36}],60:[function(t,e,n){e.exports=t(25)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/node_modules/lodash.isnative/index.js":25}],61:[function(t,e,n){e.exports=t(40)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.bind/index.js":40,"lodash._createwrapper":62,"lodash._replaceholders":65,"lodash.restparam":66}],62:[function(t,e,n){e.exports=t(41)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.bind/node_modules/lodash._createwrapper/index.js":41,"lodash._arraycopy":63,"lodash._basecreate":64,"lodash._replaceholders":65}],63:[function(t,e,n){e.exports=t(42)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.bind/node_modules/lodash._createwrapper/node_modules/lodash._arraycopy/index.js":42}],64:[function(t,e,n){e.exports=t(43)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.bind/node_modules/lodash._createwrapper/node_modules/lodash._basecreate/index.js":43}],65:[function(t,e,n){e.exports=t(44)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.bind/node_modules/lodash._replaceholders/index.js":44}],66:[function(t,e,n){e.exports=t(36)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/node_modules/lodash.restparam/index.js":36}],67:[function(t,e,n){function r(t,e,n,r){return e&&"boolean"!=typeof e&&a(t,e,n)?e=!1:"function"==typeof e&&(r=n,n=e,e=!1),n="function"==typeof n&&i(n,r,1),o(t,e,n)}var o=t("lodash._baseclone"),i=t("lodash._bindcallback"),a=t("lodash._isiterateecall");e.exports=r},{"lodash._baseclone":68,"lodash._bindcallback":75,"lodash._isiterateecall":76}],68:[function(t,e,n){(function(n){function r(t,e,n,i,c,p,g){var v;if(n&&(v=c?n(t,i,c):n(t)),void 0!==v)return v;if(!l(t))return t;var x=m(t);if(x){if(v=a(t),!e)return f(t,v)}else{var w=U.call(t),b=w==k;if(w!=E&&w!=y&&(!b||c))return $[w]?u(t,w,e):c?t:{};if(v=s(b?{}:t),!e)return h(v,t)}p||(p=[]),g||(g=[]);for(var _=p.length;_--;)if(p[_]==t)return g[_];return p.push(t),g.push(v),(x?d:o)(t,function(o,i){v[i]=r(o,e,n,i,t,p,g)}),v}function o(t,e){return p(t,e,v)}function i(t){return Y.call(t,0)}function a(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&V.call(t,"index")&&(n.index=t.index,n.input=t.input),n}function s(t){var e=t.constructor;return"function"==typeof e&&e instanceof e||(e=Object),new e}function u(t,e,n){var r=t.constructor;switch(e){case N:return i(t);case w:case b:return new r(+t);case O:case q:case D:case L:case F:case z:case R:case P:case I:var o=t.buffer;return new r(n?i(o):o,t.byteOffset,t.length);case M:case A:return new r(t);case C:var a=new r(t.source,H.exec(t));a.lastIndex=t.lastIndex}return a}function l(t){var e=typeof t;return"function"==e||!!t&&"object"==e}function c(t){return function(){return t}}var f=t("lodash._arraycopy"),d=t("lodash._arrayeach"),h=t("lodash._baseassign"),p=t("lodash._basefor"),m=t("lodash.isarray"),g=t("lodash.isnative"),v=t("lodash.keys"),y="[object Arguments]",x="[object Array]",w="[object Boolean]",b="[object Date]",_="[object Error]",k="[object Function]",j="[object Map]",M="[object Number]",E="[object Object]",C="[object RegExp]",S="[object Set]",A="[object String]",T="[object WeakMap]",N="[object ArrayBuffer]",O="[object Float32Array]",q="[object Float64Array]",D="[object Int8Array]",L="[object Int16Array]",F="[object Int32Array]",z="[object Uint8Array]",R="[object Uint8ClampedArray]",P="[object Uint16Array]",I="[object Uint32Array]",H=/\w*$/,$={};
+
+$[y]=$[x]=$[N]=$[w]=$[b]=$[O]=$[q]=$[D]=$[L]=$[F]=$[M]=$[E]=$[C]=$[A]=$[z]=$[R]=$[P]=$[I]=!0,$[_]=$[k]=$[j]=$[S]=$[T]=!1;var B=Object.prototype,V=B.hasOwnProperty,U=B.toString,W=g(W=n.ArrayBuffer)&&W,Y=g(Y=W&&new W(0).slice)&&Y,X=Math.floor,J=g(J=n.Uint8Array)&&J,Z=function(){try{var t=g(t=n.Float64Array)&&t,e=new t(new W(10),0,1)&&t}catch(r){}return e}(),K=Z?Z.BYTES_PER_ELEMENT:0;Y||(i=W&&J?function(t){var e=t.byteLength,n=Z?X(e/K):0,r=n*K,o=new W(e);if(n){var i=new Z(o,0,n);i.set(new Z(t,0,n))}return e!=r&&(i=new J(o,r),i.set(new J(t,r))),o}:c(null)),e.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"lodash._arraycopy":69,"lodash._arrayeach":70,"lodash._baseassign":71,"lodash._basefor":73,"lodash.isarray":94,"lodash.isnative":74,"lodash.keys":107}],69:[function(t,e,n){e.exports=t(42)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.bind/node_modules/lodash._createwrapper/node_modules/lodash._arraycopy/index.js":42}],70:[function(t,e,n){e.exports=t(16)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/node_modules/lodash._arrayeach/index.js":16}],71:[function(t,e,n){e.exports=t(31)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._baseassign/index.js":31,"lodash._basecopy":72,"lodash.isnative":74,"lodash.keys":107}],72:[function(t,e,n){e.exports=t(32)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._baseassign/node_modules/lodash._basecopy/index.js":32}],73:[function(t,e,n){function r(t){return function(e,n,r){for(var i=o(e),a=r(e),s=a.length,u=t?s:-1;t?u--:++u<s;){var l=a[u];if(n(i[l],l,i)===!1)break}return e}}function o(t){return i(t)?t:Object(t)}function i(t){var e=typeof t;return"function"==e||!!t&&"object"==e}var a=r();e.exports=a},{}],74:[function(t,e,n){e.exports=t(25)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/node_modules/lodash.isnative/index.js":25}],75:[function(t,e,n){e.exports=t(18)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/node_modules/lodash._bindcallback/index.js":18}],76:[function(t,e,n){e.exports=t(35)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/node_modules/lodash._isiterateecall/index.js":35}],77:[function(t,e,n){function r(t,e){return void 0===t?e:t}var o=t("lodash.assign"),i=t("lodash.restparam"),a=i(function(t){var e=t[0];return null==e?e:(t.push(r),o.apply(void 0,t))});e.exports=a},{"lodash.assign":53,"lodash.restparam":78}],78:[function(t,e,n){e.exports=t(36)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/node_modules/lodash.restparam/index.js":36}],79:[function(t,e,n){function r(t){return u[t]}function o(t){return t=i(t),t&&s.test(t)?t.replace(a,r):t}var i=t("lodash._basetostring"),a=/[&<>"'`]/g,s=RegExp(a.source),u={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"};e.exports=o},{"lodash._basetostring":80}],80:[function(t,e,n){e.exports=t(29)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.uniqueid/node_modules/lodash._basetostring/index.js":29}],81:[function(t,e,n){e.exports=t(15)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/index.js":15,"lodash._arrayeach":82,"lodash._baseeach":83,"lodash._bindcallback":84,"lodash.isarray":94}],82:[function(t,e,n){e.exports=t(16)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/node_modules/lodash._arrayeach/index.js":16}],83:[function(t,e,n){e.exports=t(17)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/node_modules/lodash._baseeach/index.js":17,"lodash.keys":107}],84:[function(t,e,n){e.exports=t(18)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/node_modules/lodash._bindcallback/index.js":18}],85:[function(t,e,n){function r(t,e){var n=typeof t;if("string"==n&&h.test(t)||"number"==n)return!0;if(f(t))return!1;var r=!d.test(t);return r||null!=e&&t in o(e)}function o(t){return a(t)?t:Object(t)}function i(t){var e=t?t.length:0;return e?t[e-1]:void 0}function a(t){var e=typeof t;return"function"==e||!!t&&"object"==e}function s(t,e){if(null==t)return!1;var n=m.call(t,e);return n||r(e)||(e=c(e),t=1==e.length?t:u(t,l(e,0,-1)),e=i(e),n=null!=t&&m.call(t,e)),n}var u=t("lodash._baseget"),l=t("lodash._baseslice"),c=t("lodash._topath"),f=t("lodash.isarray"),d=/\.|\[(?:[^[\]]+|(["'])(?:(?!\1)[^\n\\]|\\.)*?)\1\]/,h=/^\w*$/,p=Object.prototype,m=p.hasOwnProperty;e.exports=s},{"lodash._baseget":86,"lodash._baseslice":87,"lodash._topath":88,"lodash.isarray":94}],86:[function(t,e,n){function r(t,e,n){if(null!=t){void 0!==n&&n in o(t)&&(e=[n]);for(var r=-1,i=e.length;null!=t&&++r<i;)var a=t=t[e[r]];return a}}function o(t){return i(t)?t:Object(t)}function i(t){var e=typeof t;return"function"==e||!!t&&"object"==e}e.exports=r},{}],87:[function(t,e,n){function r(t,e,n){var r=-1,o=t.length;e=null==e?0:+e||0,0>e&&(e=-e>o?0:o+e),n=void 0===n||n>o?o:+n||0,0>n&&(n+=o),o=e>n?0:n-e>>>0,e>>>=0;for(var i=Array(o);++r<o;)i[r]=t[r+e];return i}e.exports=r},{}],88:[function(t,e,n){function r(t){if(i(t))return t;var e=[];return o(t).replace(a,function(t,n,r,o){e.push(r?o.replace(s,"$1"):n||t)}),e}var o=t("lodash._basetostring"),i=t("lodash.isarray"),a=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,s=/\\(\\)?/g;e.exports=r},{"lodash._basetostring":89,"lodash.isarray":94}],89:[function(t,e,n){e.exports=t(29)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.uniqueid/node_modules/lodash._basetostring/index.js":29}],90:[function(t,e,n){function r(t){return function(e){return null==e?void 0:e[t]}}function o(t){return"number"==typeof t&&t>-1&&t%1==0&&p>=t}function i(t,e,n,r){var i=t?m(t):0;return o(i)||(t=a(t),i=t.length),i?(n="number"!=typeof n||r&&l(e,n,r)?0:0>n?h(i+n,0):n||0,"string"==typeof t||!c(t)&&f(t)?i>n&&t.indexOf(e,n)>-1:s(t,e,n)>-1):!1}function a(t){return u(t,d(t))}var s=t("lodash._baseindexof"),u=t("lodash._basevalues"),l=t("lodash._isiterateecall"),c=t("lodash.isarray"),f=t("lodash.isstring"),d=t("lodash.keys"),h=Math.max,p=Math.pow(2,53)-1,m=r("length");e.exports=i},{"lodash._baseindexof":91,"lodash._basevalues":92,"lodash._isiterateecall":93,"lodash.isarray":94,"lodash.isstring":105,"lodash.keys":107}],91:[function(t,e,n){function r(t,e,n){if(e!==e)return o(t,n);for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}function o(t,e,n){for(var r=t.length,o=e+(n?0:-1);n?o--:++o<r;){var i=t[o];if(i!==i)return o}return-1}e.exports=r},{}],92:[function(t,e,n){function r(t,e){for(var n=-1,r=e.length,o=Array(r);++n<r;)o[n]=t[e[n]];return o}e.exports=r},{}],93:[function(t,e,n){e.exports=t(35)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/node_modules/lodash._isiterateecall/index.js":35}],94:[function(t,e,n){e.exports=t(46)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.isarray/index.js":46}],95:[function(t,e,n){function r(t){return!!t&&"object"==typeof t}function o(t){return r(t)&&s.call(t)==i}var i="[object Date]",a=Object.prototype,s=a.toString;e.exports=o},{}],96:[function(t,e,n){e.exports=t(19)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/index.js":19,"lodash.isarguments":97,"lodash.isarray":94,"lodash.isfunction":102,"lodash.isstring":105,"lodash.keys":107}],97:[function(t,e,n){e.exports=t(20)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],98:[function(t,e,n){function r(t){return t===t&&(0===t?1/t>0:!i(t))}function o(t,e,n,o){if(n="function"==typeof n&&s(n,o,3),!n&&r(t)&&r(e))return t===e;var i=n?n(t,e):void 0;return void 0===i?a(t,e,n):!!i}function i(t){var e=typeof t;return"function"==e||!!t&&"object"==e}var a=t("lodash._baseisequal"),s=t("lodash._bindcallback");e.exports=o},{"lodash._baseisequal":99,"lodash._bindcallback":101}],99:[function(t,e,n){function r(t,e,n,i,a,s){if(t===e)return 0!==t||1/t==1/e;var u=typeof t,l=typeof e;return"function"!=u&&"object"!=u&&"function"!=l&&"object"!=l||null==t||null==e?t!==t&&e!==e:o(t,e,r,n,i,a,s)}function o(t,e,n,r,o,c,h){var p=u(t),m=u(e),g=d,y=d;p||(g=_.call(t),g==f?g=v:g!=v&&(p=l(t))),m||(y=_.call(e),y==f?y=v:y!=v&&(m=l(e)));var x=g==v,w=y==v,k=g==y;if(k&&!p&&!x)return a(t,e,g);if(!o){var j=x&&b.call(t,"__wrapped__"),M=w&&b.call(e,"__wrapped__");if(j||M)return n(j?t.value():t,M?e.value():e,r,o,c,h)}if(!k)return!1;c||(c=[]),h||(h=[]);for(var E=c.length;E--;)if(c[E]==t)return h[E]==e;c.push(t),h.push(e);var C=(p?i:s)(t,e,n,r,o,c,h);return c.pop(),h.pop(),C}function i(t,e,n,r,o,i,a){var s=-1,u=t.length,l=e.length,c=!0;if(u!=l&&!(o&&l>u))return!1;for(;c&&++s<u;){var f=t[s],d=e[s];if(c=void 0,r&&(c=o?r(d,f,s):r(f,d,s)),void 0===c)if(o)for(var h=l;h--&&(d=e[h],!(c=f&&f===d||n(f,d,r,o,i,a))););else c=f&&f===d||n(f,d,r,o,i,a)}return!!c}function a(t,e,n){switch(n){case h:case p:return+t==+e;case m:return t.name==e.name&&t.message==e.message;case g:return t!=+t?e!=+e:0==t?1/t==1/e:t==+e;case y:case x:return t==e+""}return!1}function s(t,e,n,r,o,i,a){var s=c(t),u=s.length,l=c(e),f=l.length;if(u!=f&&!o)return!1;for(var d=o,h=-1;++h<u;){var p=s[h],m=o?p in e:b.call(e,p);if(m){var g=t[p],v=e[p];m=void 0,r&&(m=o?r(v,g,p):r(g,v,p)),void 0===m&&(m=g&&g===v||n(g,v,r,o,i,a))}if(!m)return!1;d||(d="constructor"==p)}if(!d){var y=t.constructor,x=e.constructor;if(y!=x&&"constructor"in t&&"constructor"in e&&!("function"==typeof y&&y instanceof y&&"function"==typeof x&&x instanceof x))return!1}return!0}var u=t("lodash.isarray"),l=t("lodash.istypedarray"),c=t("lodash.keys"),f="[object Arguments]",d="[object Array]",h="[object Boolean]",p="[object Date]",m="[object Error]",g="[object Number]",v="[object Object]",y="[object RegExp]",x="[object String]",w=Object.prototype,b=w.hasOwnProperty,_=w.toString;e.exports=r},{"lodash.isarray":94,"lodash.istypedarray":100,"lodash.keys":107}],100:[function(t,e,n){function r(t){return!!t&&"object"==typeof t}function o(t){return"number"==typeof t&&t>-1&&t%1==0&&O>=t}function i(t){return r(t)&&o(t.length)&&!!A[N.call(t)]}var a="[object Arguments]",s="[object Array]",u="[object Boolean]",l="[object Date]",c="[object Error]",f="[object Function]",d="[object Map]",h="[object Number]",p="[object Object]",m="[object RegExp]",g="[object Set]",v="[object String]",y="[object WeakMap]",x="[object ArrayBuffer]",w="[object Float32Array]",b="[object Float64Array]",_="[object Int8Array]",k="[object Int16Array]",j="[object Int32Array]",M="[object Uint8Array]",E="[object Uint8ClampedArray]",C="[object Uint16Array]",S="[object Uint32Array]",A={};A[w]=A[b]=A[_]=A[k]=A[j]=A[M]=A[E]=A[C]=A[S]=!0,A[a]=A[s]=A[x]=A[u]=A[l]=A[c]=A[f]=A[d]=A[h]=A[p]=A[m]=A[g]=A[v]=A[y]=!1;var T=Object.prototype,N=T.toString,O=Math.pow(2,53)-1;e.exports=i},{}],101:[function(t,e,n){e.exports=t(18)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/node_modules/lodash._bindcallback/index.js":18}],102:[function(t,e,n){e.exports=t(21)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isfunction/index.js":21}],103:[function(t,e,n){function r(t){return null===t}e.exports=r},{}],104:[function(t,e,n){function r(t){var e=typeof t;return"function"==e||!!t&&"object"==e}e.exports=r},{}],105:[function(t,e,n){e.exports=t(22)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isstring/index.js":22}],106:[function(t,e,n){function r(t){return void 0===t}e.exports=r},{}],107:[function(t,e,n){e.exports=t(23)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/index.js":23,"lodash.isarguments":108,"lodash.isarray":94,"lodash.isnative":109}],108:[function(t,e,n){e.exports=t(20)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],109:[function(t,e,n){e.exports=t(25)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/node_modules/lodash.isnative/index.js":25}],110:[function(t,e,n){var r=t("lodash._arraymap"),o=t("lodash._basedifference"),i=t("lodash._baseflatten"),a=t("lodash._bindcallback"),s=t("lodash._pickbyarray"),u=t("lodash._pickbycallback"),l=t("lodash.keysin"),c=t("lodash.restparam"),f=c(function(t,e){if(null==t)return{};if("function"!=typeof e[0]){var e=r(i(e),String);return s(t,o(l(t),e))}var n=a(e[0],e[1],3);return u(t,function(t,e,r){return!n(t,e,r)})});e.exports=f},{"lodash._arraymap":111,"lodash._basedifference":112,"lodash._baseflatten":117,"lodash._bindcallback":119,"lodash._pickbyarray":120,"lodash._pickbycallback":121,"lodash.keysin":123,"lodash.restparam":125}],111:[function(t,e,n){function r(t,e){for(var n=-1,r=t.length,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}e.exports=r},{}],112:[function(t,e,n){function r(t,e){var n=t?t.length:0,r=[];if(!n)return r;var s=-1,u=o,l=!0,c=l&&e.length>=200?a(e):null,f=e.length;c&&(u=i,l=!1,e=c);t:for(;++s<n;){var d=t[s];if(l&&d===d){for(var h=f;h--;)if(e[h]===d)continue t;r.push(d)}else u(e,d,0)<0&&r.push(d)}return r}var o=t("lodash._baseindexof"),i=t("lodash._cacheindexof"),a=t("lodash._createcache");e.exports=r},{"lodash._baseindexof":113,"lodash._cacheindexof":114,"lodash._createcache":115}],113:[function(t,e,n){e.exports=t(91)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.includes/node_modules/lodash._baseindexof/index.js":91}],114:[function(t,e,n){function r(t,e){var data=t.data,n="string"==typeof e||o(e)?data.set.has(e):data.hash[e];return n?0:-1}function o(t){var e=typeof t;return"function"==e||!!t&&"object"==e}e.exports=r},{}],115:[function(t,e,n){(function(n){function r(t){var e=t?t.length:0;for(this.data={hash:l(null),set:new u};e--;)this.push(t[e])}function o(t){var data=this.data;"string"==typeof t||i(t)?data.set.add(t):data.hash[t]=!0}function i(t){var e=typeof t;return"function"==e||!!t&&"object"==e}function a(t){return function(){return t}}var s=t("lodash.isnative"),u=s(u=n.Set)&&u,l=s(l=Object.create)&&l,c=l&&u?function(t){return new r(t)}:a(null);r.prototype.push=o,e.exports=c}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"lodash.isnative":116}],116:[function(t,e,n){e.exports=t(25)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/node_modules/lodash.isnative/index.js":25}],117:[function(t,e,n){function r(t){return!!t&&"object"==typeof t}function o(t,e,n){for(var u=-1,l=t.length,c=-1,f=[];++u<l;){var d=t[u];if(r(d)&&i(d.length)&&(s(d)||a(d))){e&&(d=o(d,e,n));var h=-1,p=d.length;for(f.length+=p;++h<p;)f[++c]=d[h]}else n||(f[++c]=d)}return f}function i(t){return"number"==typeof t&&t>-1&&t%1==0&&u>=t}var a=t("lodash.isarguments"),s=t("lodash.isarray"),u=Math.pow(2,53)-1;e.exports=o},{"lodash.isarguments":118,"lodash.isarray":94}],118:[function(t,e,n){e.exports=t(20)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],119:[function(t,e,n){e.exports=t(18)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/node_modules/lodash._bindcallback/index.js":18}],120:[function(t,e,n){function r(t,e){t=o(t);for(var n=-1,r=e.length,i={};++n<r;){var a=e[n];a in t&&(i[a]=t[a])}return i}function o(t){return i(t)?t:Object(t)}function i(t){var e=typeof t;return"function"==e||!!t&&"object"==e}e.exports=r},{}],121:[function(t,e,n){function r(t,e){return i(t,e,a)}function o(t,e){var n={};return r(t,function(t,r,o){e(t,r,o)&&(n[r]=t)}),n}var i=t("lodash._basefor"),a=t("lodash.keysin");e.exports=o},{"lodash._basefor":122,"lodash.keysin":123}],122:[function(t,e,n){e.exports=t(73)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.clone/node_modules/lodash._baseclone/node_modules/lodash._basefor/index.js":73}],123:[function(t,e,n){function r(t,e){return t=+t,e=null==e?d:e,t>-1&&t%1==0&&e>t}function o(t){return"number"==typeof t&&t>-1&&t%1==0&&d>=t}function i(t){var e=typeof t;return"function"==e||!!t&&"object"==e}function a(t){if(null==t)return[];i(t)||(t=Object(t));var e=t.length;e=e&&o(e)&&(u(t)||h.nonEnumArgs&&s(t))&&e||0;for(var n=t.constructor,a=-1,l="function"==typeof n&&n.prototype===t,f=Array(e),d=e>0;++a<e;)f[a]=a+"";for(var p in t)d&&r(p,e)||"constructor"==p&&(l||!c.call(t,p))||f.push(p);return f}var s=t("lodash.isarguments"),u=t("lodash.isarray"),l=Object.prototype,c=l.hasOwnProperty,f=l.propertyIsEnumerable,d=Math.pow(2,53)-1,h={};!function(t){var e=function(){this.x=t},n=[];e.prototype={valueOf:t,y:t};for(var r in new e)n.push(r);try{h.nonEnumArgs=!f.call(arguments,1)}catch(o){h.nonEnumArgs=!0}}(1,0),e.exports=a},{"lodash.isarguments":124,"lodash.isarray":94}],124:[function(t,e,n){e.exports=t(20)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],125:[function(t,e,n){e.exports=t(36)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/node_modules/lodash.restparam/index.js":36}],126:[function(t,e,n){function r(t,e){var n=typeof t;if("string"==n&&p.test(t)||"number"==n)return!0;if(f(t))return!1;var r=!h.test(t);return r||null!=e&&t in o(e)}function o(t){return a(t)?t:Object(t)}function i(t){var e=t?t.length:0;return e?t[e-1]:void 0}function a(t){var e=typeof t;return"function"==e||!!t&&"object"==e}function s(t,e,n){var o=null==t?void 0:t[e];return void 0===o&&(null==t||r(e,t)||(e=c(e),t=1==e.length?t:u(t,l(e,0,-1)),o=null==t?void 0:t[i(e)]),o=void 0===o?n:o),d(o)?o.call(t):o}var u=t("lodash._baseget"),l=t("lodash._baseslice"),c=t("lodash._topath"),f=t("lodash.isarray"),d=t("lodash.isfunction"),h=/\.|\[(?:[^[\]]+|(["'])(?:(?!\1)[^\n\\]|\\.)*?)\1\]/,p=/^\w*$/;e.exports=s},{"lodash._baseget":127,"lodash._baseslice":128,"lodash._topath":129,"lodash.isarray":94,"lodash.isfunction":102}],127:[function(t,e,n){e.exports=t(86)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.has/node_modules/lodash._baseget/index.js":86}],128:[function(t,e,n){e.exports=t(87)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.has/node_modules/lodash._baseslice/index.js":87}],129:[function(t,e,n){e.exports=t(88)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.has/node_modules/lodash._topath/index.js":88,"lodash._basetostring":130,"lodash.isarray":94}],130:[function(t,e,n){e.exports=t(29)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.uniqueid/node_modules/lodash._basetostring/index.js":29}],131:[function(t,e,n){var r=t("lodash._baseflatten"),o=t("lodash._baseuniq"),i=t("lodash.restparam"),a=i(function(t){return o(r(t,!1,!0))});e.exports=a},{"lodash._baseflatten":132,"lodash._baseuniq":134,"lodash.restparam":139}],132:[function(t,e,n){e.exports=t(117)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.omit/node_modules/lodash._baseflatten/index.js":117,"lodash.isarguments":133,"lodash.isarray":94}],133:[function(t,e,n){e.exports=t(20)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],134:[function(t,e,n){function r(t,e){var n=-1,r=o,s=t.length,u=!0,l=u&&s>=200,c=l?a():null,f=[];c?(r=i,u=!1):(l=!1,c=e?[]:f);t:for(;++n<s;){var d=t[n],h=e?e(d,n,t):d;if(u&&d===d){for(var p=c.length;p--;)if(c[p]===h)continue t;e&&c.push(h),f.push(d)}else r(c,h,0)<0&&((e||l)&&c.push(h),f.push(d))}return f}var o=t("lodash._baseindexof"),i=t("lodash._cacheindexof"),a=t("lodash._createcache");e.exports=r},{"lodash._baseindexof":135,"lodash._cacheindexof":136,"lodash._createcache":137}],135:[function(t,e,n){e.exports=t(91)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.includes/node_modules/lodash._baseindexof/index.js":91}],136:[function(t,e,n){e.exports=t(114)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._cacheindexof/index.js":114}],137:[function(t,e,n){e.exports=t(115)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._createcache/index.js":115,"lodash.isnative":138}],138:[function(t,e,n){e.exports=t(25)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/node_modules/lodash.isnative/index.js":25}],139:[function(t,e,n){e.exports=t(36)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/node_modules/lodash.restparam/index.js":36}],140:[function(t,e,n){e.exports=t(28)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.uniqueid/index.js":28,"lodash._basetostring":141}],141:[function(t,e,n){e.exports=t(29)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.uniqueid/node_modules/lodash._basetostring/index.js":29}],142:[function(t,e,n){function r(t,e){e||(e={}),this.collection=t,this._reset(),this._watched=e.watched||[],this._parseFilters(e),this._runFilters(),this.listenTo(this.collection,"all",this._onCollectionEvent)}"undefined"!=typeof window&&(window.ampersand=window.ampersand||{},window.ampersand["ampersand-subcollection"]=window.ampersand["ampersand-subcollection"]||[],window.ampersand["ampersand-subcollection"].push("1.5.0"));var o=t("underscore"),i=t("backbone-events-standalone"),a=t("ampersand-class-extend"),s=t("ampersand-collection-underscore-mixin"),u=Array.prototype.slice;o.extend(r.prototype,i,s,{addFilter:function(t){this.swapFilters([t],[])},removeFilter:function(t){this.swapFilters([],[t])},clearFilters:function(){this._reset(),this._runFilters()},swapFilters:function(t,e){var n=this;e?o.isArray(e)||(e=[e]):e=this._filters,t?o.isArray(t)||(t=[t]):t=[],e.forEach(function(t){n._removeFilter(t)}),t.forEach(function(t){n._addFilter(t)}),this._runFilters()},configure:function(t,e){e&&this._resetFilters(),this._parseFilters(t),this._runFilters()},at:function(t){return this.models[t]},get:function(t,e){var n=this.collection.get(t,e);return n&&this.contains(n)?n:void 0},_removeFilter:function(t){var e=this._filters.indexOf(t);-1!==e&&this._filters.splice(e,1)},_reset:function(){this.models=[],this._resetFilters()},_resetFilters:function(){this._filters=[],this._watched=[],this.limit=void 0,this.offset=void 0},_addFilter:function(t){this._filters.push(t)},_watch:function(t){this._watched=o.union(this._watched,o.isArray(t)?t:[t])},_unwatch:function(t){this._watched=o.without(this._watched,t)},_parseFilters:function(t){t.where&&(o.each(t.where,function(t,e){this._addFilter(function(n){return(n.get?n.get(e):n[e])===t})},this),this._watch(o.keys(t.where))),t.hasOwnProperty("limit")&&(this.limit=t.limit),t.hasOwnProperty("offset")&&(this.offset=t.offset),t.filter&&this._addFilter(t.filter,!1),t.filters&&t.filters.forEach(this._addFilter,this),t.comparator&&(this.comparator=t.comparator)},_runFilters:function(){var t,e,n,r=u.call(this.models),i=u.call(this.collection.models),a=this.offset||0;t=this._filters.length?o.reduce(this._filters,function(t,e){return t.filter(e)},i):u.call(i),this.comparator&&(t=o.sortBy(t,this.comparator)),(this.limit||this.offset)&&(t=t.slice(a,this.limit+a)),e=o.difference(t,r),n=o.difference(r,t),this.models=t,o.each(n,function(t){this.trigger("remove",t,this)},this),o.each(e,function(t){this.trigger("add",t,this)},this),o.isEqual(r,t)||this.trigger("sort",this)},_onCollectionEvent:function(t,e){(o.contains(this._watched,t.split(":")[1])||o.contains(["add","remove","reset","sync"],t))&&this._runFilters(),(o.contains(["sync","invalid","destroy"])||-1!==t.indexOf("change"))&&this.contains(e)&&this.trigger.apply(this,arguments)}}),Object.defineProperty(r.prototype,"length",{get:function(){return this.models.length}}),Object.defineProperty(r.prototype,"isCollection",{get:function(){return!0}}),r.extend=a,e.exports=r},{"ampersand-class-extend":143,"ampersand-collection-underscore-mixin":10,"backbone-events-standalone":156,underscore:157}],143:[function(t,e,n){e.exports=t(13)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-class-extend/ampersand-class-extend.js":13,"lodash.assign":144}],144:[function(t,e,n){e.exports=t(30)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/index.js":30,"lodash._baseassign":145,"lodash._createassigner":147,"lodash.isnative":151,"lodash.keys":152}],145:[function(t,e,n){e.exports=t(31)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._baseassign/index.js":31,"lodash._basecopy":146,"lodash.isnative":151,"lodash.keys":152}],146:[function(t,e,n){e.exports=t(32)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._baseassign/node_modules/lodash._basecopy/index.js":32}],147:[function(t,e,n){e.exports=t(33)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/index.js":33,"lodash._bindcallback":148,"lodash._isiterateecall":149,"lodash.restparam":150}],148:[function(t,e,n){e.exports=t(18)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/node_modules/lodash._bindcallback/index.js":18}],149:[function(t,e,n){e.exports=t(35)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/node_modules/lodash._isiterateecall/index.js":35}],150:[function(t,e,n){e.exports=t(36)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/node_modules/lodash.restparam/index.js":36}],151:[function(t,e,n){e.exports=t(25)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/node_modules/lodash.isnative/index.js":25}],152:[function(t,e,n){e.exports=t(23)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/index.js":23,"lodash.isarguments":153,"lodash.isarray":154,"lodash.isnative":151}],153:[function(t,e,n){e.exports=t(20)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],154:[function(t,e,n){e.exports=t(46)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.isarray/index.js":46}],155:[function(t,e,n){!function(){function t(){return{keys:Object.keys,uniqueId:function(t){var e=++l+"";return t?t+e:e},has:function(t,e){return s.call(t,e)},each:function(t,e,n){if(null!=t)if(a&&t.forEach===a)t.forEach(e,n);else if(t.length===+t.length){for(var r=0,o=t.length;o>r;r++)if(e.call(n,t[r],r,t)===i)return}else for(var s in t)if(this.has(t,s)&&e.call(n,t[s],s,t)===i)return},once:function(t){var e,n=!1;return function(){return n?e:(n=!0,e=t.apply(this,arguments),t=null,e)}}}}var r,o=this,i={},a=Array.prototype.forEach,s=Object.prototype.hasOwnProperty,u=Array.prototype.slice,l=0,c=t();r={on:function(t,e,n){if(!d(this,"on",t,[e,n])||!e)return this;this._events||(this._events={});var r=this._events[t]||(this._events[t]=[]);return r.push({callback:e,context:n,ctx:n||this}),this},once:function(t,e,n){if(!d(this,"once",t,[e,n])||!e)return this;var r=this,o=c.once(function(){r.off(t,o),e.apply(this,arguments)});return o._callback=e,this.on(t,o,n)},off:function(t,e,n){var r,o,i,a,s,u,l,f;if(!this._events||!d(this,"off",t,[e,n]))return this;if(!t&&!e&&!n)return this._events={},this;for(a=t?[t]:c.keys(this._events),s=0,u=a.length;u>s;s++)if(t=a[s],i=this._events[t]){if(this._events[t]=r=[],e||n)for(l=0,f=i.length;f>l;l++)o=i[l],(e&&e!==o.callback&&e!==o.callback._callback||n&&n!==o.context)&&r.push(o);r.length||delete this._events[t]}return this},trigger:function(t){if(!this._events)return this;var e=u.call(arguments,1);if(!d(this,"trigger",t,e))return this;var n=this._events[t],r=this._events.all;return n&&h(n,e),r&&h(r,arguments),this},stopListening:function(t,e,n){var r=this._listeners;if(!r)return this;var o=!e&&!n;"object"==typeof e&&(n=this),t&&((r={})[t._listenerId]=t);for(var i in r)r[i].off(e,n,this),o&&delete this._listeners[i];return this}};var f=/\s+/,d=function(t,e,n,r){if(!n)return!0;if("object"==typeof n){for(var o in n)t[e].apply(t,[o,n[o]].concat(r));return!1}if(f.test(n)){for(var i=n.split(f),a=0,s=i.length;s>a;a++)t[e].apply(t,[i[a]].concat(r));return!1}return!0},h=function(t,e){var n,r=-1,o=t.length,i=e[0],a=e[1],s=e[2];switch(e.length){case 0:for(;++r<o;)(n=t[r]).callback.call(n.ctx);return;case 1:for(;++r<o;)(n=t[r]).callback.call(n.ctx,i);return;case 2:for(;++r<o;)(n=t[r]).callback.call(n.ctx,i,a);return;
+case 3:for(;++r<o;)(n=t[r]).callback.call(n.ctx,i,a,s);return;default:for(;++r<o;)(n=t[r]).callback.apply(n.ctx,e)}},p={listenTo:"on",listenToOnce:"once"};c.each(p,function(t,e){r[e]=function(e,n,r){var o=this._listeners||(this._listeners={}),i=e._listenerId||(e._listenerId=c.uniqueId("l"));return o[i]=e,"object"==typeof n&&(r=this),e[t](n,r,this),this}}),r.bind=r.on,r.unbind=r.off,r.mixin=function(t){var e=["on","once","off","trigger","stopListening","listenTo","listenToOnce","bind","unbind"];return c.each(e,function(e){t[e]=this[e]},this),t},"function"==typeof define?define(function(){return r}):"undefined"!=typeof n?("undefined"!=typeof e&&e.exports&&(n=e.exports=r),n.BackboneEvents=r):o.BackboneEvents=r}(this)},{}],156:[function(t,e,n){e.exports=t("./backbone-events-standalone")},{"./backbone-events-standalone":155}],157:[function(t,e,n){e.exports=t(11)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection-underscore-mixin/node_modules/underscore/underscore.js":11}],158:[function(t,e,n){function r(t){this.cid=s("view"),t||(t={});var e=t.parent;delete t.parent,b.call(this,t,{init:!1,parent:e}),this.on("change:el",this._handleElementChange,this),this._parsedBindings=x(this.bindings,this),this._initializeBindings(),t.el&&!this.autoRender&&this._handleElementChange(),this._initializeSubviews(),this.template=t.template||this.template,this.initialize.apply(this,arguments),this.set(u(t,_)),this.autoRender&&this.template&&this.render()}"undefined"!=typeof window&&(window.ampersand=window.ampersand||{},window.ampersand["ampersand-view"]=window.ampersand["ampersand-view"]||[],window.ampersand["ampersand-view"].push("7.3.0"));var o=t("ampersand-state"),i=t("ampersand-collection-view"),a=t("domify"),s=t("lodash.uniqueid"),u=t("lodash.pick"),l=t("lodash.assign"),c=t("lodash.foreach"),f=t("lodash.result"),d=t("lodash.last"),h=t("lodash.isstring"),p=t("lodash.bind"),m=t("lodash.flatten"),g=t("lodash.invoke"),v=t("events-mixin"),y=t("matches-selector"),x=t("ampersand-dom-bindings"),w=t("get-object-path"),b=o.extend({dataTypes:{element:{set:function(t){return{val:t,type:t instanceof Element?"element":typeof t}},compare:function(t,e){return t===e}},collection:{set:function(t){return{val:t,type:t&&t.isCollection?"collection":typeof t}},compare:function(t,e){return t===e}}},props:{model:"state",el:"element",collection:"collection"},derived:{rendered:{deps:["el"],fn:function(){return!!this.el}},hasData:{deps:["model"],fn:function(){return!!this.model}}}}),_=["model","collection","el"];r.prototype=Object.create(b.prototype),l(r.prototype,{query:function(t){return t?"string"==typeof t?y(this.el,t)?this.el:this.el.querySelector(t)||void 0:t:this.el},queryAll:function(t){var e=[];return this.el?""===t?[this.el]:(y(this.el,t)&&e.push(this.el),e.concat(Array.prototype.slice.call(this.el.querySelectorAll(t)))):e},queryByHook:function(t){return this.query('[data-hook~="'+t+'"]')},initialize:function(){},render:function(){return this.renderWithTemplate(this),this},remove:function(){var t=this._parsedBindings;return this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el),this._subviews&&g(m(this._subviews),"remove"),this.stopListening(),c(t,function(e,n){c(e,function(e,r){delete t[n][r]}),delete t[n]}),this.trigger("remove",this),this},_handleElementChange:function(t,e){return this.eventManager&&this.eventManager.unbind(),this.eventManager=v(this.el,this),this.delegateEvents(),this._applyBindingsForKey(),this},delegateEvents:function(t){if(!t&&!(t=f(this,"events")))return this;this.undelegateEvents();for(var e in t)this.eventManager.bind(e,t[e]);return this},undelegateEvents:function(){return this.eventManager.unbind(),this},registerSubview:function(t){return this._subviews||(this._subviews=[]),this._subviews.push(t),t.el&&(t.parent=this),t},renderSubview:function(t,e){return"string"==typeof e&&(e=this.query(e)),this.registerSubview(t),t.render(),(e||this.el).appendChild(t.el),t},_applyBindingsForKey:function(t){if(this.el){var e,n=this._parsedBindings.getGrouped(t);for(e in n)n[e].forEach(function(t){t(this.el,w(this,e),d(e.split(".")))},this)}},_initializeBindings:function(){this.bindings&&this.on("all",function(t){"change:"===t.slice(0,7)&&this._applyBindingsForKey(t.split(":")[1])},this)},_initializeSubviews:function(){if(this.subviews)for(var t in this.subviews)this._parseSubview(this.subviews[t],t)},_parseSubview:function(t,e){function n(){var t,r;this.el&&(t=this.query(o.selector))&&(!o.waitFor||w(this,o.waitFor))&&(r=this[e]=o.prepareView.call(this,t),r.render(),this.registerSubview(r),this.off("change",n))}var r=this,o={selector:t.container||'[data-hook="'+t.hook+'"]',waitFor:t.waitFor||"",prepareView:t.prepareView||function(e){return new t.constructor({el:e,parent:r})}};this.on("change",n,this)},renderWithTemplate:function(t,e){var n=e||this.template;if(!n)throw new Error("Template string or function needed.");var r=h(n)?n:n.call(this,t||this);h(r)&&(r=a(r));var o=this.el&&this.el.parentNode;if(o&&o.replaceChild(r,this.el),"#document-fragment"===r.nodeName)throw new Error("Views can only have one root element.");return this.el=r,this},cacheElements:function(t){for(var e in t)this[e]=this.query(t[e]);return this},listenToAndRun:function(t,e,n){var r=p(n,this);this.listenTo(t,e,r),r()},animateRemove:function(){this.remove()},renderCollection:function(t,e,n,r){var o="string"==typeof n?this.query(n):n,a=l({collection:t,el:o||this.el,view:e,parent:this,viewOptions:{parent:this}},r),s=new i(a);return s.render(),this.registerSubview(s)}}),r.extend=b.extend,e.exports=r},{"ampersand-collection-view":159,"ampersand-dom-bindings":194,"ampersand-state":47,domify:197,"events-mixin":198,"get-object-path":203,"lodash.assign":204,"lodash.bind":215,"lodash.flatten":221,"lodash.foreach":226,"lodash.invoke":234,"lodash.isstring":246,"lodash.last":247,"lodash.pick":248,"lodash.result":260,"lodash.uniqueid":267,"matches-selector":269}],159:[function(t,e,n){function r(t){if(!t)throw new ReferenceError("Collection view missing required parameters: collection, el");if(!t.collection)throw new ReferenceError("Collection view requires a collection");if(!t.el&&!this.insertSelf)throw new ReferenceError("Collection view requires an el");o(this,a(t,f)),this.views=[],this.listenTo(this.collection,"add",this._addViewForModel),this.listenTo(this.collection,"remove",this._removeViewForModel),this.listenTo(this.collection,"sort",this._rerenderAll),this.listenTo(this.collection,"refresh reset",this._reset)}"undefined"!=typeof window&&(window.ampersand=window.ampersand||{},window.ampersand["ampersand-collection-view"]=window.ampersand["ampersand-collection-view"]||[],window.ampersand["ampersand-collection-view"].push("1.4.0"));var o=t("lodash.assign"),i=t("lodash.invoke"),a=t("lodash.pick"),s=t("lodash.find"),u=t("lodash.difference"),l=t("ampersand-events"),c=t("ampersand-class-extend"),f=["collection","el","viewOptions","view","emptyView","filter","reverse","parent"];o(r.prototype,l,{render:function(){return this._renderAll(),this},remove:function(){i(this.views,"remove"),this.stopListening()},_getViewByModel:function(t){return s(this.views,function(e){return t===e.model})},_createViewForModel:function(t,e){var n={model:t,collection:this.collection,parent:this},r=new this.view(o(n,this.viewOptions));return this.views.push(r),r.renderedByParentView=!0,r.render(e),r},_getOrCreateByModel:function(t,e){return this._getViewByModel(t)||this._createViewForModel(t,e)},_addViewForModel:function(t,e,n){var r=this.filter?this.filter(t):!0;if(r){this.renderedEmptyView&&(this.renderedEmptyView.remove(),delete this.renderedEmptyView);var o=this._getOrCreateByModel(t,{containerEl:this.el});n&&n.rerender?this._insertView(o):this._insertViewAtIndex(o)}},_insertViewAtIndex:function(t){if(!t.insertSelf){var e,n,r=this.collection.indexOf(t.model);e=this.collection.at(this.reverse?r-1:r+1),n=this._getViewByModel(e),n?this.el.insertBefore(t.el,n&&n.el):this.el.appendChild(t.el)}},_insertView:function(t){t.insertSelf||(this.reverse&&this.el.firstChild?this.el.insertBefore(t.el,this.el.firstChild):this.el.appendChild(t.el))},_removeViewForModel:function(t){var e=this._getViewByModel(t);if(e){var n=this.views.indexOf(e);-1!==n&&(e=this.views.splice(n,1)[0],this._removeView(e),0===this.views.length&&this._renderEmptyView())}},_removeView:function(t){t.animateRemove?t.animateRemove():t.remove()},_renderAll:function(){this.collection.each(this._addViewForModel,this),0===this.views.length&&this._renderEmptyView()},_rerenderAll:function(t,e){e=e||{},this.collection.each(function(t){this._addViewForModel(t,this,o(e,{rerender:!0}))},this)},_renderEmptyView:function(){if(this.emptyView&&!this.renderedEmptyView){var t=this.renderedEmptyView=new this.emptyView({parent:this});this.el.appendChild(t.render().el)}},_reset:function(){var t=this.collection.map(this._getOrCreateByModel,this),e=u(this.views,t);e.forEach(this._removeView,this),this.views=t,this._rerenderAll(),0===this.views.length&&this._renderEmptyView()}}),r.extend=c,e.exports=r},{"ampersand-class-extend":160,"ampersand-events":161,"lodash.assign":204,"lodash.difference":172,"lodash.find":182,"lodash.invoke":234,"lodash.pick":248}],160:[function(t,e,n){e.exports=t(13)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-class-extend/ampersand-class-extend.js":13,"lodash.assign":204}],161:[function(t,e,n){e.exports=t(14)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/ampersand-events.js":14,"lodash.assign":204,"lodash.bind":215,"lodash.foreach":226,"lodash.isempty":162,"lodash.keys":166,"lodash.once":170,"lodash.uniqueid":267}],162:[function(t,e,n){e.exports=t(19)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/index.js":19,"lodash.isarguments":163,"lodash.isarray":164,"lodash.isfunction":165,"lodash.isstring":246,"lodash.keys":166}],163:[function(t,e,n){e.exports=t(20)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],164:[function(t,e,n){e.exports=t(46)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.isarray/index.js":46}],165:[function(t,e,n){e.exports=t(21)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isfunction/index.js":21}],166:[function(t,e,n){e.exports=t(23)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/index.js":23,"lodash.isarguments":167,"lodash.isarray":168,"lodash.isnative":169}],167:[function(t,e,n){e.exports=t(20)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],168:[function(t,e,n){e.exports=t(46)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.isarray/index.js":46}],169:[function(t,e,n){e.exports=t(25)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/node_modules/lodash.isnative/index.js":25}],170:[function(t,e,n){e.exports=t(26)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.once/index.js":26,"lodash.before":171}],171:[function(t,e,n){e.exports=t(27)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.once/node_modules/lodash.before/index.js":27}],172:[function(t,e,n){var r=t("lodash._basedifference"),o=t("lodash._baseflatten"),i=t("lodash.isarguments"),a=t("lodash.isarray"),s=t("lodash.restparam"),u=s(function(t,e){return a(t)||i(t)?r(t,o(e,!1,!0)):[]});e.exports=u},{"lodash._basedifference":173,"lodash._baseflatten":178,"lodash.isarguments":179,"lodash.isarray":180,"lodash.restparam":181}],173:[function(t,e,n){e.exports=t(112)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.omit/node_modules/lodash._basedifference/index.js":112,"lodash._baseindexof":174,"lodash._cacheindexof":175,"lodash._createcache":176}],174:[function(t,e,n){e.exports=t(91)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.includes/node_modules/lodash._baseindexof/index.js":91}],175:[function(t,e,n){e.exports=t(114)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._cacheindexof/index.js":114}],176:[function(t,e,n){e.exports=t(115)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.omit/node_modules/lodash._basedifference/node_modules/lodash._createcache/index.js":115,"lodash.isnative":177}],177:[function(t,e,n){e.exports=t(25)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/node_modules/lodash.isnative/index.js":25}],178:[function(t,e,n){e.exports=t(117)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.omit/node_modules/lodash._baseflatten/index.js":117,"lodash.isarguments":179,"lodash.isarray":180}],179:[function(t,e,n){e.exports=t(20)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],180:[function(t,e,n){e.exports=t(46)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.isarray/index.js":46}],181:[function(t,e,n){e.exports=t(36)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/node_modules/lodash.restparam/index.js":36}],182:[function(t,e,n){function r(t,e){return function(n,r,i){if(r=o(r,i,3),u(n)){var l=s(n,r,e);return l>-1?n[l]:void 0}return a(n,r,t)}}var o=t("lodash._basecallback"),i=t("lodash._baseeach"),a=t("lodash._basefind"),s=t("lodash._basefindindex"),u=t("lodash.isarray"),l=(t("lodash.keys"),r(i));e.exports=l},{"lodash._basecallback":183,"lodash._baseeach":187,"lodash._basefind":188,"lodash._basefindindex":189,"lodash.isarray":190,"lodash.keys":191}],183:[function(t,e,n){function r(t,e,n){var r=typeof t;return"function"==r?"undefined"==typeof e?t:p(t,e,n):null==t?d:"object"==r?i(t):"undefined"==typeof e?s(t+""):a(t+"",e)}function o(t,e,n,r,o){for(var i=-1,a=e.length,s=!o;++i<a;)if(s&&r[i]?n[i]!==t[e[i]]:!(e[i]in t))return!1;for(i=-1;++i<a;){var u=e[i],l=t[u],c=n[i];if(s&&r[i])var f="undefined"!=typeof l||u in t;else f=o?o(l,c,u):void 0,"undefined"==typeof f&&(f=h(c,l,o,!0));if(!f)return!1}return!0}function i(t){var e=m(t),n=e.length;if(!n)return f(!0);if(1==n){var r=e[0],i=t[r];if(u(i))return function(t){return null!=t&&t[r]===i&&("undefined"!=typeof i||r in l(t))}}for(var a=Array(n),s=Array(n);n--;)i=t[e[n]],a[n]=i,s[n]=u(i);return function(t){return null!=t&&o(l(t),e,a,s)}}function a(t,e){return u(e)?function(n){return null!=n&&n[t]===e&&("undefined"!=typeof e||t in l(n))}:function(n){return null!=n&&h(e,n[t],null,!0)}}function s(t){return function(e){return null==e?void 0:e[t]}}function u(t){return t===t&&(0===t?1/t>0:!c(t))}function l(t){return c(t)?t:Object(t)}function c(t){var e=typeof t;return"function"==e||!!t&&"object"==e}function f(t){return function(){return t}}function d(t){return t}var h=t("lodash._baseisequal"),p=t("lodash._bindcallback"),m=t("lodash.keys");e.exports=r},{"lodash._baseisequal":184,"lodash._bindcallback":186,"lodash.keys":191}],184:[function(t,e,n){e.exports=t(99)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.isequal/node_modules/lodash._baseisequal/index.js":99,"lodash.isarray":190,"lodash.istypedarray":185,"lodash.keys":191}],185:[function(t,e,n){e.exports=t(100)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.isequal/node_modules/lodash._baseisequal/node_modules/lodash.istypedarray/index.js":100}],186:[function(t,e,n){e.exports=t(18)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/node_modules/lodash._bindcallback/index.js":18}],187:[function(t,e,n){e.exports=t(17)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/node_modules/lodash._baseeach/index.js":17,"lodash.keys":191}],188:[function(t,e,n){function r(t,e,n,r){var o;return n(t,function(t,n,i){return e(t,n,i)?(o=r?n:t,!1):void 0}),o}e.exports=r},{}],189:[function(t,e,n){function r(t,e,n){for(var r=t.length,o=n?r:-1;n?o--:++o<r;)if(e(t[o],o,t))return o;return-1}e.exports=r},{}],190:[function(t,e,n){e.exports=t(46)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.isarray/index.js":46}],191:[function(t,e,n){e.exports=t(23)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/index.js":23,"lodash.isarguments":192,"lodash.isarray":190,"lodash.isnative":193}],192:[function(t,e,n){e.exports=t(20)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],193:[function(t,e,n){e.exports=t(25)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/node_modules/lodash.isnative/index.js":25}],194:[function(t,e,n){function r(t,e){if(""===e)return[t];var n=[];return c(t,e)&&n.push(t),n.concat(f.call(t.querySelectorAll(e)))}function o(t,e){for(var n in e)l.setAttribute(t,n,e[n])}function i(t,e){for(var n in e)l.removeAttribute(t,n)}function a(t){return Array.isArray(t)?t:[t]}function s(t,e){var n,s=t.type||"text",u="function"==typeof s,c=function(){return"string"==typeof t.selector?t.selector:t.hook?'[data-hook~="'+t.hook+'"]':""}(),f=t.yes,d=t.no,h=!(!f&&!d);if(u)return function(t,o){r(t,c).forEach(function(t){s.call(e,t,o,n)}),n=o};if("text"===s)return function(t,e){r(t,c).forEach(function(t){l.text(t,e)})};if("class"===s)return function(t,e){r(t,c).forEach(function(t){l.switchClass(t,n,e)}),n=e};if("attribute"===s){if(!t.name)throw Error('attribute bindings must have a "name"');return function(e,o){var i=a(t.name);r(e,c).forEach(function(t){i.forEach(function(e){l.setAttribute(t,e,o)})}),n=o}}if("value"===s)return function(t,e){r(t,c).forEach(function(t){e||0===e||(e=""),document.activeElement!==t&&(t.value=e)}),n=e};if("booleanClass"===s)return h?(f=a(f||""),d=a(d||""),function(t,e){var n=e?d:f,o=e?f:d;r(t,c).forEach(function(t){n.forEach(function(e){l.removeClass(t,e)}),o.forEach(function(e){l.addClass(t,e)})})}):function(e,n,o){var i=a(t.name||o);r(e,c).forEach(function(t){i.forEach(function(e){l[n?"addClass":"removeClass"](t,e)})})};if("booleanAttribute"===s)return h?(f=a(f||""),d=a(d||""),function(t,e){var n=e?d:f,o=e?f:d;r(t,c).forEach(function(t){n.forEach(function(e){e&&l.removeAttribute(t,e)}),o.forEach(function(e){e&&l.addAttribute(t,e)})})}):function(e,n,o){var i=a(t.name||o);r(e,c).forEach(function(t){i.forEach(function(e){l[n?"addAttribute":"removeAttribute"](t,e)})})};if("toggle"===s){var p=t.mode||"display";return h?function(t,e){r(t,f).forEach(function(t){l[e?"show":"hide"](t,p)}),r(t,d).forEach(function(t){l[e?"hide":"show"](t,p)})}:function(t,e){r(t,c).forEach(function(t){l[e?"show":"hide"](t,p)})}}if("switch"===s){if(!t.cases)throw Error('switch bindings must have "cases"');return function(e,n){for(var o in t.cases)r(e,t.cases[o]).forEach(function(t){l[n===o?"show":"hide"](t)})}}if("innerHTML"===s)return function(t,e){r(t,c).forEach(function(t){l.html(t,e)})};if("switchClass"===s){if(!t.cases)throw Error('switchClass bindings must have "cases"');return function(e,n,o){var i=a(t.name||o);for(var s in t.cases)r(e,t.cases[s]).forEach(function(t){i.forEach(function(e){l[n===s?"addClass":"removeClass"](t,e)})})}}if("switchAttribute"===s){if(!t.cases)throw Error('switchAttribute bindings must have "cases"');return function(e,a,s){r(e,c).forEach(function(e){if(n&&i(e,n),a in t.cases){var r=t.cases[a];"string"==typeof r&&(r={},r[t.name||s]=t.cases[a]),o(e,r),n=r}})}}throw new Error("no such binding type: "+s)}"undefined"!=typeof window&&(window.ampersand=window.ampersand||{},window.ampersand["ampersand-dom-bindings"]=window.ampersand["ampersand-dom-bindings"]||[],window.ampersand["ampersand-dom-bindings"].push("3.5.0"));var u=t("key-tree-store"),l=t("ampersand-dom"),c=t("matches-selector");e.exports=function(t,e){var n,r,o=new u;for(n in t)r=t[n],"string"==typeof r?o.add(n,s({type:"text",selector:r})):r.forEach?r.forEach(function(t){o.add(n,s(t,e))}):o.add(n,s(r,e));return o};var f=Array.prototype.slice},{"ampersand-dom":195,"key-tree-store":196,"matches-selector":269}],195:[function(t,e,n){function r(t){return t||0===t?t:""}function o(t,e){return t.classList?t.classList.contains(e):new RegExp("(^| )"+e+"( |$)","gi").test(t.className)}function i(t,e){var n=t[e];return e in t&&(n===!0||n===!1)}function a(t){return"true"===c.getAttribute(t,"data-anddom-hidden")}function s(t,e){c.setAttribute(t,"data-anddom-"+e,t.style[e])}function u(t,e){t.style[e]=c.getAttribute(t,"data-anddom-"+e)||"",c.removeAttribute(t,"data-anddom-hidden")}function l(t,e){c.setAttribute(t,"data-anddom-hidden","true"),t.style[e]="visibility"===e?"hidden":"none"}"undefined"!=typeof window&&(window.ampersand=window.ampersand||{},window.ampersand["ampersand-dom"]=window.ampersand["ampersand-dom"]||[],window.ampersand["ampersand-dom"].push("1.4.0"));var c=e.exports={text:function(t,e){t.textContent=r(e)},addClass:function(t,e){e=r(e),e&&(Array.isArray(e)?e.forEach(function(e){c.addClass(t,e)}):t.classList?t.classList.add(e):o(t,e)||(t.classList?t.classList.add(e):t.className+=" "+e))},removeClass:function(t,e){Array.isArray(e)?e.forEach(function(e){c.removeClass(t,e)}):t.classList?(e=r(e),e&&t.classList.remove(e)):t.className=t.className.replace(new RegExp("(^|\\b)"+e.split(" ").join("|")+"(\\b|$)","gi")," ")},hasClass:o,switchClass:function(t,e,n){e&&this.removeClass(t,e),this.addClass(t,n)},addAttribute:function(t,e){t.setAttribute(e,""),i(t,e)&&(t[e]=!0)},removeAttribute:function(t,e){t.removeAttribute(e),i(t,e)&&(t[e]=!1)},setAttribute:function(t,e,n){t.setAttribute(e,r(n))},getAttribute:function(t,e){return t.getAttribute(e)},hasAttribute:function(t,e){return t.hasAttribute(e)},hide:function(t,e){e||(e="display"),a(t)||(s(t,e),l(t,e))},show:function(t,e){e||(e="display"),u(t,e)},html:function(t,e){t.innerHTML=e}}},{}],196:[function(t,e,n){e.exports=t(52)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/key-tree-store/key-tree-store.js":52}],197:[function(t,e,n){function r(t,e){if("string"!=typeof t)throw new TypeError("String expected");e||(e=document);var n=/<([\w:]+)/.exec(t);if(!n)return e.createTextNode(t);t=t.replace(/^\s+|\s+$/g,"");var r=n[1];if("body"==r){var o=e.createElement("html");return o.innerHTML=t,o.removeChild(o.lastChild)}var i=a[r]||a._default,s=i[0],u=i[1],l=i[2],o=e.createElement("div");for(o.innerHTML=u+t+l;s--;)o=o.lastChild;if(o.firstChild==o.lastChild)return o.removeChild(o.firstChild);for(var c=e.createDocumentFragment();o.firstChild;)c.appendChild(o.removeChild(o.firstChild));return c}e.exports=r;var o=document.createElement("div");o.innerHTML=' <link/><table></table><a href="/a">a</a><input type="checkbox"/>';var i=!o.getElementsByTagName("link").length;o=void 0;var a={legend:[1,"<fieldset>","</fieldset>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],_default:i?[1,"X<div>","</div>"]:[0,"",""]};a.td=a.th=[3,"<table><tbody><tr>","</tr></tbody></table>"],a.option=a.optgroup=[1,'<select multiple="multiple">',"</select>"],a.thead=a.tbody=a.colgroup=a.caption=a.tfoot=[1,"<table>","</table>"],a.polyline=a.ellipse=a.polygon=a.circle=a.text=a.line=a.path=a.rect=a.g=[1,'<svg xmlns="http://www.w3.org/2000/svg" version="1.1">',"</svg>"]},{}],198:[function(t,e,n){function r(t,e){if(!(this instanceof r))return new r(t,e);if(!t)throw new Error("element required");if(!e)throw new Error("object required");this.el=t,this.obj=e,this._events={}}function o(t){var e=t.split(/ +/);return{name:e.shift(),selector:e.join(" ")}}var i=t("component-event"),a=t("delegate-events"),s=["focus","blur"];e.exports=r,r.prototype.sub=function(t,e,n){this._events[t]=this._events[t]||{},this._events[t][e]=n},r.prototype.bind=function(t,e){function n(){var t=[].slice.call(arguments).concat(c);if("function"==typeof e)return void e.apply(u,t);if(!u[e])throw new Error(e+" method is not defined");u[e].apply(u,t)}var r=o(t),s=this.el,u=this.obj,l=r.name,e=e||"on"+l,c=[].slice.call(arguments,2);return r.selector?n=a.bind(s,r.selector,l,n):i.bind(s,l,n),this.sub(l,e,n),n},r.prototype.unbind=function(t,e){if(0==arguments.length)return this.unbindAll();if(1==arguments.length)return this.unbindAllOf(t);var n=this._events[t],r=-1!==s.indexOf(t);if(n){var o=n[e];o&&i.unbind(this.el,t,o,r)}},r.prototype.unbindAll=function(){for(var t in this._events)this.unbindAllOf(t)},r.prototype.unbindAllOf=function(t){var e=this._events[t];if(e)for(var n in e)this.unbind(t,n)}},{"component-event":199,"delegate-events":200}],199:[function(t,e,n){var r=window.addEventListener?"addEventListener":"attachEvent",o=window.removeEventListener?"removeEventListener":"detachEvent",i="addEventListener"!==r?"on":"";n.bind=function(t,e,n,o){return t[r](i+e,n,o||!1),n},n.unbind=function(t,e,n,r){return t[o](i+e,n,r||!1),n}},{}],200:[function(t,e,n){var r=t("closest"),o=t("event"),i=["focus","blur"];n.bind=function(t,e,n,a,s){return-1!==i.indexOf(n)&&(s=!0),o.bind(t,n,function(n){var o=n.target||n.srcElement;n.delegateTarget=r(o,e,!0,t),n.delegateTarget&&a.call(t,n)},s)},n.unbind=function(t,e,n,r){-1!==i.indexOf(e)&&(r=!0),o.unbind(t,e,n,r)}},{closest:201,event:199}],201:[function(t,e,n){var r=t("matches-selector");e.exports=function(t,e,n){for(var o=n?t:t.parentNode;o&&o!==document;){if(r(o,e))return o;o=o.parentNode}}},{"matches-selector":202}],202:[function(t,e,n){function r(t,e){if(i)return i.call(t,e);for(var n=t.parentNode.querySelectorAll(e),r=0;r<n.length;++r)if(n[r]==t)return!0;return!1}var o=Element.prototype,i=o.matchesSelector||o.webkitMatchesSelector||o.mozMatchesSelector||o.msMatchesSelector||o.oMatchesSelector;e.exports=r},{}],203:[function(t,e,n){function r(t,e){if(-1==e.indexOf(".")&&-1==e.indexOf("["))return t[e];for(var n,r=e.split(/\.|\[|\]/g),o=-1,i=r.length;++o<i;)if(0==o&&(n=t),r[o]){if(void 0==n)break;n=n[r[o]]}return n}e.exports=r},{}],204:[function(t,e,n){e.exports=t(30)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/index.js":30,"lodash._baseassign":205,"lodash._createassigner":207,"lodash.isnative":211,"lodash.keys":212}],205:[function(t,e,n){e.exports=t(31)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._baseassign/index.js":31,"lodash._basecopy":206,"lodash.isnative":211,"lodash.keys":212}],206:[function(t,e,n){e.exports=t(32)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._baseassign/node_modules/lodash._basecopy/index.js":32}],207:[function(t,e,n){e.exports=t(33)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/index.js":33,"lodash._bindcallback":208,"lodash._isiterateecall":209,"lodash.restparam":210}],208:[function(t,e,n){e.exports=t(18)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/node_modules/lodash._bindcallback/index.js":18}],209:[function(t,e,n){e.exports=t(35)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/node_modules/lodash._isiterateecall/index.js":35}],210:[function(t,e,n){e.exports=t(36)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/node_modules/lodash.restparam/index.js":36}],211:[function(t,e,n){e.exports=t(25)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/node_modules/lodash.isnative/index.js":25}],212:[function(t,e,n){e.exports=t(23)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/index.js":23,"lodash.isarguments":213,"lodash.isarray":214,"lodash.isnative":211}],213:[function(t,e,n){e.exports=t(20)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],214:[function(t,e,n){e.exports=t(46)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.isarray/index.js":46}],215:[function(t,e,n){e.exports=t(40)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.bind/index.js":40,"lodash._createwrapper":216,"lodash._replaceholders":219,"lodash.restparam":220}],216:[function(t,e,n){e.exports=t(41)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.bind/node_modules/lodash._createwrapper/index.js":41,"lodash._arraycopy":217,"lodash._basecreate":218,"lodash._replaceholders":219}],217:[function(t,e,n){e.exports=t(42)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.bind/node_modules/lodash._createwrapper/node_modules/lodash._arraycopy/index.js":42}],218:[function(t,e,n){e.exports=t(43)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.bind/node_modules/lodash._createwrapper/node_modules/lodash._basecreate/index.js":43}],219:[function(t,e,n){e.exports=t(44)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.bind/node_modules/lodash._replaceholders/index.js":44}],220:[function(t,e,n){e.exports=t(36)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/node_modules/lodash.restparam/index.js":36}],221:[function(t,e,n){function r(t,e,n){var r=t?t.length:0;return n&&i(t,e,n)&&(e=!1),r?o(t,e):[]}var o=t("lodash._baseflatten"),i=t("lodash._isiterateecall");e.exports=r},{"lodash._baseflatten":222,"lodash._isiterateecall":225}],222:[function(t,e,n){e.exports=t(117);
+
+},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.omit/node_modules/lodash._baseflatten/index.js":117,"lodash.isarguments":223,"lodash.isarray":224}],223:[function(t,e,n){e.exports=t(20)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],224:[function(t,e,n){e.exports=t(46)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.isarray/index.js":46}],225:[function(t,e,n){e.exports=t(35)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/node_modules/lodash._isiterateecall/index.js":35}],226:[function(t,e,n){e.exports=t(15)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/index.js":15,"lodash._arrayeach":227,"lodash._baseeach":228,"lodash._bindcallback":232,"lodash.isarray":233}],227:[function(t,e,n){e.exports=t(16)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/node_modules/lodash._arrayeach/index.js":16}],228:[function(t,e,n){e.exports=t(17)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/node_modules/lodash._baseeach/index.js":17,"lodash.keys":229}],229:[function(t,e,n){e.exports=t(23)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/index.js":23,"lodash.isarguments":230,"lodash.isarray":233,"lodash.isnative":231}],230:[function(t,e,n){e.exports=t(20)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],231:[function(t,e,n){e.exports=t(25)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/node_modules/lodash.isnative/index.js":25}],232:[function(t,e,n){e.exports=t(18)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/node_modules/lodash._bindcallback/index.js":18}],233:[function(t,e,n){e.exports=t(46)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.isarray/index.js":46}],234:[function(t,e,n){function r(t){return function(e){return null==e?void 0:e[t]}}function o(t,e){var n=typeof t;if("string"==n&&h.test(t)||"number"==n)return!0;if(c(t))return!1;var r=!d.test(t);return r||null!=e&&t in a(e)}function i(t){return"number"==typeof t&&t>-1&&t%1==0&&p>=t}function a(t){return s(t)?t:Object(t)}function s(t){var e=typeof t;return"function"==e||!!t&&"object"==e}var u=t("lodash._baseeach"),l=t("lodash._invokepath"),c=t("lodash.isarray"),f=t("lodash.restparam"),d=/\.|\[(?:[^[\]]+|(["'])(?:(?!\1)[^\n\\]|\\.)*?)\1\]/,h=/^\w*$/,p=Math.pow(2,53)-1,m=r("length"),g=f(function(t,e,n){var r=-1,a="function"==typeof e,s=o(e),c=m(t),f=i(c)?Array(c):[];return u(t,function(t){var o=a?e:s&&null!=t&&t[e];f[++r]=o?o.apply(t,n):l(t,e,n)}),f});e.exports=g},{"lodash._baseeach":235,"lodash._invokepath":239,"lodash.isarray":244,"lodash.restparam":245}],235:[function(t,e,n){e.exports=t(17)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/node_modules/lodash._baseeach/index.js":17,"lodash.keys":236}],236:[function(t,e,n){e.exports=t(23)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/index.js":23,"lodash.isarguments":237,"lodash.isarray":244,"lodash.isnative":238}],237:[function(t,e,n){e.exports=t(20)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],238:[function(t,e,n){e.exports=t(25)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.keys/node_modules/lodash.isnative/index.js":25}],239:[function(t,e,n){function r(t,e,n){null==t||o(e,t)||(e=c(e),t=1==e.length?t:u(t,l(e,0,-1)),e=a(e));var r=null==t?t:t[e];return null==r?void 0:r.apply(t,n)}function o(t,e){var n=typeof t;if("string"==n&&h.test(t)||"number"==n)return!0;if(f(t))return!1;var r=!d.test(t);return r||null!=e&&t in i(e)}function i(t){return s(t)?t:Object(t)}function a(t){var e=t?t.length:0;return e?t[e-1]:void 0}function s(t){var e=typeof t;return"function"==e||!!t&&"object"==e}var u=t("lodash._baseget"),l=t("lodash._baseslice"),c=t("lodash._topath"),f=t("lodash.isarray"),d=/\.|\[(?:[^[\]]+|(["'])(?:(?!\1)[^\n\\]|\\.)*?)\1\]/,h=/^\w*$/;e.exports=r},{"lodash._baseget":240,"lodash._baseslice":241,"lodash._topath":242,"lodash.isarray":244}],240:[function(t,e,n){e.exports=t(86)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.has/node_modules/lodash._baseget/index.js":86}],241:[function(t,e,n){e.exports=t(87)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.has/node_modules/lodash._baseslice/index.js":87}],242:[function(t,e,n){e.exports=t(88)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.has/node_modules/lodash._topath/index.js":88,"lodash._basetostring":243,"lodash.isarray":244}],243:[function(t,e,n){e.exports=t(29)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.uniqueid/node_modules/lodash._basetostring/index.js":29}],244:[function(t,e,n){e.exports=t(46)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.isarray/index.js":46}],245:[function(t,e,n){e.exports=t(36)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/node_modules/lodash.restparam/index.js":36}],246:[function(t,e,n){e.exports=t(22)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isstring/index.js":22}],247:[function(t,e,n){function r(t){var e=t?t.length:0;return e?t[e-1]:void 0}e.exports=r},{}],248:[function(t,e,n){var r=t("lodash._baseflatten"),o=t("lodash._bindcallback"),i=t("lodash._pickbyarray"),a=t("lodash._pickbycallback"),s=t("lodash.restparam"),u=s(function(t,e){return null==t?{}:"function"==typeof e[0]?a(t,o(e[0],e[1],3)):i(t,r(e))});e.exports=u},{"lodash._baseflatten":249,"lodash._bindcallback":252,"lodash._pickbyarray":253,"lodash._pickbycallback":254,"lodash.restparam":259}],249:[function(t,e,n){e.exports=t(117)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.omit/node_modules/lodash._baseflatten/index.js":117,"lodash.isarguments":250,"lodash.isarray":251}],250:[function(t,e,n){e.exports=t(20)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],251:[function(t,e,n){e.exports=t(46)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.isarray/index.js":46}],252:[function(t,e,n){e.exports=t(18)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.foreach/node_modules/lodash._bindcallback/index.js":18}],253:[function(t,e,n){e.exports=t(120)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.omit/node_modules/lodash._pickbyarray/index.js":120}],254:[function(t,e,n){e.exports=t(121)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.omit/node_modules/lodash._pickbycallback/index.js":121,"lodash._basefor":255,"lodash.keysin":256}],255:[function(t,e,n){e.exports=t(73)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.clone/node_modules/lodash._baseclone/node_modules/lodash._basefor/index.js":73}],256:[function(t,e,n){e.exports=t(123)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.omit/node_modules/lodash.keysin/index.js":123,"lodash.isarguments":257,"lodash.isarray":258}],257:[function(t,e,n){e.exports=t(20)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isarguments/index.js":20}],258:[function(t,e,n){e.exports=t(46)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.isarray/index.js":46}],259:[function(t,e,n){e.exports=t(36)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.assign/node_modules/lodash._createassigner/node_modules/lodash.restparam/index.js":36}],260:[function(t,e,n){e.exports=t(126)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.result/index.js":126,"lodash._baseget":261,"lodash._baseslice":262,"lodash._topath":263,"lodash.isarray":265,"lodash.isfunction":266}],261:[function(t,e,n){e.exports=t(86)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.has/node_modules/lodash._baseget/index.js":86}],262:[function(t,e,n){e.exports=t(87)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.has/node_modules/lodash._baseslice/index.js":87}],263:[function(t,e,n){e.exports=t(88)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-state/node_modules/lodash.has/node_modules/lodash._topath/index.js":88,"lodash._basetostring":264,"lodash.isarray":265}],264:[function(t,e,n){e.exports=t(29)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.uniqueid/node_modules/lodash._basetostring/index.js":29}],265:[function(t,e,n){e.exports=t(46)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/lodash.isarray/index.js":46}],266:[function(t,e,n){e.exports=t(21)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.isempty/node_modules/lodash.isfunction/index.js":21}],267:[function(t,e,n){e.exports=t(28)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.uniqueid/index.js":28,"lodash._basetostring":268}],268:[function(t,e,n){e.exports=t(29)},{"/mnt/fast/alexg/work/wiredtiger/tools/wtstats/template/node_modules/ampersand-collection/node_modules/ampersand-events/node_modules/lodash.uniqueid/node_modules/lodash._basetostring/index.js":29}],269:[function(t,e,n){"use strict";function r(t,e){if(i)return i.call(t,e);for(var n=t.parentNode.querySelectorAll(e),r=0;r<n.length;r++)if(n[r]==t)return!0;return!1}var o=Element.prototype,i=o.matches||o.matchesSelector||o.webkitMatchesSelector||o.mozMatchesSelector||o.msMatchesSelector||o.oMatchesSelector;e.exports=r},{}],270:[function(t,e,n){+function(t){"use strict";function e(e){return this.each(function(){var r=t(this),data=r.data("bs.button"),o="object"==typeof e&&e;data||r.data("bs.button",data=new n(this,o)),"toggle"==e?data.toggle():e&&data.setState(e)})}var n=function(e,r){this.$element=t(e),this.options=t.extend({},n.DEFAULTS,r),this.isLoading=!1};n.VERSION="3.2.0",n.DEFAULTS={loadingText:"loading..."},n.prototype.setState=function(e){var n="disabled",r=this.$element,o=r.is("input")?"val":"html",data=r.data();e+="Text",null==data.resetText&&r.data("resetText",r[o]()),r[o](null==data[e]?this.options[e]:data[e]),setTimeout(t.proxy(function(){"loadingText"==e?(this.isLoading=!0,r.addClass(n).attr(n,n)):this.isLoading&&(this.isLoading=!1,r.removeClass(n).removeAttr(n))},this),0)},n.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var n=this.$element.find("input");"radio"==n.prop("type")&&(n.prop("checked")&&this.$element.hasClass("active")?t=!1:e.find(".active").removeClass("active")),t&&n.prop("checked",!this.$element.hasClass("active")).trigger("change")}t&&this.$element.toggleClass("active")};var r=t.fn.button;t.fn.button=e,t.fn.button.Constructor=n,t.fn.button.noConflict=function(){return t.fn.button=r,this},t(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(n){var r=t(n.target);r.hasClass("btn")||(r=r.closest(".btn")),e.call(r,"toggle"),n.preventDefault()})}(jQuery)},{}],271:[function(t,e,n){+function(t){"use strict";function e(e){return this.each(function(){var r=t(this),data=r.data("bs.collapse"),o=t.extend({},n.DEFAULTS,r.data(),"object"==typeof e&&e);!data&&o.toggle&&"show"==e&&(e=!e),data||r.data("bs.collapse",data=new n(this,o)),"string"==typeof e&&data[e]()})}var n=function(e,r){this.$element=t(e),this.options=t.extend({},n.DEFAULTS,r),this.transitioning=null,this.options.parent&&(this.$parent=t(this.options.parent)),this.options.toggle&&this.toggle()};n.VERSION="3.2.0",n.DEFAULTS={toggle:!0},n.prototype.dimension=function(){var t=this.$element.hasClass("width");return t?"width":"height"},n.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var n=t.Event("show.bs.collapse");if(this.$element.trigger(n),!n.isDefaultPrevented()){var r=this.$parent&&this.$parent.find("> .panel > .in");if(r&&r.length){var o=r.data("bs.collapse");if(o&&o.transitioning)return;e.call(r,"hide"),o||r.data("bs.collapse",null)}var i=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[i](0),this.transitioning=1;var a=function(){this.$element.removeClass("collapsing").addClass("collapse in")[i](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!t.support.transition)return a.call(this);var s=t.camelCase(["scroll",i].join("-"));this.$element.one("bsTransitionEnd",t.proxy(a,this)).emulateTransitionEnd(350)[i](this.$element[0][s])}}},n.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var e=t.Event("hide.bs.collapse");if(this.$element.trigger(e),!e.isDefaultPrevented()){var n=this.dimension();this.$element[n](this.$element[n]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var r=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return t.support.transition?void this.$element[n](0).one("bsTransitionEnd",t.proxy(r,this)).emulateTransitionEnd(350):r.call(this)}}},n.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var r=t.fn.collapse;t.fn.collapse=e,t.fn.collapse.Constructor=n,t.fn.collapse.noConflict=function(){return t.fn.collapse=r,this},t(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(n){var r,o=t(this),i=o.attr("data-target")||n.preventDefault()||(r=o.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),a=t(i),data=a.data("bs.collapse"),s=data?"toggle":o.data(),u=o.attr("data-parent"),l=u&&t(u);data&&data.transitioning||(l&&l.find('[data-toggle="collapse"][data-parent="'+u+'"]').not(o).addClass("collapsed"),o[a.hasClass("in")?"addClass":"removeClass"]("collapsed")),e.call(a,s)})}(jQuery)},{}],272:[function(t,e,n){+function(t){"use strict";function e(e){e&&3===e.which||(t(o).remove(),t(i).each(function(){var r=n(t(this)),o={relatedTarget:this};r.hasClass("open")&&(r.trigger(e=t.Event("hide.bs.dropdown",o)),e.isDefaultPrevented()||r.removeClass("open").trigger("hidden.bs.dropdown",o))}))}function n(e){var n=e.attr("data-target");n||(n=e.attr("href"),n=n&&/#[A-Za-z]/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,""));var r=n&&t(n);return r&&r.length?r:e.parent()}function r(e){return this.each(function(){var n=t(this),data=n.data("bs.dropdown");data||n.data("bs.dropdown",data=new a(this)),"string"==typeof e&&data[e].call(n)})}var o=".dropdown-backdrop",i='[data-toggle="dropdown"]',a=function(e){t(e).on("click.bs.dropdown",this.toggle)};a.VERSION="3.2.0",a.prototype.toggle=function(r){var o=t(this);if(!o.is(".disabled, :disabled")){var i=n(o),a=i.hasClass("open");if(e(),!a){"ontouchstart"in document.documentElement&&!i.closest(".navbar-nav").length&&t('<div class="dropdown-backdrop"/>').insertAfter(t(this)).on("click",e);var s={relatedTarget:this};if(i.trigger(r=t.Event("show.bs.dropdown",s)),r.isDefaultPrevented())return;o.trigger("focus"),i.toggleClass("open").trigger("shown.bs.dropdown",s)}return!1}},a.prototype.keydown=function(e){if(/(38|40|27)/.test(e.keyCode)){var r=t(this);if(e.preventDefault(),e.stopPropagation(),!r.is(".disabled, :disabled")){var o=n(r),a=o.hasClass("open");if(!a||a&&27==e.keyCode)return 27==e.which&&o.find(i).trigger("focus"),r.trigger("click");var s=" li:not(.divider):visible a",u=o.find('[role="menu"]'+s+', [role="listbox"]'+s);if(u.length){var l=u.index(u.filter(":focus"));38==e.keyCode&&l>0&&l--,40==e.keyCode&&l<u.length-1&&l++,~l||(l=0),u.eq(l).trigger("focus")}}}};var s=t.fn.dropdown;t.fn.dropdown=r,t.fn.dropdown.Constructor=a,t.fn.dropdown.noConflict=function(){return t.fn.dropdown=s,this},t(document).on("click.bs.dropdown.data-api",e).on("click.bs.dropdown.data-api",".dropdown form",function(t){t.stopPropagation()}).on("click.bs.dropdown.data-api",i,a.prototype.toggle).on("keydown.bs.dropdown.data-api",i+', [role="menu"], [role="listbox"]',a.prototype.keydown)}(jQuery)},{}],273:[function(t,e,n){+function(t){"use strict";function e(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in e)if(void 0!==t.style[n])return{end:e[n]};return!1}t.fn.emulateTransitionEnd=function(e){var n=!1,r=this;t(this).one("bsTransitionEnd",function(){n=!0});var o=function(){n||t(r).trigger(t.support.transition.end)};return setTimeout(o,e),this},t(function(){t.support.transition=e(),t.support.transition&&(t.event.special.bsTransitionEnd={bindType:t.support.transition.end,delegateType:t.support.transition.end,handle:function(e){return t(e.target).is(this)?e.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery)},{}],274:[function(t,e,n){},{}],275:[function(t,e,n){!function(){function t(t){return t&&(t.ownerDocument||t.document||t).documentElement}function n(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function r(t,e){return e>t?-1:t>e?1:t>=e?0:0/0}function o(t){return null===t?0/0:+t}function i(t){return!isNaN(t)}function a(t){return{left:function(e,n,r,o){for(arguments.length<3&&(r=0),arguments.length<4&&(o=e.length);o>r;){var i=r+o>>>1;t(e[i],n)<0?r=i+1:o=i}return r},right:function(e,n,r,o){for(arguments.length<3&&(r=0),arguments.length<4&&(o=e.length);o>r;){var i=r+o>>>1;t(e[i],n)>0?o=i:r=i+1}return r}}}function s(t){return t.length}function u(t){for(var e=1;t*e%1;)e*=10;return e}function l(t,e){for(var n in e)Object.defineProperty(t.prototype,n,{value:e[n],enumerable:!1})}function c(){this._=Object.create(null)}function f(t){return(t+="")===ga||t[0]===va?va+t:t}function d(t){return(t+="")[0]===va?t.slice(1):t}function h(t){return f(t)in this._}function p(t){return(t=f(t))in this._&&delete this._[t]}function m(){var t=[];for(var e in this._)t.push(d(e));return t}function g(){var t=0;for(var e in this._)++t;return t}function v(){for(var t in this._)return!1;return!0}function y(){this._=Object.create(null)}function x(t){return t}function w(t,e,n){return function(){var r=n.apply(e,arguments);return r===e?t:r}}function b(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var n=0,r=ya.length;r>n;++n){var o=ya[n]+e;if(o in t)return o}}function _(){}function k(){}function j(t){function e(){for(var e,r=n,o=-1,i=r.length;++o<i;)(e=r[o].on)&&e.apply(this,arguments);return t}var n=[],r=new c;return e.on=function(e,o){var i,a=r.get(e);return arguments.length<2?a&&a.on:(a&&(a.on=null,n=n.slice(0,i=n.indexOf(a)).concat(n.slice(i+1)),r.remove(e)),o&&n.push(r.set(e,{on:o})),t)},e}function M(){ra.event.preventDefault()}function E(){for(var t,e=ra.event;t=e.sourceEvent;)e=t;return e}function C(t){for(var e=new k,n=0,r=arguments.length;++n<r;)e[arguments[n]]=j(e);return e.of=function(n,r){return function(o){try{var i=o.sourceEvent=ra.event;o.target=t,ra.event=o,e[o.type].apply(n,r)}finally{ra.event=i}}},e}function S(t){return wa(t,ja),t}function A(t){return"function"==typeof t?t:function(){return ba(t,this)}}function T(t){return"function"==typeof t?t:function(){return _a(t,this)}}function N(t,e){function n(){this.removeAttribute(t)}function r(){this.removeAttributeNS(t.space,t.local)}function o(){this.setAttribute(t,e)}function i(){this.setAttributeNS(t.space,t.local,e)}function a(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}function s(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}return t=ra.ns.qualify(t),null==e?t.local?r:n:"function"==typeof e?t.local?s:a:t.local?i:o}function O(t){return t.trim().replace(/\s+/g," ")}function q(t){return new RegExp("(?:^|\\s+)"+ra.requote(t)+"(?:\\s+|$)","g")}function D(t){return(t+"").trim().split(/^|\s+/)}function L(t,e){function n(){for(var n=-1;++n<o;)t[n](this,e)}function r(){for(var n=-1,r=e.apply(this,arguments);++n<o;)t[n](this,r)}t=D(t).map(F);var o=t.length;return"function"==typeof e?r:n}function F(t){var e=q(t);return function(n,r){if(o=n.classList)return r?o.add(t):o.remove(t);var o=n.getAttribute("class")||"";r?(e.lastIndex=0,e.test(o)||n.setAttribute("class",O(o+" "+t))):n.setAttribute("class",O(o.replace(e," ")))}}function z(t,e,n){function r(){this.style.removeProperty(t)}function o(){this.style.setProperty(t,e,n)}function i(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}return null==e?r:"function"==typeof e?i:o}function R(t,e){function n(){delete this[t]}function r(){this[t]=e}function o(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}return null==e?n:"function"==typeof e?o:r}function P(t){function e(){var e=this.ownerDocument,n=this.namespaceURI;return n?e.createElementNS(n,t):e.createElement(t)}function n(){return this.ownerDocument.createElementNS(t.space,t.local)}return"function"==typeof t?t:(t=ra.ns.qualify(t)).local?n:e}function I(){var t=this.parentNode;t&&t.removeChild(this)}function H(data){return{__data__:data}}function $(t){return function(){return ka(this,t)}}function B(t){return arguments.length||(t=r),function(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}}function V(t,e){for(var n=0,r=t.length;r>n;n++)for(var o,i=t[n],a=0,s=i.length;s>a;a++)(o=i[a])&&e(o,a,n);return t}function U(t){return wa(t,Ea),t}function W(t){var e,n;return function(r,o,i){var a,s=t[i].update,u=s.length;for(i!=n&&(n=i,e=0),o>=e&&(e=o+1);!(a=s[e])&&++e<u;);return a}}function Y(t,e,n){function r(){var e=this[a];e&&(this.removeEventListener(t,e,e.$),delete this[a])}function o(){var o=u(e,ia(arguments));r.call(this),this.addEventListener(t,this[a]=o,o.$=n),o._=e}function i(){var e,n=new RegExp("^__on([^.]+)"+ra.requote(t)+"$");for(var r in this)if(e=r.match(n)){var o=this[r];this.removeEventListener(e[1],o,o.$),delete this[r]}}var a="__on"+t,s=t.indexOf("."),u=X;s>0&&(t=t.slice(0,s));var l=Ca.get(t);return l&&(t=l,u=J),s?e?o:r:e?_:i}function X(t,e){return function(n){var r=ra.event;ra.event=n,e[0]=this.__data__;try{t.apply(this,e)}finally{ra.event=r}}}function J(t,e){var n=X(t,e);return function(t){var e=this,r=t.relatedTarget;r&&(r===e||8&r.compareDocumentPosition(e))||n.call(e,t)}}function Z(e){var r=".dragsuppress-"+ ++Aa,o="click"+r,i=ra.select(n(e)).on("touchmove"+r,M).on("dragstart"+r,M).on("selectstart"+r,M);if(null==Sa&&(Sa="onselectstart"in e?!1:b(e.style,"userSelect")),Sa){var a=t(e).style,s=a[Sa];a[Sa]="none"}return function(t){if(i.on(r,null),Sa&&(a[Sa]=s),t){var e=function(){i.on(o,null)};i.on(o,function(){M(),e()},!0),setTimeout(e,0)}}}function K(t,e){e.changedTouches&&(e=e.changedTouches[0]);var r=t.ownerSVGElement||t;if(r.createSVGPoint){var o=r.createSVGPoint();if(0>Ta){var i=n(t);if(i.scrollX||i.scrollY){r=ra.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var a=r[0][0].getScreenCTM();Ta=!(a.f||a.e),r.remove()}}return Ta?(o.x=e.pageX,o.y=e.pageY):(o.x=e.clientX,o.y=e.clientY),o=o.matrixTransform(t.getScreenCTM().inverse()),[o.x,o.y]}var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}function G(){return ra.event.changedTouches[0].identifier}function Q(t){return t>0?1:0>t?-1:0}function tt(t,e,n){return(e[0]-t[0])*(n[1]-t[1])-(e[1]-t[1])*(n[0]-t[0])}function et(t){return t>1?0:-1>t?qa:Math.acos(t)}function nt(t){return t>1?Fa:-1>t?-Fa:Math.asin(t)}function rt(t){return((t=Math.exp(t))-1/t)/2}function ot(t){return((t=Math.exp(t))+1/t)/2}function it(t){return((t=Math.exp(2*t))-1)/(t+1)}function at(t){return(t=Math.sin(t/2))*t}function st(){}function ut(t,e,n){return this instanceof ut?(this.h=+t,this.s=+e,void(this.l=+n)):arguments.length<2?t instanceof ut?new ut(t.h,t.s,t.l):_t(""+t,kt,ut):new ut(t,e,n)}function lt(t,e,n){function r(t){return t>360?t-=360:0>t&&(t+=360),60>t?i+(a-i)*t/60:180>t?a:240>t?i+(a-i)*(240-t)/60:i}function o(t){return Math.round(255*r(t))}var i,a;return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:0>e?0:e>1?1:e,n=0>n?0:n>1?1:n,a=.5>=n?n*(1+e):n+e-n*e,i=2*n-a,new yt(o(t+120),o(t),o(t-120))}function ct(t,e,n){return this instanceof ct?(this.h=+t,this.c=+e,void(this.l=+n)):arguments.length<2?t instanceof ct?new ct(t.h,t.c,t.l):t instanceof dt?pt(t.l,t.a,t.b):pt((t=jt((t=ra.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new ct(t,e,n)}function ft(t,e,n){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new dt(n,Math.cos(t*=za)*e,Math.sin(t)*e)}function dt(t,e,n){return this instanceof dt?(this.l=+t,this.a=+e,void(this.b=+n)):arguments.length<2?t instanceof dt?new dt(t.l,t.a,t.b):t instanceof ct?ft(t.h,t.c,t.l):jt((t=yt(t)).r,t.g,t.b):new dt(t,e,n)}function ht(t,e,n){var r=(t+16)/116,o=r+e/500,i=r-n/200;return o=mt(o)*Xa,r=mt(r)*Ja,i=mt(i)*Za,new yt(vt(3.2404542*o-1.5371385*r-.4985314*i),vt(-.969266*o+1.8760108*r+.041556*i),vt(.0556434*o-.2040259*r+1.0572252*i))}function pt(t,e,n){return t>0?new ct(Math.atan2(n,e)*Ra,Math.sqrt(e*e+n*n),t):new ct(0/0,0/0,t)}function mt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function gt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function vt(t){return Math.round(255*(.00304>=t?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function yt(t,e,n){return this instanceof yt?(this.r=~~t,this.g=~~e,void(this.b=~~n)):arguments.length<2?t instanceof yt?new yt(t.r,t.g,t.b):_t(""+t,yt,lt):new yt(t,e,n)}function xt(t){return new yt(t>>16,t>>8&255,255&t)}function wt(t){return xt(t)+""}function bt(t){return 16>t?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function _t(t,e,n){var r,o,i,a=0,s=0,u=0;if(r=/([a-z]+)\((.*)\)/i.exec(t))switch(o=r[2].split(","),r[1]){case"hsl":return n(parseFloat(o[0]),parseFloat(o[1])/100,parseFloat(o[2])/100);case"rgb":return e(Et(o[0]),Et(o[1]),Et(o[2]))}return(i=Qa.get(t.toLowerCase()))?e(i.r,i.g,i.b):(null==t||"#"!==t.charAt(0)||isNaN(i=parseInt(t.slice(1),16))||(4===t.length?(a=(3840&i)>>4,a=a>>4|a,s=240&i,s=s>>4|s,u=15&i,u=u<<4|u):7===t.length&&(a=(16711680&i)>>16,s=(65280&i)>>8,u=255&i)),e(a,s,u))}function kt(t,e,n){var r,o,i=Math.min(t/=255,e/=255,n/=255),a=Math.max(t,e,n),s=a-i,u=(a+i)/2;return s?(o=.5>u?s/(a+i):s/(2-a-i),r=t==a?(e-n)/s+(n>e?6:0):e==a?(n-t)/s+2:(t-e)/s+4,r*=60):(r=0/0,o=u>0&&1>u?0:r),new ut(r,o,u)}function jt(t,e,n){t=Mt(t),e=Mt(e),n=Mt(n);var r=gt((.4124564*t+.3575761*e+.1804375*n)/Xa),o=gt((.2126729*t+.7151522*e+.072175*n)/Ja),i=gt((.0193339*t+.119192*e+.9503041*n)/Za);return dt(116*o-16,500*(r-o),200*(o-i))}function Mt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Et(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function Ct(t){return"function"==typeof t?t:function(){return t}}function St(t){return function(e,n,r){return 2===arguments.length&&"function"==typeof n&&(r=n,n=null),At(e,n,t,r)}}function At(t,e,n,r){function o(){var t,e=u.status;if(!e&&Nt(u)||e>=200&&300>e||304===e){try{t=n.call(i,u)}catch(r){return void a.error.call(i,r)}a.load.call(i,t)}else a.error.call(i,u)}var i={},a=ra.dispatch("beforesend","progress","load","error"),s={},u=new XMLHttpRequest,l=null;return!this.XDomainRequest||"withCredentials"in u||!/^(http(s)?:)?\/\//.test(t)||(u=new XDomainRequest),"onload"in u?u.onload=u.onerror=o:u.onreadystatechange=function(){u.readyState>3&&o()},u.onprogress=function(t){var e=ra.event;ra.event=t;try{a.progress.call(i,u)}finally{ra.event=e}},i.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?s[t]:(null==e?delete s[t]:s[t]=e+"",i)},i.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",i):e},i.responseType=function(t){return arguments.length?(l=t,i):l},i.response=function(t){return n=t,i},["get","post"].forEach(function(t){i[t]=function(){return i.send.apply(i,[t].concat(ia(arguments)))}}),i.send=function(n,data,r){if(2===arguments.length&&"function"==typeof data&&(r=data,data=null),u.open(n,t,!0),null==e||"accept"in s||(s.accept=e+",*/*"),u.setRequestHeader)for(var o in s)u.setRequestHeader(o,s[o]);return null!=e&&u.overrideMimeType&&u.overrideMimeType(e),null!=l&&(u.responseType=l),null!=r&&i.on("error",r).on("load",function(t){r(null,t)}),a.beforesend.call(i,u),u.send(null==data?null:data),i},i.abort=function(){return u.abort(),i},ra.rebind(i,a,"on"),null==r?i:i.get(Tt(r))}function Tt(t){return 1===t.length?function(e,n){t(null==e?n:null)}:t}function Nt(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}function Ot(){var t=qt(),e=Dt()-t;e>24?(isFinite(e)&&(clearTimeout(rs),rs=setTimeout(Ot,e)),ns=0):(ns=1,is(Ot))}function qt(){var t=Date.now();for(os=ts;os;)t>=os.t&&(os.f=os.c(t-os.t)),os=os.n;return t}function Dt(){for(var t,e=ts,n=1/0;e;)e.f?e=t?t.n=e.n:ts=e.n:(e.t<n&&(n=e.t),e=(t=e).n);return es=t,n}function Lt(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}function Ft(t,e){var n=Math.pow(10,3*ma(8-e));return{scale:e>8?function(t){return t/n}:function(t){return t*n},symbol:t}}function zt(t){var e=t.decimal,n=t.thousands,r=t.grouping,o=t.currency,i=r&&n?function(t,e){for(var o=t.length,i=[],a=0,s=r[0],u=0;o>0&&s>0&&(u+s+1>e&&(s=Math.max(1,e-u)),i.push(t.substring(o-=s,o+s)),!((u+=s+1)>e));)s=r[a=(a+1)%r.length];return i.reverse().join(n)}:x;return function(t){var n=ss.exec(t),r=n[1]||" ",a=n[2]||">",s=n[3]||"-",u=n[4]||"",l=n[5],c=+n[6],f=n[7],d=n[8],h=n[9],p=1,m="",g="",v=!1,y=!0;switch(d&&(d=+d.substring(1)),(l||"0"===r&&"="===a)&&(l=r="0",a="="),h){case"n":f=!0,h="g";break;case"%":p=100,g="%",h="f";break;case"p":p=100,g="%",h="r";break;case"b":case"o":case"x":case"X":"#"===u&&(m="0"+h.toLowerCase());case"c":y=!1;
+
+case"d":v=!0,d=0;break;case"s":p=-1,h="r"}"$"===u&&(m=o[0],g=o[1]),"r"!=h||d||(h="g"),null!=d&&("g"==h?d=Math.max(1,Math.min(21,d)):("e"==h||"f"==h)&&(d=Math.max(0,Math.min(20,d)))),h=us.get(h)||Rt;var x=l&&f;return function(t){var n=g;if(v&&t%1)return"";var o=0>t||0===t&&0>1/t?(t=-t,"-"):"-"===s?"":s;if(0>p){var u=ra.formatPrefix(t,d);t=u.scale(t),n=u.symbol+g}else t*=p;t=h(t,d);var w,b,_=t.lastIndexOf(".");if(0>_){var k=y?t.lastIndexOf("e"):-1;0>k?(w=t,b=""):(w=t.substring(0,k),b=t.substring(k))}else w=t.substring(0,_),b=e+t.substring(_+1);!l&&f&&(w=i(w,1/0));var j=m.length+w.length+b.length+(x?0:o.length),M=c>j?new Array(j=c-j+1).join(r):"";return x&&(w=i(M+w,M.length?c-b.length:1/0)),o+=m,t=w+b,("<"===a?o+t+M:">"===a?M+o+t:"^"===a?M.substring(0,j>>=1)+o+t+M.substring(j):o+(x?t:M+t))+n}}}function Rt(t){return t+""}function Pt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function It(t,e,n){function r(e){var n=t(e),r=i(n,1);return r-e>e-n?n:r}function o(n){return e(n=t(new cs(n-1)),1),n}function i(t,n){return e(t=new cs(+t),n),t}function a(t,r,i){var a=o(t),s=[];if(i>1)for(;r>a;)n(a)%i||s.push(new Date(+a)),e(a,1);else for(;r>a;)s.push(new Date(+a)),e(a,1);return s}function s(t,e,n){try{cs=Pt;var r=new Pt;return r._=t,a(r,e,n)}finally{cs=Date}}t.floor=t,t.round=r,t.ceil=o,t.offset=i,t.range=a;var u=t.utc=Ht(t);return u.floor=u,u.round=Ht(r),u.ceil=Ht(o),u.offset=Ht(i),u.range=s,t}function Ht(t){return function(e,n){try{cs=Pt;var r=new Pt;return r._=e,t(r,n)._}finally{cs=Date}}}function $t(t){function e(t){function e(e){for(var n,o,i,a=[],s=-1,u=0;++s<r;)37===t.charCodeAt(s)&&(a.push(t.slice(u,s)),null!=(o=ds[n=t.charAt(++s)])&&(n=t.charAt(++s)),(i=S[n])&&(n=i(e,null==o?"e"===n?" ":"0":o)),a.push(n),u=s+1);return a.push(t.slice(u,s)),a.join("")}var r=t.length;return e.parse=function(e){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},o=n(r,t,e,0);if(o!=e.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var i=null!=r.Z&&cs!==Pt,a=new(i?Pt:cs);return"j"in r?a.setFullYear(r.y,0,r.j):"w"in r&&("W"in r||"U"in r)?(a.setFullYear(r.y,0,1),a.setFullYear(r.y,0,"W"in r?(r.w+6)%7+7*r.W-(a.getDay()+5)%7:r.w+7*r.U-(a.getDay()+6)%7)):a.setFullYear(r.y,r.m,r.d),a.setHours(r.H+(r.Z/100|0),r.M+r.Z%100,r.S,r.L),i?a._:a},e.toString=function(){return t},e}function n(t,e,n,r){for(var o,i,a,s=0,u=e.length,l=n.length;u>s;){if(r>=l)return-1;if(o=e.charCodeAt(s++),37===o){if(a=e.charAt(s++),i=A[a in ds?e.charAt(s++):a],!i||(r=i(t,n,r))<0)return-1}else if(o!=n.charCodeAt(r++))return-1}return r}function r(t,e,n){_.lastIndex=0;var r=_.exec(e.slice(n));return r?(t.w=k.get(r[0].toLowerCase()),n+r[0].length):-1}function o(t,e,n){w.lastIndex=0;var r=w.exec(e.slice(n));return r?(t.w=b.get(r[0].toLowerCase()),n+r[0].length):-1}function i(t,e,n){E.lastIndex=0;var r=E.exec(e.slice(n));return r?(t.m=C.get(r[0].toLowerCase()),n+r[0].length):-1}function a(t,e,n){j.lastIndex=0;var r=j.exec(e.slice(n));return r?(t.m=M.get(r[0].toLowerCase()),n+r[0].length):-1}function s(t,e,r){return n(t,S.c.toString(),e,r)}function u(t,e,r){return n(t,S.x.toString(),e,r)}function l(t,e,r){return n(t,S.X.toString(),e,r)}function c(t,e,n){var r=x.get(e.slice(n,n+=2).toLowerCase());return null==r?-1:(t.p=r,n)}var f=t.dateTime,d=t.date,h=t.time,p=t.periods,m=t.days,g=t.shortDays,v=t.months,y=t.shortMonths;e.utc=function(t){function n(t){try{cs=Pt;var e=new cs;return e._=t,r(e)}finally{cs=Date}}var r=e(t);return n.parse=function(t){try{cs=Pt;var e=r.parse(t);return e&&e._}finally{cs=Date}},n.toString=r.toString,n},e.multi=e.utc.multi=ue;var x=ra.map(),w=Vt(m),b=Ut(m),_=Vt(g),k=Ut(g),j=Vt(v),M=Ut(v),E=Vt(y),C=Ut(y);p.forEach(function(t,e){x.set(t.toLowerCase(),e)});var S={a:function(t){return g[t.getDay()]},A:function(t){return m[t.getDay()]},b:function(t){return y[t.getMonth()]},B:function(t){return v[t.getMonth()]},c:e(f),d:function(t,e){return Bt(t.getDate(),e,2)},e:function(t,e){return Bt(t.getDate(),e,2)},H:function(t,e){return Bt(t.getHours(),e,2)},I:function(t,e){return Bt(t.getHours()%12||12,e,2)},j:function(t,e){return Bt(1+ls.dayOfYear(t),e,3)},L:function(t,e){return Bt(t.getMilliseconds(),e,3)},m:function(t,e){return Bt(t.getMonth()+1,e,2)},M:function(t,e){return Bt(t.getMinutes(),e,2)},p:function(t){return p[+(t.getHours()>=12)]},S:function(t,e){return Bt(t.getSeconds(),e,2)},U:function(t,e){return Bt(ls.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Bt(ls.mondayOfYear(t),e,2)},x:e(d),X:e(h),y:function(t,e){return Bt(t.getFullYear()%100,e,2)},Y:function(t,e){return Bt(t.getFullYear()%1e4,e,4)},Z:ae,"%":function(){return"%"}},A={a:r,A:o,b:i,B:a,c:s,d:te,e:te,H:ne,I:ne,j:ee,L:ie,m:Qt,M:re,p:c,S:oe,U:Yt,w:Wt,W:Xt,x:u,X:l,y:Zt,Y:Jt,Z:Kt,"%":se};return e}function Bt(t,e,n){var r=0>t?"-":"",o=(r?-t:t)+"",i=o.length;return r+(n>i?new Array(n-i+1).join(e)+o:o)}function Vt(t){return new RegExp("^(?:"+t.map(ra.requote).join("|")+")","i")}function Ut(t){for(var e=new c,n=-1,r=t.length;++n<r;)e.set(t[n].toLowerCase(),n);return e}function Wt(t,e,n){hs.lastIndex=0;var r=hs.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Yt(t,e,n){hs.lastIndex=0;var r=hs.exec(e.slice(n));return r?(t.U=+r[0],n+r[0].length):-1}function Xt(t,e,n){hs.lastIndex=0;var r=hs.exec(e.slice(n));return r?(t.W=+r[0],n+r[0].length):-1}function Jt(t,e,n){hs.lastIndex=0;var r=hs.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function Zt(t,e,n){hs.lastIndex=0;var r=hs.exec(e.slice(n,n+2));return r?(t.y=Gt(+r[0]),n+r[0].length):-1}function Kt(t,e,n){return/^[+-]\d{4}$/.test(e=e.slice(n,n+5))?(t.Z=-e,n+5):-1}function Gt(t){return t+(t>68?1900:2e3)}function Qt(t,e,n){hs.lastIndex=0;var r=hs.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function te(t,e,n){hs.lastIndex=0;var r=hs.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function ee(t,e,n){hs.lastIndex=0;var r=hs.exec(e.slice(n,n+3));return r?(t.j=+r[0],n+r[0].length):-1}function ne(t,e,n){hs.lastIndex=0;var r=hs.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function re(t,e,n){hs.lastIndex=0;var r=hs.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function oe(t,e,n){hs.lastIndex=0;var r=hs.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function ie(t,e,n){hs.lastIndex=0;var r=hs.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function ae(t){var e=t.getTimezoneOffset(),n=e>0?"-":"+",r=ma(e)/60|0,o=ma(e)%60;return n+Bt(r,"0",2)+Bt(o,"0",2)}function se(t,e,n){ps.lastIndex=0;var r=ps.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function ue(t){for(var e=t.length,n=-1;++n<e;)t[n][0]=this(t[n][0]);return function(e){for(var n=0,r=t[n];!r[1](e);)r=t[++n];return r[0](e)}}function le(){}function ce(t,e,n){var r=n.s=t+e,o=r-t,i=r-o;n.t=t-i+(e-o)}function fe(t,e){t&&ys.hasOwnProperty(t.type)&&ys[t.type](t,e)}function de(t,e,n){var r,o=-1,i=t.length-n;for(e.lineStart();++o<i;)r=t[o],e.point(r[0],r[1],r[2]);e.lineEnd()}function he(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)de(t[n],e,1);e.polygonEnd()}function pe(){function t(t,e){t*=za,e=e*za/2+qa/4;var n=t-r,a=n>=0?1:-1,s=a*n,u=Math.cos(e),l=Math.sin(e),c=i*l,f=o*u+c*Math.cos(s),d=c*a*Math.sin(s);ws.add(Math.atan2(d,f)),r=t,o=u,i=l}var e,n,r,o,i;bs.point=function(a,s){bs.point=t,r=(e=a)*za,o=Math.cos(s=(n=s)*za/2+qa/4),i=Math.sin(s)},bs.lineEnd=function(){t(e,n)}}function me(t){var e=t[0],n=t[1],r=Math.cos(n);return[r*Math.cos(e),r*Math.sin(e),Math.sin(n)]}function ge(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ve(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function ye(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function xe(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function we(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function be(t){return[Math.atan2(t[1],t[0]),nt(t[2])]}function _e(t,e){return ma(t[0]-e[0])<Na&&ma(t[1]-e[1])<Na}function ke(t,e){t*=za;var n=Math.cos(e*=za);je(n*Math.cos(t),n*Math.sin(t),Math.sin(e))}function je(t,e,n){++_s,js+=(t-js)/_s,Ms+=(e-Ms)/_s,Es+=(n-Es)/_s}function Me(){function t(t,o){t*=za;var i=Math.cos(o*=za),a=i*Math.cos(t),s=i*Math.sin(t),u=Math.sin(o),l=Math.atan2(Math.sqrt((l=n*u-r*s)*l+(l=r*a-e*u)*l+(l=e*s-n*a)*l),e*a+n*s+r*u);ks+=l,Cs+=l*(e+(e=a)),Ss+=l*(n+(n=s)),As+=l*(r+(r=u)),je(e,n,r)}var e,n,r;qs.point=function(o,i){o*=za;var a=Math.cos(i*=za);e=a*Math.cos(o),n=a*Math.sin(o),r=Math.sin(i),qs.point=t,je(e,n,r)}}function Ee(){qs.point=ke}function Ce(){function t(t,e){t*=za;var n=Math.cos(e*=za),a=n*Math.cos(t),s=n*Math.sin(t),u=Math.sin(e),l=o*u-i*s,c=i*a-r*u,f=r*s-o*a,d=Math.sqrt(l*l+c*c+f*f),h=r*a+o*s+i*u,p=d&&-et(h)/d,m=Math.atan2(d,h);Ts+=p*l,Ns+=p*c,Os+=p*f,ks+=m,Cs+=m*(r+(r=a)),Ss+=m*(o+(o=s)),As+=m*(i+(i=u)),je(r,o,i)}var e,n,r,o,i;qs.point=function(a,s){e=a,n=s,qs.point=t,a*=za;var u=Math.cos(s*=za);r=u*Math.cos(a),o=u*Math.sin(a),i=Math.sin(s),je(r,o,i)},qs.lineEnd=function(){t(e,n),qs.lineEnd=Ee,qs.point=ke}}function Se(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return n=e.invert(n,r),n&&t.invert(n[0],n[1])}),n}function Ae(){return!0}function Te(t,e,n,r,o){var i=[],a=[];if(t.forEach(function(t){if(!((e=t.length-1)<=0)){var e,n=t[0],r=t[e];if(_e(n,r)){o.lineStart();for(var s=0;e>s;++s)o.point((n=t[s])[0],n[1]);return void o.lineEnd()}var u=new Oe(n,t,null,!0),l=new Oe(n,null,u,!1);u.o=l,i.push(u),a.push(l),u=new Oe(r,t,null,!1),l=new Oe(r,null,u,!0),u.o=l,i.push(u),a.push(l)}}),a.sort(e),Ne(i),Ne(a),i.length){for(var s=0,u=n,l=a.length;l>s;++s)a[s].e=u=!u;for(var c,f,d=i[0];;){for(var h=d,p=!0;h.v;)if((h=h.n)===d)return;c=h.z,o.lineStart();do{if(h.v=h.o.v=!0,h.e){if(p)for(var s=0,l=c.length;l>s;++s)o.point((f=c[s])[0],f[1]);else r(h.x,h.n.x,1,o);h=h.n}else{if(p){c=h.p.z;for(var s=c.length-1;s>=0;--s)o.point((f=c[s])[0],f[1])}else r(h.x,h.p.x,-1,o);h=h.p}h=h.o,c=h.z,p=!p}while(!h.v);o.lineEnd()}}}function Ne(t){if(e=t.length){for(var e,n,r=0,o=t[0];++r<e;)o.n=n=t[r],n.p=o,o=n;o.n=n=t[0],n.p=o}}function Oe(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function qe(t,e,n,r){return function(o,i){function a(e,n){var r=o(e,n);t(e=r[0],n=r[1])&&i.point(e,n)}function s(t,e){var n=o(t,e);g.point(n[0],n[1])}function u(){y.point=s,g.lineStart()}function l(){y.point=a,g.lineEnd()}function c(t,e){m.push([t,e]);var n=o(t,e);w.point(n[0],n[1])}function f(){w.lineStart(),m=[]}function d(){c(m[0][0],m[0][1]),w.lineEnd();var t,e=w.clean(),n=x.buffer(),r=n.length;if(m.pop(),p.push(m),m=null,r)if(1&e){t=n[0];var o,r=t.length-1,a=-1;if(r>0){for(b||(i.polygonStart(),b=!0),i.lineStart();++a<r;)i.point((o=t[a])[0],o[1]);i.lineEnd()}}else r>1&&2&e&&n.push(n.pop().concat(n.shift())),h.push(n.filter(De))}var h,p,m,g=e(i),v=o.invert(r[0],r[1]),y={point:a,lineStart:u,lineEnd:l,polygonStart:function(){y.point=c,y.lineStart=f,y.lineEnd=d,h=[],p=[]},polygonEnd:function(){y.point=a,y.lineStart=u,y.lineEnd=l,h=ra.merge(h);var t=Ie(v,p);h.length?(b||(i.polygonStart(),b=!0),Te(h,Fe,t,n,i)):t&&(b||(i.polygonStart(),b=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),b&&(i.polygonEnd(),b=!1),h=p=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}},x=Le(),w=e(x),b=!1;return y}}function De(t){return t.length>1}function Le(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,n){t.push([e,n])},lineEnd:_,buffer:function(){var n=e;return e=[],t=null,n},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function Fe(t,e){return((t=t.x)[0]<0?t[1]-Fa-Na:Fa-t[1])-((e=e.x)[0]<0?e[1]-Fa-Na:Fa-e[1])}function ze(t){var e,n=0/0,r=0/0,o=0/0;return{lineStart:function(){t.lineStart(),e=1},point:function(i,a){var s=i>0?qa:-qa,u=ma(i-n);ma(u-qa)<Na?(t.point(n,r=(r+a)/2>0?Fa:-Fa),t.point(o,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(i,r),e=0):o!==s&&u>=qa&&(ma(n-o)<Na&&(n-=o*Na),ma(i-s)<Na&&(i-=s*Na),r=Re(n,r,i,a),t.point(o,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=i,r=a),o=s},lineEnd:function(){t.lineEnd(),n=r=0/0},clean:function(){return 2-e}}}function Re(t,e,n,r){var o,i,a=Math.sin(t-n);return ma(a)>Na?Math.atan((Math.sin(e)*(i=Math.cos(r))*Math.sin(n)-Math.sin(r)*(o=Math.cos(e))*Math.sin(t))/(o*i*a)):(e+r)/2}function Pe(t,e,n,r){var o;if(null==t)o=n*Fa,r.point(-qa,o),r.point(0,o),r.point(qa,o),r.point(qa,0),r.point(qa,-o),r.point(0,-o),r.point(-qa,-o),r.point(-qa,0),r.point(-qa,o);else if(ma(t[0]-e[0])>Na){var i=t[0]<e[0]?qa:-qa;o=n*i/2,r.point(-i,o),r.point(0,o),r.point(i,o)}else r.point(e[0],e[1])}function Ie(t,e){var n=t[0],r=t[1],o=[Math.sin(n),-Math.cos(n),0],i=0,a=0;ws.reset();for(var s=0,u=e.length;u>s;++s){var l=e[s],c=l.length;if(c)for(var f=l[0],d=f[0],h=f[1]/2+qa/4,p=Math.sin(h),m=Math.cos(h),g=1;;){g===c&&(g=0),t=l[g];var v=t[0],y=t[1]/2+qa/4,x=Math.sin(y),w=Math.cos(y),b=v-d,_=b>=0?1:-1,k=_*b,j=k>qa,M=p*x;if(ws.add(Math.atan2(M*_*Math.sin(k),m*w+M*Math.cos(k))),i+=j?b+_*Da:b,j^d>=n^v>=n){var E=ve(me(f),me(t));we(E);var C=ve(o,E);we(C);var S=(j^b>=0?-1:1)*nt(C[2]);(r>S||r===S&&(E[0]||E[1]))&&(a+=j^b>=0?1:-1)}if(!g++)break;d=v,p=x,m=w,f=t}}return(-Na>i||Na>i&&0>ws)^1&a}function He(t){function e(t,e){return Math.cos(t)*Math.cos(e)>i}function n(t){var n,i,u,l,c;return{lineStart:function(){l=u=!1,c=1},point:function(f,d){var h,p=[f,d],m=e(f,d),g=a?m?0:o(f,d):m?o(f+(0>f?qa:-qa),d):0;if(!n&&(l=u=m)&&t.lineStart(),m!==u&&(h=r(n,p),(_e(n,h)||_e(p,h))&&(p[0]+=Na,p[1]+=Na,m=e(p[0],p[1]))),m!==u)c=0,m?(t.lineStart(),h=r(p,n),t.point(h[0],h[1])):(h=r(n,p),t.point(h[0],h[1]),t.lineEnd()),n=h;else if(s&&n&&a^m){var v;g&i||!(v=r(p,n,!0))||(c=0,a?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!m||n&&_e(n,p)||t.point(p[0],p[1]),n=p,u=m,i=g},lineEnd:function(){u&&t.lineEnd(),n=null},clean:function(){return c|(l&&u)<<1}}}function r(t,e,n){var r=me(t),o=me(e),a=[1,0,0],s=ve(r,o),u=ge(s,s),l=s[0],c=u-l*l;if(!c)return!n&&t;var f=i*u/c,d=-i*l/c,h=ve(a,s),p=xe(a,f),m=xe(s,d);ye(p,m);var g=h,v=ge(p,g),y=ge(g,g),x=v*v-y*(ge(p,p)-1);if(!(0>x)){var w=Math.sqrt(x),b=xe(g,(-v-w)/y);if(ye(b,p),b=be(b),!n)return b;var _,k=t[0],j=e[0],M=t[1],E=e[1];k>j&&(_=k,k=j,j=_);var C=j-k,S=ma(C-qa)<Na,A=S||Na>C;if(!S&&M>E&&(_=M,M=E,E=_),A?S?M+E>0^b[1]<(ma(b[0]-k)<Na?M:E):M<=b[1]&&b[1]<=E:C>qa^(k<=b[0]&&b[0]<=j)){var T=xe(g,(-v+w)/y);return ye(T,p),[b,be(T)]}}}function o(e,n){var r=a?t:qa-t,o=0;return-r>e?o|=1:e>r&&(o|=2),-r>n?o|=4:n>r&&(o|=8),o}var i=Math.cos(t),a=i>0,s=ma(i)>Na,u=mn(t,6*za);return qe(e,n,u,a?[0,-t]:[-qa,t-qa])}function $e(t,e,n,r){return function(o){var i,a=o.a,s=o.b,u=a.x,l=a.y,c=s.x,f=s.y,d=0,h=1,p=c-u,m=f-l;if(i=t-u,p||!(i>0)){if(i/=p,0>p){if(d>i)return;h>i&&(h=i)}else if(p>0){if(i>h)return;i>d&&(d=i)}if(i=n-u,p||!(0>i)){if(i/=p,0>p){if(i>h)return;i>d&&(d=i)}else if(p>0){if(d>i)return;h>i&&(h=i)}if(i=e-l,m||!(i>0)){if(i/=m,0>m){if(d>i)return;h>i&&(h=i)}else if(m>0){if(i>h)return;i>d&&(d=i)}if(i=r-l,m||!(0>i)){if(i/=m,0>m){if(i>h)return;i>d&&(d=i)}else if(m>0){if(d>i)return;h>i&&(h=i)}return d>0&&(o.a={x:u+d*p,y:l+d*m}),1>h&&(o.b={x:u+h*p,y:l+h*m}),o}}}}}}function Be(t,e,n,r){function o(r,o){return ma(r[0]-t)<Na?o>0?0:3:ma(r[0]-n)<Na?o>0?2:1:ma(r[1]-e)<Na?o>0?1:0:o>0?3:2}function i(t,e){return a(t.x,e.x)}function a(t,e){var n=o(t,1),r=o(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(s){function u(t){for(var e=0,n=g.length,r=t[1],o=0;n>o;++o)for(var i,a=1,s=g[o],u=s.length,l=s[0];u>a;++a)i=s[a],l[1]<=r?i[1]>r&&tt(l,i,t)>0&&++e:i[1]<=r&&tt(l,i,t)<0&&--e,l=i;return 0!==e}function l(i,s,u,l){var c=0,f=0;if(null==i||(c=o(i,u))!==(f=o(s,u))||a(i,s)<0^u>0){do l.point(0===c||3===c?t:n,c>1?r:e);while((c=(c+u+4)%4)!==f)}else l.point(s[0],s[1])}function c(o,i){return o>=t&&n>=o&&i>=e&&r>=i}function f(t,e){c(t,e)&&s.point(t,e)}function d(){A.point=p,g&&g.push(v=[]),j=!0,k=!1,b=_=0/0}function h(){m&&(p(y,x),w&&k&&C.rejoin(),m.push(C.buffer())),A.point=f,k&&s.lineEnd()}function p(t,e){t=Math.max(-Ls,Math.min(Ls,t)),e=Math.max(-Ls,Math.min(Ls,e));var n=c(t,e);if(g&&v.push([t,e]),j)y=t,x=e,w=n,j=!1,n&&(s.lineStart(),s.point(t,e));else if(n&&k)s.point(t,e);else{var r={a:{x:b,y:_},b:{x:t,y:e}};S(r)?(k||(s.lineStart(),s.point(r.a.x,r.a.y)),s.point(r.b.x,r.b.y),n||s.lineEnd(),M=!1):n&&(s.lineStart(),s.point(t,e),M=!1)}b=t,_=e,k=n}var m,g,v,y,x,w,b,_,k,j,M,E=s,C=Le(),S=$e(t,e,n,r),A={point:f,lineStart:d,lineEnd:h,polygonStart:function(){s=C,m=[],g=[],M=!0},polygonEnd:function(){s=E,m=ra.merge(m);var e=u([t,r]),n=M&&e,o=m.length;(n||o)&&(s.polygonStart(),n&&(s.lineStart(),l(null,null,1,s),s.lineEnd()),o&&Te(m,i,e,l,s),s.polygonEnd()),m=g=v=null}};return A}}function Ve(t){var e=0,n=qa/3,r=sn(t),o=r(e,n);return o.parallels=function(t){return arguments.length?r(e=t[0]*qa/180,n=t[1]*qa/180):[e/qa*180,n/qa*180]},o}function Ue(t,e){function n(t,e){var n=Math.sqrt(i-2*o*Math.sin(e))/o;return[n*Math.sin(t*=o),a-n*Math.cos(t)]}var r=Math.sin(t),o=(r+Math.sin(e))/2,i=1+r*(2*o-r),a=Math.sqrt(i)/o;return n.invert=function(t,e){var n=a-e;return[Math.atan2(t,n)/o,nt((i-(t*t+n*n)*o*o)/(2*o))]},n}function We(){function t(t,e){zs+=o*t-r*e,r=t,o=e}var e,n,r,o;$s.point=function(i,a){$s.point=t,e=r=i,n=o=a},$s.lineEnd=function(){t(e,n)}}function Ye(t,e){Rs>t&&(Rs=t),t>Is&&(Is=t),Ps>e&&(Ps=e),e>Hs&&(Hs=e)}function Xe(){function t(t,e){a.push("M",t,",",e,i)}function e(t,e){a.push("M",t,",",e),s.point=n}function n(t,e){a.push("L",t,",",e)}function r(){s.point=t}function o(){a.push("Z")}var i=Je(4.5),a=[],s={point:t,lineStart:function(){s.point=e},lineEnd:r,polygonStart:function(){s.lineEnd=o},polygonEnd:function(){s.lineEnd=r,s.point=t},pointRadius:function(t){return i=Je(t),s},result:function(){if(a.length){var t=a.join("");return a=[],t}}};return s}function Je(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Ze(t,e){js+=t,Ms+=e,++Es}function Ke(){function t(t,r){var o=t-e,i=r-n,a=Math.sqrt(o*o+i*i);Cs+=a*(e+t)/2,Ss+=a*(n+r)/2,As+=a,Ze(e=t,n=r)}var e,n;Vs.point=function(r,o){Vs.point=t,Ze(e=r,n=o)}}function Ge(){Vs.point=Ze}function Qe(){function t(t,e){var n=t-r,i=e-o,a=Math.sqrt(n*n+i*i);Cs+=a*(r+t)/2,Ss+=a*(o+e)/2,As+=a,a=o*t-r*e,Ts+=a*(r+t),Ns+=a*(o+e),Os+=3*a,Ze(r=t,o=e)}var e,n,r,o;Vs.point=function(i,a){Vs.point=t,Ze(e=r=i,n=o=a)},Vs.lineEnd=function(){t(e,n)}}function tn(t){function e(e,n){t.moveTo(e+a,n),t.arc(e,n,a,0,Da)}function n(e,n){t.moveTo(e,n),s.point=r}function r(e,n){t.lineTo(e,n)}function o(){s.point=e}function i(){t.closePath()}var a=4.5,s={point:e,lineStart:function(){s.point=n},lineEnd:o,polygonStart:function(){s.lineEnd=i},polygonEnd:function(){s.lineEnd=o,s.point=e},pointRadius:function(t){return a=t,s},result:_};return s}function en(t){function e(t){return(s?r:n)(t)}function n(e){return on(e,function(n,r){n=t(n,r),e.point(n[0],n[1])})}function r(e){function n(n,r){n=t(n,r),e.point(n[0],n[1])}function r(){x=0/0,j.point=i,e.lineStart()}function i(n,r){var i=me([n,r]),a=t(n,r);o(x,w,y,b,_,k,x=a[0],w=a[1],y=n,b=i[0],_=i[1],k=i[2],s,e),e.point(x,w)}function a(){j.point=n,e.lineEnd()}function u(){r(),j.point=l,j.lineEnd=c}function l(t,e){i(f=t,d=e),h=x,p=w,m=b,g=_,v=k,j.point=i}function c(){o(x,w,y,b,_,k,h,p,f,m,g,v,s,e),j.lineEnd=a,a()}var f,d,h,p,m,g,v,y,x,w,b,_,k,j={point:n,lineStart:r,lineEnd:a,polygonStart:function(){e.polygonStart(),j.lineStart=u},polygonEnd:function(){e.polygonEnd(),j.lineStart=r}};return j}function o(e,n,r,s,u,l,c,f,d,h,p,m,g,v){var y=c-e,x=f-n,w=y*y+x*x;if(w>4*i&&g--){var b=s+h,_=u+p,k=l+m,j=Math.sqrt(b*b+_*_+k*k),M=Math.asin(k/=j),E=ma(ma(k)-1)<Na||ma(r-d)<Na?(r+d)/2:Math.atan2(_,b),C=t(E,M),S=C[0],A=C[1],T=S-e,N=A-n,O=x*T-y*N;(O*O/w>i||ma((y*T+x*N)/w-.5)>.3||a>s*h+u*p+l*m)&&(o(e,n,r,s,u,l,S,A,E,b/=j,_/=j,k,g,v),v.point(S,A),o(S,A,E,b,_,k,c,f,d,h,p,m,g,v))}}var i=.5,a=Math.cos(30*za),s=16;return e.precision=function(t){return arguments.length?(s=(i=t*t)>0&&16,e):Math.sqrt(i)},e}function nn(t){var e=en(function(e,n){return t([e*Ra,n*Ra])});return function(t){return un(e(t))}}function rn(t){this.stream=t}function on(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function an(t){return sn(function(){return t})()}function sn(t){function e(t){return t=s(t[0]*za,t[1]*za),[t[0]*d+u,l-t[1]*d]}function n(t){return t=s.invert((t[0]-u)/d,(l-t[1])/d),t&&[t[0]*Ra,t[1]*Ra]}function r(){s=Se(a=fn(v,y,w),i);var t=i(m,g);return u=h-t[0]*d,l=p+t[1]*d,o()}function o(){return c&&(c.valid=!1,c=null),e}var i,a,s,u,l,c,f=en(function(t,e){return t=i(t,e),[t[0]*d+u,l-t[1]*d]}),d=150,h=480,p=250,m=0,g=0,v=0,y=0,w=0,b=Ds,_=x,k=null,j=null;return e.stream=function(t){return c&&(c.valid=!1),c=un(b(a,f(_(t)))),c.valid=!0,c},e.clipAngle=function(t){return arguments.length?(b=null==t?(k=t,Ds):He((k=+t)*za),o()):k},e.clipExtent=function(t){return arguments.length?(j=t,_=t?Be(t[0][0],t[0][1],t[1][0],t[1][1]):x,o()):j},e.scale=function(t){return arguments.length?(d=+t,r()):d},e.translate=function(t){return arguments.length?(h=+t[0],p=+t[1],r()):[h,p]},e.center=function(t){return arguments.length?(m=t[0]%360*za,g=t[1]%360*za,r()):[m*Ra,g*Ra]},e.rotate=function(t){return arguments.length?(v=t[0]%360*za,y=t[1]%360*za,w=t.length>2?t[2]%360*za:0,r()):[v*Ra,y*Ra,w*Ra]},ra.rebind(e,f,"precision"),function(){return i=t.apply(this,arguments),e.invert=i.invert&&n,r()}}function un(t){return on(t,function(e,n){t.point(e*za,n*za)})}function ln(t,e){return[t,e]}function cn(t,e){return[t>qa?t-Da:-qa>t?t+Da:t,e]}function fn(t,e,n){return t?e||n?Se(hn(t),pn(e,n)):hn(t):e||n?pn(e,n):cn}function dn(t){return function(e,n){return e+=t,[e>qa?e-Da:-qa>e?e+Da:e,n]}}function hn(t){var e=dn(t);return e.invert=dn(-t),e}function pn(t,e){function n(t,e){var n=Math.cos(e),s=Math.cos(t)*n,u=Math.sin(t)*n,l=Math.sin(e),c=l*r+s*o;return[Math.atan2(u*i-c*a,s*r-l*o),nt(c*i+u*a)]}var r=Math.cos(t),o=Math.sin(t),i=Math.cos(e),a=Math.sin(e);return n.invert=function(t,e){var n=Math.cos(e),s=Math.cos(t)*n,u=Math.sin(t)*n,l=Math.sin(e),c=l*i-u*a;return[Math.atan2(u*i+l*a,s*r+c*o),nt(c*r-s*o)]},n}function mn(t,e){var n=Math.cos(t),r=Math.sin(t);return function(o,i,a,s){var u=a*e;null!=o?(o=gn(n,o),i=gn(n,i),(a>0?i>o:o>i)&&(o+=a*Da)):(o=t+a*Da,i=t-.5*u);for(var l,c=o;a>0?c>i:i>c;c-=u)s.point((l=be([n,-r*Math.cos(c),-r*Math.sin(c)]))[0],l[1])}}function gn(t,e){var n=me(e);n[0]-=t,we(n);var r=et(-n[1]);return((-n[2]<0?-r:r)+2*Math.PI-Na)%(2*Math.PI)}function vn(t,e,n){var r=ra.range(t,e-Na,n).concat(e);return function(t){return r.map(function(e){return[t,e]})}}function yn(t,e,n){var r=ra.range(t,e-Na,n).concat(e);return function(t){return r.map(function(e){return[e,t]})}}function xn(t){return t.source}function wn(t){return t.target}function bn(t,e,n,r){var o=Math.cos(e),i=Math.sin(e),a=Math.cos(r),s=Math.sin(r),u=o*Math.cos(t),l=o*Math.sin(t),c=a*Math.cos(n),f=a*Math.sin(n),d=2*Math.asin(Math.sqrt(at(r-e)+o*a*at(n-t))),h=1/Math.sin(d),p=d?function(t){var e=Math.sin(t*=d)*h,n=Math.sin(d-t)*h,r=n*u+e*c,o=n*l+e*f,a=n*i+e*s;return[Math.atan2(o,r)*Ra,Math.atan2(a,Math.sqrt(r*r+o*o))*Ra]}:function(){return[t*Ra,e*Ra]};return p.distance=d,p}function _n(){function t(t,o){var i=Math.sin(o*=za),a=Math.cos(o),s=ma((t*=za)-e),u=Math.cos(s);Us+=Math.atan2(Math.sqrt((s=a*Math.sin(s))*s+(s=r*i-n*a*u)*s),n*i+r*a*u),e=t,n=i,r=a}var e,n,r;Ws.point=function(o,i){e=o*za,n=Math.sin(i*=za),r=Math.cos(i),Ws.point=t},Ws.lineEnd=function(){Ws.point=Ws.lineEnd=_}}function kn(t,e){function n(e,n){var r=Math.cos(e),o=Math.cos(n),i=t(r*o);return[i*o*Math.sin(e),i*Math.sin(n)]}return n.invert=function(t,n){var r=Math.sqrt(t*t+n*n),o=e(r),i=Math.sin(o),a=Math.cos(o);return[Math.atan2(t*i,r*a),Math.asin(r&&n*i/r)]},n}function jn(t,e){function n(t,e){a>0?-Fa+Na>e&&(e=-Fa+Na):e>Fa-Na&&(e=Fa-Na);var n=a/Math.pow(o(e),i);return[n*Math.sin(i*t),a-n*Math.cos(i*t)]}var r=Math.cos(t),o=function(t){return Math.tan(qa/4+t/2)},i=t===e?Math.sin(t):Math.log(r/Math.cos(e))/Math.log(o(e)/o(t)),a=r*Math.pow(o(t),i)/i;return i?(n.invert=function(t,e){var n=a-e,r=Q(i)*Math.sqrt(t*t+n*n);return[Math.atan2(t,n)/i,2*Math.atan(Math.pow(a/r,1/i))-Fa]},n):En}function Mn(t,e){function n(t,e){var n=i-e;return[n*Math.sin(o*t),i-n*Math.cos(o*t)]}var r=Math.cos(t),o=t===e?Math.sin(t):(r-Math.cos(e))/(e-t),i=r/o+t;return ma(o)<Na?ln:(n.invert=function(t,e){var n=i-e;return[Math.atan2(t,n)/o,i-Q(o)*Math.sqrt(t*t+n*n)]},n)}function En(t,e){return[t,Math.log(Math.tan(qa/4+e/2))]}function Cn(t){var e,n=an(t),r=n.scale,o=n.translate,i=n.clipExtent;return n.scale=function(){var t=r.apply(n,arguments);return t===n?e?n.clipExtent(null):n:t},n.translate=function(){var t=o.apply(n,arguments);return t===n?e?n.clipExtent(null):n:t},n.clipExtent=function(t){var a=i.apply(n,arguments);if(a===n){if(e=null==t){var s=qa*r(),u=o();i([[u[0]-s,u[1]-s],[u[0]+s,u[1]+s]])}}else e&&(a=null);return a},n.clipExtent(null)}function Sn(t,e){return[Math.log(Math.tan(qa/4+e/2)),-t]}function An(t){return t[0]}function Tn(t){return t[1]}function Nn(t){for(var e=t.length,n=[0,1],r=2,o=2;e>o;o++){for(;r>1&&tt(t[n[r-2]],t[n[r-1]],t[o])<=0;)--r;n[r++]=o}return n.slice(0,r)}function On(t,e){return t[0]-e[0]||t[1]-e[1]}function qn(t,e,n){return(n[0]-e[0])*(t[1]-e[1])<(n[1]-e[1])*(t[0]-e[0])}function Dn(t,e,n,r){var o=t[0],i=n[0],a=e[0]-o,s=r[0]-i,u=t[1],l=n[1],c=e[1]-u,f=r[1]-l,d=(s*(u-l)-f*(o-i))/(f*a-s*c);return[o+d*a,u+d*c]}function Ln(t){var e=t[0],n=t[t.length-1];return!(e[0]-n[0]||e[1]-n[1])}function Fn(){rr(this),this.edge=this.site=this.circle=null}function zn(t){var e=ou.pop()||new Fn;return e.site=t,e}function Rn(t){Xn(t),eu.remove(t),ou.push(t),rr(t)}function Pn(t){var e=t.circle,n=e.x,r=e.cy,o={x:n,y:r},i=t.P,a=t.N,s=[t];Rn(t);for(var u=i;u.circle&&ma(n-u.circle.x)<Na&&ma(r-u.circle.cy)<Na;)i=u.P,s.unshift(u),Rn(u),u=i;s.unshift(u),Xn(u);for(var l=a;l.circle&&ma(n-l.circle.x)<Na&&ma(r-l.circle.cy)<Na;)a=l.N,s.push(l),Rn(l),l=a;s.push(l),Xn(l);var c,f=s.length;for(c=1;f>c;++c)l=s[c],u=s[c-1],tr(l.edge,u.site,l.site,o);u=s[0],l=s[f-1],l.edge=Gn(u.site,l.site,null,o),Yn(u),Yn(l)}function In(t){for(var e,n,r,o,i=t.x,a=t.y,s=eu._;s;)if(r=Hn(s,a)-i,r>Na)s=s.L;else{if(o=i-$n(s,a),!(o>Na)){r>-Na?(e=s.P,n=s):o>-Na?(e=s,n=s.N):e=n=s;break}if(!s.R){e=s;break}s=s.R}var u=zn(t);if(eu.insert(e,u),e||n){if(e===n)return Xn(e),n=zn(e.site),eu.insert(u,n),u.edge=n.edge=Gn(e.site,u.site),Yn(e),void Yn(n);if(!n)return void(u.edge=Gn(e.site,u.site));Xn(e),Xn(n);var l=e.site,c=l.x,f=l.y,d=t.x-c,h=t.y-f,p=n.site,m=p.x-c,g=p.y-f,v=2*(d*g-h*m),y=d*d+h*h,x=m*m+g*g,w={x:(g*y-h*x)/v+c,y:(d*x-m*y)/v+f};tr(n.edge,l,p,w),u.edge=Gn(l,t,null,w),n.edge=Gn(t,p,null,w),Yn(e),Yn(n)}}function Hn(t,e){var n=t.site,r=n.x,o=n.y,i=o-e;if(!i)return r;var a=t.P;if(!a)return-(1/0);n=a.site;var s=n.x,u=n.y,l=u-e;if(!l)return s;var c=s-r,f=1/i-1/l,d=c/l;return f?(-d+Math.sqrt(d*d-2*f*(c*c/(-2*l)-u+l/2+o-i/2)))/f+r:(r+s)/2}function $n(t,e){var n=t.N;if(n)return Hn(n,e);var r=t.site;return r.y===e?r.x:1/0}function Bn(t){this.site=t,this.edges=[]}function Vn(t){for(var e,n,r,o,i,a,s,u,l,c,f=t[0][0],d=t[1][0],h=t[0][1],p=t[1][1],m=tu,g=m.length;g--;)if(i=m[g],i&&i.prepare())for(s=i.edges,u=s.length,a=0;u>a;)c=s[a].end(),r=c.x,o=c.y,l=s[++a%u].start(),e=l.x,n=l.y,(ma(r-e)>Na||ma(o-n)>Na)&&(s.splice(a,0,new er(Qn(i.site,c,ma(r-f)<Na&&p-o>Na?{x:f,y:ma(e-f)<Na?n:p}:ma(o-p)<Na&&d-r>Na?{x:ma(n-p)<Na?e:d,y:p}:ma(r-d)<Na&&o-h>Na?{x:d,y:ma(e-d)<Na?n:h}:ma(o-h)<Na&&r-f>Na?{x:ma(n-h)<Na?e:f,y:h}:null),i.site,null)),++u)}function Un(t,e){return e.angle-t.angle}function Wn(){rr(this),this.x=this.y=this.arc=this.site=this.cy=null}function Yn(t){var e=t.P,n=t.N;if(e&&n){var r=e.site,o=t.site,i=n.site;if(r!==i){var a=o.x,s=o.y,u=r.x-a,l=r.y-s,c=i.x-a,f=i.y-s,d=2*(u*f-l*c);if(!(d>=-Oa)){var h=u*u+l*l,p=c*c+f*f,m=(f*h-l*p)/d,g=(u*p-c*h)/d,f=g+s,v=iu.pop()||new Wn;v.arc=t,v.site=o,v.x=m+a,v.y=f+Math.sqrt(m*m+g*g),v.cy=f,t.circle=v;for(var y=null,x=ru._;x;)if(v.y<x.y||v.y===x.y&&v.x<=x.x){if(!x.L){y=x.P;break}x=x.L}else{if(!x.R){y=x;break}x=x.R}ru.insert(y,v),y||(nu=v)}}}}function Xn(t){var e=t.circle;e&&(e.P||(nu=e.N),ru.remove(e),iu.push(e),rr(e),t.circle=null)}function Jn(t){for(var e,n=Qs,r=$e(t[0][0],t[0][1],t[1][0],t[1][1]),o=n.length;o--;)e=n[o],(!Zn(e,t)||!r(e)||ma(e.a.x-e.b.x)<Na&&ma(e.a.y-e.b.y)<Na)&&(e.a=e.b=null,n.splice(o,1))}function Zn(t,e){var n=t.b;if(n)return!0;var r,o,i=t.a,a=e[0][0],s=e[1][0],u=e[0][1],l=e[1][1],c=t.l,f=t.r,d=c.x,h=c.y,p=f.x,m=f.y,g=(d+p)/2,v=(h+m)/2;if(m===h){if(a>g||g>=s)return;if(d>p){if(i){if(i.y>=l)return}else i={x:g,y:u};n={x:g,y:l}}else{if(i){if(i.y<u)return}else i={x:g,y:l};n={x:g,y:u}}}else if(r=(d-p)/(m-h),o=v-r*g,-1>r||r>1)if(d>p){if(i){if(i.y>=l)return}else i={x:(u-o)/r,y:u};n={x:(l-o)/r,y:l}}else{if(i){if(i.y<u)return}else i={x:(l-o)/r,y:l};n={x:(u-o)/r,y:u}}else if(m>h){if(i){if(i.x>=s)return}else i={x:a,y:r*a+o};n={x:s,y:r*s+o}}else{if(i){if(i.x<a)return}else i={x:s,y:r*s+o};n={x:a,y:r*a+o}}return t.a=i,t.b=n,!0}function Kn(t,e){this.l=t,this.r=e,this.a=this.b=null}function Gn(t,e,n,r){var o=new Kn(t,e);return Qs.push(o),n&&tr(o,t,e,n),r&&tr(o,e,t,r),tu[t.i].edges.push(new er(o,t,e)),tu[e.i].edges.push(new er(o,e,t)),o}function Qn(t,e,n){var r=new Kn(t,null);return r.a=e,r.b=n,Qs.push(r),r}function tr(t,e,n,r){t.a||t.b?t.l===n?t.b=r:t.a=r:(t.a=r,t.l=e,t.r=n)}function er(t,e,n){var r=t.a,o=t.b;this.edge=t,this.site=e,this.angle=n?Math.atan2(n.y-e.y,n.x-e.x):t.l===e?Math.atan2(o.x-r.x,r.y-o.y):Math.atan2(r.x-o.x,o.y-r.y)}function nr(){this._=null}function rr(t){t.U=t.C=t.L=t.R=t.P=t.N=null}function or(t,e){var n=e,r=e.R,o=n.U;o?o.L===n?o.L=r:o.R=r:t._=r,r.U=o,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function ir(t,e){var n=e,r=e.L,o=n.U;o?o.L===n?o.L=r:o.R=r:t._=r,r.U=o,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function ar(t){for(;t.L;)t=t.L;return t}function sr(t,e){var n,r,o,i=t.sort(ur).pop();for(Qs=[],tu=new Array(t.length),eu=new nr,ru=new nr;;)if(o=nu,i&&(!o||i.y<o.y||i.y===o.y&&i.x<o.x))(i.x!==n||i.y!==r)&&(tu[i.i]=new Bn(i),In(i),n=i.x,r=i.y),i=t.pop();else{if(!o)break;Pn(o.arc)}e&&(Jn(e),Vn(e));var a={cells:tu,edges:Qs};return eu=ru=Qs=tu=null,a}function ur(t,e){return e.y-t.y||e.x-t.x}function lr(t,e,n){return(t.x-n.x)*(e.y-t.y)-(t.x-e.x)*(n.y-t.y)}function cr(t){return t.x}function fr(t){return t.y}function dr(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function hr(t,e,n,r,o,i){if(!t(e,n,r,o,i)){var a=.5*(n+o),s=.5*(r+i),u=e.nodes;u[0]&&hr(t,u[0],n,r,a,s),u[1]&&hr(t,u[1],a,r,o,s),u[2]&&hr(t,u[2],n,s,a,i),u[3]&&hr(t,u[3],a,s,o,i)}}function pr(t,e,n,r,o,i,a){var s,u=1/0;return function l(t,c,f,d,h){if(!(c>i||f>a||r>d||o>h)){if(p=t.point){var p,m=e-t.x,g=n-t.y,v=m*m+g*g;if(u>v){var y=Math.sqrt(u=v);r=e-y,o=n-y,i=e+y,a=n+y,s=p}}for(var x=t.nodes,w=.5*(c+d),b=.5*(f+h),_=e>=w,k=n>=b,j=k<<1|_,M=j+4;M>j;++j)if(t=x[3&j])switch(3&j){case 0:l(t,c,f,w,b);break;case 1:l(t,w,f,d,b);break;case 2:l(t,c,b,w,h);break;case 3:l(t,w,b,d,h)}}}(t,r,o,i,a),s}function mr(t,e){t=ra.rgb(t),e=ra.rgb(e);var n=t.r,r=t.g,o=t.b,i=e.r-n,a=e.g-r,s=e.b-o;return function(t){return"#"+bt(Math.round(n+i*t))+bt(Math.round(r+a*t))+bt(Math.round(o+s*t))}}function gr(t,e){var n,r={},o={};for(n in t)n in e?r[n]=xr(t[n],e[n]):o[n]=t[n];for(n in e)n in t||(o[n]=e[n]);return function(t){for(n in r)o[n]=r[n](t);return o}}function vr(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}function yr(t,e){var n,r,o,i=su.lastIndex=uu.lastIndex=0,a=-1,s=[],u=[];for(t+="",e+="";(n=su.exec(t))&&(r=uu.exec(e));)(o=r.index)>i&&(o=e.slice(i,o),s[a]?s[a]+=o:s[++a]=o),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:vr(n,r)})),i=uu.lastIndex;return i<e.length&&(o=e.slice(i),s[a]?s[a]+=o:s[++a]=o),s.length<2?u[0]?(e=u[0].x,function(t){return e(t)+""}):function(){return e}:(e=u.length,function(t){for(var n,r=0;e>r;++r)s[(n=u[r]).i]=n.x(t);return s.join("")})}function xr(t,e){for(var n,r=ra.interpolators.length;--r>=0&&!(n=ra.interpolators[r](t,e)););return n}function wr(t,e){
+var n,r=[],o=[],i=t.length,a=e.length,s=Math.min(t.length,e.length);for(n=0;s>n;++n)r.push(xr(t[n],e[n]));for(;i>n;++n)o[n]=t[n];for(;a>n;++n)o[n]=e[n];return function(t){for(n=0;s>n;++n)o[n]=r[n](t);return o}}function br(t){return function(e){return 0>=e?0:e>=1?1:t(e)}}function _r(t){return function(e){return 1-t(1-e)}}function kr(t){return function(e){return.5*(.5>e?t(2*e):2-t(2-2*e))}}function jr(t){return t*t}function Mr(t){return t*t*t}function Er(t){if(0>=t)return 0;if(t>=1)return 1;var e=t*t,n=e*t;return 4*(.5>t?n:3*(t-e)+n-.75)}function Cr(t){return function(e){return Math.pow(e,t)}}function Sr(t){return 1-Math.cos(t*Fa)}function Ar(t){return Math.pow(2,10*(t-1))}function Tr(t){return 1-Math.sqrt(1-t*t)}function Nr(t,e){var n;return arguments.length<2&&(e=.45),arguments.length?n=e/Da*Math.asin(1/t):(t=1,n=e/4),function(r){return 1+t*Math.pow(2,-10*r)*Math.sin((r-n)*Da/e)}}function Or(t){return t||(t=1.70158),function(e){return e*e*((t+1)*e-t)}}function qr(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function Dr(t,e){t=ra.hcl(t),e=ra.hcl(e);var n=t.h,r=t.c,o=t.l,i=e.h-n,a=e.c-r,s=e.l-o;return isNaN(a)&&(a=0,r=isNaN(r)?e.c:r),isNaN(i)?(i=0,n=isNaN(n)?e.h:n):i>180?i-=360:-180>i&&(i+=360),function(t){return ft(n+i*t,r+a*t,o+s*t)+""}}function Lr(t,e){t=ra.hsl(t),e=ra.hsl(e);var n=t.h,r=t.s,o=t.l,i=e.h-n,a=e.s-r,s=e.l-o;return isNaN(a)&&(a=0,r=isNaN(r)?e.s:r),isNaN(i)?(i=0,n=isNaN(n)?e.h:n):i>180?i-=360:-180>i&&(i+=360),function(t){return lt(n+i*t,r+a*t,o+s*t)+""}}function Fr(t,e){t=ra.lab(t),e=ra.lab(e);var n=t.l,r=t.a,o=t.b,i=e.l-n,a=e.a-r,s=e.b-o;return function(t){return ht(n+i*t,r+a*t,o+s*t)+""}}function zr(t,e){return e-=t,function(n){return Math.round(t+e*n)}}function Rr(t){var e=[t.a,t.b],n=[t.c,t.d],r=Ir(e),o=Pr(e,n),i=Ir(Hr(n,e,-o))||0;e[0]*n[1]<n[0]*e[1]&&(e[0]*=-1,e[1]*=-1,r*=-1,o*=-1),this.rotate=(r?Math.atan2(e[1],e[0]):Math.atan2(-n[0],n[1]))*Ra,this.translate=[t.e,t.f],this.scale=[r,i],this.skew=i?Math.atan2(o,i)*Ra:0}function Pr(t,e){return t[0]*e[0]+t[1]*e[1]}function Ir(t){var e=Math.sqrt(Pr(t,t));return e&&(t[0]/=e,t[1]/=e),e}function Hr(t,e,n){return t[0]+=n*e[0],t[1]+=n*e[1],t}function $r(t,e){var n,r=[],o=[],i=ra.transform(t),a=ra.transform(e),s=i.translate,u=a.translate,l=i.rotate,c=a.rotate,f=i.skew,d=a.skew,h=i.scale,p=a.scale;return s[0]!=u[0]||s[1]!=u[1]?(r.push("translate(",null,",",null,")"),o.push({i:1,x:vr(s[0],u[0])},{i:3,x:vr(s[1],u[1])})):r.push(u[0]||u[1]?"translate("+u+")":""),l!=c?(l-c>180?c+=360:c-l>180&&(l+=360),o.push({i:r.push(r.pop()+"rotate(",null,")")-2,x:vr(l,c)})):c&&r.push(r.pop()+"rotate("+c+")"),f!=d?o.push({i:r.push(r.pop()+"skewX(",null,")")-2,x:vr(f,d)}):d&&r.push(r.pop()+"skewX("+d+")"),h[0]!=p[0]||h[1]!=p[1]?(n=r.push(r.pop()+"scale(",null,",",null,")"),o.push({i:n-4,x:vr(h[0],p[0])},{i:n-2,x:vr(h[1],p[1])})):(1!=p[0]||1!=p[1])&&r.push(r.pop()+"scale("+p+")"),n=o.length,function(t){for(var e,i=-1;++i<n;)r[(e=o[i]).i]=e.x(t);return r.join("")}}function Br(t,e){return e=(e-=t=+t)||1/e,function(n){return(n-t)/e}}function Vr(t,e){return e=(e-=t=+t)||1/e,function(n){return Math.max(0,Math.min(1,(n-t)/e))}}function Ur(t){for(var e=t.source,n=t.target,r=Yr(e,n),o=[e];e!==r;)e=e.parent,o.push(e);for(var i=o.length;n!==r;)o.splice(i,0,n),n=n.parent;return o}function Wr(t){for(var e=[],n=t.parent;null!=n;)e.push(t),t=n,n=n.parent;return e.push(t),e}function Yr(t,e){if(t===e)return t;for(var n=Wr(t),r=Wr(e),o=n.pop(),i=r.pop(),a=null;o===i;)a=o,o=n.pop(),i=r.pop();return a}function Xr(t){t.fixed|=2}function Jr(t){t.fixed&=-7}function Zr(t){t.fixed|=4,t.px=t.x,t.py=t.y}function Kr(t){t.fixed&=-5}function Gr(t,e,n){var r=0,o=0;if(t.charge=0,!t.leaf)for(var i,a=t.nodes,s=a.length,u=-1;++u<s;)i=a[u],null!=i&&(Gr(i,e,n),t.charge+=i.charge,r+=i.charge*i.cx,o+=i.charge*i.cy);if(t.point){t.leaf||(t.point.x+=Math.random()-.5,t.point.y+=Math.random()-.5);var l=e*n[t.point.index];t.charge+=t.pointCharge=l,r+=l*t.point.x,o+=l*t.point.y}t.cx=r/t.charge,t.cy=o/t.charge}function Qr(t,e){return ra.rebind(t,e,"sort","children","value"),t.nodes=t,t.links=io,t}function to(t,e){for(var n=[t];null!=(t=n.pop());)if(e(t),(o=t.children)&&(r=o.length))for(var r,o;--r>=0;)n.push(o[r])}function eo(t,e){for(var n=[t],r=[];null!=(t=n.pop());)if(r.push(t),(i=t.children)&&(o=i.length))for(var o,i,a=-1;++a<o;)n.push(i[a]);for(;null!=(t=r.pop());)e(t)}function no(t){return t.children}function ro(t){return t.value}function oo(t,e){return e.value-t.value}function io(t){return ra.merge(t.map(function(t){return(t.children||[]).map(function(e){return{source:t,target:e}})}))}function ao(t){return t.x}function so(t){return t.y}function uo(t,e,n){t.y0=e,t.y=n}function lo(data){return ra.range(data.length)}function co(data){for(var t=-1,e=data[0].length,n=[];++t<e;)n[t]=0;return n}function fo(t){for(var e,n=1,r=0,o=t[0][1],i=t.length;i>n;++n)(e=t[n][1])>o&&(r=n,o=e);return r}function ho(t){return t.reduce(po,0)}function po(t,e){return t+e[1]}function mo(t,e){return go(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function go(t,e){for(var n=-1,r=+t[0],o=(t[1]-r)/e,i=[];++n<=e;)i[n]=o*n+r;return i}function vo(t){return[ra.min(t),ra.max(t)]}function yo(t,e){return t.value-e.value}function xo(t,e){var n=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=n,n._pack_prev=e}function wo(t,e){t._pack_next=e,e._pack_prev=t}function bo(t,e){var n=e.x-t.x,r=e.y-t.y,o=t.r+e.r;return.999*o*o>n*n+r*r}function _o(t){function e(t){c=Math.min(t.x-t.r,c),f=Math.max(t.x+t.r,f),d=Math.min(t.y-t.r,d),h=Math.max(t.y+t.r,h)}if((n=t.children)&&(l=n.length)){var n,r,o,i,a,s,u,l,c=1/0,f=-(1/0),d=1/0,h=-(1/0);if(n.forEach(ko),r=n[0],r.x=-r.r,r.y=0,e(r),l>1&&(o=n[1],o.x=o.r,o.y=0,e(o),l>2))for(i=n[2],Eo(r,o,i),e(i),xo(r,i),r._pack_prev=i,xo(i,o),o=r._pack_next,a=3;l>a;a++){Eo(r,o,i=n[a]);var p=0,m=1,g=1;for(s=o._pack_next;s!==o;s=s._pack_next,m++)if(bo(s,i)){p=1;break}if(1==p)for(u=r._pack_prev;u!==s._pack_prev&&!bo(u,i);u=u._pack_prev,g++);p?(g>m||m==g&&o.r<r.r?wo(r,o=s):wo(r=u,o),a--):(xo(r,i),o=i,e(i))}var v=(c+f)/2,y=(d+h)/2,x=0;for(a=0;l>a;a++)i=n[a],i.x-=v,i.y-=y,x=Math.max(x,i.r+Math.sqrt(i.x*i.x+i.y*i.y));t.r=x,n.forEach(jo)}}function ko(t){t._pack_next=t._pack_prev=t}function jo(t){delete t._pack_next,delete t._pack_prev}function Mo(t,e,n,r){var o=t.children;if(t.x=e+=r*t.x,t.y=n+=r*t.y,t.r*=r,o)for(var i=-1,a=o.length;++i<a;)Mo(o[i],e,n,r)}function Eo(t,e,n){var r=t.r+n.r,o=e.x-t.x,i=e.y-t.y;if(r&&(o||i)){var a=e.r+n.r,s=o*o+i*i;a*=a,r*=r;var u=.5+(r-a)/(2*s),l=Math.sqrt(Math.max(0,2*a*(r+s)-(r-=s)*r-a*a))/(2*s);n.x=t.x+u*o+l*i,n.y=t.y+u*i-l*o}else n.x=t.x+r,n.y=t.y}function Co(t,e){return t.parent==e.parent?1:2}function So(t){var e=t.children;return e.length?e[0]:t.t}function Ao(t){var e,n=t.children;return(e=n.length)?n[e-1]:t.t}function To(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function No(t){for(var e,n=0,r=0,o=t.children,i=o.length;--i>=0;)e=o[i],e.z+=n,e.m+=n,n+=e.s+(r+=e.c)}function Oo(t,e,n){return t.a.parent===e.parent?t.a:n}function qo(t){return 1+ra.max(t,function(t){return t.y})}function Do(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}function Lo(t){var e=t.children;return e&&e.length?Lo(e[0]):t}function Fo(t){var e,n=t.children;return n&&(e=n.length)?Fo(n[e-1]):t}function zo(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Ro(t,e){var n=t.x+e[3],r=t.y+e[0],o=t.dx-e[1]-e[3],i=t.dy-e[0]-e[2];return 0>o&&(n+=o/2,o=0),0>i&&(r+=i/2,i=0),{x:n,y:r,dx:o,dy:i}}function Po(t){var e=t[0],n=t[t.length-1];return n>e?[e,n]:[n,e]}function Io(t){return t.rangeExtent?t.rangeExtent():Po(t.range())}function Ho(t,e,n,r){var o=n(t[0],t[1]),i=r(e[0],e[1]);return function(t){return i(o(t))}}function $o(t,e){var n,r=0,o=t.length-1,i=t[r],a=t[o];return i>a&&(n=r,r=o,o=n,n=i,i=a,a=n),t[r]=e.floor(i),t[o]=e.ceil(a),t}function Bo(t){return t?{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}:xu}function Vo(t,e,n,r){var o=[],i=[],a=0,s=Math.min(t.length,e.length)-1;for(t[s]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<=s;)o.push(n(t[a-1],t[a])),i.push(r(e[a-1],e[a]));return function(e){var n=ra.bisect(t,e,1,s)-1;return i[n](o[n](e))}}function Uo(t,e,n,r){function o(){var o=Math.min(t.length,e.length)>2?Vo:Ho,u=r?Vr:Br;return a=o(t,e,u,n),s=o(e,t,u,xr),i}function i(t){return a(t)}var a,s;return i.invert=function(t){return s(t)},i.domain=function(e){return arguments.length?(t=e.map(Number),o()):t},i.range=function(t){return arguments.length?(e=t,o()):e},i.rangeRound=function(t){return i.range(t).interpolate(zr)},i.clamp=function(t){return arguments.length?(r=t,o()):r},i.interpolate=function(t){return arguments.length?(n=t,o()):n},i.ticks=function(e){return Jo(t,e)},i.tickFormat=function(e,n){return Zo(t,e,n)},i.nice=function(e){return Yo(t,e),o()},i.copy=function(){return Uo(t,e,n,r)},o()}function Wo(t,e){return ra.rebind(t,e,"range","rangeRound","interpolate","clamp")}function Yo(t,e){return $o(t,Bo(Xo(t,e)[2]))}function Xo(t,e){null==e&&(e=10);var n=Po(t),r=n[1]-n[0],o=Math.pow(10,Math.floor(Math.log(r/e)/Math.LN10)),i=e/r*o;return.15>=i?o*=10:.35>=i?o*=5:.75>=i&&(o*=2),n[0]=Math.ceil(n[0]/o)*o,n[1]=Math.floor(n[1]/o)*o+.5*o,n[2]=o,n}function Jo(t,e){return ra.range.apply(ra,Xo(t,e))}function Zo(t,e,n){var r=Xo(t,e);if(n){var o=ss.exec(n);if(o.shift(),"s"===o[8]){var i=ra.formatPrefix(Math.max(ma(r[0]),ma(r[1])));return o[7]||(o[7]="."+Ko(i.scale(r[2]))),o[8]="f",n=ra.format(o.join("")),function(t){return n(i.scale(t))+i.symbol}}o[7]||(o[7]="."+Go(o[8],r)),n=o.join("")}else n=",."+Ko(r[2])+"f";return ra.format(n)}function Ko(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function Go(t,e){var n=Ko(e[2]);return t in wu?Math.abs(n-Ko(Math.max(ma(e[0]),ma(e[1]))))+ +("e"!==t):n-2*("%"===t)}function Qo(t,e,n,r){function o(t){return(n?Math.log(0>t?0:t):-Math.log(t>0?0:-t))/Math.log(e)}function i(t){return n?Math.pow(e,t):-Math.pow(e,-t)}function a(e){return t(o(e))}return a.invert=function(e){return i(t.invert(e))},a.domain=function(e){return arguments.length?(n=e[0]>=0,t.domain((r=e.map(Number)).map(o)),a):r},a.base=function(n){return arguments.length?(e=+n,t.domain(r.map(o)),a):e},a.nice=function(){var e=$o(r.map(o),n?Math:_u);return t.domain(e),r=e.map(i),a},a.ticks=function(){var t=Po(r),a=[],s=t[0],u=t[1],l=Math.floor(o(s)),c=Math.ceil(o(u)),f=e%1?2:e;if(isFinite(c-l)){if(n){for(;c>l;l++)for(var d=1;f>d;d++)a.push(i(l)*d);a.push(i(l))}else for(a.push(i(l));l++<c;)for(var d=f-1;d>0;d--)a.push(i(l)*d);for(l=0;a[l]<s;l++);for(c=a.length;a[c-1]>u;c--);a=a.slice(l,c)}return a},a.tickFormat=function(t,e){if(!arguments.length)return bu;arguments.length<2?e=bu:"function"!=typeof e&&(e=ra.format(e));var r,s=Math.max(.1,t/a.ticks().length),u=n?(r=1e-12,Math.ceil):(r=-1e-12,Math.floor);return function(t){return t/i(u(o(t)+r))<=s?e(t):""}},a.copy=function(){return Qo(t.copy(),e,n,r)},Wo(a,t)}function ti(t,e,n){function r(e){return t(o(e))}var o=ei(e),i=ei(1/e);return r.invert=function(e){return i(t.invert(e))},r.domain=function(e){return arguments.length?(t.domain((n=e.map(Number)).map(o)),r):n},r.ticks=function(t){return Jo(n,t)},r.tickFormat=function(t,e){return Zo(n,t,e)},r.nice=function(t){return r.domain(Yo(n,t))},r.exponent=function(a){return arguments.length?(o=ei(e=a),i=ei(1/e),t.domain(n.map(o)),r):e},r.copy=function(){return ti(t.copy(),e,n)},Wo(r,t)}function ei(t){return function(e){return 0>e?-Math.pow(-e,t):Math.pow(e,t)}}function ni(t,e){function n(n){return i[((o.get(n)||("range"===e.t?o.set(n,t.push(n)):0/0))-1)%i.length]}function r(e,n){return ra.range(t.length).map(function(t){return e+n*t})}var o,i,a;return n.domain=function(r){if(!arguments.length)return t;t=[],o=new c;for(var i,a=-1,s=r.length;++a<s;)o.has(i=r[a])||o.set(i,t.push(i));return n[e.t].apply(n,e.a)},n.range=function(t){return arguments.length?(i=t,a=0,e={t:"range",a:arguments},n):i},n.rangePoints=function(o,s){arguments.length<2&&(s=0);var u=o[0],l=o[1],c=t.length<2?(u=(u+l)/2,0):(l-u)/(t.length-1+s);return i=r(u+c*s/2,c),a=0,e={t:"rangePoints",a:arguments},n},n.rangeRoundPoints=function(o,s){arguments.length<2&&(s=0);var u=o[0],l=o[1],c=t.length<2?(u=l=Math.round((u+l)/2),0):(l-u)/(t.length-1+s)|0;return i=r(u+Math.round(c*s/2+(l-u-(t.length-1+s)*c)/2),c),a=0,e={t:"rangeRoundPoints",a:arguments},n},n.rangeBands=function(o,s,u){arguments.length<2&&(s=0),arguments.length<3&&(u=s);var l=o[1]<o[0],c=o[l-0],f=o[1-l],d=(f-c)/(t.length-s+2*u);return i=r(c+d*u,d),l&&i.reverse(),a=d*(1-s),e={t:"rangeBands",a:arguments},n},n.rangeRoundBands=function(o,s,u){arguments.length<2&&(s=0),arguments.length<3&&(u=s);var l=o[1]<o[0],c=o[l-0],f=o[1-l],d=Math.floor((f-c)/(t.length-s+2*u));return i=r(c+Math.round((f-c-(t.length-s)*d)/2),d),l&&i.reverse(),a=Math.round(d*(1-s)),e={t:"rangeRoundBands",a:arguments},n},n.rangeBand=function(){return a},n.rangeExtent=function(){return Po(e.a[0])},n.copy=function(){return ni(t,e)},n.domain(t)}function ri(t,e){function n(){var n=0,r=e.length;for(s=[];++n<r;)s[n-1]=ra.quantile(t,n/r);return a}function a(t){return isNaN(t=+t)?void 0:e[ra.bisect(s,t)]}var s;return a.domain=function(e){return arguments.length?(t=e.map(o).filter(i).sort(r),n()):t},a.range=function(t){return arguments.length?(e=t,n()):e},a.quantiles=function(){return s},a.invertExtent=function(n){return n=e.indexOf(n),0>n?[0/0,0/0]:[n>0?s[n-1]:t[0],n<s.length?s[n]:t[t.length-1]]},a.copy=function(){return ri(t,e)},n()}function oi(t,e,n){function r(e){return n[Math.max(0,Math.min(a,Math.floor(i*(e-t))))]}function o(){return i=n.length/(e-t),a=n.length-1,r}var i,a;return r.domain=function(n){return arguments.length?(t=+n[0],e=+n[n.length-1],o()):[t,e]},r.range=function(t){return arguments.length?(n=t,o()):n},r.invertExtent=function(e){return e=n.indexOf(e),e=0>e?0/0:e/i+t,[e,e+1/i]},r.copy=function(){return oi(t,e,n)},o()}function ii(t,e){function n(n){return n>=n?e[ra.bisect(t,n)]:void 0}return n.domain=function(e){return arguments.length?(t=e,n):t},n.range=function(t){return arguments.length?(e=t,n):e},n.invertExtent=function(n){return n=e.indexOf(n),[t[n-1],t[n]]},n.copy=function(){return ii(t,e)},n}function ai(t){function e(t){return+t}return e.invert=e,e.domain=e.range=function(n){return arguments.length?(t=n.map(e),e):t},e.ticks=function(e){return Jo(t,e)},e.tickFormat=function(e,n){return Zo(t,e,n)},e.copy=function(){return ai(t)},e}function si(){return 0}function ui(t){return t.innerRadius}function li(t){return t.outerRadius}function ci(t){return t.startAngle}function fi(t){return t.endAngle}function di(t){return t&&t.padAngle}function hi(t,e,n,r){return(t-n)*e-(e-r)*t>0?0:1}function pi(t,e,n,r,o){var i=t[0]-e[0],a=t[1]-e[1],s=(o?r:-r)/Math.sqrt(i*i+a*a),u=s*a,l=-s*i,c=t[0]+u,f=t[1]+l,d=e[0]+u,h=e[1]+l,p=(c+d)/2,m=(f+h)/2,g=d-c,v=h-f,y=g*g+v*v,x=n-r,w=c*h-d*f,b=(0>v?-1:1)*Math.sqrt(x*x*y-w*w),_=(w*v-g*b)/y,k=(-w*g-v*b)/y,j=(w*v+g*b)/y,M=(-w*g+v*b)/y,E=_-p,C=k-m,S=j-p,A=M-m;return E*E+C*C>S*S+A*A&&(_=j,k=M),[[_-u,k-l],[_*n/x,k*n/x]]}function mi(t){function e(data){function e(){u.push("M",i(t(l),s))}for(var a,u=[],l=[],c=-1,f=data.length,d=Ct(n),h=Ct(r);++c<f;)o.call(this,a=data[c],c)?l.push([+d.call(this,a,c),+h.call(this,a,c)]):l.length&&(e(),l=[]);return l.length&&e(),u.length?u.join(""):null}var n=An,r=Tn,o=Ae,i=gi,a=i.key,s=.7;return e.x=function(t){return arguments.length?(n=t,e):n},e.y=function(t){return arguments.length?(r=t,e):r},e.defined=function(t){return arguments.length?(o=t,e):o},e.interpolate=function(t){return arguments.length?(a="function"==typeof t?i=t:(i=Su.get(t)||gi).key,e):a},e.tension=function(t){return arguments.length?(s=t,e):s},e}function gi(t){return t.join("L")}function vi(t){return gi(t)+"Z"}function yi(t){for(var e=0,n=t.length,r=t[0],o=[r[0],",",r[1]];++e<n;)o.push("H",(r[0]+(r=t[e])[0])/2,"V",r[1]);return n>1&&o.push("H",r[0]),o.join("")}function xi(t){for(var e=0,n=t.length,r=t[0],o=[r[0],",",r[1]];++e<n;)o.push("V",(r=t[e])[1],"H",r[0]);return o.join("")}function wi(t){for(var e=0,n=t.length,r=t[0],o=[r[0],",",r[1]];++e<n;)o.push("H",(r=t[e])[0],"V",r[1]);return o.join("")}function bi(t,e){return t.length<4?gi(t):t[1]+ji(t.slice(1,-1),Mi(t,e))}function _i(t,e){return t.length<3?gi(t):t[0]+ji((t.push(t[0]),t),Mi([t[t.length-2]].concat(t,[t[1]]),e))}function ki(t,e){return t.length<3?gi(t):t[0]+ji(t,Mi(t,e))}function ji(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return gi(t);var n=t.length!=e.length,r="",o=t[0],i=t[1],a=e[0],s=a,u=1;if(n&&(r+="Q"+(i[0]-2*a[0]/3)+","+(i[1]-2*a[1]/3)+","+i[0]+","+i[1],o=t[1],u=2),e.length>1){s=e[1],i=t[u],u++,r+="C"+(o[0]+a[0])+","+(o[1]+a[1])+","+(i[0]-s[0])+","+(i[1]-s[1])+","+i[0]+","+i[1];for(var l=2;l<e.length;l++,u++)i=t[u],s=e[l],r+="S"+(i[0]-s[0])+","+(i[1]-s[1])+","+i[0]+","+i[1]}if(n){var c=t[u];r+="Q"+(i[0]+2*s[0]/3)+","+(i[1]+2*s[1]/3)+","+c[0]+","+c[1]}return r}function Mi(t,e){for(var n,r=[],o=(1-e)/2,i=t[0],a=t[1],s=1,u=t.length;++s<u;)n=i,i=a,a=t[s],r.push([o*(a[0]-n[0]),o*(a[1]-n[1])]);return r}function Ei(t){if(t.length<3)return gi(t);var e=1,n=t.length,r=t[0],o=r[0],i=r[1],a=[o,o,o,(r=t[1])[0]],s=[i,i,i,r[1]],u=[o,",",i,"L",Ti(Nu,a),",",Ti(Nu,s)];for(t.push(t[n-1]);++e<=n;)r=t[e],a.shift(),a.push(r[0]),s.shift(),s.push(r[1]),Ni(u,a,s);return t.pop(),u.push("L",r),u.join("")}function Ci(t){if(t.length<4)return gi(t);for(var e,n=[],r=-1,o=t.length,i=[0],a=[0];++r<3;)e=t[r],i.push(e[0]),a.push(e[1]);for(n.push(Ti(Nu,i)+","+Ti(Nu,a)),--r;++r<o;)e=t[r],i.shift(),i.push(e[0]),a.shift(),a.push(e[1]),Ni(n,i,a);return n.join("")}function Si(t){for(var e,n,r=-1,o=t.length,i=o+4,a=[],s=[];++r<4;)n=t[r%o],a.push(n[0]),s.push(n[1]);for(e=[Ti(Nu,a),",",Ti(Nu,s)],--r;++r<i;)n=t[r%o],a.shift(),a.push(n[0]),s.shift(),s.push(n[1]),Ni(e,a,s);return e.join("")}function Ai(t,e){var n=t.length-1;if(n)for(var r,o,i=t[0][0],a=t[0][1],s=t[n][0]-i,u=t[n][1]-a,l=-1;++l<=n;)r=t[l],o=l/n,r[0]=e*r[0]+(1-e)*(i+o*s),r[1]=e*r[1]+(1-e)*(a+o*u);return Ei(t)}function Ti(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function Ni(t,e,n){t.push("C",Ti(Au,e),",",Ti(Au,n),",",Ti(Tu,e),",",Ti(Tu,n),",",Ti(Nu,e),",",Ti(Nu,n))}function Oi(t,e){return(e[1]-t[1])/(e[0]-t[0])}function qi(t){for(var e=0,n=t.length-1,r=[],o=t[0],i=t[1],a=r[0]=Oi(o,i);++e<n;)r[e]=(a+(a=Oi(o=i,i=t[e+1])))/2;return r[e]=a,r}function Di(t){for(var e,n,r,o,i=[],a=qi(t),s=-1,u=t.length-1;++s<u;)e=Oi(t[s],t[s+1]),ma(e)<Na?a[s]=a[s+1]=0:(n=a[s]/e,r=a[s+1]/e,o=n*n+r*r,o>9&&(o=3*e/Math.sqrt(o),a[s]=o*n,a[s+1]=o*r));for(s=-1;++s<=u;)o=(t[Math.min(u,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+a[s]*a[s])),i.push([o||0,a[s]*o||0]);return i}function Li(t){return t.length<3?gi(t):t[0]+ji(t,Di(t))}function Fi(t){for(var e,n,r,o=-1,i=t.length;++o<i;)e=t[o],n=e[0],r=e[1]-Fa,e[0]=n*Math.cos(r),e[1]=n*Math.sin(r);return t}function zi(t){function e(data){function e(){p.push("M",s(t(g),f),c,l(t(m.reverse()),f),"Z")}for(var u,d,h,p=[],m=[],g=[],v=-1,y=data.length,x=Ct(n),w=Ct(o),b=n===r?function(){return d}:Ct(r),_=o===i?function(){return h}:Ct(i);++v<y;)a.call(this,u=data[v],v)?(m.push([d=+x.call(this,u,v),h=+w.call(this,u,v)]),g.push([+b.call(this,u,v),+_.call(this,u,v)])):m.length&&(e(),m=[],g=[]);return m.length&&e(),p.length?p.join(""):null}var n=An,r=An,o=0,i=Tn,a=Ae,s=gi,u=s.key,l=s,c="L",f=.7;return e.x=function(t){return arguments.length?(n=r=t,e):r},e.x0=function(t){return arguments.length?(n=t,e):n},e.x1=function(t){return arguments.length?(r=t,e):r},e.y=function(t){return arguments.length?(o=i=t,e):i},e.y0=function(t){return arguments.length?(o=t,e):o},e.y1=function(t){return arguments.length?(i=t,e):i},e.defined=function(t){return arguments.length?(a=t,e):a},e.interpolate=function(t){return arguments.length?(u="function"==typeof t?s=t:(s=Su.get(t)||gi).key,l=s.reverse||s,c=s.closed?"M":"L",e):u},e.tension=function(t){return arguments.length?(f=t,e):f},e}function Ri(t){return t.radius}function Pi(t){return[t.x,t.y]}function Ii(t){return function(){var e=t.apply(this,arguments),n=e[0],r=e[1]-Fa;return[n*Math.cos(r),n*Math.sin(r)]}}function Hi(){return 64}function $i(){return"circle"}function Bi(t){var e=Math.sqrt(t/qa);return"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+-e+"A"+e+","+e+" 0 1,1 0,"+e+"Z"}function Vi(t){return function(){var e,n;(e=this[t])&&(n=e[e.active])&&(--e.count?delete e[e.active]:delete this[t],e.active+=.5,n.event&&n.event.interrupt.call(this,this.__data__,n.index))}}function Ui(t,e,n){return wa(t,Ru),t.namespace=e,t.id=n,t}function Wi(t,e,n,r){var o=t.id,i=t.namespace;return V(t,"function"==typeof n?function(t,a,s){t[i][o].tween.set(e,r(n.call(t,t.__data__,a,s)))}:(n=r(n),function(t){t[i][o].tween.set(e,n)}))}function Yi(t){return null==t&&(t=""),function(){this.textContent=t}}function Xi(t){return null==t?"__transition__":"__transition_"+t+"__"}function Ji(t,e,n,r,o){var i=t[n]||(t[n]={active:0,count:0}),a=i[r];if(!a){var s=o.time;a=i[r]={tween:new c,time:s,delay:o.delay,duration:o.duration,ease:o.ease,index:e},o=null,++i.count,ra.timer(function(o){function u(n){if(i.active>r)return c();var o=i[i.active];o&&(--i.count,delete i[i.active],o.event&&o.event.interrupt.call(t,t.__data__,o.index)),i.active=r,a.event&&a.event.start.call(t,t.__data__,e),a.tween.forEach(function(n,r){(r=r.call(t,t.__data__,e))&&m.push(r)}),d=a.ease,f=a.duration,ra.timer(function(){return p.c=l(n||1)?Ae:l,1},0,s)}function l(n){if(i.active!==r)return 1;for(var o=n/f,s=d(o),u=m.length;u>0;)m[--u].call(t,s);return o>=1?(a.event&&a.event.end.call(t,t.__data__,e),c()):void 0}function c(){return--i.count?delete i[r]:delete t[n],1}var f,d,h=a.delay,p=os,m=[];return p.t=h+s,o>=h?u(o-h):void(p.c=u)},0,s)}}function Zi(t,e,n){t.attr("transform",function(t){var r=e(t);return"translate("+(isFinite(r)?r:n(t))+",0)"})}function Ki(t,e,n){t.attr("transform",function(t){var r=e(t);return"translate(0,"+(isFinite(r)?r:n(t))+")"})}function Gi(t){return t.toISOString()}function Qi(t,e,n){function r(e){return t(e)}function o(t,n){var r=t[1]-t[0],o=r/n,i=ra.bisect(Yu,o);return i==Yu.length?[e.year,Xo(t.map(function(t){return t/31536e6}),n)[2]]:i?e[o/Yu[i-1]<Yu[i]/o?i-1:i]:[Zu,Xo(t,n)[2]]}return r.invert=function(e){return ta(t.invert(e))},r.domain=function(e){return arguments.length?(t.domain(e),r):t.domain().map(ta)},r.nice=function(t,e){function n(n){return!isNaN(n)&&!t.range(n,ta(+n+1),e).length}var i=r.domain(),a=Po(i),s=null==t?o(a,10):"number"==typeof t&&o(a,t);return s&&(t=s[0],e=s[1]),r.domain($o(i,e>1?{floor:function(e){for(;n(e=t.floor(e));)e=ta(e-1);return e},ceil:function(e){for(;n(e=t.ceil(e));)e=ta(+e+1);return e}}:t))},r.ticks=function(t,e){var n=Po(r.domain()),i=null==t?o(n,10):"number"==typeof t?o(n,t):!t.range&&[{range:t},e];return i&&(t=i[0],e=i[1]),t.range(n[0],ta(+n[1]+1),1>e?1:e)},r.tickFormat=function(){return n},r.copy=function(){return Qi(t.copy(),e,n)},Wo(r,t)}function ta(t){return new Date(t)}function ea(t){return JSON.parse(t.responseText)}function na(t){var e=aa.createRange();return e.selectNode(aa.body),e.createContextualFragment(t.responseText)}var ra={version:"3.5.5"},oa=[].slice,ia=function(t){return oa.call(t)},aa=this.document;if(aa)try{ia(aa.documentElement.childNodes)[0].nodeType}catch(sa){ia=function(t){for(var e=t.length,n=new Array(e);e--;)n[e]=t[e];return n}}if(Date.now||(Date.now=function(){return+new Date}),aa)try{aa.createElement("DIV").style.setProperty("opacity",0,"")}catch(ua){var la=this.Element.prototype,ca=la.setAttribute,fa=la.setAttributeNS,da=this.CSSStyleDeclaration.prototype,ha=da.setProperty;la.setAttribute=function(t,e){ca.call(this,t,e+"")},la.setAttributeNS=function(t,e,n){fa.call(this,t,e,n+"")},da.setProperty=function(t,e,n){ha.call(this,t,e+"",n)}}ra.ascending=r,ra.descending=function(t,e){return t>e?-1:e>t?1:e>=t?0:0/0},ra.min=function(t,e){var n,r,o=-1,i=t.length;if(1===arguments.length){for(;++o<i;)if(null!=(r=t[o])&&r>=r){n=r;break}for(;++o<i;)null!=(r=t[o])&&n>r&&(n=r)}else{for(;++o<i;)if(null!=(r=e.call(t,t[o],o))&&r>=r){n=r;break}for(;++o<i;)null!=(r=e.call(t,t[o],o))&&n>r&&(n=r)}return n},ra.max=function(t,e){var n,r,o=-1,i=t.length;if(1===arguments.length){for(;++o<i;)if(null!=(r=t[o])&&r>=r){n=r;break}for(;++o<i;)null!=(r=t[o])&&r>n&&(n=r)}else{for(;++o<i;)if(null!=(r=e.call(t,t[o],o))&&r>=r){n=r;break}for(;++o<i;)null!=(r=e.call(t,t[o],o))&&r>n&&(n=r)}return n},ra.extent=function(t,e){var n,r,o,i=-1,a=t.length;if(1===arguments.length){for(;++i<a;)if(null!=(r=t[i])&&r>=r){n=o=r;break}for(;++i<a;)null!=(r=t[i])&&(n>r&&(n=r),r>o&&(o=r))}else{for(;++i<a;)if(null!=(r=e.call(t,t[i],i))&&r>=r){n=o=r;break}for(;++i<a;)null!=(r=e.call(t,t[i],i))&&(n>r&&(n=r),r>o&&(o=r))}return[n,o]},ra.sum=function(t,e){var n,r=0,o=t.length,a=-1;if(1===arguments.length)for(;++a<o;)i(n=+t[a])&&(r+=n);else for(;++a<o;)i(n=+e.call(t,t[a],a))&&(r+=n);return r},ra.mean=function(t,e){var n,r=0,a=t.length,s=-1,u=a;if(1===arguments.length)for(;++s<a;)i(n=o(t[s]))?r+=n:--u;else for(;++s<a;)i(n=o(e.call(t,t[s],s)))?r+=n:--u;return u?r/u:void 0},ra.quantile=function(t,e){var n=(t.length-1)*e+1,r=Math.floor(n),o=+t[r-1],i=n-r;return i?o+i*(t[r]-o):o},ra.median=function(t,e){var n,a=[],s=t.length,u=-1;if(1===arguments.length)for(;++u<s;)i(n=o(t[u]))&&a.push(n);else for(;++u<s;)i(n=o(e.call(t,t[u],u)))&&a.push(n);return a.length?ra.quantile(a.sort(r),.5):void 0},ra.variance=function(t,e){var n,r,a=t.length,s=0,u=0,l=-1,c=0;if(1===arguments.length)for(;++l<a;)i(n=o(t[l]))&&(r=n-s,s+=r/++c,u+=r*(n-s));else for(;++l<a;)i(n=o(e.call(t,t[l],l)))&&(r=n-s,s+=r/++c,u+=r*(n-s));return c>1?u/(c-1):void 0},ra.deviation=function(){var t=ra.variance.apply(this,arguments);return t?Math.sqrt(t):t};var pa=a(r);ra.bisectLeft=pa.left,ra.bisect=ra.bisectRight=pa.right,ra.bisector=function(t){return a(1===t.length?function(e,n){return r(t(e),n)}:t)},ra.shuffle=function(t,e,n){(i=arguments.length)<3&&(n=t.length,2>i&&(e=0));for(var r,o,i=n-e;i;)o=Math.random()*i--|0,r=t[i+e],t[i+e]=t[o+e],t[o+e]=r;return t},ra.permute=function(t,e){for(var n=e.length,r=new Array(n);n--;)r[n]=t[e[n]];return r},ra.pairs=function(t){for(var e,n=0,r=t.length-1,o=t[0],i=new Array(0>r?0:r);r>n;)i[n]=[e=o,o=t[++n]];return i},ra.zip=function(){if(!(r=arguments.length))return[];for(var t=-1,e=ra.min(arguments,s),n=new Array(e);++t<e;)for(var r,o=-1,i=n[t]=new Array(r);++o<r;)i[o]=arguments[o][t];return n},ra.transpose=function(t){return ra.zip.apply(ra,t)},ra.keys=function(t){var e=[];for(var n in t)e.push(n);return e},ra.values=function(t){var e=[];for(var n in t)e.push(t[n]);return e},ra.entries=function(t){var e=[];for(var n in t)e.push({key:n,value:t[n]});return e},ra.merge=function(t){for(var e,n,r,o=t.length,i=-1,a=0;++i<o;)a+=t[i].length;for(n=new Array(a);--o>=0;)for(r=t[o],e=r.length;--e>=0;)n[--a]=r[e];return n};var ma=Math.abs;ra.range=function(t,e,n){if(arguments.length<3&&(n=1,arguments.length<2&&(e=t,t=0)),(e-t)/n===1/0)throw new Error("infinite range");var r,o=[],i=u(ma(n)),a=-1;if(t*=i,e*=i,n*=i,0>n)for(;(r=t+n*++a)>e;)o.push(r/i);else for(;(r=t+n*++a)<e;)o.push(r/i);return o},ra.map=function(t,e){var n=new c;if(t instanceof c)t.forEach(function(t,e){n.set(t,e)});else if(Array.isArray(t)){var r,o=-1,i=t.length;if(1===arguments.length)for(;++o<i;)n.set(o,t[o]);else for(;++o<i;)n.set(e.call(t,r=t[o],o),r)}else for(var a in t)n.set(a,t[a]);return n};var ga="__proto__",va="\x00";l(c,{has:h,get:function(t){return this._[f(t)]},set:function(t,e){return this._[f(t)]=e},remove:p,keys:m,values:function(){var t=[];for(var e in this._)t.push(this._[e]);return t},entries:function(){var t=[];for(var e in this._)t.push({key:d(e),value:this._[e]});return t},size:g,empty:v,forEach:function(t){for(var e in this._)t.call(this,d(e),this._[e])}}),ra.nest=function(){function t(e,a,s){if(s>=i.length)return r?r.call(o,a):n?a.sort(n):a;for(var u,l,f,d,h=-1,p=a.length,m=i[s++],g=new c;++h<p;)(d=g.get(u=m(l=a[h])))?d.push(l):g.set(u,[l]);return e?(l=e(),f=function(n,r){l.set(n,t(e,r,s))}):(l={},f=function(n,r){l[n]=t(e,r,s)}),g.forEach(f),l}function e(t,n){if(n>=i.length)return t;var r=[],o=a[n++];return t.forEach(function(t,o){r.push({key:t,values:e(o,n)})}),o?r.sort(function(t,e){return o(t.key,e.key)}):r}var n,r,o={},i=[],a=[];return o.map=function(e,n){return t(n,e,0)},o.entries=function(n){return e(t(ra.map,n,0),0)},o.key=function(t){return i.push(t),o},o.sortKeys=function(t){return a[i.length-1]=t,o},o.sortValues=function(t){return n=t,o},o.rollup=function(t){return r=t,o},o},ra.set=function(t){var e=new y;if(t)for(var n=0,r=t.length;r>n;++n)e.add(t[n]);return e},l(y,{has:h,add:function(t){return this._[f(t+="")]=!0,t},remove:p,values:m,size:g,empty:v,forEach:function(t){for(var e in this._)t.call(this,d(e))}}),ra.behavior={},ra.rebind=function(t,e){for(var n,r=1,o=arguments.length;++r<o;)t[n=arguments[r]]=w(t,e,e[n]);return t};var ya=["webkit","ms","moz","Moz","o","O"];ra.dispatch=function(){for(var t=new k,e=-1,n=arguments.length;++e<n;)t[arguments[e]]=j(t);return t},k.prototype.on=function(t,e){var n=t.indexOf("."),r="";if(n>=0&&(r=t.slice(n+1),t=t.slice(0,n)),t)return arguments.length<2?this[t].on(r):this[t].on(r,e);if(2===arguments.length){if(null==e)for(t in this)this.hasOwnProperty(t)&&this[t].on(r,null);return this}},ra.event=null,ra.requote=function(t){return t.replace(xa,"\\$&")};var xa=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,wa={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)t[n]=e[n]},ba=function(t,e){return e.querySelector(t)},_a=function(t,e){return e.querySelectorAll(t)},ka=function(t,e){var n=t.matches||t[b(t,"matchesSelector")];return(ka=function(t,e){return n.call(t,e)})(t,e)};"function"==typeof Sizzle&&(ba=function(t,e){return Sizzle(t,e)[0]||null},_a=Sizzle,ka=Sizzle.matchesSelector),ra.selection=function(){return ra.select(aa.documentElement)};var ja=ra.selection.prototype=[];ja.select=function(t){var e,n,r,o,i=[];t=A(t);for(var a=-1,s=this.length;++a<s;){i.push(e=[]),e.parentNode=(r=this[a]).parentNode;for(var u=-1,l=r.length;++u<l;)(o=r[u])?(e.push(n=t.call(o,o.__data__,u,a)),n&&"__data__"in o&&(n.__data__=o.__data__)):e.push(null)}return S(i)},ja.selectAll=function(t){var e,n,r=[];t=T(t);for(var o=-1,i=this.length;++o<i;)for(var a=this[o],s=-1,u=a.length;++s<u;)(n=a[s])&&(r.push(e=ia(t.call(n,n.__data__,s,o))),e.parentNode=n);return S(r)};var Ma={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};ra.ns={prefix:Ma,qualify:function(t){var e=t.indexOf(":"),n=t;return e>=0&&(n=t.slice(0,e),t=t.slice(e+1)),Ma.hasOwnProperty(n)?{space:Ma[n],local:t}:t}},ja.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node();return t=ra.ns.qualify(t),t.local?n.getAttributeNS(t.space,t.local):n.getAttribute(t)}for(e in t)this.each(N(e,t[e]));return this}return this.each(N(t,e))},ja.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node(),r=(t=D(t)).length,o=-1;if(e=n.classList){for(;++o<r;)if(!e.contains(t[o]))return!1}else for(e=n.getAttribute("class");++o<r;)if(!q(t[o]).test(e))return!1;return!0}for(e in t)this.each(L(e,t[e]));return this}return this.each(L(t,e))},ja.style=function(t,e,r){var o=arguments.length;if(3>o){if("string"!=typeof t){2>o&&(e="");for(r in t)this.each(z(r,t[r],e));return this}if(2>o){var i=this.node();return n(i).getComputedStyle(i,null).getPropertyValue(t)}r=""}return this.each(z(t,e,r))},ja.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(R(e,t[e]));return this}return this.each(R(t,e))},ja.text=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent},ja.html=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t;
+
+}):this.node().innerHTML},ja.append=function(t){return t=P(t),this.select(function(){return this.appendChild(t.apply(this,arguments))})},ja.insert=function(t,e){return t=P(t),e=A(e),this.select(function(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)})},ja.remove=function(){return this.each(I)},ja.data=function(t,e){function n(t,n){var r,o,i,a=t.length,f=n.length,d=Math.min(a,f),h=new Array(f),p=new Array(f),m=new Array(a);if(e){var g,v=new c,y=new Array(a);for(r=-1;++r<a;)v.has(g=e.call(o=t[r],o.__data__,r))?m[r]=o:v.set(g,o),y[r]=g;for(r=-1;++r<f;)(o=v.get(g=e.call(n,i=n[r],r)))?o!==!0&&(h[r]=o,o.__data__=i):p[r]=H(i),v.set(g,!0);for(r=-1;++r<a;)v.get(y[r])!==!0&&(m[r]=t[r])}else{for(r=-1;++r<d;)o=t[r],i=n[r],o?(o.__data__=i,h[r]=o):p[r]=H(i);for(;f>r;++r)p[r]=H(n[r]);for(;a>r;++r)m[r]=t[r]}p.update=h,p.parentNode=h.parentNode=m.parentNode=t.parentNode,s.push(p),u.push(h),l.push(m)}var r,o,i=-1,a=this.length;if(!arguments.length){for(t=new Array(a=(r=this[0]).length);++i<a;)(o=r[i])&&(t[i]=o.__data__);return t}var s=U([]),u=S([]),l=S([]);if("function"==typeof t)for(;++i<a;)n(r=this[i],t.call(r,r.parentNode.__data__,i));else for(;++i<a;)n(r=this[i],t);return u.enter=function(){return s},u.exit=function(){return l},u},ja.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")},ja.filter=function(t){var e,n,r,o=[];"function"!=typeof t&&(t=$(t));for(var i=0,a=this.length;a>i;i++){o.push(e=[]),e.parentNode=(n=this[i]).parentNode;for(var s=0,u=n.length;u>s;s++)(r=n[s])&&t.call(r,r.__data__,s,i)&&e.push(r)}return S(o)},ja.order=function(){for(var t=-1,e=this.length;++t<e;)for(var n,r=this[t],o=r.length-1,i=r[o];--o>=0;)(n=r[o])&&(i&&i!==n.nextSibling&&i.parentNode.insertBefore(n,i),i=n);return this},ja.sort=function(t){t=B.apply(this,arguments);for(var e=-1,n=this.length;++e<n;)this[e].sort(t);return this.order()},ja.each=function(t){return V(this,function(e,n,r){t.call(e,e.__data__,n,r)})},ja.call=function(t){var e=ia(arguments);return t.apply(e[0]=this,e),this},ja.empty=function(){return!this.node()},ja.node=function(){for(var t=0,e=this.length;e>t;t++)for(var n=this[t],r=0,o=n.length;o>r;r++){var i=n[r];if(i)return i}return null},ja.size=function(){var t=0;return V(this,function(){++t}),t};var Ea=[];ra.selection.enter=U,ra.selection.enter.prototype=Ea,Ea.append=ja.append,Ea.empty=ja.empty,Ea.node=ja.node,Ea.call=ja.call,Ea.size=ja.size,Ea.select=function(t){for(var e,n,r,o,i,a=[],s=-1,u=this.length;++s<u;){r=(o=this[s]).update,a.push(e=[]),e.parentNode=o.parentNode;for(var l=-1,c=o.length;++l<c;)(i=o[l])?(e.push(r[l]=n=t.call(o.parentNode,i.__data__,l,s)),n.__data__=i.__data__):e.push(null)}return S(a)},Ea.insert=function(t,e){return arguments.length<2&&(e=W(this)),ja.insert.call(this,t,e)},ra.select=function(e){var n;return"string"==typeof e?(n=[ba(e,aa)],n.parentNode=aa.documentElement):(n=[e],n.parentNode=t(e)),S([n])},ra.selectAll=function(t){var e;return"string"==typeof t?(e=ia(_a(t,aa)),e.parentNode=aa.documentElement):(e=t,e.parentNode=null),S([e])},ja.on=function(t,e,n){var r=arguments.length;if(3>r){if("string"!=typeof t){2>r&&(e=!1);for(n in t)this.each(Y(n,t[n],e));return this}if(2>r)return(r=this.node()["__on"+t])&&r._;n=!1}return this.each(Y(t,e,n))};var Ca=ra.map({mouseenter:"mouseover",mouseleave:"mouseout"});aa&&Ca.forEach(function(t){"on"+t in aa&&Ca.remove(t)});var Sa,Aa=0;ra.mouse=function(t){return K(t,E())};var Ta=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;ra.touch=function(t,e,n){if(arguments.length<3&&(n=e,e=E().changedTouches),e)for(var r,o=0,i=e.length;i>o;++o)if((r=e[o]).identifier===n)return K(t,r)},ra.behavior.drag=function(){function t(){this.on("mousedown.drag",i).on("touchstart.drag",a)}function e(t,e,n,i,a){return function(){function s(){var t,n,r=e(d,m);r&&(t=r[0]-x[0],n=r[1]-x[1],p|=t|n,x=r,h({type:"drag",x:r[0]+l[0],y:r[1]+l[1],dx:t,dy:n}))}function u(){e(d,m)&&(v.on(i+g,null).on(a+g,null),y(p&&ra.event.target===f),h({type:"dragend"}))}var l,c=this,f=ra.event.target,d=c.parentNode,h=r.of(c,arguments),p=0,m=t(),g=".drag"+(null==m?"":"-"+m),v=ra.select(n(f)).on(i+g,s).on(a+g,u),y=Z(f),x=e(d,m);o?(l=o.apply(c,arguments),l=[l.x-x[0],l.y-x[1]]):l=[0,0],h({type:"dragstart"})}}var r=C(t,"drag","dragstart","dragend"),o=null,i=e(_,ra.mouse,n,"mousemove","mouseup"),a=e(G,ra.touch,x,"touchmove","touchend");return t.origin=function(e){return arguments.length?(o=e,t):o},ra.rebind(t,r,"on")},ra.touches=function(t,e){return arguments.length<2&&(e=E().touches),e?ia(e).map(function(e){var n=K(t,e);return n.identifier=e.identifier,n}):[]};var Na=1e-6,Oa=Na*Na,qa=Math.PI,Da=2*qa,La=Da-Na,Fa=qa/2,za=qa/180,Ra=180/qa,Pa=Math.SQRT2,Ia=2,Ha=4;ra.interpolateZoom=function(t,e){function n(t){var e=t*y;if(v){var n=ot(m),a=i/(Ia*d)*(n*it(Pa*e+m)-rt(m));return[r+a*l,o+a*c,i*n/ot(Pa*e+m)]}return[r+t*l,o+t*c,i*Math.exp(Pa*e)]}var r=t[0],o=t[1],i=t[2],a=e[0],s=e[1],u=e[2],l=a-r,c=s-o,f=l*l+c*c,d=Math.sqrt(f),h=(u*u-i*i+Ha*f)/(2*i*Ia*d),p=(u*u-i*i-Ha*f)/(2*u*Ia*d),m=Math.log(Math.sqrt(h*h+1)-h),g=Math.log(Math.sqrt(p*p+1)-p),v=g-m,y=(v||Math.log(u/i))/Pa;return n.duration=1e3*y,n},ra.behavior.zoom=function(){function t(t){t.on(N,f).on(Ba+".zoom",h).on("dblclick.zoom",p).on(D,d)}function e(t){return[(t[0]-j.x)/j.k,(t[1]-j.y)/j.k]}function r(t){return[t[0]*j.k+j.x,t[1]*j.k+j.y]}function o(t){j.k=Math.max(S[0],Math.min(S[1],t))}function i(t,e){e=r(e),j.x+=t[0]-e[0],j.y+=t[1]-e[1]}function a(e,n,r,a){e.__chart__={x:j.x,y:j.y,k:j.k},o(Math.pow(2,a)),i(g=n,r),e=ra.select(e),A>0&&(e=e.transition().duration(A)),e.call(t.event)}function s(){b&&b.domain(w.range().map(function(t){return(t-j.x)/j.k}).map(w.invert)),k&&k.domain(_.range().map(function(t){return(t-j.y)/j.k}).map(_.invert))}function u(t){T++||t({type:"zoomstart"})}function l(t){s(),t({type:"zoom",scale:j.k,translate:[j.x,j.y]})}function c(t){--T||t({type:"zoomend"}),g=null}function f(){function t(){f=1,i(ra.mouse(o),h),l(s)}function r(){d.on(O,null).on(q,null),p(f&&ra.event.target===a),c(s)}var o=this,a=ra.event.target,s=L.of(o,arguments),f=0,d=ra.select(n(o)).on(O,t).on(q,r),h=e(ra.mouse(o)),p=Z(o);zu.call(o),u(s)}function d(){function t(){var t=ra.touches(p);return h=j.k,t.forEach(function(t){t.identifier in g&&(g[t.identifier]=e(t))}),t}function n(){var e=ra.event.target;ra.select(e).on(w,r).on(b,s),_.push(e);for(var n=ra.event.changedTouches,o=0,i=n.length;i>o;++o)g[n[o].identifier]=null;var u=t(),l=Date.now();if(1===u.length){if(500>l-x){var c=u[0];a(p,c,g[c.identifier],Math.floor(Math.log(j.k)/Math.LN2)+1),M()}x=l}else if(u.length>1){var c=u[0],f=u[1],d=c[0]-f[0],h=c[1]-f[1];v=d*d+h*h}}function r(){var t,e,n,r,a=ra.touches(p);zu.call(p);for(var s=0,u=a.length;u>s;++s,r=null)if(n=a[s],r=g[n.identifier]){if(e)break;t=n,e=r}if(r){var c=(c=n[0]-t[0])*c+(c=n[1]-t[1])*c,f=v&&Math.sqrt(c/v);t=[(t[0]+n[0])/2,(t[1]+n[1])/2],e=[(e[0]+r[0])/2,(e[1]+r[1])/2],o(f*h)}x=null,i(t,e),l(m)}function s(){if(ra.event.touches.length){for(var e=ra.event.changedTouches,n=0,r=e.length;r>n;++n)delete g[e[n].identifier];for(var o in g)return void t()}ra.selectAll(_).on(y,null),k.on(N,f).on(D,d),E(),c(m)}var h,p=this,m=L.of(p,arguments),g={},v=0,y=".zoom-"+ra.event.changedTouches[0].identifier,w="touchmove"+y,b="touchend"+y,_=[],k=ra.select(p),E=Z(p);n(),u(m),k.on(N,null).on(D,n)}function h(){var t=L.of(this,arguments);y?clearTimeout(y):(m=e(g=v||ra.mouse(this)),zu.call(this),u(t)),y=setTimeout(function(){y=null,c(t)},50),M(),o(Math.pow(2,.002*$a())*j.k),i(g,m),l(t)}function p(){var t=ra.mouse(this),n=Math.log(j.k)/Math.LN2;a(this,t,e(t),ra.event.shiftKey?Math.ceil(n)-1:Math.floor(n)+1)}var m,g,v,y,x,w,b,_,k,j={x:0,y:0,k:1},E=[960,500],S=Va,A=250,T=0,N="mousedown.zoom",O="mousemove.zoom",q="mouseup.zoom",D="touchstart.zoom",L=C(t,"zoomstart","zoom","zoomend");return Ba||(Ba="onwheel"in aa?($a=function(){return-ra.event.deltaY*(ra.event.deltaMode?120:1)},"wheel"):"onmousewheel"in aa?($a=function(){return ra.event.wheelDelta},"mousewheel"):($a=function(){return-ra.event.detail},"MozMousePixelScroll")),t.event=function(t){t.each(function(){var t=L.of(this,arguments),e=j;Lu?ra.select(this).transition().each("start.zoom",function(){j=this.__chart__||{x:0,y:0,k:1},u(t)}).tween("zoom:zoom",function(){var n=E[0],r=E[1],o=g?g[0]:n/2,i=g?g[1]:r/2,a=ra.interpolateZoom([(o-j.x)/j.k,(i-j.y)/j.k,n/j.k],[(o-e.x)/e.k,(i-e.y)/e.k,n/e.k]);return function(e){var r=a(e),s=n/r[2];this.__chart__=j={x:o-r[0]*s,y:i-r[1]*s,k:s},l(t)}}).each("interrupt.zoom",function(){c(t)}).each("end.zoom",function(){c(t)}):(this.__chart__=j,u(t),l(t),c(t))})},t.translate=function(e){return arguments.length?(j={x:+e[0],y:+e[1],k:j.k},s(),t):[j.x,j.y]},t.scale=function(e){return arguments.length?(j={x:j.x,y:j.y,k:+e},s(),t):j.k},t.scaleExtent=function(e){return arguments.length?(S=null==e?Va:[+e[0],+e[1]],t):S},t.center=function(e){return arguments.length?(v=e&&[+e[0],+e[1]],t):v},t.size=function(e){return arguments.length?(E=e&&[+e[0],+e[1]],t):E},t.duration=function(e){return arguments.length?(A=+e,t):A},t.x=function(e){return arguments.length?(b=e,w=e.copy(),j={x:0,y:0,k:1},t):b},t.y=function(e){return arguments.length?(k=e,_=e.copy(),j={x:0,y:0,k:1},t):k},ra.rebind(t,L,"on")};var $a,Ba,Va=[0,1/0];ra.color=st,st.prototype.toString=function(){return this.rgb()+""},ra.hsl=ut;var Ua=ut.prototype=new st;Ua.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),new ut(this.h,this.s,this.l/t)},Ua.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new ut(this.h,this.s,t*this.l)},Ua.rgb=function(){return lt(this.h,this.s,this.l)},ra.hcl=ct;var Wa=ct.prototype=new st;Wa.brighter=function(t){return new ct(this.h,this.c,Math.min(100,this.l+Ya*(arguments.length?t:1)))},Wa.darker=function(t){return new ct(this.h,this.c,Math.max(0,this.l-Ya*(arguments.length?t:1)))},Wa.rgb=function(){return ft(this.h,this.c,this.l).rgb()},ra.lab=dt;var Ya=18,Xa=.95047,Ja=1,Za=1.08883,Ka=dt.prototype=new st;Ka.brighter=function(t){return new dt(Math.min(100,this.l+Ya*(arguments.length?t:1)),this.a,this.b)},Ka.darker=function(t){return new dt(Math.max(0,this.l-Ya*(arguments.length?t:1)),this.a,this.b)},Ka.rgb=function(){return ht(this.l,this.a,this.b)},ra.rgb=yt;var Ga=yt.prototype=new st;Ga.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,n=this.g,r=this.b,o=30;return e||n||r?(e&&o>e&&(e=o),n&&o>n&&(n=o),r&&o>r&&(r=o),new yt(Math.min(255,e/t),Math.min(255,n/t),Math.min(255,r/t))):new yt(o,o,o)},Ga.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),new yt(t*this.r,t*this.g,t*this.b)},Ga.hsl=function(){return kt(this.r,this.g,this.b)},Ga.toString=function(){return"#"+bt(this.r)+bt(this.g)+bt(this.b)};var Qa=ra.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});Qa.forEach(function(t,e){Qa.set(t,xt(e))}),ra.functor=Ct,ra.xhr=St(x),ra.dsv=function(t,e){function n(t,n,i){arguments.length<3&&(i=n,n=null);var a=At(t,e,null==n?r:o(n),i);return a.row=function(t){return arguments.length?a.response(null==(n=t)?r:o(t)):n},a}function r(t){return n.parse(t.responseText)}function o(t){return function(e){return n.parse(e.responseText,t)}}function i(e){return e.map(a).join(t)}function a(t){return s.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}var s=new RegExp('["'+t+"\n]"),u=t.charCodeAt(0);return n.parse=function(t,e){var r;return n.parseRows(t,function(t,n){if(r)return r(t,n-1);var o=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}");r=e?function(t,n){return e(o(t),n)}:o})},n.parseRows=function(t,e){function n(){if(c>=l)return a;if(o)return o=!1,i;var e=c;if(34===t.charCodeAt(e)){for(var n=e;n++<l;)if(34===t.charCodeAt(n)){if(34!==t.charCodeAt(n+1))break;++n}c=n+2;var r=t.charCodeAt(n+1);return 13===r?(o=!0,10===t.charCodeAt(n+2)&&++c):10===r&&(o=!0),t.slice(e+1,n).replace(/""/g,'"')}for(;l>c;){var r=t.charCodeAt(c++),s=1;if(10===r)o=!0;else if(13===r)o=!0,10===t.charCodeAt(c)&&(++c,++s);else if(r!==u)continue;return t.slice(e,c-s)}return t.slice(e)}for(var r,o,i={},a={},s=[],l=t.length,c=0,f=0;(r=n())!==a;){for(var d=[];r!==i&&r!==a;)d.push(r),r=n();e&&null==(d=e(d,f++))||s.push(d)}return s},n.format=function(e){if(Array.isArray(e[0]))return n.formatRows(e);var r=new y,o=[];return e.forEach(function(t){for(var e in t)r.has(e)||o.push(r.add(e))}),[o.map(a).join(t)].concat(e.map(function(e){return o.map(function(t){return a(e[t])}).join(t)})).join("\n")},n.formatRows=function(t){return t.map(i).join("\n")},n},ra.csv=ra.dsv(",","text/csv"),ra.tsv=ra.dsv(" ","text/tab-separated-values");var ts,es,ns,rs,os,is=this[b(this,"requestAnimationFrame")]||function(t){setTimeout(t,17)};ra.timer=function(t,e,n){var r=arguments.length;2>r&&(e=0),3>r&&(n=Date.now());var o=n+e,i={c:t,t:o,f:!1,n:null};es?es.n=i:ts=i,es=i,ns||(rs=clearTimeout(rs),ns=1,is(Ot))},ra.timer.flush=function(){qt(),Dt()},ra.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)};var as=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(Ft);ra.formatPrefix=function(t,e){var n=0;return t&&(0>t&&(t*=-1),e&&(t=ra.round(t,Lt(t,e))),n=1+Math.floor(1e-12+Math.log(t)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((n-1)/3)))),as[8+n/3]};var ss=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,us=ra.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=ra.round(t,Lt(t,e))).toFixed(Math.max(0,Math.min(20,Lt(t*(1+1e-15),e))))}}),ls=ra.time={},cs=Date;Pt.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){fs.setUTCDate.apply(this._,arguments)},setDay:function(){fs.setUTCDay.apply(this._,arguments)},setFullYear:function(){fs.setUTCFullYear.apply(this._,arguments)},setHours:function(){fs.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){fs.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){fs.setUTCMinutes.apply(this._,arguments)},setMonth:function(){fs.setUTCMonth.apply(this._,arguments)},setSeconds:function(){fs.setUTCSeconds.apply(this._,arguments)},setTime:function(){fs.setTime.apply(this._,arguments)}};var fs=Date.prototype;ls.year=It(function(t){return t=ls.day(t),t.setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),ls.years=ls.year.range,ls.years.utc=ls.year.utc.range,ls.day=It(function(t){var e=new cs(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),ls.days=ls.day.range,ls.days.utc=ls.day.utc.range,ls.dayOfYear=function(t){var e=ls.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var n=ls[t]=It(function(t){return(t=ls.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var n=ls.year(t).getDay();return Math.floor((ls.dayOfYear(t)+(n+e)%7)/7)-(n!==e)});ls[t+"s"]=n.range,ls[t+"s"].utc=n.utc.range,ls[t+"OfYear"]=function(t){var n=ls.year(t).getDay();return Math.floor((ls.dayOfYear(t)+(n+e)%7)/7)}}),ls.week=ls.sunday,ls.weeks=ls.sunday.range,ls.weeks.utc=ls.sunday.utc.range,ls.weekOfYear=ls.sundayOfYear;var ds={"-":"",_:" ",0:"0"},hs=/^\s*\d+/,ps=/^%/;ra.locale=function(t){return{numberFormat:zt(t),timeFormat:$t(t)}};var ms=ra.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});ra.format=ms.numberFormat,ra.geo={},le.prototype={s:0,t:0,add:function(t){ce(t,this.t,gs),ce(gs.s,this.s,this),this.s?this.t+=gs.t:this.s=gs.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var gs=new le;ra.geo.stream=function(t,e){t&&vs.hasOwnProperty(t.type)?vs[t.type](t,e):fe(t,e)};var vs={Feature:function(t,e){fe(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,o=n.length;++r<o;)fe(n[r].geometry,e)}},ys={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,o=n.length;++r<o;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){de(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,o=n.length;++r<o;)de(n[r],e,0)},Polygon:function(t,e){he(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,o=n.length;++r<o;)he(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,o=n.length;++r<o;)fe(n[r],e)}};ra.geo.area=function(t){return xs=0,ra.geo.stream(t,bs),xs};var xs,ws=new le,bs={sphere:function(){xs+=4*qa},point:_,lineStart:_,lineEnd:_,polygonStart:function(){ws.reset(),bs.lineStart=pe},polygonEnd:function(){var t=2*ws;xs+=0>t?4*qa+t:t,bs.lineStart=bs.lineEnd=bs.point=_}};ra.geo.bounds=function(){function t(t,e){x.push(w=[c=t,d=t]),f>e&&(f=e),e>h&&(h=e)}function e(e,n){var r=me([e*za,n*za]);if(v){var o=ve(v,r),i=[o[1],-o[0],0],a=ve(i,o);we(a),a=be(a);var u=e-p,l=u>0?1:-1,m=a[0]*Ra*l,g=ma(u)>180;if(g^(m>l*p&&l*e>m)){var y=a[1]*Ra;y>h&&(h=y)}else if(m=(m+360)%360-180,g^(m>l*p&&l*e>m)){var y=-a[1]*Ra;f>y&&(f=y)}else f>n&&(f=n),n>h&&(h=n);g?p>e?s(c,e)>s(c,d)&&(d=e):s(e,d)>s(c,d)&&(c=e):d>=c?(c>e&&(c=e),e>d&&(d=e)):e>p?s(c,e)>s(c,d)&&(d=e):s(e,d)>s(c,d)&&(c=e)}else t(e,n);v=r,p=e}function n(){b.point=e}function r(){w[0]=c,w[1]=d,b.point=t,v=null}function o(t,n){if(v){var r=t-p;y+=ma(r)>180?r+(r>0?360:-360):r}else m=t,g=n;bs.point(t,n),e(t,n)}function i(){bs.lineStart()}function a(){o(m,g),bs.lineEnd(),ma(y)>Na&&(c=-(d=180)),w[0]=c,w[1]=d,v=null}function s(t,e){return(e-=t)<0?e+360:e}function u(t,e){return t[0]-e[0]}function l(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}var c,f,d,h,p,m,g,v,y,x,w,b={point:t,lineStart:n,lineEnd:r,polygonStart:function(){b.point=o,b.lineStart=i,b.lineEnd=a,y=0,bs.polygonStart()},polygonEnd:function(){bs.polygonEnd(),b.point=t,b.lineStart=n,b.lineEnd=r,0>ws?(c=-(d=180),f=-(h=90)):y>Na?h=90:-Na>y&&(f=-90),w[0]=c,w[1]=d}};return function(t){h=d=-(c=f=1/0),x=[],ra.geo.stream(t,b);var e=x.length;if(e){x.sort(u);for(var n,r=1,o=x[0],i=[o];e>r;++r)n=x[r],l(n[0],o)||l(n[1],o)?(s(o[0],n[1])>s(o[0],o[1])&&(o[1]=n[1]),s(n[0],o[1])>s(o[0],o[1])&&(o[0]=n[0])):i.push(o=n);for(var a,n,p=-(1/0),e=i.length-1,r=0,o=i[e];e>=r;o=n,++r)n=i[r],(a=s(o[1],n[0]))>p&&(p=a,c=n[0],d=o[1])}return x=w=null,c===1/0||f===1/0?[[0/0,0/0],[0/0,0/0]]:[[c,f],[d,h]]}}(),ra.geo.centroid=function(t){_s=ks=js=Ms=Es=Cs=Ss=As=Ts=Ns=Os=0,ra.geo.stream(t,qs);var e=Ts,n=Ns,r=Os,o=e*e+n*n+r*r;return Oa>o&&(e=Cs,n=Ss,r=As,Na>ks&&(e=js,n=Ms,r=Es),o=e*e+n*n+r*r,Oa>o)?[0/0,0/0]:[Math.atan2(n,e)*Ra,nt(r/Math.sqrt(o))*Ra]};var _s,ks,js,Ms,Es,Cs,Ss,As,Ts,Ns,Os,qs={sphere:_,point:ke,lineStart:Me,lineEnd:Ee,polygonStart:function(){qs.lineStart=Ce},polygonEnd:function(){qs.lineStart=Me}},Ds=qe(Ae,ze,Pe,[-qa,-qa/2]),Ls=1e9;ra.geo.clipExtent=function(){var t,e,n,r,o,i,a={stream:function(t){return o&&(o.valid=!1),o=i(t),o.valid=!0,o},extent:function(s){return arguments.length?(i=Be(t=+s[0][0],e=+s[0][1],n=+s[1][0],r=+s[1][1]),o&&(o.valid=!1,o=null),a):[[t,e],[n,r]]}};return a.extent([[0,0],[960,500]])},(ra.geo.conicEqualArea=function(){return Ve(Ue)}).raw=Ue,ra.geo.albers=function(){return ra.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},ra.geo.albersUsa=function(){function t(t){var i=t[0],a=t[1];return e=null,n(i,a),e||(r(i,a),e)||o(i,a),e}var e,n,r,o,i=ra.geo.albers(),a=ra.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),s=ra.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(t,n){e=[t,n]}};return t.invert=function(t){var e=i.scale(),n=i.translate(),r=(t[0]-n[0])/e,o=(t[1]-n[1])/e;return(o>=.12&&.234>o&&r>=-.425&&-.214>r?a:o>=.166&&.234>o&&r>=-.214&&-.115>r?s:i).invert(t)},t.stream=function(t){var e=i.stream(t),n=a.stream(t),r=s.stream(t);return{point:function(t,o){e.point(t,o),n.point(t,o),r.point(t,o)},sphere:function(){e.sphere(),n.sphere(),r.sphere()},lineStart:function(){e.lineStart(),n.lineStart(),r.lineStart()},lineEnd:function(){e.lineEnd(),n.lineEnd(),r.lineEnd()},polygonStart:function(){e.polygonStart(),n.polygonStart(),r.polygonStart()},polygonEnd:function(){e.polygonEnd(),n.polygonEnd(),r.polygonEnd()}}},t.precision=function(e){return arguments.length?(i.precision(e),a.precision(e),s.precision(e),t):i.precision()},t.scale=function(e){return arguments.length?(i.scale(e),a.scale(.35*e),s.scale(e),t.translate(i.translate())):i.scale()},t.translate=function(e){if(!arguments.length)return i.translate();var l=i.scale(),c=+e[0],f=+e[1];return n=i.translate(e).clipExtent([[c-.455*l,f-.238*l],[c+.455*l,f+.238*l]]).stream(u).point,r=a.translate([c-.307*l,f+.201*l]).clipExtent([[c-.425*l+Na,f+.12*l+Na],[c-.214*l-Na,f+.234*l-Na]]).stream(u).point,o=s.translate([c-.205*l,f+.212*l]).clipExtent([[c-.214*l+Na,f+.166*l+Na],[c-.115*l-Na,f+.234*l-Na]]).stream(u).point,t},t.scale(1070)};var Fs,zs,Rs,Ps,Is,Hs,$s={point:_,lineStart:_,lineEnd:_,polygonStart:function(){zs=0,$s.lineStart=We},polygonEnd:function(){$s.lineStart=$s.lineEnd=$s.point=_,Fs+=ma(zs/2)}},Bs={point:Ye,lineStart:_,lineEnd:_,polygonStart:_,polygonEnd:_},Vs={point:Ze,lineStart:Ke,lineEnd:Ge,polygonStart:function(){Vs.lineStart=Qe},polygonEnd:function(){Vs.point=Ze,Vs.lineStart=Ke,Vs.lineEnd=Ge}};ra.geo.path=function(){function t(t){return t&&("function"==typeof s&&i.pointRadius(+s.apply(this,arguments)),a&&a.valid||(a=o(i)),ra.geo.stream(t,a)),i.result()}function e(){return a=null,t}var n,r,o,i,a,s=4.5;return t.area=function(t){return Fs=0,ra.geo.stream(t,o($s)),Fs},t.centroid=function(t){return js=Ms=Es=Cs=Ss=As=Ts=Ns=Os=0,ra.geo.stream(t,o(Vs)),Os?[Ts/Os,Ns/Os]:As?[Cs/As,Ss/As]:Es?[js/Es,Ms/Es]:[0/0,0/0]},t.bounds=function(t){return Is=Hs=-(Rs=Ps=1/0),ra.geo.stream(t,o(Bs)),[[Rs,Ps],[Is,Hs]]},t.projection=function(t){return arguments.length?(o=(n=t)?t.stream||nn(t):x,e()):n},t.context=function(t){return arguments.length?(i=null==(r=t)?new Xe:new tn(t),"function"!=typeof s&&i.pointRadius(s),e()):r},t.pointRadius=function(e){return arguments.length?(s="function"==typeof e?e:(i.pointRadius(+e),+e),t):s},t.projection(ra.geo.albersUsa()).context(null)},ra.geo.transform=function(t){return{stream:function(e){var n=new rn(e);for(var r in t)n[r]=t[r];return n}}},rn.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},ra.geo.projection=an,ra.geo.projectionMutator=sn,(ra.geo.equirectangular=function(){return an(ln)}).raw=ln.invert=ln,ra.geo.rotation=function(t){function e(e){return e=t(e[0]*za,e[1]*za),e[0]*=Ra,e[1]*=Ra,e}return t=fn(t[0]%360*za,t[1]*za,t.length>2?t[2]*za:0),e.invert=function(e){return e=t.invert(e[0]*za,e[1]*za),e[0]*=Ra,e[1]*=Ra,e},e},cn.invert=ln,ra.geo.circle=function(){function t(){var t="function"==typeof r?r.apply(this,arguments):r,e=fn(-t[0]*za,-t[1]*za,0).invert,o=[];return n(null,null,1,{point:function(t,n){o.push(t=e(t,n)),t[0]*=Ra,t[1]*=Ra}}),{type:"Polygon",coordinates:[o]}}var e,n,r=[0,0],o=6;return t.origin=function(e){return arguments.length?(r=e,t):r},t.angle=function(r){return arguments.length?(n=mn((e=+r)*za,o*za),t):e},t.precision=function(r){return arguments.length?(n=mn(e*za,(o=+r)*za),t):o},t.angle(90)},ra.geo.distance=function(t,e){var n,r=(e[0]-t[0])*za,o=t[1]*za,i=e[1]*za,a=Math.sin(r),s=Math.cos(r),u=Math.sin(o),l=Math.cos(o),c=Math.sin(i),f=Math.cos(i);return Math.atan2(Math.sqrt((n=f*a)*n+(n=l*c-u*f*s)*n),u*c+l*f*s)},ra.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return ra.range(Math.ceil(i/g)*g,o,g).map(d).concat(ra.range(Math.ceil(l/v)*v,u,v).map(h)).concat(ra.range(Math.ceil(r/p)*p,n,p).filter(function(t){return ma(t%g)>Na}).map(c)).concat(ra.range(Math.ceil(s/m)*m,a,m).filter(function(t){return ma(t%v)>Na}).map(f))}var n,r,o,i,a,s,u,l,c,f,d,h,p=10,m=p,g=90,v=360,y=2.5;return t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[d(i).concat(h(u).slice(1),d(o).reverse().slice(1),h(l).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()},t.majorExtent=function(e){return arguments.length?(i=+e[0][0],o=+e[1][0],l=+e[0][1],u=+e[1][1],i>o&&(e=i,i=o,o=e),l>u&&(e=l,l=u,u=e),t.precision(y)):[[i,l],[o,u]]},t.minorExtent=function(e){return arguments.length?(r=+e[0][0],n=+e[1][0],s=+e[0][1],a=+e[1][1],r>n&&(e=r,r=n,n=e),s>a&&(e=s,s=a,a=e),t.precision(y)):[[r,s],[n,a]]},t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()},t.majorStep=function(e){return arguments.length?(g=+e[0],v=+e[1],t):[g,v]},t.minorStep=function(e){return arguments.length?(p=+e[0],m=+e[1],t):[p,m]},t.precision=function(e){return arguments.length?(y=+e,c=vn(s,a,90),f=yn(r,n,y),d=vn(l,u,90),h=yn(i,o,y),t):y},t.majorExtent([[-180,-90+Na],[180,90-Na]]).minorExtent([[-180,-80-Na],[180,80+Na]])},ra.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[e||r.apply(this,arguments),n||o.apply(this,arguments)]}}var e,n,r=xn,o=wn;return t.distance=function(){return ra.geo.distance(e||r.apply(this,arguments),n||o.apply(this,arguments))},t.source=function(n){return arguments.length?(r=n,e="function"==typeof n?null:n,t):r},t.target=function(e){return arguments.length?(o=e,n="function"==typeof e?null:e,t):o},t.precision=function(){return arguments.length?t:0},t},ra.geo.interpolate=function(t,e){return bn(t[0]*za,t[1]*za,e[0]*za,e[1]*za)},ra.geo.length=function(t){return Us=0,ra.geo.stream(t,Ws),Us};var Us,Ws={sphere:_,point:_,lineStart:_n,lineEnd:_,polygonStart:_,polygonEnd:_},Ys=kn(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(ra.geo.azimuthalEqualArea=function(){return an(Ys)}).raw=Ys;var Xs=kn(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},x);(ra.geo.azimuthalEquidistant=function(){return an(Xs)}).raw=Xs,(ra.geo.conicConformal=function(){return Ve(jn)}).raw=jn,(ra.geo.conicEquidistant=function(){return Ve(Mn)}).raw=Mn;var Js=kn(function(t){return 1/t},Math.atan);(ra.geo.gnomonic=function(){return an(Js)}).raw=Js,En.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Fa]},(ra.geo.mercator=function(){return Cn(En)}).raw=En;var Zs=kn(function(){return 1},Math.asin);(ra.geo.orthographic=function(){return an(Zs)}).raw=Zs;var Ks=kn(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(ra.geo.stereographic=function(){return an(Ks)}).raw=Ks,Sn.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Fa]},(ra.geo.transverseMercator=function(){var t=Cn(Sn),e=t.center,n=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])},t.rotate=function(t){return t?n([t[0],t[1],t.length>2?t[2]+90:90]):(t=n(),[t[0],t[1],t[2]-90])},n([0,0,90])}).raw=Sn,ra.geom={},ra.geom.hull=function(t){function e(data){if(data.length<3)return[];var t,e=Ct(n),o=Ct(r),i=data.length,a=[],s=[];for(t=0;i>t;t++)a.push([+e.call(this,data[t],t),+o.call(this,data[t],t),t]);for(a.sort(On),t=0;i>t;t++)s.push([a[t][0],-a[t][1]]);var u=Nn(a),l=Nn(s),c=l[0]===u[0],f=l[l.length-1]===u[u.length-1],d=[];for(t=u.length-1;t>=0;--t)d.push(data[a[u[t]][2]]);for(t=+c;t<l.length-f;++t)d.push(data[a[l[t]][2]]);return d}var n=An,r=Tn;return arguments.length?e(t):(e.x=function(t){return arguments.length?(n=t,e):n},e.y=function(t){return arguments.length?(r=t,e):r},e)},ra.geom.polygon=function(t){return wa(t,Gs),t};var Gs=ra.geom.polygon.prototype=[];Gs.area=function(){for(var t,e=-1,n=this.length,r=this[n-1],o=0;++e<n;)t=r,r=this[e],o+=t[1]*r[0]-t[0]*r[1];return.5*o},Gs.centroid=function(t){var e,n,r=-1,o=this.length,i=0,a=0,s=this[o-1];for(arguments.length||(t=-1/(6*this.area()));++r<o;)e=s,s=this[r],n=e[0]*s[1]-s[0]*e[1],i+=(e[0]+s[0])*n,a+=(e[1]+s[1])*n;return[i*t,a*t]},Gs.clip=function(t){for(var e,n,r,o,i,a,s=Ln(t),u=-1,l=this.length-Ln(this),c=this[l-1];++u<l;){for(e=t.slice(),t.length=0,o=this[u],i=e[(r=e.length-s)-1],
+n=-1;++n<r;)a=e[n],qn(a,c,o)?(qn(i,c,o)||t.push(Dn(i,a,c,o)),t.push(a)):qn(i,c,o)&&t.push(Dn(i,a,c,o)),i=a;s&&t.push(t[0]),c=o}return t};var Qs,tu,eu,nu,ru,ou=[],iu=[];Bn.prototype.prepare=function(){for(var t,e=this.edges,n=e.length;n--;)t=e[n].edge,t.b&&t.a||e.splice(n,1);return e.sort(Un),e.length},er.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},nr.prototype={insert:function(t,e){var n,r,o;if(t){if(e.P=t,e.N=t.N,t.N&&(t.N.P=e),t.N=e,t.R){for(t=t.R;t.L;)t=t.L;t.L=e}else t.R=e;n=t}else this._?(t=ar(this._),e.P=null,e.N=t,t.P=t.L=e,n=t):(e.P=e.N=null,this._=e,n=null);for(e.L=e.R=null,e.U=n,e.C=!0,t=e;n&&n.C;)r=n.U,n===r.L?(o=r.R,o&&o.C?(n.C=o.C=!1,r.C=!0,t=r):(t===n.R&&(or(this,n),t=n,n=t.U),n.C=!1,r.C=!0,ir(this,r))):(o=r.L,o&&o.C?(n.C=o.C=!1,r.C=!0,t=r):(t===n.L&&(ir(this,n),t=n,n=t.U),n.C=!1,r.C=!0,or(this,r))),n=t.U;this._.C=!1},remove:function(t){t.N&&(t.N.P=t.P),t.P&&(t.P.N=t.N),t.N=t.P=null;var e,n,r,o=t.U,i=t.L,a=t.R;if(n=i?a?ar(a):i:a,o?o.L===t?o.L=n:o.R=n:this._=n,i&&a?(r=n.C,n.C=t.C,n.L=i,i.U=n,n!==a?(o=n.U,n.U=t.U,t=n.R,o.L=t,n.R=a,a.U=n):(n.U=o,o=n,t=n.R)):(r=t.C,t=n),t&&(t.U=o),!r){if(t&&t.C)return void(t.C=!1);do{if(t===this._)break;if(t===o.L){if(e=o.R,e.C&&(e.C=!1,o.C=!0,or(this,o),e=o.R),e.L&&e.L.C||e.R&&e.R.C){e.R&&e.R.C||(e.L.C=!1,e.C=!0,ir(this,e),e=o.R),e.C=o.C,o.C=e.R.C=!1,or(this,o),t=this._;break}}else if(e=o.L,e.C&&(e.C=!1,o.C=!0,ir(this,o),e=o.L),e.L&&e.L.C||e.R&&e.R.C){e.L&&e.L.C||(e.R.C=!1,e.C=!0,or(this,e),e=o.L),e.C=o.C,o.C=e.L.C=!1,ir(this,o),t=this._;break}e.C=!0,t=o,o=o.U}while(!t.C);t&&(t.C=!1)}}},ra.geom.voronoi=function(t){function e(data){var t=new Array(data.length),e=s[0][0],r=s[0][1],o=s[1][0],i=s[1][1];return sr(n(data),s).cells.forEach(function(n,a){var s=n.edges,u=n.site,l=t[a]=s.length?s.map(function(t){var e=t.start();return[e.x,e.y]}):u.x>=e&&u.x<=o&&u.y>=r&&u.y<=i?[[e,i],[o,i],[o,r],[e,r]]:[];l.point=data[a]}),t}function n(data){return data.map(function(t,e){return{x:Math.round(i(t,e)/Na)*Na,y:Math.round(a(t,e)/Na)*Na,i:e}})}var r=An,o=Tn,i=r,a=o,s=au;return t?e(t):(e.links=function(data){return sr(n(data)).edges.filter(function(t){return t.l&&t.r}).map(function(t){return{source:data[t.l.i],target:data[t.r.i]}})},e.triangles=function(data){var t=[];return sr(n(data)).cells.forEach(function(e,n){for(var r,o,i=e.site,a=e.edges.sort(Un),s=-1,u=a.length,l=a[u-1].edge,c=l.l===i?l.r:l.l;++s<u;)r=l,o=c,l=a[s].edge,c=l.l===i?l.r:l.l,n<o.i&&n<c.i&&lr(i,o,c)<0&&t.push([data[n],data[o.i],data[c.i]])}),t},e.x=function(t){return arguments.length?(i=Ct(r=t),e):r},e.y=function(t){return arguments.length?(a=Ct(o=t),e):o},e.clipExtent=function(t){return arguments.length?(s=null==t?au:t,e):s===au?null:s},e.size=function(t){return arguments.length?e.clipExtent(t&&[[0,0],t]):s===au?null:s&&s[1]},e)};var au=[[-1e6,-1e6],[1e6,1e6]];ra.geom.delaunay=function(t){return ra.geom.voronoi().triangles(t)},ra.geom.quadtree=function(t,e,n,r,o){function i(data){function t(t,e,n,r,o,a,s,u){if(!isNaN(n)&&!isNaN(r))if(t.leaf){var l=t.x,c=t.y;if(null!=l)if(ma(l-n)+ma(c-r)<.01)i(t,e,n,r,o,a,s,u);else{var f=t.point;t.x=t.y=t.point=null,i(t,f,l,c,o,a,s,u),i(t,e,n,r,o,a,s,u)}else t.x=n,t.y=r,t.point=e}else i(t,e,n,r,o,a,s,u)}function i(e,n,r,o,i,a,s,u){var l=.5*(i+s),c=.5*(a+u),f=r>=l,d=o>=c,h=d<<1|f;e.leaf=!1,e=e.nodes[h]||(e.nodes[h]=dr()),f?i=l:s=l,d?a=c:u=c,t(e,n,r,o,i,a,s,u)}var l,c,f,d,h,p,m,g,v,y=Ct(s),x=Ct(u);if(null!=e)p=e,m=n,g=r,v=o;else if(g=v=-(p=m=1/0),c=[],f=[],h=data.length,a)for(d=0;h>d;++d)l=data[d],l.x<p&&(p=l.x),l.y<m&&(m=l.y),l.x>g&&(g=l.x),l.y>v&&(v=l.y),c.push(l.x),f.push(l.y);else for(d=0;h>d;++d){var w=+y(l=data[d],d),b=+x(l,d);p>w&&(p=w),m>b&&(m=b),w>g&&(g=w),b>v&&(v=b),c.push(w),f.push(b)}var _=g-p,k=v-m;_>k?v=m+_:g=p+k;var j=dr();if(j.add=function(e){t(j,e,+y(e,++d),+x(e,d),p,m,g,v)},j.visit=function(t){hr(t,j,p,m,g,v)},j.find=function(t){return pr(j,t[0],t[1],p,m,g,v)},d=-1,null==e){for(;++d<h;)t(j,data[d],c[d],f[d],p,m,g,v);--d}else data.forEach(j.add);return c=f=data=l=null,j}var a,s=An,u=Tn;return(a=arguments.length)?(s=cr,u=fr,3===a&&(o=n,r=e,n=e=0),i(t)):(i.x=function(t){return arguments.length?(s=t,i):s},i.y=function(t){return arguments.length?(u=t,i):u},i.extent=function(t){return arguments.length?(null==t?e=n=r=o=null:(e=+t[0][0],n=+t[0][1],r=+t[1][0],o=+t[1][1]),i):null==e?null:[[e,n],[r,o]]},i.size=function(t){return arguments.length?(null==t?e=n=r=o=null:(e=n=0,r=+t[0],o=+t[1]),i):null==e?null:[r-e,o-n]},i)},ra.interpolateRgb=mr,ra.interpolateObject=gr,ra.interpolateNumber=vr,ra.interpolateString=yr;var su=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,uu=new RegExp(su.source,"g");ra.interpolate=xr,ra.interpolators=[function(t,e){var n=typeof e;return("string"===n?Qa.has(e)||/^(#|rgb\(|hsl\()/.test(e)?mr:yr:e instanceof st?mr:Array.isArray(e)?wr:"object"===n&&isNaN(e)?gr:vr)(t,e)}],ra.interpolateArray=wr;var lu=function(){return x},cu=ra.map({linear:lu,poly:Cr,quad:function(){return jr},cubic:function(){return Mr},sin:function(){return Sr},exp:function(){return Ar},circle:function(){return Tr},elastic:Nr,back:Or,bounce:function(){return qr}}),fu=ra.map({"in":x,out:_r,"in-out":kr,"out-in":function(t){return kr(_r(t))}});ra.ease=function(t){var e=t.indexOf("-"),n=e>=0?t.slice(0,e):t,r=e>=0?t.slice(e+1):"in";return n=cu.get(n)||lu,r=fu.get(r)||x,br(r(n.apply(null,oa.call(arguments,1))))},ra.interpolateHcl=Dr,ra.interpolateHsl=Lr,ra.interpolateLab=Fr,ra.interpolateRound=zr,ra.transform=function(t){var e=aa.createElementNS(ra.ns.prefix.svg,"g");return(ra.transform=function(t){if(null!=t){e.setAttribute("transform",t);var n=e.transform.baseVal.consolidate()}return new Rr(n?n.matrix:du)})(t)},Rr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var du={a:1,b:0,c:0,d:1,e:0,f:0};ra.interpolateTransform=$r,ra.layout={},ra.layout.bundle=function(){return function(t){for(var e=[],n=-1,r=t.length;++n<r;)e.push(Ur(t[n]));return e}},ra.layout.chord=function(){function t(){var t,l,f,d,h,p={},m=[],g=ra.range(i),v=[];for(n=[],r=[],t=0,d=-1;++d<i;){for(l=0,h=-1;++h<i;)l+=o[d][h];m.push(l),v.push(ra.range(i)),t+=l}for(a&&g.sort(function(t,e){return a(m[t],m[e])}),s&&v.forEach(function(t,e){t.sort(function(t,n){return s(o[e][t],o[e][n])})}),t=(Da-c*i)/t,l=0,d=-1;++d<i;){for(f=l,h=-1;++h<i;){var y=g[d],x=v[y][h],w=o[y][x],b=l,_=l+=w*t;p[y+"-"+x]={index:y,subindex:x,startAngle:b,endAngle:_,value:w}}r[y]={index:y,startAngle:f,endAngle:l,value:(l-f)/t},l+=c}for(d=-1;++d<i;)for(h=d-1;++h<i;){var k=p[d+"-"+h],j=p[h+"-"+d];(k.value||j.value)&&n.push(k.value<j.value?{source:j,target:k}:{source:k,target:j})}u&&e()}function e(){n.sort(function(t,e){return u((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)})}var n,r,o,i,a,s,u,l={},c=0;return l.matrix=function(t){return arguments.length?(i=(o=t)&&o.length,n=r=null,l):o},l.padding=function(t){return arguments.length?(c=t,n=r=null,l):c},l.sortGroups=function(t){return arguments.length?(a=t,n=r=null,l):a},l.sortSubgroups=function(t){return arguments.length?(s=t,n=null,l):s},l.sortChords=function(t){return arguments.length?(u=t,n&&e(),l):u},l.chords=function(){return n||t(),n},l.groups=function(){return r||t(),r},l},ra.layout.force=function(){function t(t){return function(e,n,r,o){if(e.point!==t){var i=e.cx-t.x,a=e.cy-t.y,s=o-n,u=i*i+a*a;if(u>s*s/g){if(p>u){var l=e.charge/u;t.px-=i*l,t.py-=a*l}return!0}if(e.point&&u&&p>u){var l=e.pointCharge/u;t.px-=i*l,t.py-=a*l}}return!e.charge}}function e(t){t.px=ra.event.x,t.py=ra.event.y,s.resume()}var n,r,o,i,a,s={},u=ra.dispatch("start","tick","end"),l=[1,1],c=.9,f=hu,d=pu,h=-30,p=mu,m=.1,g=.64,v=[],y=[];return s.tick=function(){if((r*=.99)<.005)return u.end({type:"end",alpha:r=0}),!0;var e,n,s,f,d,p,g,x,w,b=v.length,_=y.length;for(n=0;_>n;++n)s=y[n],f=s.source,d=s.target,x=d.x-f.x,w=d.y-f.y,(p=x*x+w*w)&&(p=r*i[n]*((p=Math.sqrt(p))-o[n])/p,x*=p,w*=p,d.x-=x*(g=f.weight/(d.weight+f.weight)),d.y-=w*g,f.x+=x*(g=1-g),f.y+=w*g);if((g=r*m)&&(x=l[0]/2,w=l[1]/2,n=-1,g))for(;++n<b;)s=v[n],s.x+=(x-s.x)*g,s.y+=(w-s.y)*g;if(h)for(Gr(e=ra.geom.quadtree(v),r,a),n=-1;++n<b;)(s=v[n]).fixed||e.visit(t(s));for(n=-1;++n<b;)s=v[n],s.fixed?(s.x=s.px,s.y=s.py):(s.x-=(s.px-(s.px=s.x))*c,s.y-=(s.py-(s.py=s.y))*c);u.tick({type:"tick",alpha:r})},s.nodes=function(t){return arguments.length?(v=t,s):v},s.links=function(t){return arguments.length?(y=t,s):y},s.size=function(t){return arguments.length?(l=t,s):l},s.linkDistance=function(t){return arguments.length?(f="function"==typeof t?t:+t,s):f},s.distance=s.linkDistance,s.linkStrength=function(t){return arguments.length?(d="function"==typeof t?t:+t,s):d},s.friction=function(t){return arguments.length?(c=+t,s):c},s.charge=function(t){return arguments.length?(h="function"==typeof t?t:+t,s):h},s.chargeDistance=function(t){return arguments.length?(p=t*t,s):Math.sqrt(p)},s.gravity=function(t){return arguments.length?(m=+t,s):m},s.theta=function(t){return arguments.length?(g=t*t,s):Math.sqrt(g)},s.alpha=function(t){return arguments.length?(t=+t,r?r=t>0?t:0:t>0&&(u.start({type:"start",alpha:r=t}),ra.timer(s.tick)),s):r},s.start=function(){function t(t,r){if(!n){for(n=new Array(u),s=0;u>s;++s)n[s]=[];for(s=0;c>s;++s){var o=y[s];n[o.source.index].push(o.target),n[o.target.index].push(o.source)}}for(var i,a=n[e],s=-1,l=a.length;++s<l;)if(!isNaN(i=a[s][t]))return i;return Math.random()*r}var e,n,r,u=v.length,c=y.length,p=l[0],m=l[1];for(e=0;u>e;++e)(r=v[e]).index=e,r.weight=0;for(e=0;c>e;++e)r=y[e],"number"==typeof r.source&&(r.source=v[r.source]),"number"==typeof r.target&&(r.target=v[r.target]),++r.source.weight,++r.target.weight;for(e=0;u>e;++e)r=v[e],isNaN(r.x)&&(r.x=t("x",p)),isNaN(r.y)&&(r.y=t("y",m)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(o=[],"function"==typeof f)for(e=0;c>e;++e)o[e]=+f.call(this,y[e],e);else for(e=0;c>e;++e)o[e]=f;if(i=[],"function"==typeof d)for(e=0;c>e;++e)i[e]=+d.call(this,y[e],e);else for(e=0;c>e;++e)i[e]=d;if(a=[],"function"==typeof h)for(e=0;u>e;++e)a[e]=+h.call(this,v[e],e);else for(e=0;u>e;++e)a[e]=h;return s.resume()},s.resume=function(){return s.alpha(.1)},s.stop=function(){return s.alpha(0)},s.drag=function(){return n||(n=ra.behavior.drag().origin(x).on("dragstart.force",Xr).on("drag.force",e).on("dragend.force",Jr)),arguments.length?void this.on("mouseover.force",Zr).on("mouseout.force",Kr).call(n):n},ra.rebind(s,u,"on")};var hu=20,pu=1,mu=1/0;ra.layout.hierarchy=function(){function t(o){var i,a=[o],s=[];for(o.depth=0;null!=(i=a.pop());)if(s.push(i),(l=n.call(t,i,i.depth))&&(u=l.length)){for(var u,l,c;--u>=0;)a.push(c=l[u]),c.parent=i,c.depth=i.depth+1;r&&(i.value=0),i.children=l}else r&&(i.value=+r.call(t,i,i.depth)||0),delete i.children;return eo(o,function(t){var n,o;e&&(n=t.children)&&n.sort(e),r&&(o=t.parent)&&(o.value+=t.value)}),s}var e=oo,n=no,r=ro;return t.sort=function(n){return arguments.length?(e=n,t):e},t.children=function(e){return arguments.length?(n=e,t):n},t.value=function(e){return arguments.length?(r=e,t):r},t.revalue=function(e){return r&&(to(e,function(t){t.children&&(t.value=0)}),eo(e,function(e){var n;e.children||(e.value=+r.call(t,e,e.depth)||0),(n=e.parent)&&(n.value+=e.value)})),e},t},ra.layout.partition=function(){function t(e,n,r,o){var i=e.children;if(e.x=n,e.y=e.depth*o,e.dx=r,e.dy=o,i&&(a=i.length)){var a,s,u,l=-1;for(r=e.value?r/e.value:0;++l<a;)t(s=i[l],n,u=s.value*r,o),n+=u}}function e(t){var n=t.children,r=0;if(n&&(o=n.length))for(var o,i=-1;++i<o;)r=Math.max(r,e(n[i]));return 1+r}function n(n,i){var a=r.call(this,n,i);return t(a[0],0,o[0],o[1]/e(a[0])),a}var r=ra.layout.hierarchy(),o=[1,1];return n.size=function(t){return arguments.length?(o=t,n):o},Qr(n,r)},ra.layout.pie=function(){function t(data){var a,s=data.length,u=data.map(function(n,r){return+e.call(t,n,r)}),l=+("function"==typeof r?r.apply(this,arguments):r),c=("function"==typeof o?o.apply(this,arguments):o)-l,f=Math.min(Math.abs(c)/s,+("function"==typeof i?i.apply(this,arguments):i)),d=f*(0>c?-1:1),h=(c-s*d)/ra.sum(u),p=ra.range(s),m=[];return null!=n&&p.sort(n===gu?function(t,e){return u[e]-u[t]}:function(t,e){return n(data[t],data[e])}),p.forEach(function(t){m[t]={data:data[t],value:a=u[t],startAngle:l,endAngle:l+=a*h+d,padAngle:f}}),m}var e=Number,n=gu,r=0,o=Da,i=0;return t.value=function(n){return arguments.length?(e=n,t):e},t.sort=function(e){return arguments.length?(n=e,t):n},t.startAngle=function(e){return arguments.length?(r=e,t):r},t.endAngle=function(e){return arguments.length?(o=e,t):o},t.padAngle=function(e){return arguments.length?(i=e,t):i},t};var gu={};ra.layout.stack=function(){function t(data,s){if(!(f=data.length))return data;var u=data.map(function(n,r){return e.call(t,n,r)}),l=u.map(function(e){return e.map(function(e,n){return[i.call(t,e,n),a.call(t,e,n)]})}),c=n.call(t,l,s);u=ra.permute(u,c),l=ra.permute(l,c);var f,d,h,p,m=r.call(t,l,s),g=u[0].length;for(h=0;g>h;++h)for(o.call(t,u[0][h],p=m[h],l[0][h][1]),d=1;f>d;++d)o.call(t,u[d][h],p+=l[d-1][h][1],l[d][h][1]);return data}var e=x,n=lo,r=co,o=uo,i=ao,a=so;return t.values=function(n){return arguments.length?(e=n,t):e},t.order=function(e){return arguments.length?(n="function"==typeof e?e:vu.get(e)||lo,t):n},t.offset=function(e){return arguments.length?(r="function"==typeof e?e:yu.get(e)||co,t):r},t.x=function(e){return arguments.length?(i=e,t):i},t.y=function(e){return arguments.length?(a=e,t):a},t.out=function(e){return arguments.length?(o=e,t):o},t};var vu=ra.map({"inside-out":function(data){var t,e,n=data.length,r=data.map(fo),o=data.map(ho),i=ra.range(n).sort(function(t,e){return r[t]-r[e]}),a=0,s=0,u=[],l=[];for(t=0;n>t;++t)e=i[t],s>a?(a+=o[e],u.push(e)):(s+=o[e],l.push(e));return l.reverse().concat(u)},reverse:function(data){return ra.range(data.length).reverse()},"default":lo}),yu=ra.map({silhouette:function(data){var t,e,n,r=data.length,o=data[0].length,i=[],a=0,s=[];for(e=0;o>e;++e){for(t=0,n=0;r>t;t++)n+=data[t][e][1];n>a&&(a=n),i.push(n)}for(e=0;o>e;++e)s[e]=(a-i[e])/2;return s},wiggle:function(data){var t,e,n,r,o,i,a,s,u,l=data.length,c=data[0],f=c.length,d=[];for(d[0]=s=u=0,e=1;f>e;++e){for(t=0,r=0;l>t;++t)r+=data[t][e][1];for(t=0,o=0,a=c[e][0]-c[e-1][0];l>t;++t){for(n=0,i=(data[t][e][1]-data[t][e-1][1])/(2*a);t>n;++n)i+=(data[n][e][1]-data[n][e-1][1])/a;o+=i*data[t][e][1]}d[e]=s-=r?o/r*a:0,u>s&&(u=s)}for(e=0;f>e;++e)d[e]-=u;return d},expand:function(data){var t,e,n,r=data.length,o=data[0].length,i=1/r,a=[];for(e=0;o>e;++e){for(t=0,n=0;r>t;t++)n+=data[t][e][1];if(n)for(t=0;r>t;t++)data[t][e][1]/=n;else for(t=0;r>t;t++)data[t][e][1]=i}for(e=0;o>e;++e)a[e]=0;return a},zero:co});ra.layout.histogram=function(){function t(data,t){for(var i,a,s=[],u=data.map(n,this),l=r.call(this,u,t),c=o.call(this,l,u,t),t=-1,f=u.length,d=c.length-1,h=e?1:1/f;++t<d;)i=s[t]=[],i.dx=c[t+1]-(i.x=c[t]),i.y=0;if(d>0)for(t=-1;++t<f;)a=u[t],a>=l[0]&&a<=l[1]&&(i=s[ra.bisect(c,a,1,d)-1],i.y+=h,i.push(data[t]));return s}var e=!0,n=Number,r=vo,o=mo;return t.value=function(e){return arguments.length?(n=e,t):n},t.range=function(e){return arguments.length?(r=Ct(e),t):r},t.bins=function(e){return arguments.length?(o="number"==typeof e?function(t){return go(t,e)}:Ct(e),t):o},t.frequency=function(n){return arguments.length?(e=!!n,t):e},t},ra.layout.pack=function(){function t(t,i){var a=n.call(this,t,i),s=a[0],u=o[0],l=o[1],c=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,eo(s,function(t){t.r=+c(t.value)}),eo(s,_o),r){var f=r*(e?1:Math.max(2*s.r/u,2*s.r/l))/2;eo(s,function(t){t.r+=f}),eo(s,_o),eo(s,function(t){t.r-=f})}return Mo(s,u/2,l/2,e?1:1/Math.max(2*s.r/u,2*s.r/l)),a}var e,n=ra.layout.hierarchy().sort(yo),r=0,o=[1,1];return t.size=function(e){return arguments.length?(o=e,t):o},t.radius=function(n){return arguments.length?(e=null==n||"function"==typeof n?n:+n,t):e},t.padding=function(e){return arguments.length?(r=+e,t):r},Qr(t,n)},ra.layout.tree=function(){function t(t,o){var c=a.call(this,t,o),f=c[0],d=e(f);if(eo(d,n),d.parent.m=-d.z,to(d,r),l)to(f,i);else{var h=f,p=f,m=f;to(f,function(t){t.x<h.x&&(h=t),t.x>p.x&&(p=t),t.depth>m.depth&&(m=t)});var g=s(h,p)/2-h.x,v=u[0]/(p.x+s(p,h)/2+g),y=u[1]/(m.depth||1);to(f,function(t){t.x=(t.x+g)*v,t.y=t.depth*y})}return c}function e(t){for(var e,n={A:null,children:[t]},r=[n];null!=(e=r.pop());)for(var o,i=e.children,a=0,s=i.length;s>a;++a)r.push((i[a]=o={_:i[a],parent:e,children:(o=i[a].children)&&o.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:a}).a=o);return n.children[0]}function n(t){var e=t.children,n=t.parent.children,r=t.i?n[t.i-1]:null;if(e.length){No(t);var i=(e[0].z+e[e.length-1].z)/2;r?(t.z=r.z+s(t._,r._),t.m=t.z-i):t.z=i}else r&&(t.z=r.z+s(t._,r._));t.parent.A=o(t,r,t.parent.A||n[0])}function r(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function o(t,e,n){if(e){for(var r,o=t,i=t,a=e,u=o.parent.children[0],l=o.m,c=i.m,f=a.m,d=u.m;a=Ao(a),o=So(o),a&&o;)u=So(u),i=Ao(i),i.a=t,r=a.z+f-o.z-l+s(a._,o._),r>0&&(To(Oo(a,t,n),t,r),l+=r,c+=r),f+=a.m,l+=o.m,d+=u.m,c+=i.m;a&&!Ao(i)&&(i.t=a,i.m+=f-c),o&&!So(u)&&(u.t=o,u.m+=l-d,n=t)}return n}function i(t){t.x*=u[0],t.y=t.depth*u[1]}var a=ra.layout.hierarchy().sort(null).value(null),s=Co,u=[1,1],l=null;return t.separation=function(e){return arguments.length?(s=e,t):s},t.size=function(e){return arguments.length?(l=null==(u=e)?i:null,t):l?null:u},t.nodeSize=function(e){return arguments.length?(l=null==(u=e)?null:i,t):l?u:null},Qr(t,a)},ra.layout.cluster=function(){function t(t,i){var a,s=e.call(this,t,i),u=s[0],l=0;eo(u,function(t){var e=t.children;e&&e.length?(t.x=Do(e),t.y=qo(e)):(t.x=a?l+=n(t,a):0,t.y=0,a=t)});var c=Lo(u),f=Fo(u),d=c.x-n(c,f)/2,h=f.x+n(f,c)/2;return eo(u,o?function(t){t.x=(t.x-u.x)*r[0],t.y=(u.y-t.y)*r[1]}:function(t){t.x=(t.x-d)/(h-d)*r[0],t.y=(1-(u.y?t.y/u.y:1))*r[1]}),s}var e=ra.layout.hierarchy().sort(null).value(null),n=Co,r=[1,1],o=!1;return t.separation=function(e){return arguments.length?(n=e,t):n},t.size=function(e){return arguments.length?(o=null==(r=e),t):o?null:r},t.nodeSize=function(e){return arguments.length?(o=null!=(r=e),t):o?r:null},Qr(t,e)},ra.layout.treemap=function(){function t(t,e){for(var n,r,o=-1,i=t.length;++o<i;)r=(n=t[o]).value*(0>e?0:e),n.area=isNaN(r)||0>=r?0:r}function e(n){var i=n.children;if(i&&i.length){var a,s,u,l=f(n),c=[],d=i.slice(),p=1/0,m="slice"===h?l.dx:"dice"===h?l.dy:"slice-dice"===h?1&n.depth?l.dy:l.dx:Math.min(l.dx,l.dy);for(t(d,l.dx*l.dy/n.value),c.area=0;(u=d.length)>0;)c.push(a=d[u-1]),c.area+=a.area,"squarify"!==h||(s=r(c,m))<=p?(d.pop(),p=s):(c.area-=c.pop().area,o(c,m,l,!1),m=Math.min(l.dx,l.dy),c.length=c.area=0,p=1/0);c.length&&(o(c,m,l,!0),c.length=c.area=0),i.forEach(e)}}function n(e){var r=e.children;if(r&&r.length){var i,a=f(e),s=r.slice(),u=[];for(t(s,a.dx*a.dy/e.value),u.area=0;i=s.pop();)u.push(i),u.area+=i.area,null!=i.z&&(o(u,i.z?a.dx:a.dy,a,!s.length),u.length=u.area=0);r.forEach(n)}}function r(t,e){for(var n,r=t.area,o=0,i=1/0,a=-1,s=t.length;++a<s;)(n=t[a].area)&&(i>n&&(i=n),n>o&&(o=n));return r*=r,e*=e,r?Math.max(e*o*p/r,r/(e*i*p)):1/0}function o(t,e,n,r){var o,i=-1,a=t.length,s=n.x,l=n.y,c=e?u(t.area/e):0;if(e==n.dx){for((r||c>n.dy)&&(c=n.dy);++i<a;)o=t[i],o.x=s,o.y=l,o.dy=c,s+=o.dx=Math.min(n.x+n.dx-s,c?u(o.area/c):0);o.z=!0,o.dx+=n.x+n.dx-s,n.y+=c,n.dy-=c}else{for((r||c>n.dx)&&(c=n.dx);++i<a;)o=t[i],o.x=s,o.y=l,o.dx=c,l+=o.dy=Math.min(n.y+n.dy-l,c?u(o.area/c):0);o.z=!1,o.dy+=n.y+n.dy-l,n.x+=c,n.dx-=c}}function i(r){var o=a||s(r),i=o[0];return i.x=0,i.y=0,i.dx=l[0],i.dy=l[1],a&&s.revalue(i),t([i],i.dx*i.dy/i.value),(a?n:e)(i),d&&(a=o),o}var a,s=ra.layout.hierarchy(),u=Math.round,l=[1,1],c=null,f=zo,d=!1,h="squarify",p=.5*(1+Math.sqrt(5));return i.size=function(t){return arguments.length?(l=t,i):l},i.padding=function(t){function e(e){var n=t.call(i,e,e.depth);return null==n?zo(e):Ro(e,"number"==typeof n?[n,n,n,n]:n)}function n(e){return Ro(e,t)}if(!arguments.length)return c;var r;return f=null==(c=t)?zo:"function"==(r=typeof t)?e:"number"===r?(t=[t,t,t,t],n):n,i},i.round=function(t){return arguments.length?(u=t?Math.round:Number,i):u!=Number},i.sticky=function(t){return arguments.length?(d=t,a=null,i):d},i.ratio=function(t){return arguments.length?(p=t,i):p},i.mode=function(t){return arguments.length?(h=t+"",i):h},Qr(i,s)},ra.random={normal:function(t,e){var n=arguments.length;return 2>n&&(e=1),1>n&&(t=0),function(){var n,r,o;do n=2*Math.random()-1,r=2*Math.random()-1,o=n*n+r*r;while(!o||o>1);return t+e*n*Math.sqrt(-2*Math.log(o)/o)}},logNormal:function(){var t=ra.random.normal.apply(ra,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=ra.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,n=0;t>n;n++)e+=Math.random();return e}}},ra.scale={};var xu={floor:x,ceil:x};ra.scale.linear=function(){return Uo([0,1],[0,1],xr,!1)};var wu={s:1,g:1,p:1,r:1,e:1};ra.scale.log=function(){return Qo(ra.scale.linear().domain([0,1]),10,!0,[1,10])};var bu=ra.format(".0e"),_u={floor:function(t){return-Math.ceil(-t)},ceil:function(t){return-Math.floor(-t)}};ra.scale.pow=function(){return ti(ra.scale.linear(),1,[0,1])},ra.scale.sqrt=function(){return ra.scale.pow().exponent(.5)},ra.scale.ordinal=function(){return ni([],{t:"range",a:[[]]})},ra.scale.category10=function(){return ra.scale.ordinal().range(ku)},ra.scale.category20=function(){return ra.scale.ordinal().range(ju)},ra.scale.category20b=function(){return ra.scale.ordinal().range(Mu)},ra.scale.category20c=function(){return ra.scale.ordinal().range(Eu)};var ku=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(wt),ju=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(wt),Mu=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(wt),Eu=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(wt);ra.scale.quantile=function(){return ri([],[])},ra.scale.quantize=function(){return oi(0,1,[0,1])},ra.scale.threshold=function(){return ii([.5],[0,1])},ra.scale.identity=function(){return ai([0,1])},ra.svg={},ra.svg.arc=function(){function t(){var t=Math.max(0,+n.apply(this,arguments)),l=Math.max(0,+r.apply(this,arguments)),c=a.apply(this,arguments)-Fa,f=s.apply(this,arguments)-Fa,d=Math.abs(f-c),h=c>f?0:1;if(t>l&&(p=l,l=t,t=p),d>=La)return e(l,h)+(t?e(t,1-h):"")+"Z";var p,m,g,v,y,x,w,b,_,k,j,M,E=0,C=0,S=[];if((v=(+u.apply(this,arguments)||0)/2)&&(g=i===Cu?Math.sqrt(t*t+l*l):+i.apply(this,arguments),h||(C*=-1),l&&(C=nt(g/l*Math.sin(v))),t&&(E=nt(g/t*Math.sin(v)))),l){y=l*Math.cos(c+C),x=l*Math.sin(c+C),w=l*Math.cos(f-C),b=l*Math.sin(f-C);var A=Math.abs(f-c-2*C)<=qa?0:1;if(C&&hi(y,x,w,b)===h^A){var T=(c+f)/2;y=l*Math.cos(T),x=l*Math.sin(T),w=b=null}}else y=x=0;if(t){_=t*Math.cos(f-E),k=t*Math.sin(f-E),j=t*Math.cos(c+E),M=t*Math.sin(c+E);var N=Math.abs(c-f+2*E)<=qa?0:1;if(E&&hi(_,k,j,M)===1-h^N){var O=(c+f)/2;_=t*Math.cos(O),k=t*Math.sin(O),j=M=null}}else _=k=0;if((p=Math.min(Math.abs(l-t)/2,+o.apply(this,arguments)))>.001){m=l>t^h?0:1;var q=null==j?[_,k]:null==w?[y,x]:Dn([y,x],[j,M],[w,b],[_,k]),D=y-q[0],L=x-q[1],F=w-q[0],z=b-q[1],R=1/Math.sin(Math.acos((D*F+L*z)/(Math.sqrt(D*D+L*L)*Math.sqrt(F*F+z*z)))/2),P=Math.sqrt(q[0]*q[0]+q[1]*q[1]);if(null!=w){var I=Math.min(p,(l-P)/(R+1)),H=pi(null==j?[_,k]:[j,M],[y,x],l,I,h),$=pi([w,b],[_,k],l,I,h);p===I?S.push("M",H[0],"A",I,",",I," 0 0,",m," ",H[1],"A",l,",",l," 0 ",1-h^hi(H[1][0],H[1][1],$[1][0],$[1][1]),",",h," ",$[1],"A",I,",",I," 0 0,",m," ",$[0]):S.push("M",H[0],"A",I,",",I," 0 1,",m," ",$[0])}else S.push("M",y,",",x);if(null!=j){var B=Math.min(p,(t-P)/(R-1)),V=pi([y,x],[j,M],t,-B,h),U=pi([_,k],null==w?[y,x]:[w,b],t,-B,h);p===B?S.push("L",U[0],"A",B,",",B," 0 0,",m," ",U[1],"A",t,",",t," 0 ",h^hi(U[1][0],U[1][1],V[1][0],V[1][1]),",",1-h," ",V[1],"A",B,",",B," 0 0,",m," ",V[0]):S.push("L",U[0],"A",B,",",B," 0 0,",m," ",V[0])}else S.push("L",_,",",k)}else S.push("M",y,",",x),null!=w&&S.push("A",l,",",l," 0 ",A,",",h," ",w,",",b),S.push("L",_,",",k),null!=j&&S.push("A",t,",",t," 0 ",N,",",1-h," ",j,",",M);return S.push("Z"),S.join("")}function e(t,e){return"M0,"+t+"A"+t+","+t+" 0 1,"+e+" 0,"+-t+"A"+t+","+t+" 0 1,"+e+" 0,"+t}var n=ui,r=li,o=si,i=Cu,a=ci,s=fi,u=di;return t.innerRadius=function(e){return arguments.length?(n=Ct(e),t):n},t.outerRadius=function(e){return arguments.length?(r=Ct(e),t):r},t.cornerRadius=function(e){return arguments.length?(o=Ct(e),t):o},t.padRadius=function(e){return arguments.length?(i=e==Cu?Cu:Ct(e),t):i},t.startAngle=function(e){return arguments.length?(a=Ct(e),t):a},t.endAngle=function(e){return arguments.length?(s=Ct(e),t):s},t.padAngle=function(e){return arguments.length?(u=Ct(e),t):u},t.centroid=function(){var t=(+n.apply(this,arguments)+ +r.apply(this,arguments))/2,e=(+a.apply(this,arguments)+ +s.apply(this,arguments))/2-Fa;return[Math.cos(e)*t,Math.sin(e)*t]},t};var Cu="auto";ra.svg.line=function(){return mi(x)};var Su=ra.map({linear:gi,"linear-closed":vi,step:yi,"step-before":xi,"step-after":wi,basis:Ei,"basis-open":Ci,"basis-closed":Si,bundle:Ai,cardinal:ki,"cardinal-open":bi,"cardinal-closed":_i,monotone:Li});Su.forEach(function(t,e){e.key=t,e.closed=/-closed$/.test(t)});var Au=[0,2/3,1/3,0],Tu=[0,1/3,2/3,0],Nu=[0,1/6,2/3,1/6];ra.svg.line.radial=function(){var t=mi(Fi);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},xi.reverse=wi,wi.reverse=xi,ra.svg.area=function(){return zi(x)},ra.svg.area.radial=function(){var t=zi(Fi);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},ra.svg.chord=function(){function t(t,s){var u=e(this,i,t,s),l=e(this,a,t,s);return"M"+u.p0+r(u.r,u.p1,u.a1-u.a0)+(n(u,l)?o(u.r,u.p1,u.r,u.p0):o(u.r,u.p1,l.r,l.p0)+r(l.r,l.p1,l.a1-l.a0)+o(l.r,l.p1,u.r,u.p0))+"Z"}function e(t,e,n,r){var o=e.call(t,n,r),i=s.call(t,o,r),a=u.call(t,o,r)-Fa,c=l.call(t,o,r)-Fa;return{r:i,a0:a,a1:c,p0:[i*Math.cos(a),i*Math.sin(a)],p1:[i*Math.cos(c),i*Math.sin(c)]}}function n(t,e){return t.a0==e.a0&&t.a1==e.a1}function r(t,e,n){return"A"+t+","+t+" 0 "+ +(n>qa)+",1 "+e}function o(t,e,n,r){return"Q 0,0 "+r}var i=xn,a=wn,s=Ri,u=ci,l=fi;return t.radius=function(e){return arguments.length?(s=Ct(e),t):s},t.source=function(e){return arguments.length?(i=Ct(e),t):i},t.target=function(e){return arguments.length?(a=Ct(e),t):a},t.startAngle=function(e){return arguments.length?(u=Ct(e),t):u},t.endAngle=function(e){return arguments.length?(l=Ct(e),t):l},t},ra.svg.diagonal=function(){function t(t,o){var i=e.call(this,t,o),a=n.call(this,t,o),s=(i.y+a.y)/2,u=[i,{x:i.x,y:s},{x:a.x,y:s},a];return u=u.map(r),"M"+u[0]+"C"+u[1]+" "+u[2]+" "+u[3]}var e=xn,n=wn,r=Pi;return t.source=function(n){return arguments.length?(e=Ct(n),t):e},t.target=function(e){return arguments.length?(n=Ct(e),t):n},t.projection=function(e){return arguments.length?(r=e,t):r},t},ra.svg.diagonal.radial=function(){var t=ra.svg.diagonal(),e=Pi,n=t.projection;return t.projection=function(t){return arguments.length?n(Ii(e=t)):e},t},ra.svg.symbol=function(){function t(t,r){return(Ou.get(e.call(this,t,r))||Bi)(n.call(this,t,r))}var e=$i,n=Hi;return t.type=function(n){return arguments.length?(e=Ct(n),t):e},t.size=function(e){return arguments.length?(n=Ct(e),t):n},t};var Ou=ra.map({circle:Bi,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*Du)),n=e*Du;return"M0,"+-e+"L"+n+",0 0,"+e+" "+-n+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/qu),n=e*qu/2;return"M0,"+n+"L"+e+","+-n+" "+-e+","+-n+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/qu),n=e*qu/2;return"M0,"+-n+"L"+e+","+n+" "+-e+","+n+"Z"}});ra.svg.symbolTypes=Ou.keys();var qu=Math.sqrt(3),Du=Math.tan(30*za);ja.transition=function(t){for(var e,n,r=Lu||++Pu,o=Xi(t),i=[],a=Fu||{time:Date.now(),ease:Er,delay:0,duration:250},s=-1,u=this.length;++s<u;){i.push(e=[]);for(var l=this[s],c=-1,f=l.length;++c<f;)(n=l[c])&&Ji(n,c,o,r,a),e.push(n)}return Ui(i,o,r)},ja.interrupt=function(t){return this.each(null==t?zu:Vi(Xi(t)))};var Lu,Fu,zu=Vi(Xi()),Ru=[],Pu=0;Ru.call=ja.call,Ru.empty=ja.empty,Ru.node=ja.node,Ru.size=ja.size,ra.transition=function(t,e){return t&&t.transition?Lu?t.transition(e):t:ra.selection().transition(t)},ra.transition.prototype=Ru,Ru.select=function(t){var e,n,r,o=this.id,i=this.namespace,a=[];t=A(t);for(var s=-1,u=this.length;++s<u;){a.push(e=[]);for(var l=this[s],c=-1,f=l.length;++c<f;)(r=l[c])&&(n=t.call(r,r.__data__,c,s))?("__data__"in r&&(n.__data__=r.__data__),Ji(n,c,i,o,r[i][o]),e.push(n)):e.push(null)}return Ui(a,i,o)},Ru.selectAll=function(t){var e,n,r,o,i,a=this.id,s=this.namespace,u=[];t=T(t);for(var l=-1,c=this.length;++l<c;)for(var f=this[l],d=-1,h=f.length;++d<h;)if(r=f[d]){i=r[s][a],n=t.call(r,r.__data__,d,l),u.push(e=[]);for(var p=-1,m=n.length;++p<m;)(o=n[p])&&Ji(o,p,s,a,i),e.push(o)}return Ui(u,s,a)},Ru.filter=function(t){var e,n,r,o=[];"function"!=typeof t&&(t=$(t));for(var i=0,a=this.length;a>i;i++){o.push(e=[]);for(var n=this[i],s=0,u=n.length;u>s;s++)(r=n[s])&&t.call(r,r.__data__,s,i)&&e.push(r)}return Ui(o,this.namespace,this.id)},Ru.tween=function(t,e){var n=this.id,r=this.namespace;return arguments.length<2?this.node()[r][n].tween.get(t):V(this,null==e?function(e){e[r][n].tween.remove(t)}:function(o){o[r][n].tween.set(t,e)})},Ru.attr=function(t,e){function n(){this.removeAttribute(s)}function r(){this.removeAttributeNS(s.space,s.local)}function o(t){return null==t?n:(t+="",function(){var e,n=this.getAttribute(s);return n!==t&&(e=a(n,t),function(t){this.setAttribute(s,e(t))})})}function i(t){return null==t?r:(t+="",function(){var e,n=this.getAttributeNS(s.space,s.local);return n!==t&&(e=a(n,t),function(t){this.setAttributeNS(s.space,s.local,e(t))})})}if(arguments.length<2){for(e in t)this.attr(e,t[e]);return this}var a="transform"==t?$r:xr,s=ra.ns.qualify(t);return Wi(this,"attr."+t,e,s.local?i:o)},Ru.attrTween=function(t,e){function n(t,n){var r=e.call(this,t,n,this.getAttribute(o));return r&&function(t){this.setAttribute(o,r(t))}}function r(t,n){var r=e.call(this,t,n,this.getAttributeNS(o.space,o.local));return r&&function(t){this.setAttributeNS(o.space,o.local,r(t))}}var o=ra.ns.qualify(t);return this.tween("attr."+t,o.local?r:n)},Ru.style=function(t,e,r){function o(){this.style.removeProperty(t)}function i(e){return null==e?o:(e+="",function(){var o,i=n(this).getComputedStyle(this,null).getPropertyValue(t);return i!==e&&(o=xr(i,e),function(e){this.style.setProperty(t,o(e),r)})})}var a=arguments.length;if(3>a){if("string"!=typeof t){2>a&&(e="");for(r in t)this.style(r,t[r],e);return this}r=""}return Wi(this,"style."+t,e,i)},Ru.styleTween=function(t,e,r){function o(o,i){var a=e.call(this,o,i,n(this).getComputedStyle(this,null).getPropertyValue(t));return a&&function(e){this.style.setProperty(t,a(e),r)}}return arguments.length<3&&(r=""),this.tween("style."+t,o)},Ru.text=function(t){return Wi(this,"text",t,Yi)},Ru.remove=function(){var t=this.namespace;return this.each("end.transition",function(){var e;this[t].count<2&&(e=this.parentNode)&&e.removeChild(this)})},Ru.ease=function(t){var e=this.id,n=this.namespace;return arguments.length<1?this.node()[n][e].ease:("function"!=typeof t&&(t=ra.ease.apply(ra,arguments)),V(this,function(r){r[n][e].ease=t}))},Ru.delay=function(t){var e=this.id,n=this.namespace;return arguments.length<1?this.node()[n][e].delay:V(this,"function"==typeof t?function(r,o,i){
+r[n][e].delay=+t.call(r,r.__data__,o,i)}:(t=+t,function(r){r[n][e].delay=t}))},Ru.duration=function(t){var e=this.id,n=this.namespace;return arguments.length<1?this.node()[n][e].duration:V(this,"function"==typeof t?function(r,o,i){r[n][e].duration=Math.max(1,t.call(r,r.__data__,o,i))}:(t=Math.max(1,t),function(r){r[n][e].duration=t}))},Ru.each=function(t,e){var n=this.id,r=this.namespace;if(arguments.length<2){var o=Fu,i=Lu;try{Lu=n,V(this,function(e,o,i){Fu=e[r][n],t.call(e,e.__data__,o,i)})}finally{Fu=o,Lu=i}}else V(this,function(o){var i=o[r][n];(i.event||(i.event=ra.dispatch("start","end","interrupt"))).on(t,e)});return this},Ru.transition=function(){for(var t,e,n,r,o=this.id,i=++Pu,a=this.namespace,s=[],u=0,l=this.length;l>u;u++){s.push(t=[]);for(var e=this[u],c=0,f=e.length;f>c;c++)(n=e[c])&&(r=n[a][o],Ji(n,c,a,i,{time:r.time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration})),t.push(n)}return Ui(s,a,i)},ra.svg.axis=function(){function t(t){t.each(function(){var t,l=ra.select(this),c=this.__chart__||n,f=this.__chart__=n.copy(),d=null==u?f.ticks?f.ticks.apply(f,s):f.domain():u,h=null==e?f.tickFormat?f.tickFormat.apply(f,s):x:e,p=l.selectAll(".tick").data(d,f),m=p.enter().insert("g",".domain").attr("class","tick").style("opacity",Na),g=ra.transition(p.exit()).style("opacity",Na).remove(),v=ra.transition(p.order()).style("opacity",1),y=Math.max(o,0)+a,w=Io(f),b=l.selectAll(".domain").data([0]),_=(b.enter().append("path").attr("class","domain"),ra.transition(b));m.append("line"),m.append("text");var k,j,M,E,C=m.select("line"),S=v.select("line"),A=p.select("text").text(h),T=m.select("text"),N=v.select("text"),O="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r?(t=Zi,k="x",M="y",j="x2",E="y2",A.attr("dy",0>O?"0em":".71em").style("text-anchor","middle"),_.attr("d","M"+w[0]+","+O*i+"V0H"+w[1]+"V"+O*i)):(t=Ki,k="y",M="x",j="y2",E="x2",A.attr("dy",".32em").style("text-anchor",0>O?"end":"start"),_.attr("d","M"+O*i+","+w[0]+"H0V"+w[1]+"H"+O*i)),C.attr(E,O*o),T.attr(M,O*y),S.attr(j,0).attr(E,O*o),N.attr(k,0).attr(M,O*y),f.rangeBand){var q=f,D=q.rangeBand()/2;c=f=function(t){return q(t)+D}}else c.rangeBand?c=f:g.call(t,f,c);m.call(t,c,f),v.call(t,f,f)})}var e,n=ra.scale.linear(),r=Iu,o=6,i=6,a=3,s=[10],u=null;return t.scale=function(e){return arguments.length?(n=e,t):n},t.orient=function(e){return arguments.length?(r=e in Hu?e+"":Iu,t):r},t.ticks=function(){return arguments.length?(s=arguments,t):s},t.tickValues=function(e){return arguments.length?(u=e,t):u},t.tickFormat=function(n){return arguments.length?(e=n,t):e},t.tickSize=function(e){var n=arguments.length;return n?(o=+e,i=+arguments[n-1],t):o},t.innerTickSize=function(e){return arguments.length?(o=+e,t):o},t.outerTickSize=function(e){return arguments.length?(i=+e,t):i},t.tickPadding=function(e){return arguments.length?(a=+e,t):a},t.tickSubdivide=function(){return arguments.length&&t},t};var Iu="bottom",Hu={top:1,right:1,bottom:1,left:1};ra.svg.brush=function(){function t(n){n.each(function(){var n=ra.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",i).on("touchstart.brush",i),a=n.selectAll(".background").data([0]);a.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),n.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var s=n.selectAll(".resize").data(m,x);s.exit().remove(),s.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return $u[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),s.style("display",t.empty()?"none":null);var u,f=ra.transition(n),d=ra.transition(a);l&&(u=Io(l),d.attr("x",u[0]).attr("width",u[1]-u[0]),r(f)),c&&(u=Io(c),d.attr("y",u[0]).attr("height",u[1]-u[0]),o(f)),e(f)})}function e(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+f[+/e$/.test(t)]+","+d[+/^s/.test(t)]+")"})}function r(t){t.select(".extent").attr("x",f[0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",f[1]-f[0])}function o(t){t.select(".extent").attr("y",d[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",d[1]-d[0])}function i(){function i(){32==ra.event.keyCode&&(A||(x=null,N[0]-=f[1],N[1]-=d[1],A=2),M())}function m(){32==ra.event.keyCode&&2==A&&(N[0]+=f[1],N[1]+=d[1],A=0,M())}function g(){var t=ra.mouse(b),n=!1;w&&(t[0]+=w[0],t[1]+=w[1]),A||(ra.event.altKey?(x||(x=[(f[0]+f[1])/2,(d[0]+d[1])/2]),N[0]=f[+(t[0]<x[0])],N[1]=d[+(t[1]<x[1])]):x=null),C&&v(t,l,0)&&(r(j),n=!0),S&&v(t,c,1)&&(o(j),n=!0),n&&(e(j),k({type:"brush",mode:A?"move":"resize"}))}function v(t,e,n){var r,o,i=Io(e),u=i[0],l=i[1],c=N[n],m=n?d:f,g=m[1]-m[0];return A&&(u-=c,l-=g+c),r=(n?p:h)?Math.max(u,Math.min(l,t[n])):t[n],A?o=(r+=c)+g:(x&&(c=Math.max(u,Math.min(l,2*x[n]-r))),r>c?(o=r,r=c):o=c),m[0]!=r||m[1]!=o?(n?s=null:a=null,m[0]=r,m[1]=o,!0):void 0}function y(){g(),j.style("pointer-events","all").selectAll(".resize").style("display",t.empty()?"none":null),ra.select("body").style("cursor",null),O.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),T(),k({type:"brushend"})}var x,w,b=this,_=ra.select(ra.event.target),k=u.of(b,arguments),j=ra.select(b),E=_.datum(),C=!/^(n|s)$/.test(E)&&l,S=!/^(e|w)$/.test(E)&&c,A=_.classed("extent"),T=Z(b),N=ra.mouse(b),O=ra.select(n(b)).on("keydown.brush",i).on("keyup.brush",m);if(ra.event.changedTouches?O.on("touchmove.brush",g).on("touchend.brush",y):O.on("mousemove.brush",g).on("mouseup.brush",y),j.interrupt().selectAll("*").interrupt(),A)N[0]=f[0]-N[0],N[1]=d[0]-N[1];else if(E){var q=+/w$/.test(E),D=+/^n/.test(E);w=[f[1-q]-N[0],d[1-D]-N[1]],N[0]=f[q],N[1]=d[D]}else ra.event.altKey&&(x=N.slice());j.style("pointer-events","none").selectAll(".resize").style("display",null),ra.select("body").style("cursor",_.style("cursor")),k({type:"brushstart"}),g()}var a,s,u=C(t,"brushstart","brush","brushend"),l=null,c=null,f=[0,0],d=[0,0],h=!0,p=!0,m=Bu[0];return t.event=function(t){t.each(function(){var t=u.of(this,arguments),e={x:f,y:d,i:a,j:s},n=this.__chart__||e;this.__chart__=e,Lu?ra.select(this).transition().each("start.brush",function(){a=n.i,s=n.j,f=n.x,d=n.y,t({type:"brushstart"})}).tween("brush:brush",function(){var n=wr(f,e.x),r=wr(d,e.y);return a=s=null,function(o){f=e.x=n(o),d=e.y=r(o),t({type:"brush",mode:"resize"})}}).each("end.brush",function(){a=e.i,s=e.j,t({type:"brush",mode:"resize"}),t({type:"brushend"})}):(t({type:"brushstart"}),t({type:"brush",mode:"resize"}),t({type:"brushend"}))})},t.x=function(e){return arguments.length?(l=e,m=Bu[!l<<1|!c],t):l},t.y=function(e){return arguments.length?(c=e,m=Bu[!l<<1|!c],t):c},t.clamp=function(e){return arguments.length?(l&&c?(h=!!e[0],p=!!e[1]):l?h=!!e:c&&(p=!!e),t):l&&c?[h,p]:l?h:c?p:null},t.extent=function(e){var n,r,o,i,u;return arguments.length?(l&&(n=e[0],r=e[1],c&&(n=n[0],r=r[0]),a=[n,r],l.invert&&(n=l(n),r=l(r)),n>r&&(u=n,n=r,r=u),(n!=f[0]||r!=f[1])&&(f=[n,r])),c&&(o=e[0],i=e[1],l&&(o=o[1],i=i[1]),s=[o,i],c.invert&&(o=c(o),i=c(i)),o>i&&(u=o,o=i,i=u),(o!=d[0]||i!=d[1])&&(d=[o,i])),t):(l&&(a?(n=a[0],r=a[1]):(n=f[0],r=f[1],l.invert&&(n=l.invert(n),r=l.invert(r)),n>r&&(u=n,n=r,r=u))),c&&(s?(o=s[0],i=s[1]):(o=d[0],i=d[1],c.invert&&(o=c.invert(o),i=c.invert(i)),o>i&&(u=o,o=i,i=u))),l&&c?[[n,o],[r,i]]:l?[n,r]:c&&[o,i])},t.clear=function(){return t.empty()||(f=[0,0],d=[0,0],a=s=null),t},t.empty=function(){return!!l&&f[0]==f[1]||!!c&&d[0]==d[1]},ra.rebind(t,u,"on")};var $u={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Bu=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Vu=ls.format=ms.timeFormat,Uu=Vu.utc,Wu=Uu("%Y-%m-%dT%H:%M:%S.%LZ");Vu.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Gi:Wu,Gi.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},Gi.toString=Wu.toString,ls.second=It(function(t){return new cs(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),ls.seconds=ls.second.range,ls.seconds.utc=ls.second.utc.range,ls.minute=It(function(t){return new cs(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),ls.minutes=ls.minute.range,ls.minutes.utc=ls.minute.utc.range,ls.hour=It(function(t){var e=t.getTimezoneOffset()/60;return new cs(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),ls.hours=ls.hour.range,ls.hours.utc=ls.hour.utc.range,ls.month=It(function(t){return t=ls.day(t),t.setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),ls.months=ls.month.range,ls.months.utc=ls.month.utc.range;var Yu=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Xu=[[ls.second,1],[ls.second,5],[ls.second,15],[ls.second,30],[ls.minute,1],[ls.minute,5],[ls.minute,15],[ls.minute,30],[ls.hour,1],[ls.hour,3],[ls.hour,6],[ls.hour,12],[ls.day,1],[ls.day,2],[ls.week,1],[ls.month,1],[ls.month,3],[ls.year,1]],Ju=Vu.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%I:%M",function(t){return t.getMinutes()}],["%I %p",function(t){return t.getHours()}],["%a %d",function(t){return t.getDay()&&1!=t.getDate()}],["%b %d",function(t){return 1!=t.getDate()}],["%B",function(t){return t.getMonth()}],["%Y",Ae]]),Zu={range:function(t,e,n){return ra.range(Math.ceil(t/n)*n,+e,n).map(ta)},floor:x,ceil:x};Xu.year=ls.year,ls.scale=function(){return Qi(ra.scale.linear(),Xu,Ju)};var Ku=Xu.map(function(t){return[t[0].utc,t[1]]}),Gu=Uu.multi([[".%L",function(t){return t.getUTCMilliseconds()}],[":%S",function(t){return t.getUTCSeconds()}],["%I:%M",function(t){return t.getUTCMinutes()}],["%I %p",function(t){return t.getUTCHours()}],["%a %d",function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],["%b %d",function(t){return 1!=t.getUTCDate()}],["%B",function(t){return t.getUTCMonth()}],["%Y",Ae]]);Ku.year=ls.year.utc,ls.scale.utc=function(){return Qi(ra.scale.linear(),Ku,Gu)},ra.text=St(function(t){return t.responseText}),ra.json=function(t,e){return At(t,"application/json",ea,e)},ra.html=function(t,e){return At(t,"text/html",na,e)},ra.xml=St(function(t){return t.responseXML}),"function"==typeof define&&define.amd?define(ra):"object"==typeof e&&e.exports&&(e.exports=ra),this.d3=ra}()},{}],276:[function(t,e,n){function r(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function o(){var t=arguments,e=this.useColors;if(t[0]=(e?"%c":"")+this.namespace+(e?" %c":" ")+t[0]+(e?"%c ":" ")+"+"+n.humanize(this.diff),!e)return t;var r="color: "+this.color;t=[t[0],r,"color: inherit"].concat(Array.prototype.slice.call(t,1));var o=0,i=0;return t[0].replace(/%[a-z%]/g,function(t){"%%"!==t&&(o++,"%c"===t&&(i=o))}),t.splice(i,0,r),t}function i(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(t){try{null==t?l.removeItem("debug"):l.debug=t}catch(e){}}function s(){var t;try{t=l.debug}catch(e){}return t}function u(){try{return window.localStorage}catch(t){}}n=e.exports=t("./debug"),n.log=i,n.formatArgs=o,n.save=a,n.load=s,n.useColors=r;var l;l="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:u(),n.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],n.formatters.j=function(t){return JSON.stringify(t)},n.enable(s())},{"./debug":277}],277:[function(t,e,n){function r(){return n.colors[c++%n.colors.length]}function o(t){function e(){}function o(){var t=o,e=+new Date,i=e-(l||e);t.diff=i,t.prev=l,t.curr=e,l=e,null==t.useColors&&(t.useColors=n.useColors()),null==t.color&&t.useColors&&(t.color=r());var a=Array.prototype.slice.call(arguments);a[0]=n.coerce(a[0]),"string"!=typeof a[0]&&(a=["%o"].concat(a));var s=0;a[0]=a[0].replace(/%([a-z%])/g,function(e,r){if("%%"===e)return e;s++;var o=n.formatters[r];if("function"==typeof o){var i=a[s];e=o.call(t,i),a.splice(s,1),s--}return e}),"function"==typeof n.formatArgs&&(a=n.formatArgs.apply(t,a));var u=o.log||n.log||console.log.bind(console);u.apply(t,a)}e.enabled=!1,o.enabled=!0;var i=n.enabled(t)?o:e;return i.namespace=t,i}function i(t){n.save(t);for(var e=(t||"").split(/[\s,]+/),r=e.length,o=0;r>o;o++)e[o]&&(t=e[o].replace(/\*/g,".*?"),"-"===t[0]?n.skips.push(new RegExp("^"+t.substr(1)+"$")):n.names.push(new RegExp("^"+t+"$")))}function a(){n.enable("")}function s(t){var e,r;for(e=0,r=n.skips.length;r>e;e++)if(n.skips[e].test(t))return!1;for(e=0,r=n.names.length;r>e;e++)if(n.names[e].test(t))return!0;return!1}function u(t){return t instanceof Error?t.stack||t.message:t}n=e.exports=o,n.coerce=u,n.disable=a,n.enable=i,n.enabled=s,n.humanize=t("ms"),n.names=[],n.skips=[],n.formatters={};var l,c=0},{ms:278}],278:[function(t,e,n){function r(t){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*f;case"days":case"day":case"d":return n*c;case"hours":case"hour":case"hrs":case"hr":case"h":return n*l;case"minutes":case"minute":case"mins":case"min":case"m":return n*u;case"seconds":case"second":case"secs":case"sec":case"s":return n*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n}}}function o(t){return t>=c?Math.round(t/c)+"d":t>=l?Math.round(t/l)+"h":t>=u?Math.round(t/u)+"m":t>=s?Math.round(t/s)+"s":t+"ms"}function i(t){return a(t,c,"day")||a(t,l,"hour")||a(t,u,"minute")||a(t,s,"second")||t+" ms"}function a(t,e,n){return e>t?void 0:1.5*e>t?Math.floor(t/e)+" "+n:Math.ceil(t/e)+" "+n+"s"}var s=1e3,u=60*s,l=60*u,c=24*l,f=365.25*c;e.exports=function(t,e){return e=e||{},"string"==typeof t?r(t):e["long"]?i(t):o(t)}},{}],279:[function(t,e,n){(function(r){!function(t){if("object"==typeof n&&"undefined"!=typeof e)e.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var o;"undefined"!=typeof window?o=window:"undefined"!=typeof r?o=r:"undefined"!=typeof self&&(o=self),o.jade=t()}}(function(){return function e(n,r,o){function i(s,u){if(!r[s]){if(!n[s]){var l="function"==typeof t&&t;if(!u&&l)return l(s,!0);if(a)return a(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var f=r[s]={exports:{}};n[s][0].call(f.exports,function(t){var e=n[s][1][t];return i(e?e:t)},f,f.exports,e,n,r,o)}return r[s].exports}for(var a="function"==typeof t&&t,s=0;s<o.length;s++)i(o[s]);return i}({1:[function(t,e,n){"use strict";function r(t){return null!=t&&""!==t}function o(t){return(Array.isArray(t)?t.map(o):t&&"object"==typeof t?Object.keys(t).filter(function(e){return t[e]}):[t]).filter(r).join(" ")}n.merge=function i(t,e){if(1===arguments.length){for(var n=t[0],o=1;o<t.length;o++)n=i(n,t[o]);return n}var a=t["class"],s=e["class"];(a||s)&&(a=a||[],s=s||[],Array.isArray(a)||(a=[a]),Array.isArray(s)||(s=[s]),t["class"]=a.concat(s).filter(r));for(var u in e)"class"!=u&&(t[u]=e[u]);return t},n.joinClasses=o,n.cls=function(t,e){for(var r=[],i=0;i<t.length;i++)r.push(e&&e[i]?n.escape(o([t[i]])):o(t[i]));var a=o(r);return a.length?' class="'+a+'"':""},n.style=function(t){return t&&"object"==typeof t?Object.keys(t).map(function(e){return e+":"+t[e]}).join(";"):t},n.attr=function(t,e,r,o){return"style"===t&&(e=n.style(e)),"boolean"==typeof e||null==e?e?" "+(o?t:t+'="'+t+'"'):"":0==t.indexOf("data")&&"string"!=typeof e?(-1!==JSON.stringify(e).indexOf("&")&&console.warn("Since Jade 2.0.0, ampersands (`&`) in data attributes will be escaped to `&amp;`"),e&&"function"==typeof e.toISOString&&console.warn("Jade will eliminate the double quotes around dates in ISO form after 2.0.0")," "+t+"='"+JSON.stringify(e).replace(/'/g,"&apos;")+"'"):r?(e&&"function"==typeof e.toISOString&&console.warn("Jade will stringify dates in ISO form after 2.0.0")," "+t+'="'+n.escape(e)+'"'):(e&&"function"==typeof e.toISOString&&console.warn("Jade will stringify dates in ISO form after 2.0.0")," "+t+'="'+e+'"')},n.attrs=function(t,e){var r=[],i=Object.keys(t);if(i.length)for(var a=0;a<i.length;++a){var s=i[a],u=t[s];"class"==s?(u=o(u))&&r.push(" "+s+'="'+u+'"'):r.push(n.attr(s,u,!1,e))}return r.join("")},n.escape=function(t){var e=String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");return e===""+t?t:e},n.rethrow=function a(e,n,r,o){if(!(e instanceof Error))throw e;if(!("undefined"==typeof window&&n||o))throw e.message+=" on line "+r,e;try{o=o||t("fs").readFileSync(n,"utf8")}catch(i){a(e,null,r)}var s=3,u=o.split("\n"),l=Math.max(r-s,0),c=Math.min(u.length,r+s),s=u.slice(l,c).map(function(t,e){var n=e+l+1;return(n==r?" > ":" ")+n+"| "+t}).join("\n");throw e.path=n,e.message=(n||"Jade")+":"+r+"\n"+s+"\n\n"+e.message,e}},{fs:2}],2:[function(t,e,n){},{}]},{},[1])(1)})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{fs:274}],280:[function(t,e,n){!function(t,n){"object"==typeof e&&"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}:n(t)}("undefined"!=typeof window?window:this,function(t,e){function n(t){var e=t.length,n=Q.type(t);return"function"===n||Q.isWindow(t)?!1:1===t.nodeType&&e?!0:"array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t}function r(t,e,n){if(Q.isFunction(e))return Q.grep(t,function(t,r){return!!e.call(t,r,t)!==n});if(e.nodeType)return Q.grep(t,function(t){return t===e!==n});if("string"==typeof e){if(st.test(e))return Q.filter(e,t,n);e=Q.filter(e,t)}return Q.grep(t,function(t){return W.call(e,t)>=0!==n})}function o(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}function i(t){var e=pt[t]={};return Q.each(t.match(ht)||[],function(t,n){e[n]=!0}),e}function a(){K.removeEventListener("DOMContentLoaded",a,!1),t.removeEventListener("load",a,!1),Q.ready()}function s(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=Q.expando+s.uid++}function u(t,e,data){var n;if(void 0===data&&1===t.nodeType)if(n="data-"+e.replace(wt,"-$1").toLowerCase(),data=t.getAttribute(n),"string"==typeof data){try{data="true"===data?!0:"false"===data?!1:"null"===data?null:+data+""===data?+data:xt.test(data)?Q.parseJSON(data):data}catch(r){}yt.set(t,e,data)}else data=void 0;return data}function l(){return!0}function c(){return!1}function f(){try{return K.activeElement}catch(t){}}function d(t,e){return Q.nodeName(t,"table")&&Q.nodeName(11!==e.nodeType?e:e.firstChild,"tr")?t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody")):t}function h(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function p(t){var e=Ft.exec(t.type);return e?t.type=e[1]:t.removeAttribute("type"),t}function m(t,e){for(var n=0,r=t.length;r>n;n++)vt.set(t[n],"globalEval",!e||vt.get(e[n],"globalEval"))}function g(t,e){var n,r,o,i,a,s,u,l;if(1===e.nodeType){if(vt.hasData(t)&&(i=vt.access(t),a=vt.set(e,i),l=i.events)){delete a.handle,a.events={};for(o in l)for(n=0,r=l[o].length;r>n;n++)Q.event.add(e,o,l[o][n])}yt.hasData(t)&&(s=yt.access(t),u=Q.extend({},s),yt.set(e,u))}}function v(t,e){var n=t.getElementsByTagName?t.getElementsByTagName(e||"*"):t.querySelectorAll?t.querySelectorAll(e||"*"):[];return void 0===e||e&&Q.nodeName(t,e)?Q.merge([t],n):n}function y(t,e){var n=e.nodeName.toLowerCase();"input"===n&&jt.test(t.type)?e.checked=t.checked:("input"===n||"textarea"===n)&&(e.defaultValue=t.defaultValue)}function x(e,n){var r,o=Q(n.createElement(e)).appendTo(n.body),i=t.getDefaultComputedStyle&&(r=t.getDefaultComputedStyle(o[0]))?r.display:Q.css(o[0],"display");return o.detach(),i}function w(t){var e=K,n=It[t];return n||(n=x(t,e),"none"!==n&&n||(Pt=(Pt||Q("<iframe frameborder='0' width='0' height='0'/>")).appendTo(e.documentElement),e=Pt[0].contentDocument,e.write(),e.close(),n=x(t,e),Pt.detach()),It[t]=n),n}function b(t,e,n){var r,o,i,a,s=t.style;return n=n||Bt(t),n&&(a=n.getPropertyValue(e)||n[e]),n&&(""!==a||Q.contains(t.ownerDocument,t)||(a=Q.style(t,e)),$t.test(a)&&Ht.test(e)&&(r=s.width,o=s.minWidth,i=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=o,s.maxWidth=i)),void 0!==a?a+"":a}function _(t,e){return{get:function(){return t()?void delete this.get:(this.get=e).apply(this,arguments)}}}function k(t,e){if(e in t)return e;for(var n=e[0].toUpperCase()+e.slice(1),r=e,o=Jt.length;o--;)if(e=Jt[o]+n,e in t)return e;return r}function j(t,e,n){var r=Ut.exec(e);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):e}function M(t,e,n,r,o){for(var i=n===(r?"border":"content")?4:"width"===e?1:0,a=0;4>i;i+=2)"margin"===n&&(a+=Q.css(t,n+_t[i],!0,o)),r?("content"===n&&(a-=Q.css(t,"padding"+_t[i],!0,o)),"margin"!==n&&(a-=Q.css(t,"border"+_t[i]+"Width",!0,o))):(a+=Q.css(t,"padding"+_t[i],!0,o),"padding"!==n&&(a+=Q.css(t,"border"+_t[i]+"Width",!0,o)));return a}function E(t,e,n){var r=!0,o="width"===e?t.offsetWidth:t.offsetHeight,i=Bt(t),a="border-box"===Q.css(t,"boxSizing",!1,i);if(0>=o||null==o){if(o=b(t,e,i),(0>o||null==o)&&(o=t.style[e]),$t.test(o))return o;r=a&&(Z.boxSizingReliable()||o===t.style[e]),o=parseFloat(o)||0}return o+M(t,e,n||(a?"border":"content"),r,i)+"px"}function C(t,e){for(var n,r,o,i=[],a=0,s=t.length;s>a;a++)r=t[a],r.style&&(i[a]=vt.get(r,"olddisplay"),n=r.style.display,e?(i[a]||"none"!==n||(r.style.display=""),""===r.style.display&&kt(r)&&(i[a]=vt.access(r,"olddisplay",w(r.nodeName)))):(o=kt(r),"none"===n&&o||vt.set(r,"olddisplay",o?n:Q.css(r,"display"))));for(a=0;s>a;a++)r=t[a],r.style&&(e&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=e?i[a]||"":"none"));return t}function S(t,e,n,r,o){return new S.prototype.init(t,e,n,r,o)}function A(){return setTimeout(function(){Zt=void 0}),Zt=Q.now()}function T(t,e){var n,r=0,o={height:t};for(e=e?1:0;4>r;r+=2-e)n=_t[r],o["margin"+n]=o["padding"+n]=t;return e&&(o.opacity=o.width=t),o}function N(t,e,n){for(var r,o=(ne[e]||[]).concat(ne["*"]),i=0,a=o.length;a>i;i++)if(r=o[i].call(n,e,t))return r}function O(t,e,n){var r,o,i,a,s,u,l,c,f=this,d={},h=t.style,p=t.nodeType&&kt(t),m=vt.get(t,"fxshow");n.queue||(s=Q._queueHooks(t,"fx"),null==s.unqueued&&(s.unqueued=0,u=s.empty.fire,s.empty.fire=function(){s.unqueued||u()}),s.unqueued++,f.always(function(){f.always(function(){s.unqueued--,Q.queue(t,"fx").length||s.empty.fire()})})),1===t.nodeType&&("height"in e||"width"in e)&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],l=Q.css(t,"display"),c="none"===l?vt.get(t,"olddisplay")||w(t.nodeName):l,"inline"===c&&"none"===Q.css(t,"float")&&(h.display="inline-block")),n.overflow&&(h.overflow="hidden",f.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]}));for(r in e)if(o=e[r],Gt.exec(o)){if(delete e[r],i=i||"toggle"===o,o===(p?"hide":"show")){if("show"!==o||!m||void 0===m[r])continue;p=!0}d[r]=m&&m[r]||Q.style(t,r)}else l=void 0;if(Q.isEmptyObject(d))"inline"===("none"===l?w(t.nodeName):l)&&(h.display=l);else{m?"hidden"in m&&(p=m.hidden):m=vt.access(t,"fxshow",{}),i&&(m.hidden=!p),p?Q(t).show():f.done(function(){Q(t).hide()}),f.done(function(){var e;vt.remove(t,"fxshow");for(e in d)Q.style(t,e,d[e])});for(r in d)a=N(p?m[r]:0,r,f),r in m||(m[r]=a.start,p&&(a.end=a.start,a.start="width"===r||"height"===r?1:0))}}function q(t,e){var n,r,o,i,a;for(n in t)if(r=Q.camelCase(n),o=e[r],i=t[n],Q.isArray(i)&&(o=i[1],i=t[n]=i[0]),n!==r&&(t[r]=i,delete t[n]),a=Q.cssHooks[r],a&&"expand"in a){i=a.expand(i),delete t[r];for(n in i)n in t||(t[n]=i[n],e[n]=o)}else e[r]=o}function D(t,e,n){var r,o,i=0,a=ee.length,s=Q.Deferred().always(function(){delete u.elem}),u=function(){if(o)return!1;for(var e=Zt||A(),n=Math.max(0,l.startTime+l.duration-e),r=n/l.duration||0,i=1-r,a=0,u=l.tweens.length;u>a;a++)l.tweens[a].run(i);return s.notifyWith(t,[l,i,n]),1>i&&u?n:(s.resolveWith(t,[l]),!1)},l=s.promise({elem:t,props:Q.extend({},e),opts:Q.extend(!0,{specialEasing:{}},n),originalProperties:e,originalOptions:n,startTime:Zt||A(),duration:n.duration,tweens:[],createTween:function(e,n){var r=Q.Tween(t,l.opts,e,n,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(r),r},stop:function(e){var n=0,r=e?l.tweens.length:0;if(o)return this;for(o=!0;r>n;n++)l.tweens[n].run(1);return e?s.resolveWith(t,[l,e]):s.rejectWith(t,[l,e]),this}}),c=l.props;for(q(c,l.opts.specialEasing);a>i;i++)if(r=ee[i].call(l,t,c,l.opts))return r;return Q.map(c,N,l),Q.isFunction(l.opts.start)&&l.opts.start.call(t,l),Q.fx.timer(Q.extend(u,{elem:t,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function L(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var r,o=0,i=e.toLowerCase().match(ht)||[];if(Q.isFunction(n))for(;r=i[o++];)"+"===r[0]?(r=r.slice(1)||"*",(t[r]=t[r]||[]).unshift(n)):(t[r]=t[r]||[]).push(n)}}function F(t,e,n,r){function o(s){var u;return i[s]=!0,Q.each(t[s]||[],function(t,s){var l=s(e,n,r);return"string"!=typeof l||a||i[l]?a?!(u=l):void 0:(e.dataTypes.unshift(l),o(l),!1)}),u}var i={},a=t===xe;return o(e.dataTypes[0])||!i["*"]&&o("*")}function z(t,e){var n,r,o=Q.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((o[n]?t:r||(r={}))[n]=e[n]);return r&&Q.extend(!0,t,r),t}function R(t,e,n){for(var r,o,i,a,s=t.contents,u=t.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=t.mimeType||e.getResponseHeader("Content-Type"));if(r)for(o in s)if(s[o]&&s[o].test(r)){u.unshift(o);break}if(u[0]in n)i=u[0];else{for(o in n){if(!u[0]||t.converters[o+" "+u[0]]){i=o;break}a||(a=o)}i=i||a}return i?(i!==u[0]&&u.unshift(i),n[i]):void 0}function P(t,e,n,r){var o,i,a,s,u,l={},c=t.dataTypes.slice();if(c[1])for(a in t.converters)l[a.toLowerCase()]=t.converters[a];for(i=c.shift();i;)if(t.responseFields[i]&&(n[t.responseFields[i]]=e),!u&&r&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),u=i,i=c.shift())if("*"===i)i=u;else if("*"!==u&&u!==i){if(a=l[u+" "+i]||l["* "+i],!a)for(o in l)if(s=o.split(" "),s[1]===i&&(a=l[u+" "+s[0]]||l["* "+s[0]])){a===!0?a=l[o]:l[o]!==!0&&(i=s[0],c.unshift(s[1]));break}if(a!==!0)if(a&&t["throws"])e=a(e);else try{e=a(e)}catch(f){return{state:"parsererror",error:a?f:"No conversion from "+u+" to "+i}}}return{state:"success",data:e}}function I(t,e,n,r){var o;if(Q.isArray(e))Q.each(e,function(e,o){n||je.test(t)?r(t,o):I(t+"["+("object"==typeof o?e:"")+"]",o,n,r)});else if(n||"object"!==Q.type(e))r(t,e);else for(o in e)I(t+"["+o+"]",e[o],n,r)}function H(t){return Q.isWindow(t)?t:9===t.nodeType&&t.defaultView}var $=[],B=$.slice,V=$.concat,U=$.push,W=$.indexOf,Y={},X=Y.toString,J=Y.hasOwnProperty,Z={},K=t.document,G="2.1.3",Q=function(t,e){return new Q.fn.init(t,e)},tt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,et=/^-ms-/,nt=/-([\da-z])/gi,rt=function(t,e){return e.toUpperCase()};Q.fn=Q.prototype={jquery:G,constructor:Q,selector:"",length:0,toArray:function(){return B.call(this)},get:function(t){return null!=t?0>t?this[t+this.length]:this[t]:B.call(this)},pushStack:function(t){var e=Q.merge(this.constructor(),t);return e.prevObject=this,e.context=this.context,e},each:function(t,e){return Q.each(this,t,e)},map:function(t){return this.pushStack(Q.map(this,function(e,n){return t.call(e,n,e)}))},slice:function(){return this.pushStack(B.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(t){var e=this.length,n=+t+(0>t?e:0);return this.pushStack(n>=0&&e>n?[this[n]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:U,sort:$.sort,splice:$.splice},Q.extend=Q.fn.extend=function(){var t,e,n,r,o,i,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||Q.isFunction(a)||(a={}),s===u&&(a=this,s--);u>s;s++)if(null!=(t=arguments[s]))for(e in t)n=a[e],r=t[e],a!==r&&(l&&r&&(Q.isPlainObject(r)||(o=Q.isArray(r)))?(o?(o=!1,i=n&&Q.isArray(n)?n:[]):i=n&&Q.isPlainObject(n)?n:{},a[e]=Q.extend(l,i,r)):void 0!==r&&(a[e]=r));return a},Q.extend({expando:"jQuery"+(G+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isFunction:function(t){return"function"===Q.type(t)},isArray:Array.isArray,isWindow:function(t){return null!=t&&t===t.window},isNumeric:function(t){return!Q.isArray(t)&&t-parseFloat(t)+1>=0},isPlainObject:function(t){return"object"!==Q.type(t)||t.nodeType||Q.isWindow(t)?!1:t.constructor&&!J.call(t.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},type:function(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?Y[X.call(t)]||"object":typeof t},globalEval:function(t){var e,n=eval;t=Q.trim(t),t&&(1===t.indexOf("use strict")?(e=K.createElement("script"),e.text=t,K.head.appendChild(e).parentNode.removeChild(e)):n(t))},camelCase:function(t){return t.replace(et,"ms-").replace(nt,rt)},nodeName:function(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()},each:function(t,e,r){var o,i=0,a=t.length,s=n(t);if(r){if(s)for(;a>i&&(o=e.apply(t[i],r),o!==!1);i++);else for(i in t)if(o=e.apply(t[i],r),o===!1)break}else if(s)for(;a>i&&(o=e.call(t[i],i,t[i]),o!==!1);i++);else for(i in t)if(o=e.call(t[i],i,t[i]),o===!1)break;return t},trim:function(t){return null==t?"":(t+"").replace(tt,"")},makeArray:function(t,e){var r=e||[];return null!=t&&(n(Object(t))?Q.merge(r,"string"==typeof t?[t]:t):U.call(r,t)),r},inArray:function(t,e,n){return null==e?-1:W.call(e,t,n)},merge:function(t,e){for(var n=+e.length,r=0,o=t.length;n>r;r++)t[o++]=e[r];return t.length=o,t},grep:function(t,e,n){for(var r,o=[],i=0,a=t.length,s=!n;a>i;i++)r=!e(t[i],i),r!==s&&o.push(t[i]);return o},map:function(t,e,r){var o,i=0,a=t.length,s=n(t),u=[];if(s)for(;a>i;i++)o=e(t[i],i,r),null!=o&&u.push(o);else for(i in t)o=e(t[i],i,r),null!=o&&u.push(o);return V.apply([],u)},guid:1,proxy:function(t,e){var n,r,o;return"string"==typeof e&&(n=t[e],e=t,t=n),Q.isFunction(t)?(r=B.call(arguments,2),o=function(){return t.apply(e||this,r.concat(B.call(arguments)))},o.guid=t.guid=t.guid||Q.guid++,o):void 0},now:Date.now,support:Z}),Q.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(t,e){Y["[object "+e+"]"]=e.toLowerCase()});var ot=function(t){function e(t,e,n,r){var o,i,a,s,u,l,f,h,p,m;if((e?e.ownerDocument||e:I)!==O&&N(e),e=e||O,n=n||[],s=e.nodeType,"string"!=typeof t||!t||1!==s&&9!==s&&11!==s)return n;if(!r&&D){if(11!==s&&(o=yt.exec(t)))if(a=o[1]){if(9===s){if(i=e.getElementById(a),!i||!i.parentNode)return n;if(i.id===a)return n.push(i),n}else if(e.ownerDocument&&(i=e.ownerDocument.getElementById(a))&&R(e,i)&&i.id===a)return n.push(i),n}else{if(o[2])return G.apply(n,e.getElementsByTagName(t)),n;if((a=o[3])&&b.getElementsByClassName)return G.apply(n,e.getElementsByClassName(a)),n}if(b.qsa&&(!L||!L.test(t))){if(h=f=P,p=e,m=1!==s&&t,1===s&&"object"!==e.nodeName.toLowerCase()){for(l=M(t),(f=e.getAttribute("id"))?h=f.replace(wt,"\\$&"):e.setAttribute("id",h),h="[id='"+h+"'] ",u=l.length;u--;)l[u]=h+d(l[u]);p=xt.test(t)&&c(e.parentNode)||e,m=l.join(",")}if(m)try{return G.apply(n,p.querySelectorAll(m)),n}catch(g){}finally{f||e.removeAttribute("id")}}}return C(t.replace(ut,"$1"),e,n,r)}function n(){function t(n,r){return e.push(n+" ")>_.cacheLength&&delete t[e.shift()],t[n+" "]=r}var e=[];return t}function r(t){return t[P]=!0,t}function o(t){var e=O.createElement("div");try{return!!t(e)}catch(n){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function i(t,e){for(var n=t.split("|"),r=t.length;r--;)_.attrHandle[n[r]]=e;
+
+}function a(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||Y)-(~t.sourceIndex||Y);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function s(t){return function(e){var n=e.nodeName.toLowerCase();return"input"===n&&e.type===t}}function u(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function l(t){return r(function(e){return e=+e,r(function(n,r){for(var o,i=t([],n.length,e),a=i.length;a--;)n[o=i[a]]&&(n[o]=!(r[o]=n[o]))})})}function c(t){return t&&"undefined"!=typeof t.getElementsByTagName&&t}function f(){}function d(t){for(var e=0,n=t.length,r="";n>e;e++)r+=t[e].value;return r}function h(t,e,n){var r=e.dir,o=n&&"parentNode"===r,i=$++;return e.first?function(e,n,i){for(;e=e[r];)if(1===e.nodeType||o)return t(e,n,i)}:function(e,n,a){var s,u,l=[H,i];if(a){for(;e=e[r];)if((1===e.nodeType||o)&&t(e,n,a))return!0}else for(;e=e[r];)if(1===e.nodeType||o){if(u=e[P]||(e[P]={}),(s=u[r])&&s[0]===H&&s[1]===i)return l[2]=s[2];if(u[r]=l,l[2]=t(e,n,a))return!0}}}function p(t){return t.length>1?function(e,n,r){for(var o=t.length;o--;)if(!t[o](e,n,r))return!1;return!0}:t[0]}function m(t,n,r){for(var o=0,i=n.length;i>o;o++)e(t,n[o],r);return r}function g(t,e,n,r,o){for(var i,a=[],s=0,u=t.length,l=null!=e;u>s;s++)(i=t[s])&&(!n||n(i,r,o))&&(a.push(i),l&&e.push(s));return a}function v(t,e,n,o,i,a){return o&&!o[P]&&(o=v(o)),i&&!i[P]&&(i=v(i,a)),r(function(r,a,s,u){var l,c,f,d=[],h=[],p=a.length,v=r||m(e||"*",s.nodeType?[s]:s,[]),y=!t||!r&&e?v:g(v,d,t,s,u),x=n?i||(r?t:p||o)?[]:a:y;if(n&&n(y,x,s,u),o)for(l=g(x,h),o(l,[],s,u),c=l.length;c--;)(f=l[c])&&(x[h[c]]=!(y[h[c]]=f));if(r){if(i||t){if(i){for(l=[],c=x.length;c--;)(f=x[c])&&l.push(y[c]=f);i(null,x=[],l,u)}for(c=x.length;c--;)(f=x[c])&&(l=i?tt(r,f):d[c])>-1&&(r[l]=!(a[l]=f))}}else x=g(x===a?x.splice(p,x.length):x),i?i(null,a,x,u):G.apply(a,x)})}function y(t){for(var e,n,r,o=t.length,i=_.relative[t[0].type],a=i||_.relative[" "],s=i?1:0,u=h(function(t){return t===e},a,!0),l=h(function(t){return tt(e,t)>-1},a,!0),c=[function(t,n,r){var o=!i&&(r||n!==S)||((e=n).nodeType?u(t,n,r):l(t,n,r));return e=null,o}];o>s;s++)if(n=_.relative[t[s].type])c=[h(p(c),n)];else{if(n=_.filter[t[s].type].apply(null,t[s].matches),n[P]){for(r=++s;o>r&&!_.relative[t[r].type];r++);return v(s>1&&p(c),s>1&&d(t.slice(0,s-1).concat({value:" "===t[s-2].type?"*":""})).replace(ut,"$1"),n,r>s&&y(t.slice(s,r)),o>r&&y(t=t.slice(r)),o>r&&d(t))}c.push(n)}return p(c)}function x(t,n){var o=n.length>0,i=t.length>0,a=function(r,a,s,u,l){var c,f,d,h=0,p="0",m=r&&[],v=[],y=S,x=r||i&&_.find.TAG("*",l),w=H+=null==y?1:Math.random()||.1,b=x.length;for(l&&(S=a!==O&&a);p!==b&&null!=(c=x[p]);p++){if(i&&c){for(f=0;d=t[f++];)if(d(c,a,s)){u.push(c);break}l&&(H=w)}o&&((c=!d&&c)&&h--,r&&m.push(c))}if(h+=p,o&&p!==h){for(f=0;d=n[f++];)d(m,v,a,s);if(r){if(h>0)for(;p--;)m[p]||v[p]||(v[p]=Z.call(u));v=g(v)}G.apply(u,v),l&&!r&&v.length>0&&h+n.length>1&&e.uniqueSort(u)}return l&&(H=w,S=y),m};return o?r(a):a}var w,b,_,k,j,M,E,C,S,A,T,N,O,q,D,L,F,z,R,P="sizzle"+1*new Date,I=t.document,H=0,$=0,B=n(),V=n(),U=n(),W=function(t,e){return t===e&&(T=!0),0},Y=1<<31,X={}.hasOwnProperty,J=[],Z=J.pop,K=J.push,G=J.push,Q=J.slice,tt=function(t,e){for(var n=0,r=t.length;r>n;n++)if(t[n]===e)return n;return-1},et="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",nt="[\\x20\\t\\r\\n\\f]",rt="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",ot=rt.replace("w","w#"),it="\\["+nt+"*("+rt+")(?:"+nt+"*([*^$|!~]?=)"+nt+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ot+"))|)"+nt+"*\\]",at=":("+rt+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+it+")*)|.*)\\)|)",st=new RegExp(nt+"+","g"),ut=new RegExp("^"+nt+"+|((?:^|[^\\\\])(?:\\\\.)*)"+nt+"+$","g"),lt=new RegExp("^"+nt+"*,"+nt+"*"),ct=new RegExp("^"+nt+"*([>+~]|"+nt+")"+nt+"*"),ft=new RegExp("="+nt+"*([^\\]'\"]*?)"+nt+"*\\]","g"),dt=new RegExp(at),ht=new RegExp("^"+ot+"$"),pt={ID:new RegExp("^#("+rt+")"),CLASS:new RegExp("^\\.("+rt+")"),TAG:new RegExp("^("+rt.replace("w","w*")+")"),ATTR:new RegExp("^"+it),PSEUDO:new RegExp("^"+at),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+nt+"*(even|odd|(([+-]|)(\\d*)n|)"+nt+"*(?:([+-]|)"+nt+"*(\\d+)|))"+nt+"*\\)|)","i"),bool:new RegExp("^(?:"+et+")$","i"),needsContext:new RegExp("^"+nt+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+nt+"*((?:-\\d)?\\d*)"+nt+"*\\)|)(?=[^-]|$)","i")},mt=/^(?:input|select|textarea|button)$/i,gt=/^h\d$/i,vt=/^[^{]+\{\s*\[native \w/,yt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,xt=/[+~]/,wt=/'|\\/g,bt=new RegExp("\\\\([\\da-f]{1,6}"+nt+"?|("+nt+")|.)","ig"),_t=function(t,e,n){var r="0x"+e-65536;return r!==r||n?e:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},kt=function(){N()};try{G.apply(J=Q.call(I.childNodes),I.childNodes),J[I.childNodes.length].nodeType}catch(jt){G={apply:J.length?function(t,e){K.apply(t,Q.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}b=e.support={},j=e.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return e?"HTML"!==e.nodeName:!1},N=e.setDocument=function(t){var e,n,r=t?t.ownerDocument||t:I;return r!==O&&9===r.nodeType&&r.documentElement?(O=r,q=r.documentElement,n=r.defaultView,n&&n!==n.top&&(n.addEventListener?n.addEventListener("unload",kt,!1):n.attachEvent&&n.attachEvent("onunload",kt)),D=!j(r),b.attributes=o(function(t){return t.className="i",!t.getAttribute("className")}),b.getElementsByTagName=o(function(t){return t.appendChild(r.createComment("")),!t.getElementsByTagName("*").length}),b.getElementsByClassName=vt.test(r.getElementsByClassName),b.getById=o(function(t){return q.appendChild(t).id=P,!r.getElementsByName||!r.getElementsByName(P).length}),b.getById?(_.find.ID=function(t,e){if("undefined"!=typeof e.getElementById&&D){var n=e.getElementById(t);return n&&n.parentNode?[n]:[]}},_.filter.ID=function(t){var e=t.replace(bt,_t);return function(t){return t.getAttribute("id")===e}}):(delete _.find.ID,_.filter.ID=function(t){var e=t.replace(bt,_t);return function(t){var n="undefined"!=typeof t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}}),_.find.TAG=b.getElementsByTagName?function(t,e){return"undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t):b.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,r=[],o=0,i=e.getElementsByTagName(t);if("*"===t){for(;n=i[o++];)1===n.nodeType&&r.push(n);return r}return i},_.find.CLASS=b.getElementsByClassName&&function(t,e){return D?e.getElementsByClassName(t):void 0},F=[],L=[],(b.qsa=vt.test(r.querySelectorAll))&&(o(function(t){q.appendChild(t).innerHTML="<a id='"+P+"'></a><select id='"+P+"-\f]' msallowcapture=''><option selected=''></option></select>",t.querySelectorAll("[msallowcapture^='']").length&&L.push("[*^$]="+nt+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||L.push("\\["+nt+"*(?:value|"+et+")"),t.querySelectorAll("[id~="+P+"-]").length||L.push("~="),t.querySelectorAll(":checked").length||L.push(":checked"),t.querySelectorAll("a#"+P+"+*").length||L.push(".#.+[+~]")}),o(function(t){var e=r.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&L.push("name"+nt+"*[*^$|!~]?="),t.querySelectorAll(":enabled").length||L.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),L.push(",.*:")})),(b.matchesSelector=vt.test(z=q.matches||q.webkitMatchesSelector||q.mozMatchesSelector||q.oMatchesSelector||q.msMatchesSelector))&&o(function(t){b.disconnectedMatch=z.call(t,"div"),z.call(t,"[s!='']:x"),F.push("!=",at)}),L=L.length&&new RegExp(L.join("|")),F=F.length&&new RegExp(F.join("|")),e=vt.test(q.compareDocumentPosition),R=e||vt.test(q.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},W=e?function(t,e){if(t===e)return T=!0,0;var n=!t.compareDocumentPosition-!e.compareDocumentPosition;return n?n:(n=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1,1&n||!b.sortDetached&&e.compareDocumentPosition(t)===n?t===r||t.ownerDocument===I&&R(I,t)?-1:e===r||e.ownerDocument===I&&R(I,e)?1:A?tt(A,t)-tt(A,e):0:4&n?-1:1)}:function(t,e){if(t===e)return T=!0,0;var n,o=0,i=t.parentNode,s=e.parentNode,u=[t],l=[e];if(!i||!s)return t===r?-1:e===r?1:i?-1:s?1:A?tt(A,t)-tt(A,e):0;if(i===s)return a(t,e);for(n=t;n=n.parentNode;)u.unshift(n);for(n=e;n=n.parentNode;)l.unshift(n);for(;u[o]===l[o];)o++;return o?a(u[o],l[o]):u[o]===I?-1:l[o]===I?1:0},r):O},e.matches=function(t,n){return e(t,null,null,n)},e.matchesSelector=function(t,n){if((t.ownerDocument||t)!==O&&N(t),n=n.replace(ft,"='$1']"),!(!b.matchesSelector||!D||F&&F.test(n)||L&&L.test(n)))try{var r=z.call(t,n);if(r||b.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(o){}return e(n,O,null,[t]).length>0},e.contains=function(t,e){return(t.ownerDocument||t)!==O&&N(t),R(t,e)},e.attr=function(t,e){(t.ownerDocument||t)!==O&&N(t);var n=_.attrHandle[e.toLowerCase()],r=n&&X.call(_.attrHandle,e.toLowerCase())?n(t,e,!D):void 0;return void 0!==r?r:b.attributes||!D?t.getAttribute(e):(r=t.getAttributeNode(e))&&r.specified?r.value:null},e.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},e.uniqueSort=function(t){var e,n=[],r=0,o=0;if(T=!b.detectDuplicates,A=!b.sortStable&&t.slice(0),t.sort(W),T){for(;e=t[o++];)e===t[o]&&(r=n.push(o));for(;r--;)t.splice(n[r],1)}return A=null,t},k=e.getText=function(t){var e,n="",r=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=k(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[r++];)n+=k(e);return n},_=e.selectors={cacheLength:50,createPseudo:r,match:pt,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(bt,_t),t[3]=(t[3]||t[4]||t[5]||"").replace(bt,_t),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||e.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&e.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return pt.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&dt.test(n)&&(e=M(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(bt,_t).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=B[t+" "];return e||(e=new RegExp("(^|"+nt+")"+t+"("+nt+"|$)"))&&B(t,function(t){return e.test("string"==typeof t.className&&t.className||"undefined"!=typeof t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,n,r){return function(o){var i=e.attr(o,t);return null==i?"!="===n:n?(i+="","="===n?i===r:"!="===n?i!==r:"^="===n?r&&0===i.indexOf(r):"*="===n?r&&i.indexOf(r)>-1:"$="===n?r&&i.slice(-r.length)===r:"~="===n?(" "+i.replace(st," ")+" ").indexOf(r)>-1:"|="===n?i===r||i.slice(0,r.length+1)===r+"-":!1):!0}},CHILD:function(t,e,n,r,o){var i="nth"!==t.slice(0,3),a="last"!==t.slice(-4),s="of-type"===e;return 1===r&&0===o?function(t){return!!t.parentNode}:function(e,n,u){var l,c,f,d,h,p,m=i!==a?"nextSibling":"previousSibling",g=e.parentNode,v=s&&e.nodeName.toLowerCase(),y=!u&&!s;if(g){if(i){for(;m;){for(f=e;f=f[m];)if(s?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;p=m="only"===t&&!p&&"nextSibling"}return!0}if(p=[a?g.firstChild:g.lastChild],a&&y){for(c=g[P]||(g[P]={}),l=c[t]||[],h=l[0]===H&&l[1],d=l[0]===H&&l[2],f=h&&g.childNodes[h];f=++h&&f&&f[m]||(d=h=0)||p.pop();)if(1===f.nodeType&&++d&&f===e){c[t]=[H,h,d];break}}else if(y&&(l=(e[P]||(e[P]={}))[t])&&l[0]===H)d=l[1];else for(;(f=++h&&f&&f[m]||(d=h=0)||p.pop())&&((s?f.nodeName.toLowerCase()!==v:1!==f.nodeType)||!++d||(y&&((f[P]||(f[P]={}))[t]=[H,d]),f!==e)););return d-=o,d===r||d%r===0&&d/r>=0}}},PSEUDO:function(t,n){var o,i=_.pseudos[t]||_.setFilters[t.toLowerCase()]||e.error("unsupported pseudo: "+t);return i[P]?i(n):i.length>1?(o=[t,t,"",n],_.setFilters.hasOwnProperty(t.toLowerCase())?r(function(t,e){for(var r,o=i(t,n),a=o.length;a--;)r=tt(t,o[a]),t[r]=!(e[r]=o[a])}):function(t){return i(t,0,o)}):i}},pseudos:{not:r(function(t){var e=[],n=[],o=E(t.replace(ut,"$1"));return o[P]?r(function(t,e,n,r){for(var i,a=o(t,null,r,[]),s=t.length;s--;)(i=a[s])&&(t[s]=!(e[s]=i))}):function(t,r,i){return e[0]=t,o(e,null,i,n),e[0]=null,!n.pop()}}),has:r(function(t){return function(n){return e(t,n).length>0}}),contains:r(function(t){return t=t.replace(bt,_t),function(e){return(e.textContent||e.innerText||k(e)).indexOf(t)>-1}}),lang:r(function(t){return ht.test(t||"")||e.error("unsupported lang: "+t),t=t.replace(bt,_t).toLowerCase(),function(e){var n;do if(n=D?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return n=n.toLowerCase(),n===t||0===n.indexOf(t+"-");while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===q},focus:function(t){return t===O.activeElement&&(!O.hasFocus||O.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return t.disabled===!1},disabled:function(t){return t.disabled===!0},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,t.selected===!0},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!_.pseudos.empty(t)},header:function(t){return gt.test(t.nodeName)},input:function(t){return mt.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:l(function(){return[0]}),last:l(function(t,e){return[e-1]}),eq:l(function(t,e,n){return[0>n?n+e:n]}),even:l(function(t,e){for(var n=0;e>n;n+=2)t.push(n);return t}),odd:l(function(t,e){for(var n=1;e>n;n+=2)t.push(n);return t}),lt:l(function(t,e,n){for(var r=0>n?n+e:n;--r>=0;)t.push(r);return t}),gt:l(function(t,e,n){for(var r=0>n?n+e:n;++r<e;)t.push(r);return t})}},_.pseudos.nth=_.pseudos.eq;for(w in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})_.pseudos[w]=s(w);for(w in{submit:!0,reset:!0})_.pseudos[w]=u(w);return f.prototype=_.filters=_.pseudos,_.setFilters=new f,M=e.tokenize=function(t,n){var r,o,i,a,s,u,l,c=V[t+" "];if(c)return n?0:c.slice(0);for(s=t,u=[],l=_.preFilter;s;){(!r||(o=lt.exec(s)))&&(o&&(s=s.slice(o[0].length)||s),u.push(i=[])),r=!1,(o=ct.exec(s))&&(r=o.shift(),i.push({value:r,type:o[0].replace(ut," ")}),s=s.slice(r.length));for(a in _.filter)!(o=pt[a].exec(s))||l[a]&&!(o=l[a](o))||(r=o.shift(),i.push({value:r,type:a,matches:o}),s=s.slice(r.length));if(!r)break}return n?s.length:s?e.error(t):V(t,u).slice(0)},E=e.compile=function(t,e){var n,r=[],o=[],i=U[t+" "];if(!i){for(e||(e=M(t)),n=e.length;n--;)i=y(e[n]),i[P]?r.push(i):o.push(i);i=U(t,x(o,r)),i.selector=t}return i},C=e.select=function(t,e,n,r){var o,i,a,s,u,l="function"==typeof t&&t,f=!r&&M(t=l.selector||t);if(n=n||[],1===f.length){if(i=f[0]=f[0].slice(0),i.length>2&&"ID"===(a=i[0]).type&&b.getById&&9===e.nodeType&&D&&_.relative[i[1].type]){if(e=(_.find.ID(a.matches[0].replace(bt,_t),e)||[])[0],!e)return n;l&&(e=e.parentNode),t=t.slice(i.shift().value.length)}for(o=pt.needsContext.test(t)?0:i.length;o--&&(a=i[o],!_.relative[s=a.type]);)if((u=_.find[s])&&(r=u(a.matches[0].replace(bt,_t),xt.test(i[0].type)&&c(e.parentNode)||e))){if(i.splice(o,1),t=r.length&&d(i),!t)return G.apply(n,r),n;break}}return(l||E(t,f))(r,e,!D,n,xt.test(t)&&c(e.parentNode)||e),n},b.sortStable=P.split("").sort(W).join("")===P,b.detectDuplicates=!!T,N(),b.sortDetached=o(function(t){return 1&t.compareDocumentPosition(O.createElement("div"))}),o(function(t){return t.innerHTML="<a href='#'></a>","#"===t.firstChild.getAttribute("href")})||i("type|href|height|width",function(t,e,n){return n?void 0:t.getAttribute(e,"type"===e.toLowerCase()?1:2)}),b.attributes&&o(function(t){return t.innerHTML="<input/>",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")})||i("value",function(t,e,n){return n||"input"!==t.nodeName.toLowerCase()?void 0:t.defaultValue}),o(function(t){return null==t.getAttribute("disabled")})||i(et,function(t,e,n){var r;return n?void 0:t[e]===!0?e.toLowerCase():(r=t.getAttributeNode(e))&&r.specified?r.value:null}),e}(t);Q.find=ot,Q.expr=ot.selectors,Q.expr[":"]=Q.expr.pseudos,Q.unique=ot.uniqueSort,Q.text=ot.getText,Q.isXMLDoc=ot.isXML,Q.contains=ot.contains;var it=Q.expr.match.needsContext,at=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,st=/^.[^:#\[\.,]*$/;Q.filter=function(t,e,n){var r=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===r.nodeType?Q.find.matchesSelector(r,t)?[r]:[]:Q.find.matches(t,Q.grep(e,function(t){return 1===t.nodeType}))},Q.fn.extend({find:function(t){var e,n=this.length,r=[],o=this;if("string"!=typeof t)return this.pushStack(Q(t).filter(function(){for(e=0;n>e;e++)if(Q.contains(o[e],this))return!0}));for(e=0;n>e;e++)Q.find(t,o[e],r);return r=this.pushStack(n>1?Q.unique(r):r),r.selector=this.selector?this.selector+" "+t:t,r},filter:function(t){return this.pushStack(r(this,t||[],!1))},not:function(t){return this.pushStack(r(this,t||[],!0))},is:function(t){return!!r(this,"string"==typeof t&&it.test(t)?Q(t):t||[],!1).length}});var ut,lt=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,ct=Q.fn.init=function(t,e){var n,r;if(!t)return this;if("string"==typeof t){if(n="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:lt.exec(t),!n||!n[1]&&e)return!e||e.jquery?(e||ut).find(t):this.constructor(e).find(t);if(n[1]){if(e=e instanceof Q?e[0]:e,Q.merge(this,Q.parseHTML(n[1],e&&e.nodeType?e.ownerDocument||e:K,!0)),at.test(n[1])&&Q.isPlainObject(e))for(n in e)Q.isFunction(this[n])?this[n](e[n]):this.attr(n,e[n]);return this}return r=K.getElementById(n[2]),r&&r.parentNode&&(this.length=1,this[0]=r),this.context=K,this.selector=t,this}return t.nodeType?(this.context=this[0]=t,this.length=1,this):Q.isFunction(t)?"undefined"!=typeof ut.ready?ut.ready(t):t(Q):(void 0!==t.selector&&(this.selector=t.selector,this.context=t.context),Q.makeArray(t,this))};ct.prototype=Q.fn,ut=Q(K);var ft=/^(?:parents|prev(?:Until|All))/,dt={children:!0,contents:!0,next:!0,prev:!0};Q.extend({dir:function(t,e,n){for(var r=[],o=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(o&&Q(t).is(n))break;r.push(t)}return r},sibling:function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n}}),Q.fn.extend({has:function(t){var e=Q(t,this),n=e.length;return this.filter(function(){for(var t=0;n>t;t++)if(Q.contains(this,e[t]))return!0})},closest:function(t,e){for(var n,r=0,o=this.length,i=[],a=it.test(t)||"string"!=typeof t?Q(t,e||this.context):0;o>r;r++)for(n=this[r];n&&n!==e;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&Q.find.matchesSelector(n,t))){i.push(n);break}return this.pushStack(i.length>1?Q.unique(i):i)},index:function(t){return t?"string"==typeof t?W.call(Q(t),this[0]):W.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(Q.unique(Q.merge(this.get(),Q(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),Q.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return Q.dir(t,"parentNode")},parentsUntil:function(t,e,n){return Q.dir(t,"parentNode",n)},next:function(t){return o(t,"nextSibling")},prev:function(t){return o(t,"previousSibling")},nextAll:function(t){return Q.dir(t,"nextSibling")},prevAll:function(t){return Q.dir(t,"previousSibling")},nextUntil:function(t,e,n){return Q.dir(t,"nextSibling",n)},prevUntil:function(t,e,n){return Q.dir(t,"previousSibling",n)},siblings:function(t){return Q.sibling((t.parentNode||{}).firstChild,t)},children:function(t){return Q.sibling(t.firstChild)},contents:function(t){return t.contentDocument||Q.merge([],t.childNodes)}},function(t,e){Q.fn[t]=function(n,r){var o=Q.map(this,e,n);return"Until"!==t.slice(-5)&&(r=n),r&&"string"==typeof r&&(o=Q.filter(r,o)),this.length>1&&(dt[t]||Q.unique(o),ft.test(t)&&o.reverse()),this.pushStack(o)}});var ht=/\S+/g,pt={};Q.Callbacks=function(t){t="string"==typeof t?pt[t]||i(t):Q.extend({},t);var e,n,r,o,a,s,u=[],l=!t.once&&[],c=function(data){for(e=t.memory&&data,n=!0,s=o||0,o=0,a=u.length,r=!0;u&&a>s;s++)if(u[s].apply(data[0],data[1])===!1&&t.stopOnFalse){e=!1;break}r=!1,u&&(l?l.length&&c(l.shift()):e?u=[]:f.disable())},f={add:function(){if(u){var n=u.length;!function i(e){Q.each(e,function(e,n){var r=Q.type(n);"function"===r?t.unique&&f.has(n)||u.push(n):n&&n.length&&"string"!==r&&i(n)})}(arguments),r?a=u.length:e&&(o=n,c(e))}return this},remove:function(){return u&&Q.each(arguments,function(t,e){for(var n;(n=Q.inArray(e,u,n))>-1;)u.splice(n,1),r&&(a>=n&&a--,s>=n&&s--)}),this},has:function(t){return t?Q.inArray(t,u)>-1:!(!u||!u.length)},empty:function(){return u=[],a=0,this},disable:function(){return u=l=e=void 0,this},disabled:function(){return!u},lock:function(){return l=void 0,e||f.disable(),this},locked:function(){return!l},fireWith:function(t,e){return!u||n&&!l||(e=e||[],e=[t,e.slice?e.slice():e],r?l.push(e):c(e)),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!n}};return f},Q.extend({Deferred:function(t){var e=[["resolve","done",Q.Callbacks("once memory"),"resolved"],["reject","fail",Q.Callbacks("once memory"),"rejected"],["notify","progress",Q.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return o.done(arguments).fail(arguments),this},then:function(){var t=arguments;return Q.Deferred(function(n){Q.each(e,function(e,i){var a=Q.isFunction(t[e])&&t[e];o[i[1]](function(){var t=a&&a.apply(this,arguments);t&&Q.isFunction(t.promise)?t.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[i[0]+"With"](this===r?n.promise():this,a?[t]:arguments)})}),t=null}).promise()},promise:function(t){return null!=t?Q.extend(t,r):r}},o={};return r.pipe=r.then,Q.each(e,function(t,i){var a=i[2],s=i[3];r[i[1]]=a.add,s&&a.add(function(){n=s},e[1^t][2].disable,e[2][2].lock),o[i[0]]=function(){return o[i[0]+"With"](this===o?r:this,arguments),this},o[i[0]+"With"]=a.fireWith}),r.promise(o),t&&t.call(o,o),o},when:function(t){var e,n,r,o=0,i=B.call(arguments),a=i.length,s=1!==a||t&&Q.isFunction(t.promise)?a:0,u=1===s?t:Q.Deferred(),l=function(t,n,r){return function(o){n[t]=this,r[t]=arguments.length>1?B.call(arguments):o,r===e?u.notifyWith(n,r):--s||u.resolveWith(n,r)}};if(a>1)for(e=new Array(a),n=new Array(a),r=new Array(a);a>o;o++)i[o]&&Q.isFunction(i[o].promise)?i[o].promise().done(l(o,r,i)).fail(u.reject).progress(l(o,n,e)):--s;return s||u.resolveWith(r,i),u.promise()}});var mt;Q.fn.ready=function(t){return Q.ready.promise().done(t),this},Q.extend({isReady:!1,readyWait:1,holdReady:function(t){t?Q.readyWait++:Q.ready(!0)},ready:function(t){(t===!0?--Q.readyWait:Q.isReady)||(Q.isReady=!0,t!==!0&&--Q.readyWait>0||(mt.resolveWith(K,[Q]),Q.fn.triggerHandler&&(Q(K).triggerHandler("ready"),Q(K).off("ready"))))}}),Q.ready.promise=function(e){return mt||(mt=Q.Deferred(),"complete"===K.readyState?setTimeout(Q.ready):(K.addEventListener("DOMContentLoaded",a,!1),t.addEventListener("load",a,!1))),mt.promise(e)},Q.ready.promise();var gt=Q.access=function(t,e,n,r,o,i,a){var s=0,u=t.length,l=null==n;if("object"===Q.type(n)){o=!0;for(s in n)Q.access(t,e,s,n[s],!0,i,a)}else if(void 0!==r&&(o=!0,Q.isFunction(r)||(a=!0),l&&(a?(e.call(t,r),e=null):(l=e,e=function(t,e,n){return l.call(Q(t),n)})),e))for(;u>s;s++)e(t[s],n,a?r:r.call(t[s],s,e(t[s],n)));return o?t:l?e.call(t):u?e(t[0],n):i};Q.acceptData=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType},s.uid=1,s.accepts=Q.acceptData,s.prototype={key:function(t){if(!s.accepts(t))return 0;var e={},n=t[this.expando];if(!n){n=s.uid++;try{e[this.expando]={value:n},Object.defineProperties(t,e)}catch(r){e[this.expando]=n,Q.extend(t,e)}}return this.cache[n]||(this.cache[n]={}),n},set:function(t,data,e){var n,r=this.key(t),o=this.cache[r];if("string"==typeof data)o[data]=e;else if(Q.isEmptyObject(o))Q.extend(this.cache[r],data);else for(n in data)o[n]=data[n];return o},get:function(t,e){var n=this.cache[this.key(t)];return void 0===e?n:n[e]},access:function(t,e,n){var r;return void 0===e||e&&"string"==typeof e&&void 0===n?(r=this.get(t,e),void 0!==r?r:this.get(t,Q.camelCase(e))):(this.set(t,e,n),void 0!==n?n:e)},remove:function(t,e){var n,r,o,i=this.key(t),a=this.cache[i];if(void 0===e)this.cache[i]={};else{Q.isArray(e)?r=e.concat(e.map(Q.camelCase)):(o=Q.camelCase(e),e in a?r=[e,o]:(r=o,r=r in a?[r]:r.match(ht)||[])),n=r.length;for(;n--;)delete a[r[n]]}},hasData:function(t){return!Q.isEmptyObject(this.cache[t[this.expando]]||{})},discard:function(t){t[this.expando]&&delete this.cache[t[this.expando]]}};var vt=new s,yt=new s,xt=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,wt=/([A-Z])/g;Q.extend({hasData:function(t){return yt.hasData(t)||vt.hasData(t)},data:function(t,e,data){return yt.access(t,e,data)},removeData:function(t,e){yt.remove(t,e)},_data:function(t,e,data){return vt.access(t,e,data)},_removeData:function(t,e){vt.remove(t,e)}}),Q.fn.extend({data:function(t,e){var n,r,data,o=this[0],i=o&&o.attributes;if(void 0===t){if(this.length&&(data=yt.get(o),1===o.nodeType&&!vt.get(o,"hasDataAttrs"))){for(n=i.length;n--;)i[n]&&(r=i[n].name,0===r.indexOf("data-")&&(r=Q.camelCase(r.slice(5)),u(o,r,data[r])));vt.set(o,"hasDataAttrs",!0)}return data}return"object"==typeof t?this.each(function(){yt.set(this,t)}):gt(this,function(e){var data,n=Q.camelCase(t);if(o&&void 0===e){if(data=yt.get(o,t),void 0!==data)return data;if(data=yt.get(o,n),void 0!==data)return data;if(data=u(o,n,void 0),void 0!==data)return data}else this.each(function(){var data=yt.get(this,n);yt.set(this,n,e),-1!==t.indexOf("-")&&void 0!==data&&yt.set(this,t,e)})},null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each(function(){yt.remove(this,t)})}}),Q.extend({queue:function(t,e,data){var n;return t?(e=(e||"fx")+"queue",n=vt.get(t,e),data&&(!n||Q.isArray(data)?n=vt.access(t,e,Q.makeArray(data)):n.push(data)),n||[]):void 0},dequeue:function(t,e){e=e||"fx";var n=Q.queue(t,e),r=n.length,o=n.shift(),i=Q._queueHooks(t,e),a=function(){Q.dequeue(t,e)};"inprogress"===o&&(o=n.shift(),r--),o&&("fx"===e&&n.unshift("inprogress"),delete i.stop,o.call(t,a,i)),!r&&i&&i.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return vt.get(t,n)||vt.access(t,n,{empty:Q.Callbacks("once memory").add(function(){vt.remove(t,[e+"queue",n])})})}}),Q.fn.extend({queue:function(t,data){var e=2;return"string"!=typeof t&&(data=t,t="fx",e--),arguments.length<e?Q.queue(this[0],t):void 0===data?this:this.each(function(){var e=Q.queue(this,t,data);Q._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&Q.dequeue(this,t)})},dequeue:function(t){return this.each(function(){Q.dequeue(this,t)})},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var n,r=1,o=Q.Deferred(),i=this,a=this.length,s=function(){--r||o.resolveWith(i,[i])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";a--;)n=vt.get(i[a],t+"queueHooks"),n&&n.empty&&(r++,n.empty.add(s));return s(),o.promise(e)}});var bt=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,_t=["Top","Right","Bottom","Left"],kt=function(t,e){return t=e||t,"none"===Q.css(t,"display")||!Q.contains(t.ownerDocument,t)},jt=/^(?:checkbox|radio)$/i;!function(){var t=K.createDocumentFragment(),e=t.appendChild(K.createElement("div")),n=K.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),e.appendChild(n),Z.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="<textarea>x</textarea>",Z.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var Mt="undefined";Z.focusinBubbles="onfocusin"in t;var Et=/^key/,Ct=/^(?:mouse|pointer|contextmenu)|click/,St=/^(?:focusinfocus|focusoutblur)$/,At=/^([^.]*)(?:\.(.+)|)$/;Q.event={global:{},add:function(t,e,n,data,r){var o,i,a,s,u,l,c,f,d,h,p,m=vt.get(t);if(m)for(n.handler&&(o=n,n=o.handler,r=o.selector),n.guid||(n.guid=Q.guid++),(s=m.events)||(s=m.events={}),(i=m.handle)||(i=m.handle=function(e){return typeof Q!==Mt&&Q.event.triggered!==e.type?Q.event.dispatch.apply(t,arguments):void 0}),e=(e||"").match(ht)||[""],u=e.length;u--;)a=At.exec(e[u])||[],d=p=a[1],h=(a[2]||"").split(".").sort(),d&&(c=Q.event.special[d]||{},d=(r?c.delegateType:c.bindType)||d,c=Q.event.special[d]||{},l=Q.extend({type:d,origType:p,data:data,handler:n,guid:n.guid,selector:r,needsContext:r&&Q.expr.match.needsContext.test(r),namespace:h.join(".")},o),(f=s[d])||(f=s[d]=[],f.delegateCount=0,c.setup&&c.setup.call(t,data,h,i)!==!1||t.addEventListener&&t.addEventListener(d,i,!1)),c.add&&(c.add.call(t,l),l.handler.guid||(l.handler.guid=n.guid)),r?f.splice(f.delegateCount++,0,l):f.push(l),Q.event.global[d]=!0)},remove:function(t,e,n,r,o){var i,a,s,u,l,c,f,d,h,p,m,g=vt.hasData(t)&&vt.get(t);if(g&&(u=g.events)){for(e=(e||"").match(ht)||[""],l=e.length;l--;)if(s=At.exec(e[l])||[],h=m=s[1],p=(s[2]||"").split(".").sort(),h){for(f=Q.event.special[h]||{},h=(r?f.delegateType:f.bindType)||h,d=u[h]||[],s=s[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=i=d.length;i--;)c=d[i],!o&&m!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(d.splice(i,1),c.selector&&d.delegateCount--,f.remove&&f.remove.call(t,c));a&&!d.length&&(f.teardown&&f.teardown.call(t,p,g.handle)!==!1||Q.removeEvent(t,h,g.handle),delete u[h])}else for(h in u)Q.event.remove(t,h+e[l],n,r,!0);Q.isEmptyObject(u)&&(delete g.handle,vt.remove(t,"events"))}},trigger:function(e,data,n,r){var o,i,a,s,u,l,c,f=[n||K],d=J.call(e,"type")?e.type:e,h=J.call(e,"namespace")?e.namespace.split("."):[];if(i=a=n=n||K,3!==n.nodeType&&8!==n.nodeType&&!St.test(d+Q.event.triggered)&&(d.indexOf(".")>=0&&(h=d.split("."),d=h.shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,e=e[Q.expando]?e:new Q.Event(d,"object"==typeof e&&e),e.isTrigger=r?2:3,e.namespace=h.join("."),e.namespace_re=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),data=null==data?[e]:Q.makeArray(data,[e]),c=Q.event.special[d]||{},r||!c.trigger||c.trigger.apply(n,data)!==!1)){if(!r&&!c.noBubble&&!Q.isWindow(n)){for(s=c.delegateType||d,St.test(s+d)||(i=i.parentNode);i;i=i.parentNode)f.push(i),a=i;a===(n.ownerDocument||K)&&f.push(a.defaultView||a.parentWindow||t)}for(o=0;(i=f[o++])&&!e.isPropagationStopped();)e.type=o>1?s:c.bindType||d,l=(vt.get(i,"events")||{})[e.type]&&vt.get(i,"handle"),l&&l.apply(i,data),l=u&&i[u],l&&l.apply&&Q.acceptData(i)&&(e.result=l.apply(i,data),e.result===!1&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&c._default.apply(f.pop(),data)!==!1||!Q.acceptData(n)||u&&Q.isFunction(n[d])&&!Q.isWindow(n)&&(a=n[u],a&&(n[u]=null),Q.event.triggered=d,n[d](),Q.event.triggered=void 0,a&&(n[u]=a)),e.result}},dispatch:function(t){t=Q.event.fix(t);var e,n,r,o,i,a=[],s=B.call(arguments),u=(vt.get(this,"events")||{})[t.type]||[],l=Q.event.special[t.type]||{};if(s[0]=t,t.delegateTarget=this,!l.preDispatch||l.preDispatch.call(this,t)!==!1){for(a=Q.event.handlers.call(this,t,u),e=0;(o=a[e++])&&!t.isPropagationStopped();)for(t.currentTarget=o.elem,n=0;(i=o.handlers[n++])&&!t.isImmediatePropagationStopped();)(!t.namespace_re||t.namespace_re.test(i.namespace))&&(t.handleObj=i,
+t.data=i.data,r=((Q.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,s),void 0!==r&&(t.result=r)===!1&&(t.preventDefault(),t.stopPropagation()));return l.postDispatch&&l.postDispatch.call(this,t),t.result}},handlers:function(t,e){var n,r,o,i,a=[],s=e.delegateCount,u=t.target;if(s&&u.nodeType&&(!t.button||"click"!==t.type))for(;u!==this;u=u.parentNode||this)if(u.disabled!==!0||"click"!==t.type){for(r=[],n=0;s>n;n++)i=e[n],o=i.selector+" ",void 0===r[o]&&(r[o]=i.needsContext?Q(o,this).index(u)>=0:Q.find(o,this,null,[u]).length),r[o]&&r.push(i);r.length&&a.push({elem:u,handlers:r})}return s<e.length&&a.push({elem:this,handlers:e.slice(s)}),a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(t,e){return null==t.which&&(t.which=null!=e.charCode?e.charCode:e.keyCode),t}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(t,e){var n,r,o,i=e.button;return null==t.pageX&&null!=e.clientX&&(n=t.target.ownerDocument||K,r=n.documentElement,o=n.body,t.pageX=e.clientX+(r&&r.scrollLeft||o&&o.scrollLeft||0)-(r&&r.clientLeft||o&&o.clientLeft||0),t.pageY=e.clientY+(r&&r.scrollTop||o&&o.scrollTop||0)-(r&&r.clientTop||o&&o.clientTop||0)),t.which||void 0===i||(t.which=1&i?1:2&i?3:4&i?2:0),t}},fix:function(t){if(t[Q.expando])return t;var e,n,r,o=t.type,i=t,a=this.fixHooks[o];for(a||(this.fixHooks[o]=a=Ct.test(o)?this.mouseHooks:Et.test(o)?this.keyHooks:{}),r=a.props?this.props.concat(a.props):this.props,t=new Q.Event(i),e=r.length;e--;)n=r[e],t[n]=i[n];return t.target||(t.target=K),3===t.target.nodeType&&(t.target=t.target.parentNode),a.filter?a.filter(t,i):t},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==f()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===f()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&Q.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(t){return Q.nodeName(t.target,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}},simulate:function(t,e,n,r){var o=Q.extend(new Q.Event,n,{type:t,isSimulated:!0,originalEvent:{}});r?Q.event.trigger(o,null,e):Q.event.dispatch.call(e,o),o.isDefaultPrevented()&&n.preventDefault()}},Q.removeEvent=function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n,!1)},Q.Event=function(t,e){return this instanceof Q.Event?(t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&t.returnValue===!1?l:c):this.type=t,e&&Q.extend(this,e),this.timeStamp=t&&t.timeStamp||Q.now(),void(this[Q.expando]=!0)):new Q.Event(t,e)},Q.Event.prototype={isDefaultPrevented:c,isPropagationStopped:c,isImmediatePropagationStopped:c,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=l,t&&t.preventDefault&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=l,t&&t.stopPropagation&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=l,t&&t.stopImmediatePropagation&&t.stopImmediatePropagation(),this.stopPropagation()}},Q.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(t,e){Q.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,r=this,o=t.relatedTarget,i=t.handleObj;return(!o||o!==r&&!Q.contains(r,o))&&(t.type=i.origType,n=i.handler.apply(this,arguments),t.type=e),n}}}),Z.focusinBubbles||Q.each({focus:"focusin",blur:"focusout"},function(t,e){var n=function(t){Q.event.simulate(e,t.target,Q.event.fix(t),!0)};Q.event.special[e]={setup:function(){var r=this.ownerDocument||this,o=vt.access(r,e);o||r.addEventListener(t,n,!0),vt.access(r,e,(o||0)+1)},teardown:function(){var r=this.ownerDocument||this,o=vt.access(r,e)-1;o?vt.access(r,e,o):(r.removeEventListener(t,n,!0),vt.remove(r,e))}}}),Q.fn.extend({on:function(t,e,data,n,r){var o,i;if("object"==typeof t){"string"!=typeof e&&(data=data||e,e=void 0);for(i in t)this.on(i,e,data,t[i],r);return this}if(null==data&&null==n?(n=e,data=e=void 0):null==n&&("string"==typeof e?(n=data,data=void 0):(n=data,data=e,e=void 0)),n===!1)n=c;else if(!n)return this;return 1===r&&(o=n,n=function(t){return Q().off(t),o.apply(this,arguments)},n.guid=o.guid||(o.guid=Q.guid++)),this.each(function(){Q.event.add(this,t,n,data,e)})},one:function(t,e,data,n){return this.on(t,e,data,n,1)},off:function(t,e,n){var r,o;if(t&&t.preventDefault&&t.handleObj)return r=t.handleObj,Q(t.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof t){for(o in t)this.off(o,e,t[o]);return this}return(e===!1||"function"==typeof e)&&(n=e,e=void 0),n===!1&&(n=c),this.each(function(){Q.event.remove(this,t,n,e)})},trigger:function(t,data){return this.each(function(){Q.event.trigger(t,data,this)})},triggerHandler:function(t,data){var e=this[0];return e?Q.event.trigger(t,data,e,!0):void 0}});var Tt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Nt=/<([\w:]+)/,Ot=/<|&#?\w+;/,qt=/<(?:script|style|link)/i,Dt=/checked\s*(?:[^=]|=\s*.checked.)/i,Lt=/^$|\/(?:java|ecma)script/i,Ft=/^true\/(.*)/,zt=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Rt={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};Rt.optgroup=Rt.option,Rt.tbody=Rt.tfoot=Rt.colgroup=Rt.caption=Rt.thead,Rt.th=Rt.td,Q.extend({clone:function(t,e,n){var r,o,i,a,s=t.cloneNode(!0),u=Q.contains(t.ownerDocument,t);if(!(Z.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||Q.isXMLDoc(t)))for(a=v(s),i=v(t),r=0,o=i.length;o>r;r++)y(i[r],a[r]);if(e)if(n)for(i=i||v(t),a=a||v(s),r=0,o=i.length;o>r;r++)g(i[r],a[r]);else g(t,s);return a=v(s,"script"),a.length>0&&m(a,!u&&v(t,"script")),s},buildFragment:function(t,e,n,r){for(var o,i,a,s,u,l,c=e.createDocumentFragment(),f=[],d=0,h=t.length;h>d;d++)if(o=t[d],o||0===o)if("object"===Q.type(o))Q.merge(f,o.nodeType?[o]:o);else if(Ot.test(o)){for(i=i||c.appendChild(e.createElement("div")),a=(Nt.exec(o)||["",""])[1].toLowerCase(),s=Rt[a]||Rt._default,i.innerHTML=s[1]+o.replace(Tt,"<$1></$2>")+s[2],l=s[0];l--;)i=i.lastChild;Q.merge(f,i.childNodes),i=c.firstChild,i.textContent=""}else f.push(e.createTextNode(o));for(c.textContent="",d=0;o=f[d++];)if((!r||-1===Q.inArray(o,r))&&(u=Q.contains(o.ownerDocument,o),i=v(c.appendChild(o),"script"),u&&m(i),n))for(l=0;o=i[l++];)Lt.test(o.type||"")&&n.push(o);return c},cleanData:function(t){for(var data,e,n,r,o=Q.event.special,i=0;void 0!==(e=t[i]);i++){if(Q.acceptData(e)&&(r=e[vt.expando],r&&(data=vt.cache[r]))){if(data.events)for(n in data.events)o[n]?Q.event.remove(e,n):Q.removeEvent(e,n,data.handle);vt.cache[r]&&delete vt.cache[r]}delete yt.cache[e[yt.expando]]}}}),Q.fn.extend({text:function(t){return gt(this,function(t){return void 0===t?Q.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=t)})},null,t,arguments.length)},append:function(){return this.domManip(arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=d(this,t);e.appendChild(t)}})},prepend:function(){return this.domManip(arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=d(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return this.domManip(arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return this.domManip(arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},remove:function(t,e){for(var n,r=t?Q.filter(t,this):this,o=0;null!=(n=r[o]);o++)e||1!==n.nodeType||Q.cleanData(v(n)),n.parentNode&&(e&&Q.contains(n.ownerDocument,n)&&m(v(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(Q.cleanData(v(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null==t?!1:t,e=null==e?t:e,this.map(function(){return Q.clone(this,t,e)})},html:function(t){return gt(this,function(t){var e=this[0]||{},n=0,r=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!qt.test(t)&&!Rt[(Nt.exec(t)||["",""])[1].toLowerCase()]){t=t.replace(Tt,"<$1></$2>");try{for(;r>n;n++)e=this[n]||{},1===e.nodeType&&(Q.cleanData(v(e,!1)),e.innerHTML=t);e=0}catch(o){}}e&&this.empty().append(t)},null,t,arguments.length)},replaceWith:function(){var t=arguments[0];return this.domManip(arguments,function(e){t=this.parentNode,Q.cleanData(v(this)),t&&t.replaceChild(e,this)}),t&&(t.length||t.nodeType)?this:this.remove()},detach:function(t){return this.remove(t,!0)},domManip:function(t,e){t=V.apply([],t);var n,r,o,i,a,s,u=0,l=this.length,c=this,f=l-1,d=t[0],m=Q.isFunction(d);if(m||l>1&&"string"==typeof d&&!Z.checkClone&&Dt.test(d))return this.each(function(n){var r=c.eq(n);m&&(t[0]=d.call(this,n,r.html())),r.domManip(t,e)});if(l&&(n=Q.buildFragment(t,this[0].ownerDocument,!1,this),r=n.firstChild,1===n.childNodes.length&&(n=r),r)){for(o=Q.map(v(n,"script"),h),i=o.length;l>u;u++)a=n,u!==f&&(a=Q.clone(a,!0,!0),i&&Q.merge(o,v(a,"script"))),e.call(this[u],a,u);if(i)for(s=o[o.length-1].ownerDocument,Q.map(o,p),u=0;i>u;u++)a=o[u],Lt.test(a.type||"")&&!vt.access(a,"globalEval")&&Q.contains(s,a)&&(a.src?Q._evalUrl&&Q._evalUrl(a.src):Q.globalEval(a.textContent.replace(zt,"")))}return this}}),Q.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(t,e){Q.fn[t]=function(t){for(var n,r=[],o=Q(t),i=o.length-1,a=0;i>=a;a++)n=a===i?this:this.clone(!0),Q(o[a])[e](n),U.apply(r,n.get());return this.pushStack(r)}});var Pt,It={},Ht=/^margin/,$t=new RegExp("^("+bt+")(?!px)[a-z%]+$","i"),Bt=function(e){return e.ownerDocument.defaultView.opener?e.ownerDocument.defaultView.getComputedStyle(e,null):t.getComputedStyle(e,null)};!function(){function e(){a.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",a.innerHTML="",o.appendChild(i);var e=t.getComputedStyle(a,null);n="1%"!==e.top,r="4px"===e.width,o.removeChild(i)}var n,r,o=K.documentElement,i=K.createElement("div"),a=K.createElement("div");a.style&&(a.style.backgroundClip="content-box",a.cloneNode(!0).style.backgroundClip="",Z.clearCloneStyle="content-box"===a.style.backgroundClip,i.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",i.appendChild(a),t.getComputedStyle&&Q.extend(Z,{pixelPosition:function(){return e(),n},boxSizingReliable:function(){return null==r&&e(),r},reliableMarginRight:function(){var e,n=a.appendChild(K.createElement("div"));return n.style.cssText=a.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",n.style.marginRight=n.style.width="0",a.style.width="1px",o.appendChild(i),e=!parseFloat(t.getComputedStyle(n,null).marginRight),o.removeChild(i),a.removeChild(n),e}}))}(),Q.swap=function(t,e,n,r){var o,i,a={};for(i in e)a[i]=t.style[i],t.style[i]=e[i];o=n.apply(t,r||[]);for(i in e)t.style[i]=a[i];return o};var Vt=/^(none|table(?!-c[ea]).+)/,Ut=new RegExp("^("+bt+")(.*)$","i"),Wt=new RegExp("^([+-])=("+bt+")","i"),Yt={position:"absolute",visibility:"hidden",display:"block"},Xt={letterSpacing:"0",fontWeight:"400"},Jt=["Webkit","O","Moz","ms"];Q.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=b(t,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(t,e,n,r){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var o,i,a,s=Q.camelCase(e),u=t.style;return e=Q.cssProps[s]||(Q.cssProps[s]=k(u,s)),a=Q.cssHooks[e]||Q.cssHooks[s],void 0===n?a&&"get"in a&&void 0!==(o=a.get(t,!1,r))?o:u[e]:(i=typeof n,"string"===i&&(o=Wt.exec(n))&&(n=(o[1]+1)*o[2]+parseFloat(Q.css(t,e)),i="number"),null!=n&&n===n&&("number"!==i||Q.cssNumber[s]||(n+="px"),Z.clearCloneStyle||""!==n||0!==e.indexOf("background")||(u[e]="inherit"),a&&"set"in a&&void 0===(n=a.set(t,n,r))||(u[e]=n)),void 0)}},css:function(t,e,n,r){var o,i,a,s=Q.camelCase(e);return e=Q.cssProps[s]||(Q.cssProps[s]=k(t.style,s)),a=Q.cssHooks[e]||Q.cssHooks[s],a&&"get"in a&&(o=a.get(t,!0,n)),void 0===o&&(o=b(t,e,r)),"normal"===o&&e in Xt&&(o=Xt[e]),""===n||n?(i=parseFloat(o),n===!0||Q.isNumeric(i)?i||0:o):o}}),Q.each(["height","width"],function(t,e){Q.cssHooks[e]={get:function(t,n,r){return n?Vt.test(Q.css(t,"display"))&&0===t.offsetWidth?Q.swap(t,Yt,function(){return E(t,e,r)}):E(t,e,r):void 0},set:function(t,n,r){var o=r&&Bt(t);return j(t,n,r?M(t,e,r,"border-box"===Q.css(t,"boxSizing",!1,o),o):0)}}}),Q.cssHooks.marginRight=_(Z.reliableMarginRight,function(t,e){return e?Q.swap(t,{display:"inline-block"},b,[t,"marginRight"]):void 0}),Q.each({margin:"",padding:"",border:"Width"},function(t,e){Q.cssHooks[t+e]={expand:function(n){for(var r=0,o={},i="string"==typeof n?n.split(" "):[n];4>r;r++)o[t+_t[r]+e]=i[r]||i[r-2]||i[0];return o}},Ht.test(t)||(Q.cssHooks[t+e].set=j)}),Q.fn.extend({css:function(t,e){return gt(this,function(t,e,n){var r,o,i={},a=0;if(Q.isArray(e)){for(r=Bt(t),o=e.length;o>a;a++)i[e[a]]=Q.css(t,e[a],!1,r);return i}return void 0!==n?Q.style(t,e,n):Q.css(t,e)},t,e,arguments.length>1)},show:function(){return C(this,!0)},hide:function(){return C(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each(function(){kt(this)?Q(this).show():Q(this).hide()})}}),Q.Tween=S,S.prototype={constructor:S,init:function(t,e,n,r,o,i){this.elem=t,this.prop=n,this.easing=o||"swing",this.options=e,this.start=this.now=this.cur(),this.end=r,this.unit=i||(Q.cssNumber[n]?"":"px")},cur:function(){var t=S.propHooks[this.prop];return t&&t.get?t.get(this):S.propHooks._default.get(this)},run:function(t){var e,n=S.propHooks[this.prop];return this.pos=e=this.options.duration?Q.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):S.propHooks._default.set(this),this}},S.prototype.init.prototype=S.prototype,S.propHooks={_default:{get:function(t){var e;return null==t.elem[t.prop]||t.elem.style&&null!=t.elem.style[t.prop]?(e=Q.css(t.elem,t.prop,""),e&&"auto"!==e?e:0):t.elem[t.prop]},set:function(t){Q.fx.step[t.prop]?Q.fx.step[t.prop](t):t.elem.style&&(null!=t.elem.style[Q.cssProps[t.prop]]||Q.cssHooks[t.prop])?Q.style(t.elem,t.prop,t.now+t.unit):t.elem[t.prop]=t.now}}},S.propHooks.scrollTop=S.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},Q.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2}},Q.fx=S.prototype.init,Q.fx.step={};var Zt,Kt,Gt=/^(?:toggle|show|hide)$/,Qt=new RegExp("^(?:([+-])=|)("+bt+")([a-z%]*)$","i"),te=/queueHooks$/,ee=[O],ne={"*":[function(t,e){var n=this.createTween(t,e),r=n.cur(),o=Qt.exec(e),i=o&&o[3]||(Q.cssNumber[t]?"":"px"),a=(Q.cssNumber[t]||"px"!==i&&+r)&&Qt.exec(Q.css(n.elem,t)),s=1,u=20;if(a&&a[3]!==i){i=i||a[3],o=o||[],a=+r||1;do s=s||".5",a/=s,Q.style(n.elem,t,a+i);while(s!==(s=n.cur()/r)&&1!==s&&--u)}return o&&(a=n.start=+a||+r||0,n.unit=i,n.end=o[1]?a+(o[1]+1)*o[2]:+o[2]),n}]};Q.Animation=Q.extend(D,{tweener:function(t,e){Q.isFunction(t)?(e=t,t=["*"]):t=t.split(" ");for(var n,r=0,o=t.length;o>r;r++)n=t[r],ne[n]=ne[n]||[],ne[n].unshift(e)},prefilter:function(t,e){e?ee.unshift(t):ee.push(t)}}),Q.speed=function(t,e,n){var r=t&&"object"==typeof t?Q.extend({},t):{complete:n||!n&&e||Q.isFunction(t)&&t,duration:t,easing:n&&e||e&&!Q.isFunction(e)&&e};return r.duration=Q.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in Q.fx.speeds?Q.fx.speeds[r.duration]:Q.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){Q.isFunction(r.old)&&r.old.call(this),r.queue&&Q.dequeue(this,r.queue)},r},Q.fn.extend({fadeTo:function(t,e,n,r){return this.filter(kt).css("opacity",0).show().end().animate({opacity:e},t,n,r)},animate:function(t,e,n,r){var o=Q.isEmptyObject(t),i=Q.speed(e,n,r),a=function(){var e=D(this,Q.extend({},t),i);(o||vt.get(this,"finish"))&&e.stop(!0)};return a.finish=a,o||i.queue===!1?this.each(a):this.queue(i.queue,a)},stop:function(t,e,n){var r=function(t){var e=t.stop;delete t.stop,e(n)};return"string"!=typeof t&&(n=e,e=t,t=void 0),e&&t!==!1&&this.queue(t||"fx",[]),this.each(function(){var e=!0,o=null!=t&&t+"queueHooks",i=Q.timers,data=vt.get(this);if(o)data[o]&&data[o].stop&&r(data[o]);else for(o in data)data[o]&&data[o].stop&&te.test(o)&&r(data[o]);for(o=i.length;o--;)i[o].elem!==this||null!=t&&i[o].queue!==t||(i[o].anim.stop(n),e=!1,i.splice(o,1));(e||!n)&&Q.dequeue(this,t)})},finish:function(t){return t!==!1&&(t=t||"fx"),this.each(function(){var e,data=vt.get(this),n=data[t+"queue"],r=data[t+"queueHooks"],o=Q.timers,i=n?n.length:0;for(data.finish=!0,Q.queue(this,t,[]),r&&r.stop&&r.stop.call(this,!0),e=o.length;e--;)o[e].elem===this&&o[e].queue===t&&(o[e].anim.stop(!0),o.splice(e,1));for(e=0;i>e;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete data.finish})}}),Q.each(["toggle","show","hide"],function(t,e){var n=Q.fn[e];Q.fn[e]=function(t,r,o){return null==t||"boolean"==typeof t?n.apply(this,arguments):this.animate(T(e,!0),t,r,o)}}),Q.each({slideDown:T("show"),slideUp:T("hide"),slideToggle:T("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(t,e){Q.fn[t]=function(t,n,r){return this.animate(e,t,n,r)}}),Q.timers=[],Q.fx.tick=function(){var t,e=0,n=Q.timers;for(Zt=Q.now();e<n.length;e++)t=n[e],t()||n[e]!==t||n.splice(e--,1);n.length||Q.fx.stop(),Zt=void 0},Q.fx.timer=function(t){Q.timers.push(t),t()?Q.fx.start():Q.timers.pop()},Q.fx.interval=13,Q.fx.start=function(){Kt||(Kt=setInterval(Q.fx.tick,Q.fx.interval))},Q.fx.stop=function(){clearInterval(Kt),Kt=null},Q.fx.speeds={slow:600,fast:200,_default:400},Q.fn.delay=function(t,e){return t=Q.fx?Q.fx.speeds[t]||t:t,e=e||"fx",this.queue(e,function(e,n){var r=setTimeout(e,t);n.stop=function(){clearTimeout(r)}})},function(){var t=K.createElement("input"),e=K.createElement("select"),n=e.appendChild(K.createElement("option"));t.type="checkbox",Z.checkOn=""!==t.value,Z.optSelected=n.selected,e.disabled=!0,Z.optDisabled=!n.disabled,t=K.createElement("input"),t.value="t",t.type="radio",Z.radioValue="t"===t.value}();var re,oe,ie=Q.expr.attrHandle;Q.fn.extend({attr:function(t,e){return gt(this,Q.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each(function(){Q.removeAttr(this,t)})}}),Q.extend({attr:function(t,e,n){var r,o,i=t.nodeType;if(t&&3!==i&&8!==i&&2!==i)return typeof t.getAttribute===Mt?Q.prop(t,e,n):(1===i&&Q.isXMLDoc(t)||(e=e.toLowerCase(),r=Q.attrHooks[e]||(Q.expr.match.bool.test(e)?oe:re)),void 0===n?r&&"get"in r&&null!==(o=r.get(t,e))?o:(o=Q.find.attr(t,e),null==o?void 0:o):null!==n?r&&"set"in r&&void 0!==(o=r.set(t,n,e))?o:(t.setAttribute(e,n+""),n):void Q.removeAttr(t,e))},removeAttr:function(t,e){var n,r,o=0,i=e&&e.match(ht);if(i&&1===t.nodeType)for(;n=i[o++];)r=Q.propFix[n]||n,Q.expr.match.bool.test(n)&&(t[r]=!1),t.removeAttribute(n)},attrHooks:{type:{set:function(t,e){if(!Z.radioValue&&"radio"===e&&Q.nodeName(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}}}),oe={set:function(t,e,n){return e===!1?Q.removeAttr(t,n):t.setAttribute(n,n),n}},Q.each(Q.expr.match.bool.source.match(/\w+/g),function(t,e){var n=ie[e]||Q.find.attr;ie[e]=function(t,e,r){var o,i;return r||(i=ie[e],ie[e]=o,o=null!=n(t,e,r)?e.toLowerCase():null,ie[e]=i),o}});var ae=/^(?:input|select|textarea|button)$/i;Q.fn.extend({prop:function(t,e){return gt(this,Q.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each(function(){delete this[Q.propFix[t]||t]})}}),Q.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(t,e,n){var r,o,i,a=t.nodeType;if(t&&3!==a&&8!==a&&2!==a)return i=1!==a||!Q.isXMLDoc(t),i&&(e=Q.propFix[e]||e,o=Q.propHooks[e]),void 0!==n?o&&"set"in o&&void 0!==(r=o.set(t,n,e))?r:t[e]=n:o&&"get"in o&&null!==(r=o.get(t,e))?r:t[e]},propHooks:{tabIndex:{get:function(t){return t.hasAttribute("tabindex")||ae.test(t.nodeName)||t.href?t.tabIndex:-1}}}}),Z.optSelected||(Q.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null}}),Q.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){Q.propFix[this.toLowerCase()]=this});var se=/[\t\r\n\f]/g;Q.fn.extend({addClass:function(t){var e,n,r,o,i,a,s="string"==typeof t&&t,u=0,l=this.length;if(Q.isFunction(t))return this.each(function(e){Q(this).addClass(t.call(this,e,this.className))});if(s)for(e=(t||"").match(ht)||[];l>u;u++)if(n=this[u],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(se," "):" ")){for(i=0;o=e[i++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");a=Q.trim(r),n.className!==a&&(n.className=a)}return this},removeClass:function(t){var e,n,r,o,i,a,s=0===arguments.length||"string"==typeof t&&t,u=0,l=this.length;if(Q.isFunction(t))return this.each(function(e){Q(this).removeClass(t.call(this,e,this.className))});if(s)for(e=(t||"").match(ht)||[];l>u;u++)if(n=this[u],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(se," "):"")){for(i=0;o=e[i++];)for(;r.indexOf(" "+o+" ")>=0;)r=r.replace(" "+o+" "," ");a=t?Q.trim(r):"",n.className!==a&&(n.className=a)}return this},toggleClass:function(t,e){var n=typeof t;return"boolean"==typeof e&&"string"===n?e?this.addClass(t):this.removeClass(t):this.each(Q.isFunction(t)?function(n){Q(this).toggleClass(t.call(this,n,this.className,e),e)}:function(){if("string"===n)for(var e,r=0,o=Q(this),i=t.match(ht)||[];e=i[r++];)o.hasClass(e)?o.removeClass(e):o.addClass(e);else(n===Mt||"boolean"===n)&&(this.className&&vt.set(this,"__className__",this.className),this.className=this.className||t===!1?"":vt.get(this,"__className__")||"")})},hasClass:function(t){for(var e=" "+t+" ",n=0,r=this.length;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(se," ").indexOf(e)>=0)return!0;return!1}});var ue=/\r/g;Q.fn.extend({val:function(t){var e,n,r,o=this[0];{if(arguments.length)return r=Q.isFunction(t),this.each(function(n){var o;1===this.nodeType&&(o=r?t.call(this,n,Q(this).val()):t,null==o?o="":"number"==typeof o?o+="":Q.isArray(o)&&(o=Q.map(o,function(t){return null==t?"":t+""})),e=Q.valHooks[this.type]||Q.valHooks[this.nodeName.toLowerCase()],e&&"set"in e&&void 0!==e.set(this,o,"value")||(this.value=o))});if(o)return e=Q.valHooks[o.type]||Q.valHooks[o.nodeName.toLowerCase()],e&&"get"in e&&void 0!==(n=e.get(o,"value"))?n:(n=o.value,"string"==typeof n?n.replace(ue,""):null==n?"":n)}}}),Q.extend({valHooks:{option:{get:function(t){var e=Q.find.attr(t,"value");return null!=e?e:Q.trim(Q.text(t))}},select:{get:function(t){for(var e,n,r=t.options,o=t.selectedIndex,i="select-one"===t.type||0>o,a=i?null:[],s=i?o+1:r.length,u=0>o?s:i?o:0;s>u;u++)if(n=r[u],!(!n.selected&&u!==o||(Z.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&Q.nodeName(n.parentNode,"optgroup"))){if(e=Q(n).val(),i)return e;a.push(e)}return a},set:function(t,e){for(var n,r,o=t.options,i=Q.makeArray(e),a=o.length;a--;)r=o[a],(r.selected=Q.inArray(r.value,i)>=0)&&(n=!0);return n||(t.selectedIndex=-1),i}}}}),Q.each(["radio","checkbox"],function(){Q.valHooks[this]={set:function(t,e){return Q.isArray(e)?t.checked=Q.inArray(Q(t).val(),e)>=0:void 0}},Z.checkOn||(Q.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})}),Q.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(t,e){Q.fn[e]=function(data,t){return arguments.length>0?this.on(e,null,data,t):this.trigger(e)}}),Q.fn.extend({hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)},bind:function(t,data,e){return this.on(t,null,data,e)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,data,n){return this.on(e,t,data,n)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)}});var le=Q.now(),ce=/\?/;Q.parseJSON=function(data){return JSON.parse(data+"")},Q.parseXML=function(data){var t,e;if(!data||"string"!=typeof data)return null;try{e=new DOMParser,t=e.parseFromString(data,"text/xml")}catch(n){t=void 0}return(!t||t.getElementsByTagName("parsererror").length)&&Q.error("Invalid XML: "+data),t};var fe=/#.*$/,de=/([?&])_=[^&]*/,he=/^(.*?):[ \t]*([^\r\n]*)$/gm,pe=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,me=/^(?:GET|HEAD)$/,ge=/^\/\//,ve=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,ye={},xe={},we="*/".concat("*"),be=t.location.href,_e=ve.exec(be.toLowerCase())||[];Q.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:be,type:"GET",isLocal:pe.test(_e[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":we,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":Q.parseJSON,"text xml":Q.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?z(z(t,Q.ajaxSettings),e):z(Q.ajaxSettings,t)},ajaxPrefilter:L(ye),ajaxTransport:L(xe),ajax:function(t,e){function n(t,e,n,a){var u,c,v,y,w,_=e;2!==x&&(x=2,s&&clearTimeout(s),r=void 0,i=a||"",b.readyState=t>0?4:0,u=t>=200&&300>t||304===t,n&&(y=R(f,b,n)),y=P(f,y,b,u),u?(f.ifModified&&(w=b.getResponseHeader("Last-Modified"),w&&(Q.lastModified[o]=w),w=b.getResponseHeader("etag"),w&&(Q.etag[o]=w)),204===t||"HEAD"===f.type?_="nocontent":304===t?_="notmodified":(_=y.state,c=y.data,v=y.error,u=!v)):(v=_,(t||!_)&&(_="error",0>t&&(t=0))),b.status=t,b.statusText=(e||_)+"",u?p.resolveWith(d,[c,_,b]):p.rejectWith(d,[b,_,v]),b.statusCode(g),g=void 0,l&&h.trigger(u?"ajaxSuccess":"ajaxError",[b,f,u?c:v]),m.fireWith(d,[b,_]),l&&(h.trigger("ajaxComplete",[b,f]),--Q.active||Q.event.trigger("ajaxStop")))}"object"==typeof t&&(e=t,t=void 0),e=e||{};var r,o,i,a,s,u,l,c,f=Q.ajaxSetup({},e),d=f.context||f,h=f.context&&(d.nodeType||d.jquery)?Q(d):Q.event,p=Q.Deferred(),m=Q.Callbacks("once memory"),g=f.statusCode||{},v={},y={},x=0,w="canceled",b={readyState:0,getResponseHeader:function(t){var e;if(2===x){if(!a)for(a={};e=he.exec(i);)a[e[1].toLowerCase()]=e[2];e=a[t.toLowerCase()]}return null==e?null:e},getAllResponseHeaders:function(){return 2===x?i:null},setRequestHeader:function(t,e){var n=t.toLowerCase();return x||(t=y[n]=y[n]||t,v[t]=e),this},overrideMimeType:function(t){return x||(f.mimeType=t),this},statusCode:function(t){var e;if(t)if(2>x)for(e in t)g[e]=[g[e],t[e]];else b.always(t[b.status]);return this},abort:function(t){var e=t||w;return r&&r.abort(e),n(0,e),this}};if(p.promise(b).complete=m.add,b.success=b.done,b.error=b.fail,f.url=((t||f.url||be)+"").replace(fe,"").replace(ge,_e[1]+"//"),f.type=e.method||e.type||f.method||f.type,f.dataTypes=Q.trim(f.dataType||"*").toLowerCase().match(ht)||[""],null==f.crossDomain&&(u=ve.exec(f.url.toLowerCase()),f.crossDomain=!(!u||u[1]===_e[1]&&u[2]===_e[2]&&(u[3]||("http:"===u[1]?"80":"443"))===(_e[3]||("http:"===_e[1]?"80":"443")))),f.data&&f.processData&&"string"!=typeof f.data&&(f.data=Q.param(f.data,f.traditional)),F(ye,f,e,b),2===x)return b;l=Q.event&&f.global,l&&0===Q.active++&&Q.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!me.test(f.type),o=f.url,f.hasContent||(f.data&&(o=f.url+=(ce.test(o)?"&":"?")+f.data,delete f.data),f.cache===!1&&(f.url=de.test(o)?o.replace(de,"$1_="+le++):o+(ce.test(o)?"&":"?")+"_="+le++)),f.ifModified&&(Q.lastModified[o]&&b.setRequestHeader("If-Modified-Since",Q.lastModified[o]),Q.etag[o]&&b.setRequestHeader("If-None-Match",Q.etag[o])),(f.data&&f.hasContent&&f.contentType!==!1||e.contentType)&&b.setRequestHeader("Content-Type",f.contentType),b.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+we+"; q=0.01":""):f.accepts["*"]);for(c in f.headers)b.setRequestHeader(c,f.headers[c]);if(f.beforeSend&&(f.beforeSend.call(d,b,f)===!1||2===x))return b.abort();w="abort";for(c in{success:1,error:1,complete:1})b[c](f[c]);if(r=F(xe,f,e,b)){b.readyState=1,l&&h.trigger("ajaxSend",[b,f]),f.async&&f.timeout>0&&(s=setTimeout(function(){b.abort("timeout")},f.timeout));try{x=1,r.send(v,n)}catch(_){if(!(2>x))throw _;n(-1,_)}}else n(-1,"No Transport");return b},getJSON:function(t,data,e){return Q.get(t,data,e,"json")},getScript:function(t,e){return Q.get(t,void 0,e,"script")}}),Q.each(["get","post"],function(t,e){Q[e]=function(t,data,n,r){return Q.isFunction(data)&&(r=r||n,n=data,data=void 0),Q.ajax({url:t,type:e,dataType:r,data:data,success:n})}}),Q._evalUrl=function(t){return Q.ajax({url:t,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},Q.fn.extend({wrapAll:function(t){var e;return Q.isFunction(t)?this.each(function(e){Q(this).wrapAll(t.call(this,e))}):(this[0]&&(e=Q(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t}).append(this)),this)},wrapInner:function(t){return this.each(Q.isFunction(t)?function(e){Q(this).wrapInner(t.call(this,e))}:function(){var e=Q(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)})},wrap:function(t){var e=Q.isFunction(t);return this.each(function(n){Q(this).wrapAll(e?t.call(this,n):t)})},unwrap:function(){return this.parent().each(function(){Q.nodeName(this,"body")||Q(this).replaceWith(this.childNodes)}).end()}}),Q.expr.filters.hidden=function(t){return t.offsetWidth<=0&&t.offsetHeight<=0},Q.expr.filters.visible=function(t){return!Q.expr.filters.hidden(t)};var ke=/%20/g,je=/\[\]$/,Me=/\r?\n/g,Ee=/^(?:submit|button|image|reset|file)$/i,Ce=/^(?:input|select|textarea|keygen)/i;Q.param=function(t,e){var n,r=[],o=function(t,e){e=Q.isFunction(e)?e():null==e?"":e,r[r.length]=encodeURIComponent(t)+"="+encodeURIComponent(e)};if(void 0===e&&(e=Q.ajaxSettings&&Q.ajaxSettings.traditional),Q.isArray(t)||t.jquery&&!Q.isPlainObject(t))Q.each(t,function(){o(this.name,this.value)});else for(n in t)I(n,t[n],e,o);return r.join("&").replace(ke,"+")},Q.fn.extend({serialize:function(){return Q.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=Q.prop(this,"elements");return t?Q.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!Q(this).is(":disabled")&&Ce.test(this.nodeName)&&!Ee.test(t)&&(this.checked||!jt.test(t))}).map(function(t,e){var n=Q(this).val();return null==n?null:Q.isArray(n)?Q.map(n,function(t){return{name:e.name,value:t.replace(Me,"\r\n")}}):{name:e.name,value:n.replace(Me,"\r\n")}}).get()}}),Q.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(t){}};var Se=0,Ae={},Te={0:200,1223:204},Ne=Q.ajaxSettings.xhr();t.attachEvent&&t.attachEvent("onunload",function(){for(var t in Ae)Ae[t]()}),Z.cors=!!Ne&&"withCredentials"in Ne,Z.ajax=Ne=!!Ne,Q.ajaxTransport(function(t){var e;
+
+return Z.cors||Ne&&!t.crossDomain?{send:function(n,r){var o,i=t.xhr(),a=++Se;if(i.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(o in t.xhrFields)i[o]=t.xhrFields[o];t.mimeType&&i.overrideMimeType&&i.overrideMimeType(t.mimeType),t.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(o in n)i.setRequestHeader(o,n[o]);e=function(t){return function(){e&&(delete Ae[a],e=i.onload=i.onerror=null,"abort"===t?i.abort():"error"===t?r(i.status,i.statusText):r(Te[i.status]||i.status,i.statusText,"string"==typeof i.responseText?{text:i.responseText}:void 0,i.getAllResponseHeaders()))}},i.onload=e(),i.onerror=e("error"),e=Ae[a]=e("abort");try{i.send(t.hasContent&&t.data||null)}catch(s){if(e)throw s}},abort:function(){e&&e()}}:void 0}),Q.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(t){return Q.globalEval(t),t}}}),Q.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),Q.ajaxTransport("script",function(t){if(t.crossDomain){var e,n;return{send:function(r,o){e=Q("<script>").prop({async:!0,charset:t.scriptCharset,src:t.url}).on("load error",n=function(t){e.remove(),n=null,t&&o("error"===t.type?404:200,t.type)}),K.head.appendChild(e[0])},abort:function(){n&&n()}}}});var Oe=[],qe=/(=)\?(?=&|$)|\?\?/;Q.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=Oe.pop()||Q.expando+"_"+le++;return this[t]=!0,t}}),Q.ajaxPrefilter("json jsonp",function(e,n,r){var o,i,a,s=e.jsonp!==!1&&(qe.test(e.url)?"url":"string"==typeof e.data&&!(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&qe.test(e.data)&&"data");return s||"jsonp"===e.dataTypes[0]?(o=e.jsonpCallback=Q.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,s?e[s]=e[s].replace(qe,"$1"+o):e.jsonp!==!1&&(e.url+=(ce.test(e.url)?"&":"?")+e.jsonp+"="+o),e.converters["script json"]=function(){return a||Q.error(o+" was not called"),a[0]},e.dataTypes[0]="json",i=t[o],t[o]=function(){a=arguments},r.always(function(){t[o]=i,e[o]&&(e.jsonpCallback=n.jsonpCallback,Oe.push(o)),a&&Q.isFunction(i)&&i(a[0]),a=i=void 0}),"script"):void 0}),Q.parseHTML=function(data,t,e){if(!data||"string"!=typeof data)return null;"boolean"==typeof t&&(e=t,t=!1),t=t||K;var n=at.exec(data),r=!e&&[];return n?[t.createElement(n[1])]:(n=Q.buildFragment([data],t,r),r&&r.length&&Q(r).remove(),Q.merge([],n.childNodes))};var De=Q.fn.load;Q.fn.load=function(t,e,n){if("string"!=typeof t&&De)return De.apply(this,arguments);var r,o,i,a=this,s=t.indexOf(" ");return s>=0&&(r=Q.trim(t.slice(s)),t=t.slice(0,s)),Q.isFunction(e)?(n=e,e=void 0):e&&"object"==typeof e&&(o="POST"),a.length>0&&Q.ajax({url:t,type:o,dataType:"html",data:e}).done(function(t){i=arguments,a.html(r?Q("<div>").append(Q.parseHTML(t)).find(r):t)}).complete(n&&function(t,e){a.each(n,i||[t.responseText,e,t])}),this},Q.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){Q.fn[e]=function(t){return this.on(e,t)}}),Q.expr.filters.animated=function(t){return Q.grep(Q.timers,function(e){return t===e.elem}).length};var Le=t.document.documentElement;Q.offset={setOffset:function(t,e,n){var r,o,i,a,s,u,l,c=Q.css(t,"position"),f=Q(t),d={};"static"===c&&(t.style.position="relative"),s=f.offset(),i=Q.css(t,"top"),u=Q.css(t,"left"),l=("absolute"===c||"fixed"===c)&&(i+u).indexOf("auto")>-1,l?(r=f.position(),a=r.top,o=r.left):(a=parseFloat(i)||0,o=parseFloat(u)||0),Q.isFunction(e)&&(e=e.call(t,n,s)),null!=e.top&&(d.top=e.top-s.top+a),null!=e.left&&(d.left=e.left-s.left+o),"using"in e?e.using.call(t,d):f.css(d)}},Q.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){Q.offset.setOffset(this,t,e)});var e,n,r=this[0],o={top:0,left:0},i=r&&r.ownerDocument;if(i)return e=i.documentElement,Q.contains(e,r)?(typeof r.getBoundingClientRect!==Mt&&(o=r.getBoundingClientRect()),n=H(i),{top:o.top+n.pageYOffset-e.clientTop,left:o.left+n.pageXOffset-e.clientLeft}):o},position:function(){if(this[0]){var t,e,n=this[0],r={top:0,left:0};return"fixed"===Q.css(n,"position")?e=n.getBoundingClientRect():(t=this.offsetParent(),e=this.offset(),Q.nodeName(t[0],"html")||(r=t.offset()),r.top+=Q.css(t[0],"borderTopWidth",!0),r.left+=Q.css(t[0],"borderLeftWidth",!0)),{top:e.top-r.top-Q.css(n,"marginTop",!0),left:e.left-r.left-Q.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||Le;t&&!Q.nodeName(t,"html")&&"static"===Q.css(t,"position");)t=t.offsetParent;return t||Le})}}),Q.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r="pageYOffset"===n;Q.fn[e]=function(o){return gt(this,function(e,o,i){var a=H(e);return void 0===i?a?a[n]:e[o]:void(a?a.scrollTo(r?t.pageXOffset:i,r?i:t.pageYOffset):e[o]=i)},e,o,arguments.length,null)}}),Q.each(["top","left"],function(t,e){Q.cssHooks[e]=_(Z.pixelPosition,function(t,n){return n?(n=b(t,e),$t.test(n)?Q(t).position()[e]+"px":n):void 0})}),Q.each({Height:"height",Width:"width"},function(t,e){Q.each({padding:"inner"+t,content:e,"":"outer"+t},function(n,r){Q.fn[r]=function(r,o){var i=arguments.length&&(n||"boolean"!=typeof r),a=n||(r===!0||o===!0?"margin":"border");return gt(this,function(e,n,r){var o;return Q.isWindow(e)?e.document.documentElement["client"+t]:9===e.nodeType?(o=e.documentElement,Math.max(e.body["scroll"+t],o["scroll"+t],e.body["offset"+t],o["offset"+t],o["client"+t])):void 0===r?Q.css(e,n,a):Q.style(e,n,r,a)},e,i?r:void 0,i,null)}})}),Q.fn.size=function(){return this.length},Q.fn.andSelf=Q.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return Q});var Fe=t.jQuery,ze=t.$;return Q.noConflict=function(e){return t.$===Q&&(t.$=ze),e&&t.jQuery===Q&&(t.jQuery=Fe),Q},typeof e===Mt&&(t.jQuery=t.$=Q),Q})},{}],281:[function(t,e,n){(function(t){(function(){function r(t,e,n){for(var r=(n||0)-1,o=t?t.length:0;++r<o;)if(t[r]===e)return r;return-1}function o(t,e){var n=typeof e;if(t=t.cache,"boolean"==n||null==e)return t[e]?0:-1;"number"!=n&&"string"!=n&&(n="object");var o="number"==n?e:w+e;return t=(t=t[n])&&t[o],"object"==n?t&&r(t,e)>-1?0:-1:t?0:-1}function i(t){var e=this.cache,n=typeof t;if("boolean"==n||null==t)e[t]=!0;else{"number"!=n&&"string"!=n&&(n="object");var r="number"==n?t:w+t,o=e[n]||(e[n]={});"object"==n?(o[r]||(o[r]=[])).push(t):o[r]=!0}}function a(t){return t.charCodeAt(0)}function s(t,e){for(var n=t.criteria,r=e.criteria,o=-1,i=n.length;++o<i;){var a=n[o],s=r[o];if(a!==s){if(a>s||"undefined"==typeof a)return 1;if(s>a||"undefined"==typeof s)return-1}}return t.index-e.index}function u(t){var e=-1,n=t.length,r=t[0],o=t[n/2|0],a=t[n-1];if(r&&"object"==typeof r&&o&&"object"==typeof o&&a&&"object"==typeof a)return!1;var s=f();s["false"]=s["null"]=s["true"]=s.undefined=!1;var u=f();for(u.array=t,u.cache=s,u.push=i;++e<n;)u.push(t[e]);return u}function l(t){return"\\"+Z[t]}function c(){return v.pop()||[]}function f(){return y.pop()||{array:null,cache:null,criteria:null,"false":!1,index:0,"null":!1,number:null,object:null,push:null,string:null,"true":!1,undefined:!1,value:null}}function d(t){t.length=0,v.length<_&&v.push(t)}function h(t){var e=t.cache;e&&h(e),t.array=t.cache=t.criteria=t.object=t.number=t.string=t.value=null,y.length<_&&y.push(t)}function p(t,e,n){e||(e=0),"undefined"==typeof n&&(n=t?t.length:0);for(var r=-1,o=n-e||0,i=Array(0>o?0:o);++r<o;)i[r]=t[e+r];return i}function m(t){function e(t){return t&&"object"==typeof t&&!Gn(t)&&Dn.call(t,"__wrapped__")?t:new n(t)}function n(t,e){this.__chain__=!!e,this.__wrapped__=t}function i(t){function e(){if(r){var t=p(r);Ln.apply(t,arguments)}if(this instanceof e){var i=y(n.prototype),a=n.apply(i,t||arguments);return Tt(a)?a:i}return n.apply(o,t||arguments)}var n=t[0],r=t[2],o=t[4];return Kn(e,t),e}function v(t,e,n,r,o){if(n){var i=n(t);if("undefined"!=typeof i)return i}var a=Tt(t);if(!a)return t;var s=Cn.call(t);if(!W[s])return t;var u=Jn[s];switch(s){case P:case I:return new u(+t);case $:case U:return new u(t);case V:return i=u(t.source,S.exec(t)),i.lastIndex=t.lastIndex,i}var l=Gn(t);if(e){var f=!r;r||(r=c()),o||(o=c());for(var h=r.length;h--;)if(r[h]==t)return o[h];i=l?u(t.length):{}}else i=l?p(t):ir({},t);return l&&(Dn.call(t,"index")&&(i.index=t.index),Dn.call(t,"input")&&(i.input=t.input)),e?(r.push(t),o.push(i),(l?Zt:ur)(t,function(t,a){i[a]=v(t,e,n,r,o)}),f&&(d(r),d(o)),i):i}function y(t,e){return Tt(t)?In(t):{}}function _(t,e,n){if("function"!=typeof t)return Ke;if("undefined"==typeof e||!("prototype"in t))return t;var r=t.__bindData__;if("undefined"==typeof r&&(Zn.funcNames&&(r=!t.name),r=r||!Zn.funcDecomp,!r)){var o=On.call(t);Zn.funcNames||(r=!A.test(o)),r||(r=q.test(o),Kn(t,r))}if(r===!1||r!==!0&&1&r[1])return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)};case 4:return function(n,r,o,i){return t.call(e,n,r,o,i)}}return De(t,e)}function Z(t){function e(){var t=u?a:this;if(o){var h=p(o);Ln.apply(h,arguments)}if((i||c)&&(h||(h=p(arguments)),i&&Ln.apply(h,i),c&&h.length<s))return r|=16,Z([n,f?r:-4&r,h,null,a,s]);if(h||(h=arguments),l&&(n=t[d]),this instanceof e){t=y(n.prototype);var m=n.apply(t,h);return Tt(m)?m:t}return n.apply(t,h)}var n=t[0],r=t[1],o=t[2],i=t[3],a=t[4],s=t[5],u=1&r,l=2&r,c=4&r,f=8&r,d=n;return Kn(e,t),e}function G(t,e){var n=-1,i=ut(),a=t?t.length:0,s=a>=b&&i===r,l=[];if(s){var c=u(e);c?(i=o,e=c):s=!1}for(;++n<a;){var f=t[n];i(e,f)<0&&l.push(f)}return s&&h(e),l}function Q(t,e,n,r){for(var o=(r||0)-1,i=t?t.length:0,a=[];++o<i;){var s=t[o];if(s&&"object"==typeof s&&"number"==typeof s.length&&(Gn(s)||dt(s))){e||(s=Q(s,e,n));var u=-1,l=s.length,c=a.length;for(a.length+=l;++u<l;)a[c++]=s[u]}else n||a.push(s)}return a}function tt(t,e,n,r,o,i){if(n){var a=n(t,e);if("undefined"!=typeof a)return!!a}if(t===e)return 0!==t||1/t==1/e;var s=typeof t,u=typeof e;if(!(t!==t||t&&J[s]||e&&J[u]))return!1;if(null==t||null==e)return t===e;var l=Cn.call(t),f=Cn.call(e);if(l==z&&(l=B),f==z&&(f=B),l!=f)return!1;switch(l){case P:case I:return+t==+e;case $:return t!=+t?e!=+e:0==t?1/t==1/e:t==+e;case V:case U:return t==_n(e)}var h=l==R;if(!h){var p=Dn.call(t,"__wrapped__"),m=Dn.call(e,"__wrapped__");if(p||m)return tt(p?t.__wrapped__:t,m?e.__wrapped__:e,n,r,o,i);if(l!=B)return!1;var g=t.constructor,v=e.constructor;if(g!=v&&!(At(g)&&g instanceof g&&At(v)&&v instanceof v)&&"constructor"in t&&"constructor"in e)return!1}var y=!o;o||(o=c()),i||(i=c());for(var x=o.length;x--;)if(o[x]==t)return i[x]==e;var w=0;if(a=!0,o.push(t),i.push(e),h){if(x=t.length,w=e.length,a=w==x,a||r)for(;w--;){var b=x,_=e[w];if(r)for(;b--&&!(a=tt(t[b],_,n,r,o,i)););else if(!(a=tt(t[w],_,n,r,o,i)))break}}else sr(e,function(e,s,u){return Dn.call(u,s)?(w++,a=Dn.call(t,s)&&tt(t[s],e,n,r,o,i)):void 0}),a&&!r&&sr(t,function(t,e,n){return Dn.call(n,e)?a=--w>-1:void 0});return o.pop(),i.pop(),y&&(d(o),d(i)),a}function et(t,e,n,r,o){(Gn(e)?Zt:ur)(e,function(e,i){var a,s,u=e,l=t[i];if(e&&((s=Gn(e))||lr(e))){for(var c=r.length;c--;)if(a=r[c]==e){l=o[c];break}if(!a){var f;n&&(u=n(l,e),(f="undefined"!=typeof u)&&(l=u)),f||(l=s?Gn(l)?l:[]:lr(l)?l:{}),r.push(e),o.push(l),f||et(l,e,n,r,o)}}else n&&(u=n(l,e),"undefined"==typeof u&&(u=e)),"undefined"!=typeof u&&(l=u);t[i]=l})}function rt(t,e){return t+Nn(Xn()*(e-t+1))}function ot(t,e,n){var i=-1,a=ut(),s=t?t.length:0,l=[],f=!e&&s>=b&&a===r,p=n||f?c():l;if(f){var m=u(p);a=o,p=m}for(;++i<s;){var g=t[i],v=n?n(g,i,t):g;(e?!i||p[p.length-1]!==v:a(p,v)<0)&&((n||f)&&p.push(v),l.push(g))}return f?(d(p.array),h(p)):n&&d(p),l}function it(t){return function(n,r,o){var i={};r=e.createCallback(r,o,3);var a=-1,s=n?n.length:0;if("number"==typeof s)for(;++a<s;){var u=n[a];t(i,u,r(u,a,n),n)}else ur(n,function(e,n,o){t(i,e,r(e,n,o),o)});return i}}function at(t,e,n,r,o,a){var s=1&e,u=2&e,l=4&e,c=16&e,f=32&e;if(!u&&!At(t))throw new kn;c&&!n.length&&(e&=-17,c=n=!1),f&&!r.length&&(e&=-33,f=r=!1);var d=t&&t.__bindData__;if(d&&d!==!0)return d=p(d),d[2]&&(d[2]=p(d[2])),d[3]&&(d[3]=p(d[3])),!s||1&d[1]||(d[4]=o),!s&&1&d[1]&&(e|=8),!l||4&d[1]||(d[5]=a),c&&Ln.apply(d[2]||(d[2]=[]),n),f&&Rn.apply(d[3]||(d[3]=[]),r),d[1]|=e,at.apply(null,d);var h=1==e||17===e?i:Z;return h([t,e,n,r,o,a])}function st(t){return er[t]}function ut(){var t=(t=e.indexOf)===ve?r:t;return t}function lt(t){return"function"==typeof t&&Sn.test(t)}function ct(t){var e,n;return t&&Cn.call(t)==B&&(e=t.constructor,!At(e)||e instanceof e)?(sr(t,function(t,e){n=e}),"undefined"==typeof n||Dn.call(t,n)):!1}function ft(t){return nr[t]}function dt(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Cn.call(t)==z||!1}function ht(t,e,n,r){return"boolean"!=typeof e&&null!=e&&(r=n,n=e,e=!1),v(t,e,"function"==typeof n&&_(n,r,1))}function pt(t,e,n){return v(t,!0,"function"==typeof e&&_(e,n,1))}function mt(t,e){var n=y(t);return e?ir(n,e):n}function gt(t,n,r){var o;return n=e.createCallback(n,r,3),ur(t,function(t,e,r){return n(t,e,r)?(o=e,!1):void 0}),o}function vt(t,n,r){var o;return n=e.createCallback(n,r,3),xt(t,function(t,e,r){return n(t,e,r)?(o=e,!1):void 0}),o}function yt(t,e,n){var r=[];sr(t,function(t,e){r.push(e,t)});var o=r.length;for(e=_(e,n,3);o--&&e(r[o--],r[o],t)!==!1;);return t}function xt(t,e,n){var r=tr(t),o=r.length;for(e=_(e,n,3);o--;){var i=r[o];if(e(t[i],i,t)===!1)break}return t}function wt(t){var e=[];return sr(t,function(t,n){At(t)&&e.push(n)}),e.sort()}function bt(t,e){return t?Dn.call(t,e):!1}function _t(t){for(var e=-1,n=tr(t),r=n.length,o={};++e<r;){var i=n[e];o[t[i]]=i}return o}function kt(t){return t===!0||t===!1||t&&"object"==typeof t&&Cn.call(t)==P||!1}function jt(t){return t&&"object"==typeof t&&Cn.call(t)==I||!1}function Mt(t){return t&&1===t.nodeType||!1}function Et(t){var e=!0;if(!t)return e;var n=Cn.call(t),r=t.length;return n==R||n==U||n==z||n==B&&"number"==typeof r&&At(t.splice)?!r:(ur(t,function(){return e=!1}),e)}function Ct(t,e,n,r){return tt(t,e,"function"==typeof n&&_(n,r,2))}function St(t){return $n(t)&&!Bn(parseFloat(t))}function At(t){return"function"==typeof t}function Tt(t){return!(!t||!J[typeof t])}function Nt(t){return qt(t)&&t!=+t}function Ot(t){return null===t}function qt(t){return"number"==typeof t||t&&"object"==typeof t&&Cn.call(t)==$||!1}function Dt(t){return t&&"object"==typeof t&&Cn.call(t)==V||!1}function Lt(t){return"string"==typeof t||t&&"object"==typeof t&&Cn.call(t)==U||!1}function Ft(t){return"undefined"==typeof t}function zt(t,n,r){var o={};return n=e.createCallback(n,r,3),ur(t,function(t,e,r){o[e]=n(t,e,r)}),o}function Rt(t){var e=arguments,n=2;if(!Tt(t))return t;if("number"!=typeof e[2]&&(n=e.length),n>3&&"function"==typeof e[n-2])var r=_(e[--n-1],e[n--],2);else n>2&&"function"==typeof e[n-1]&&(r=e[--n]);for(var o=p(arguments,1,n),i=-1,a=c(),s=c();++i<n;)et(t,o[i],r,a,s);return d(a),d(s),t}function Pt(t,n,r){var o={};if("function"!=typeof n){var i=[];sr(t,function(t,e){i.push(e)}),i=G(i,Q(arguments,!0,!1,1));for(var a=-1,s=i.length;++a<s;){var u=i[a];o[u]=t[u]}}else n=e.createCallback(n,r,3),sr(t,function(t,e,r){n(t,e,r)||(o[e]=t)});return o}function It(t){for(var e=-1,n=tr(t),r=n.length,o=pn(r);++e<r;){var i=n[e];o[e]=[i,t[i]]}return o}function Ht(t,n,r){var o={};if("function"!=typeof n)for(var i=-1,a=Q(arguments,!0,!1,1),s=Tt(t)?a.length:0;++i<s;){var u=a[i];u in t&&(o[u]=t[u])}else n=e.createCallback(n,r,3),sr(t,function(t,e,r){n(t,e,r)&&(o[e]=t)});return o}function $t(t,n,r,o){var i=Gn(t);if(null==r)if(i)r=[];else{var a=t&&t.constructor,s=a&&a.prototype;r=y(s)}return n&&(n=e.createCallback(n,o,4),(i?Zt:ur)(t,function(t,e,o){return n(r,t,e,o)})),r}function Bt(t){for(var e=-1,n=tr(t),r=n.length,o=pn(r);++e<r;)o[e]=t[n[e]];return o}function Vt(t){for(var e=arguments,n=-1,r=Q(e,!0,!1,1),o=e[2]&&e[2][e[1]]===t?1:r.length,i=pn(o);++n<o;)i[n]=t[r[n]];return i}function Ut(t,e,n){var r=-1,o=ut(),i=t?t.length:0,a=!1;return n=(0>n?Un(0,i+n):n)||0,Gn(t)?a=o(t,e,n)>-1:"number"==typeof i?a=(Lt(t)?t.indexOf(e,n):o(t,e,n))>-1:ur(t,function(t){return++r>=n?!(a=t===e):void 0}),a}function Wt(t,n,r){var o=!0;n=e.createCallback(n,r,3);var i=-1,a=t?t.length:0;if("number"==typeof a)for(;++i<a&&(o=!!n(t[i],i,t)););else ur(t,function(t,e,r){return o=!!n(t,e,r)});return o}function Yt(t,n,r){var o=[];n=e.createCallback(n,r,3);var i=-1,a=t?t.length:0;if("number"==typeof a)for(;++i<a;){var s=t[i];n(s,i,t)&&o.push(s)}else ur(t,function(t,e,r){n(t,e,r)&&o.push(t)});return o}function Xt(t,n,r){n=e.createCallback(n,r,3);var o=-1,i=t?t.length:0;if("number"!=typeof i){var a;return ur(t,function(t,e,r){return n(t,e,r)?(a=t,!1):void 0}),a}for(;++o<i;){var s=t[o];if(n(s,o,t))return s}}function Jt(t,n,r){var o;return n=e.createCallback(n,r,3),Kt(t,function(t,e,r){return n(t,e,r)?(o=t,!1):void 0}),o}function Zt(t,e,n){var r=-1,o=t?t.length:0;if(e=e&&"undefined"==typeof n?e:_(e,n,3),"number"==typeof o)for(;++r<o&&e(t[r],r,t)!==!1;);else ur(t,e);return t}function Kt(t,e,n){var r=t?t.length:0;if(e=e&&"undefined"==typeof n?e:_(e,n,3),"number"==typeof r)for(;r--&&e(t[r],r,t)!==!1;);else{var o=tr(t);r=o.length,ur(t,function(t,n,i){return n=o?o[--r]:--r,e(i[n],n,i)})}return t}function Gt(t,e){var n=p(arguments,2),r=-1,o="function"==typeof e,i=t?t.length:0,a=pn("number"==typeof i?i:0);return Zt(t,function(t){a[++r]=(o?e:t[e]).apply(t,n)}),a}function Qt(t,n,r){var o=-1,i=t?t.length:0;if(n=e.createCallback(n,r,3),"number"==typeof i)for(var a=pn(i);++o<i;)a[o]=n(t[o],o,t);else a=[],ur(t,function(t,e,r){a[++o]=n(t,e,r)});return a}function te(t,n,r){var o=-(1/0),i=o;if("function"!=typeof n&&r&&r[n]===t&&(n=null),null==n&&Gn(t))for(var s=-1,u=t.length;++s<u;){var l=t[s];l>i&&(i=l)}else n=null==n&&Lt(t)?a:e.createCallback(n,r,3),Zt(t,function(t,e,r){var a=n(t,e,r);a>o&&(o=a,i=t)});return i}function ee(t,n,r){var o=1/0,i=o;if("function"!=typeof n&&r&&r[n]===t&&(n=null),null==n&&Gn(t))for(var s=-1,u=t.length;++s<u;){var l=t[s];i>l&&(i=l)}else n=null==n&&Lt(t)?a:e.createCallback(n,r,3),Zt(t,function(t,e,r){var a=n(t,e,r);o>a&&(o=a,i=t)});return i}function ne(t,n,r,o){if(!t)return r;var i=arguments.length<3;n=e.createCallback(n,o,4);var a=-1,s=t.length;if("number"==typeof s)for(i&&(r=t[++a]);++a<s;)r=n(r,t[a],a,t);else ur(t,function(t,e,o){r=i?(i=!1,t):n(r,t,e,o)});return r}function re(t,n,r,o){var i=arguments.length<3;return n=e.createCallback(n,o,4),Kt(t,function(t,e,o){r=i?(i=!1,t):n(r,t,e,o)}),r}function oe(t,n,r){return n=e.createCallback(n,r,3),Yt(t,function(t,e,r){return!n(t,e,r)})}function ie(t,e,n){if(t&&"number"!=typeof t.length&&(t=Bt(t)),null==e||n)return t?t[rt(0,t.length-1)]:g;var r=ae(t);return r.length=Wn(Un(0,e),r.length),r}function ae(t){var e=-1,n=t?t.length:0,r=pn("number"==typeof n?n:0);return Zt(t,function(t){var n=rt(0,++e);r[e]=r[n],r[n]=t}),r}function se(t){var e=t?t.length:0;return"number"==typeof e?e:tr(t).length}function ue(t,n,r){var o;n=e.createCallback(n,r,3);var i=-1,a=t?t.length:0;if("number"==typeof a)for(;++i<a&&!(o=n(t[i],i,t)););else ur(t,function(t,e,r){return!(o=n(t,e,r))});return!!o}function le(t,n,r){var o=-1,i=Gn(n),a=t?t.length:0,u=pn("number"==typeof a?a:0);for(i||(n=e.createCallback(n,r,3)),Zt(t,function(t,e,r){var a=u[++o]=f();i?a.criteria=Qt(n,function(e){return t[e]}):(a.criteria=c())[0]=n(t,e,r),a.index=o,a.value=t}),a=u.length,u.sort(s);a--;){var l=u[a];u[a]=l.value,i||d(l.criteria),h(l)}return u}function ce(t){return t&&"number"==typeof t.length?p(t):Bt(t)}function fe(t){for(var e=-1,n=t?t.length:0,r=[];++e<n;){var o=t[e];o&&r.push(o)}return r}function de(t){return G(t,Q(arguments,!0,!0,1))}function he(t,n,r){var o=-1,i=t?t.length:0;for(n=e.createCallback(n,r,3);++o<i;)if(n(t[o],o,t))return o;return-1}function pe(t,n,r){var o=t?t.length:0;for(n=e.createCallback(n,r,3);o--;)if(n(t[o],o,t))return o;return-1}function me(t,n,r){var o=0,i=t?t.length:0;if("number"!=typeof n&&null!=n){var a=-1;for(n=e.createCallback(n,r,3);++a<i&&n(t[a],a,t);)o++}else if(o=n,null==o||r)return t?t[0]:g;return p(t,0,Wn(Un(0,o),i))}function ge(t,e,n,r){return"boolean"!=typeof e&&null!=e&&(r=n,n="function"!=typeof e&&r&&r[e]===t?null:e,e=!1),null!=n&&(t=Qt(t,n,r)),Q(t,e)}function ve(t,e,n){if("number"==typeof n){var o=t?t.length:0;n=0>n?Un(0,o+n):n||0}else if(n){var i=Ee(t,e);return t[i]===e?i:-1}return r(t,e,n)}function ye(t,n,r){var o=0,i=t?t.length:0;if("number"!=typeof n&&null!=n){var a=i;for(n=e.createCallback(n,r,3);a--&&n(t[a],a,t);)o++}else o=null==n||r?1:n||o;return p(t,0,Wn(Un(0,i-o),i))}function xe(){for(var t=[],e=-1,n=arguments.length,i=c(),a=ut(),s=a===r,l=c();++e<n;){var f=arguments[e];(Gn(f)||dt(f))&&(t.push(f),i.push(s&&f.length>=b&&u(e?t[e]:l)))}var p=t[0],m=-1,g=p?p.length:0,v=[];t:for(;++m<g;){var y=i[0];if(f=p[m],(y?o(y,f):a(l,f))<0){for(e=n,(y||l).push(f);--e;)if(y=i[e],(y?o(y,f):a(t[e],f))<0)continue t;v.push(f)}}for(;n--;)y=i[n],y&&h(y);return d(i),d(l),v}function we(t,n,r){var o=0,i=t?t.length:0;if("number"!=typeof n&&null!=n){var a=i;for(n=e.createCallback(n,r,3);a--&&n(t[a],a,t);)o++}else if(o=n,null==o||r)return t?t[i-1]:g;return p(t,Un(0,i-o))}function be(t,e,n){var r=t?t.length:0;for("number"==typeof n&&(r=(0>n?Un(0,r+n):Wn(n,r-1))+1);r--;)if(t[r]===e)return r;return-1}function _e(t){for(var e=arguments,n=0,r=e.length,o=t?t.length:0;++n<r;)for(var i=-1,a=e[n];++i<o;)t[i]===a&&(zn.call(t,i--,1),o--);return t}function ke(t,e,n){t=+t||0,n="number"==typeof n?n:+n||1,null==e&&(e=t,t=0);for(var r=-1,o=Un(0,An((e-t)/(n||1))),i=pn(o);++r<o;)i[r]=t,t+=n;return i}function je(t,n,r){var o=-1,i=t?t.length:0,a=[];for(n=e.createCallback(n,r,3);++o<i;){var s=t[o];n(s,o,t)&&(a.push(s),zn.call(t,o--,1),i--)}return a}function Me(t,n,r){if("number"!=typeof n&&null!=n){var o=0,i=-1,a=t?t.length:0;for(n=e.createCallback(n,r,3);++i<a&&n(t[i],i,t);)o++}else o=null==n||r?1:Un(0,n);return p(t,o)}function Ee(t,n,r,o){var i=0,a=t?t.length:i;for(r=r?e.createCallback(r,o,1):Ke,n=r(n);a>i;){var s=i+a>>>1;r(t[s])<n?i=s+1:a=s}return i}function Ce(){return ot(Q(arguments,!0,!0))}function Se(t,n,r,o){return"boolean"!=typeof n&&null!=n&&(o=r,r="function"!=typeof n&&o&&o[n]===t?null:n,n=!1),null!=r&&(r=e.createCallback(r,o,3)),ot(t,n,r)}function Ae(t){return G(t,p(arguments,1))}function Te(){for(var t=-1,e=arguments.length;++t<e;){var n=arguments[t];if(Gn(n)||dt(n))var r=r?ot(G(r,n).concat(G(n,r))):n}return r||[]}function Ne(){for(var t=arguments.length>1?arguments:arguments[0],e=-1,n=t?te(hr(t,"length")):0,r=pn(0>n?0:n);++e<n;)r[e]=hr(t,e);return r}function Oe(t,e){var n=-1,r=t?t.length:0,o={};for(e||!r||Gn(t[0])||(e=[]);++n<r;){var i=t[n];e?o[i]=e[n]:i&&(o[i[0]]=i[1])}return o}function qe(t,e){if(!At(e))throw new kn;return function(){return--t<1?e.apply(this,arguments):void 0}}function De(t,e){return arguments.length>2?at(t,17,p(arguments,2),null,e):at(t,1,null,null,e)}function Le(t){for(var e=arguments.length>1?Q(arguments,!0,!1,1):wt(t),n=-1,r=e.length;++n<r;){var o=e[n];t[o]=at(t[o],1,null,null,t)}return t}function Fe(t,e){return arguments.length>2?at(e,19,p(arguments,2),null,t):at(e,3,null,null,t)}function ze(){for(var t=arguments,e=t.length;e--;)if(!At(t[e]))throw new kn;return function(){for(var e=arguments,n=t.length;n--;)e=[t[n].apply(this,e)];return e[0]}}function Re(t,e){return e="number"==typeof e?e:+e||t.length,at(t,4,null,null,null,e)}function Pe(t,e,n){var r,o,i,a,s,u,l,c=0,f=!1,d=!0;if(!At(t))throw new kn;if(e=Un(0,e)||0,n===!0){var h=!0;d=!1}else Tt(n)&&(h=n.leading,f="maxWait"in n&&(Un(e,n.maxWait)||0),d="trailing"in n?n.trailing:d);var p=function(){var n=e-(mr()-a);if(0>=n){o&&Tn(o);var f=l;o=u=l=g,f&&(c=mr(),i=t.apply(s,r),u||o||(r=s=null))}else u=Fn(p,n)},m=function(){u&&Tn(u),o=u=l=g,(d||f!==e)&&(c=mr(),i=t.apply(s,r),u||o||(r=s=null))};return function(){if(r=arguments,a=mr(),s=this,l=d&&(u||!h),f===!1)var n=h&&!u;else{o||h||(c=a);var g=f-(a-c),v=0>=g;v?(o&&(o=Tn(o)),c=a,i=t.apply(s,r)):o||(o=Fn(m,g))}return v&&u?u=Tn(u):u||e===f||(u=Fn(p,e)),n&&(v=!0,i=t.apply(s,r)),!v||u||o||(r=s=null),i}}function Ie(t){if(!At(t))throw new kn;var e=p(arguments,1);return Fn(function(){t.apply(g,e)},1)}function He(t,e){if(!At(t))throw new kn;var n=p(arguments,2);return Fn(function(){t.apply(g,n)},e)}function $e(t,e){if(!At(t))throw new kn;var n=function(){var r=n.cache,o=e?e.apply(this,arguments):w+arguments[0];return Dn.call(r,o)?r[o]:r[o]=t.apply(this,arguments)};return n.cache={},n}function Be(t){var e,n;if(!At(t))throw new kn;return function(){return e?n:(e=!0,n=t.apply(this,arguments),t=null,n)}}function Ve(t){return at(t,16,p(arguments,1))}function Ue(t){return at(t,32,null,p(arguments,1))}function We(t,e,n){var r=!0,o=!0;if(!At(t))throw new kn;return n===!1?r=!1:Tt(n)&&(r="leading"in n?n.leading:r,o="trailing"in n?n.trailing:o),Y.leading=r,Y.maxWait=e,Y.trailing=o,Pe(t,e,Y)}function Ye(t,e){return at(e,16,[t])}function Xe(t){return function(){return t}}function Je(t,e,n){var r=typeof t;if(null==t||"function"==r)return _(t,e,n);if("object"!=r)return en(t);var o=tr(t),i=o[0],a=t[i];return 1!=o.length||a!==a||Tt(a)?function(e){for(var n=o.length,r=!1;n--&&(r=tt(e[o[n]],t[o[n]],null,!0)););return r}:function(t){var e=t[i];return a===e&&(0!==a||1/a==1/e)}}function Ze(t){return null==t?"":_n(t).replace(or,st)}function Ke(t){return t}function Ge(t,r,o){var i=!0,a=r&&wt(r);r&&(o||a.length)||(null==o&&(o=r),s=n,r=t,t=e,a=wt(r)),o===!1?i=!1:Tt(o)&&"chain"in o&&(i=o.chain);var s=t,u=At(s);Zt(a,function(e){var n=t[e]=r[e];u&&(s.prototype[e]=function(){var e=this.__chain__,r=this.__wrapped__,o=[r];Ln.apply(o,arguments);var a=n.apply(t,o);if(i||e){if(r===a&&Tt(a))return this;a=new s(a),a.__chain__=e}return a})})}function Qe(){return t._=En,this}function tn(){}function en(t){return function(e){return e[t]}}function nn(t,e,n){var r=null==t,o=null==e;if(null==n&&("boolean"==typeof t&&o?(n=t,t=1):o||"boolean"!=typeof e||(n=e,o=!0)),r&&o&&(e=1),t=+t||0,o?(e=t,t=0):e=+e||0,n||t%1||e%1){var i=Xn();return Wn(t+i*(e-t+parseFloat("1e-"+((i+"").length-1))),e)}return rt(t,e)}function rn(t,e){if(t){var n=t[e];return At(n)?t[e]():n}}function on(t,data,n){var r=e.templateSettings;t=_n(t||""),n=ar({},n,r);var o,i=ar({},n.imports,r.imports),a=tr(i),s=Bt(i),u=0,c=n.interpolate||O,f="__p += '",d=bn((n.escape||O).source+"|"+c.source+"|"+(c===T?C:O).source+"|"+(n.evaluate||O).source+"|$","g");t.replace(d,function(e,n,r,i,a,s){return r||(r=i),f+=t.slice(u,s).replace(D,l),n&&(f+="' +\n__e("+n+") +\n'"),a&&(o=!0,f+="';\n"+a+";\n__p += '"),r&&(f+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),u=s+e.length,e}),f+="';\n";var h=n.variable,p=h;p||(h="obj",f="with ("+h+") {\n"+f+"\n}\n"),f=(o?f.replace(j,""):f).replace(M,"$1").replace(E,"$1;"),f="function("+h+") {\n"+(p?"":h+" || ("+h+" = {});\n")+"var __t, __p = '', __e = _.escape"+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var m="\n/*\n//# sourceURL="+(n.sourceURL||"/lodash/template/source["+F++ +"]")+"\n*/";try{var v=vn(a,"return "+f+m).apply(g,s)}catch(y){throw y.source=f,y}return data?v(data):(v.source=f,v)}function an(t,e,n){t=(t=+t)>-1?t:0;var r=-1,o=pn(t);for(e=_(e,n,1);++r<t;)o[r]=e(r);return o}function sn(t){return null==t?"":_n(t).replace(rr,ft)}function un(t){var e=++x;return _n(null==t?"":t)+e}function ln(t){return t=new n(t),t.__chain__=!0,t}function cn(t,e){return e(t),t}function fn(){return this.__chain__=!0,this}function dn(){return _n(this.__wrapped__)}function hn(){return this.__wrapped__}t=t?nt.defaults(K.Object(),t,nt.pick(K,L)):K;var pn=t.Array,mn=t.Boolean,gn=t.Date,vn=t.Function,yn=t.Math,xn=t.Number,wn=t.Object,bn=t.RegExp,_n=t.String,kn=t.TypeError,jn=[],Mn=wn.prototype,En=t._,Cn=Mn.toString,Sn=bn("^"+_n(Cn).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),An=yn.ceil,Tn=t.clearTimeout,Nn=yn.floor,On=vn.prototype.toString,qn=lt(qn=wn.getPrototypeOf)&&qn,Dn=Mn.hasOwnProperty,Ln=jn.push,Fn=t.setTimeout,zn=jn.splice,Rn=jn.unshift,Pn=function(){try{var t={},e=lt(e=wn.defineProperty)&&e,n=e(t,t,t)&&e}catch(r){}return n}(),In=lt(In=wn.create)&&In,Hn=lt(Hn=pn.isArray)&&Hn,$n=t.isFinite,Bn=t.isNaN,Vn=lt(Vn=wn.keys)&&Vn,Un=yn.max,Wn=yn.min,Yn=t.parseInt,Xn=yn.random,Jn={};Jn[R]=pn,Jn[P]=mn,Jn[I]=gn,Jn[H]=vn,Jn[B]=wn,Jn[$]=xn,Jn[V]=bn,Jn[U]=_n,n.prototype=e.prototype;var Zn=e.support={};Zn.funcDecomp=!lt(t.WinRTError)&&q.test(m),Zn.funcNames="string"==typeof vn.name,e.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:T,variable:"",imports:{_:e}},In||(y=function(){function e(){}return function(n){if(Tt(n)){e.prototype=n;var r=new e;e.prototype=null}return r||t.Object()}}());var Kn=Pn?function(t,e){X.value=e,Pn(t,"__bindData__",X)}:tn,Gn=Hn||function(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Cn.call(t)==R||!1},Qn=function(t){var e,n=t,r=[];if(!n)return r;if(!J[typeof t])return r;for(e in n)Dn.call(n,e)&&r.push(e);return r},tr=Vn?function(t){return Tt(t)?Vn(t):[]}:Qn,er={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},nr=_t(er),rr=bn("("+tr(nr).join("|")+")","g"),or=bn("["+tr(er).join("")+"]","g"),ir=function(t,e,n){var r,o=t,i=o;if(!o)return i;var a=arguments,s=0,u="number"==typeof n?2:a.length;if(u>3&&"function"==typeof a[u-2])var l=_(a[--u-1],a[u--],2);else u>2&&"function"==typeof a[u-1]&&(l=a[--u]);for(;++s<u;)if(o=a[s],o&&J[typeof o])for(var c=-1,f=J[typeof o]&&tr(o),d=f?f.length:0;++c<d;)r=f[c],i[r]=l?l(i[r],o[r]):o[r];return i},ar=function(t,e,n){var r,o=t,i=o;if(!o)return i;for(var a=arguments,s=0,u="number"==typeof n?2:a.length;++s<u;)if(o=a[s],o&&J[typeof o])for(var l=-1,c=J[typeof o]&&tr(o),f=c?c.length:0;++l<f;)r=c[l],"undefined"==typeof i[r]&&(i[r]=o[r]);return i},sr=function(t,e,n){var r,o=t,i=o;if(!o)return i;if(!J[typeof o])return i;e=e&&"undefined"==typeof n?e:_(e,n,3);for(r in o)if(e(o[r],r,t)===!1)return i;return i},ur=function(t,e,n){var r,o=t,i=o;if(!o)return i;if(!J[typeof o])return i;e=e&&"undefined"==typeof n?e:_(e,n,3);for(var a=-1,s=J[typeof o]&&tr(o),u=s?s.length:0;++a<u;)if(r=s[a],e(o[r],r,t)===!1)return i;return i},lr=qn?function(t){if(!t||Cn.call(t)!=B)return!1;var e=t.valueOf,n=lt(e)&&(n=qn(e))&&qn(n);return n?t==n||qn(t)==n:ct(t)}:ct,cr=it(function(t,e,n){Dn.call(t,n)?t[n]++:t[n]=1}),fr=it(function(t,e,n){(Dn.call(t,n)?t[n]:t[n]=[]).push(e)}),dr=it(function(t,e,n){t[n]=e}),hr=Qt,pr=Yt,mr=lt(mr=gn.now)&&mr||function(){return(new gn).getTime()},gr=8==Yn(k+"08")?Yn:function(t,e){return Yn(Lt(t)?t.replace(N,""):t,e||0)};return e.after=qe,e.assign=ir,e.at=Vt,e.bind=De,e.bindAll=Le,e.bindKey=Fe,e.chain=ln,e.compact=fe,e.compose=ze,e.constant=Xe,e.countBy=cr,e.create=mt,e.createCallback=Je,e.curry=Re,e.debounce=Pe,e.defaults=ar,e.defer=Ie,e.delay=He,e.difference=de,e.filter=Yt,e.flatten=ge,e.forEach=Zt,e.forEachRight=Kt,e.forIn=sr,e.forInRight=yt,e.forOwn=ur,e.forOwnRight=xt,e.functions=wt,e.groupBy=fr,e.indexBy=dr,e.initial=ye,e.intersection=xe,e.invert=_t,e.invoke=Gt,e.keys=tr,e.map=Qt,e.mapValues=zt,e.max=te,e.memoize=$e,e.merge=Rt,e.min=ee,e.omit=Pt,e.once=Be,e.pairs=It,e.partial=Ve,e.partialRight=Ue,e.pick=Ht,e.pluck=hr,e.property=en,e.pull=_e,e.range=ke,e.reject=oe,e.remove=je,e.rest=Me,e.shuffle=ae,e.sortBy=le,e.tap=cn,e.throttle=We,e.times=an,e.toArray=ce,e.transform=$t,e.union=Ce,e.uniq=Se,e.values=Bt,e.where=pr,e.without=Ae,e.wrap=Ye,e.xor=Te,e.zip=Ne,e.zipObject=Oe,e.collect=Qt,e.drop=Me,e.each=Zt,e.eachRight=Kt,e.extend=ir,e.methods=wt,e.object=Oe,e.select=Yt,e.tail=Me,e.unique=Se,e.unzip=Ne,Ge(e),e.clone=ht,e.cloneDeep=pt,e.contains=Ut,e.escape=Ze,e.every=Wt,e.find=Xt,e.findIndex=he,e.findKey=gt,e.findLast=Jt,e.findLastIndex=pe,e.findLastKey=vt,e.has=bt,e.identity=Ke,e.indexOf=ve,e.isArguments=dt,e.isArray=Gn,e.isBoolean=kt,e.isDate=jt,e.isElement=Mt,e.isEmpty=Et,e.isEqual=Ct,e.isFinite=St,e.isFunction=At,e.isNaN=Nt,e.isNull=Ot,e.isNumber=qt,e.isObject=Tt,e.isPlainObject=lr,e.isRegExp=Dt,e.isString=Lt,e.isUndefined=Ft,e.lastIndexOf=be,e.mixin=Ge,e.noConflict=Qe,e.noop=tn,e.now=mr,e.parseInt=gr,e.random=nn,e.reduce=ne,
+e.reduceRight=re,e.result=rn,e.runInContext=m,e.size=se,e.some=ue,e.sortedIndex=Ee,e.template=on,e.unescape=sn,e.uniqueId=un,e.all=Wt,e.any=ue,e.detect=Xt,e.findWhere=Xt,e.foldl=ne,e.foldr=re,e.include=Ut,e.inject=ne,Ge(function(){var t={};return ur(e,function(n,r){e.prototype[r]||(t[r]=n)}),t}(),!1),e.first=me,e.last=we,e.sample=ie,e.take=me,e.head=me,ur(e,function(t,r){var o="sample"!==r;e.prototype[r]||(e.prototype[r]=function(e,r){var i=this.__chain__,a=t(this.__wrapped__,e,r);return i||null!=e&&(!r||o&&"function"==typeof e)?new n(a,i):a})}),e.VERSION="2.4.1",e.prototype.chain=fn,e.prototype.toString=dn,e.prototype.value=hn,e.prototype.valueOf=hn,Zt(["join","pop","shift"],function(t){var r=jn[t];e.prototype[t]=function(){var t=this.__chain__,e=r.apply(this.__wrapped__,arguments);return t?new n(e,t):e}}),Zt(["push","reverse","sort","unshift"],function(t){var n=jn[t];e.prototype[t]=function(){return n.apply(this.__wrapped__,arguments),this}}),Zt(["concat","slice","splice"],function(t){var r=jn[t];e.prototype[t]=function(){return new n(r.apply(this.__wrapped__,arguments),this.__chain__)}}),e}var g,v=[],y=[],x=0,w=+new Date+"",b=75,_=40,k=" \f \ufeff\n\r\u2028\u2029 ᠎              ",j=/\b__p \+= '';/g,M=/\b(__p \+=) '' \+/g,E=/(__e\(.*?\)|\b__t\)) \+\n'';/g,C=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,S=/\w*$/,A=/^\s*function[ \n\r\t]+\w/,T=/<%=([\s\S]+?)%>/g,N=RegExp("^["+k+"]*0+(?=.$)"),O=/($^)/,q=/\bthis\b/,D=/['\n\r\t\u2028\u2029\\]/g,L=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"],F=0,z="[object Arguments]",R="[object Array]",P="[object Boolean]",I="[object Date]",H="[object Function]",$="[object Number]",B="[object Object]",V="[object RegExp]",U="[object String]",W={};W[H]=!1,W[z]=W[R]=W[P]=W[I]=W[$]=W[B]=W[V]=W[U]=!0;var Y={leading:!1,maxWait:0,trailing:!1},X={configurable:!1,enumerable:!1,value:null,writable:!1},J={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},Z={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},K=J[typeof window]&&window||this,G=J[typeof n]&&n&&!n.nodeType&&n,Q=J[typeof e]&&e&&!e.nodeType&&e,tt=Q&&Q.exports===G&&G,et=J[typeof t]&&t;!et||et.global!==et&&et.window!==et||(K=et);var nt=m();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(K._=nt,define(function(){return nt})):G&&Q?tt?(Q.exports=nt)._=nt:G._=nt:K._=nt}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],282:[function(t,e,n){{var r=t("ampersand-view"),o=t("./sidebar"),i=t("./chart"),a=t("jquery");t("debug")("view:app"),e.exports=r.extend({template:t("./templates/app.jade"),props:{chartView:"object",menuOpen:{type:"boolean","default":!1}},events:{"click .navbar-right label":"navButtonClicked","click [data-hook=menu-toggle]":"menuToggled"},bindings:{"model.chart.subSampled":{type:"toggle",hook:"sample-warning"},menuOpen:{type:"booleanClass",selector:"#wrapper",name:"active"}},subviews:{sidebar:{hook:"sidebar",waitFor:"model.sidebar",prepareView:function(t){return new o({el:t,model:this.model.sidebar})}},chart:{hook:"chart",waitFor:"model.chart",prepareView:function(t){return this.chartView=new i({el:t,model:this.model.chart}),this.chartView}}},statChanged:function(t,e){this.model.chart.recalcXDomain=!0,this.chartView.render()},render:function(){this.renderWithTemplate(this.model)},navButtonClicked:function(t){var e=a(t.target).find("input"),n=e.attr("name"),r=e.val();this.model.chart[n]=r,this.model.chart.recalcXDomain="xSetting"===n,this.chartView.render()},menuToggled:function(t){this.toggle("menuOpen")}})}},{"./chart":283,"./sidebar":286,"./templates/app.jade":288,"ampersand-view":158,debug:276,jquery:280}],283:[function(t,e,n){{var r=t("ampersand-view"),o=t("./viz"),i=t("./empty");t("d3"),t("jquery"),t("debug")("view:chart"),e.exports=r.extend({props:{vizView:{type:"any","default":null},emptyView:{type:"any","default":null},activeView:{type:"string","default":"empty",values:["empty","viz"]}},template:t("./templates/chart.jade"),bindings:{activeView:{type:"switch",cases:{empty:"[data-hook=empty]",viz:"[data-hook=graph]"}}},render:function(){this.activeView=this.model.empty?"empty":"viz",this.vizView?(this.vizView.data={series:this.model.series.filter(function(t){return t.selected}),model:this.model},this.vizView.redraw()):(this.renderWithTemplate(this.model),this.vizView=new o({width:"auto",height:600,renderMode:"svg",className:"multiline",debounceRender:!1,vizFn:t("./viz/d3-multiline"),data:{series:this.model.series.filter(function(t){return t.selected}),model:this.model}}),this.emptyView=new i,this.renderSubview(this.emptyView,"[data-hook=empty]"),this.renderSubview(this.vizView,"[data-hook=graph]"))}})}},{"./empty":284,"./templates/chart.jade":289,"./viz":294,"./viz/d3-multiline":295,"ampersand-view":158,d3:275,debug:276,jquery:280}],284:[function(t,e,n){{var r=t("ampersand-view");t("debug")("view:empty"),e.exports=r.extend({template:t("./templates/empty.jade"),autorender:!0})}},{"./templates/empty.jade":290,"ampersand-view":158,debug:276}],285:[function(t,e,n){{var r=t("ampersand-view"),o=t("ampersand-subcollection"),i=t("./stat"),a=t("jquery");t("lodash"),t("debug")("view:panel"),e.exports=r.extend({props:{indicator:{type:"string","default":"none",values:["none","some","all"]},statViews:"object",filteredStats:"object"},template:t("./templates/panel.jade"),events:{"click a":"collapsibleToggle","click [data-hook=caret]":"collapsibleToggle","click [data-hook=indicator]":"indicatorClicked"},bindings:{indicator:{type:function(t,e,n){switch($el=a(t),$el.removeClass(),this.model.selected){case"all":$el.addClass("fa fa-circle");break;case"some":$el.addClass("fa fa-adjust");break;case"none":$el.addClass("fa fa-circle-o")}},hook:"indicator"},"model.open":{type:"booleanClass",hook:"caret",yes:"fa-caret-up",no:"fa-caret-down"}},initialize:function(){this.filteredStats=new o(this.model.stats,{comparator:function(t){return t.name}})},render:function(){this.renderWithTemplate(this.model),this.statViews=this.renderCollection(this.filteredStats,i,this.queryByHook("stats"))},indicatorClicked:function(t){var e="all"!==this.model.selected;switch(this.filteredStats.each(function(t){t.selected=e}),this.model.selected){case"all":case"some":this.collapsibleOpen();break;case"none":this.collapsibleClose()}this.model.app.clearSelectionState(),this.statChanged(null,{propagate:!0})},statChanged:function(t,e){e=e||{},this.indicator=this.model.selected,e.propagate&&this.parent.parent.statChanged(t,e)},collapsibleToggle:function(t){this.model.open?this.collapsibleClose(t):this.collapsibleOpen(t)},collapsibleClose:function(t){a(this.query(".collapse")).collapse("hide"),this.model.open=!1},collapsibleOpen:function(t){a(this.query(".collapse")).collapse("show"),this.model.open=!0},resetStats:function(){this.filteredStats.configure({},!0)},filterStats:function(t){this.filteredStats.configure({filter:function(e){return-1!==e.name.search(new RegExp(t),"gi")}},!0),0===this.filteredStats.length?this.collapsibleClose():this.collapsibleOpen()}})}},{"./stat":287,"./templates/panel.jade":291,"ampersand-subcollection":142,"ampersand-view":158,debug:276,jquery:280,lodash:281}],286:[function(t,e,n){{var r=t("ampersand-view"),o=t("./panel"),i=t("lodash");t("debug")("view:sidebar"),e.exports=r.extend({props:{panelViews:"object"},template:t("./templates/sidebar.jade"),events:{"click [data-hook=button]":"clearClicked","input [data-hook=input]":"inputChanged"},bindings:{"model.search.content":{type:"value",hook:"input"}},render:function(){this.renderWithTemplate(this.model),this.panelViews=this.renderCollection(this.model.panels,o,this.queryByHook("panels"))},closeAndReset:function(){i.each(this.panelViews.views,function(t){t.collapsibleClose(),t.resetStats()})},clearClicked:function(){this.model.search.content="",this.closeAndReset(),this.queryByHook("button").blur()},filterPanels:function(t){i.each(this.panelViews.views,function(e){e.filterStats(t)})},statChanged:function(t,e){this.parent.statChanged(t,e),e.all&&i.each(this.panelViews.views,function(e){e.statChanged(t,{all:!1,propagate:!1})})},inputChanged:i.debounce(function(){var t=this.queryByHook("input").value;this.model.search.content=t,""===t.trim()?this.closeAndReset():this.filterPanels(t)},200,{leading:!1,trailing:!0})})}},{"./panel":285,"./templates/sidebar.jade":292,"ampersand-view":158,debug:276,lodash:281}],287:[function(t,e,n){{var r=t("ampersand-view");t("debug")("view:stat"),e.exports=r.extend({template:t("./templates/stat.jade"),render:function(){this.renderWithTemplate(this.model)},events:{click:"clicked"},bindings:{"model.selected":{type:"booleanClass",hook:"circle",yes:"fa-circle",no:"fa-circle-o"}},clicked:function(t){t.shiftKey?this.model.app.toggleAllExcept(this.model):(this.model.app.clearSelectionState(),this.model.toggle("selected")),this.parent.parent.statChanged(this,{all:t.shiftKey,propagate:!0})}})}},{"./templates/stat.jade":293,"ampersand-view":158,debug:276}],288:[function(t,e,n){t("jade/runtime");e.exports=function(t){var e=[];return e.push('<div id="app"><nav id="navbar" role="navigation" class="navbar navbar-default"><div class="container-fluid"><div class="navbar-header"><div class="navbar-brand"> <div data-hook="menu-toggle" class="brand-image"></div></div></div><ul class="nav navbar-right"><li data-hook="sample-warning" class="navbar-text"><div title="warning: more series data points than pixels. data is being sub-sampled to improve performance. To avoid sub-sampling, increase the browser window width or zoom in." class="alert alert-warning"><i id="menubtn" class="fa fa-warning"></i><span>sub-sampling</span></div></li><li class="navbar-text"><i id="menubtn" class="fa fa-clock-o"></i><span>x-axis</span><div data-toggle="buttons" data-hook="xSetting" class="btn-group"><label class="btn btn-default active"><input type="radio" name="xSetting" id="relative" value="relative" checked="checked"/>relative</label><label class="btn btn-default"><input type="radio" name="xSetting" id="absolute" value="absolute"/>absolute</label></div></li><li class="navbar-text"><i id="menubtn" class="fa fa-line-chart"></i><span>y-axis</span><div data-toggle="buttons" data-hook="ySetting" class="btn-group"><label class="btn btn-default active"><input type="radio" name="ySetting" value="linear" checked="checked"/>linear</label><label class="btn btn-default"><input type="radio" name="ySetting" value="log-scale"/>log-scale</label></div></li></ul></div></nav><div id="wrapper"><div id="sidebar-wrapper"><div class="sidebar-nav"><div data-hook="sidebar"></div></div></div><div class="container-fluid"><div class="row"><div class="col-md-12"><div data-hook="chart"></div></div></div></div></div></div>'),e.join("")}},{"jade/runtime":279}],289:[function(t,e,n){t("jade/runtime");e.exports=function(t){var e=[];return e.push('<div><div class="container-fluid"><div class="row"><div class="col-md-12"><div data-hook="empty"></div><div data-hook="graph"></div></div></div></div></div>'),e.join("")}},{"jade/runtime":279}],290:[function(t,e,n){t("jade/runtime");e.exports=function(t){var e=[];return e.push('<div class="instructions"><dl class="dl-horizontal"><dt><h1><span class="searchbox">mem|&nbsp;</span><i class="fa fa-search"></i></h1></dt><dd>filter stats by typing in the text box</dd><dt><h1> <u>cursor</u><i class="fa fa-caret-down"></i></h1></dt><dd>open/close group panels</dd><dt><h1><i class="fa fa-circle-o"></i><i class="fa fa-adjust"> </i><i class="fa fa-circle"> </i></h1></dt><dd>click to toggle individual stats or the entire group</dd><dt><h1><i class="fa fa-expand"></i><i class="fa fa-arrows-h"> </i><i class="fa fa-compress"> </i></h1></dt><dd>zoom with two-finger scroll or mouse wheel, pan with click+drag</dd><dt><h1>x<i class="fa fa-clock-o"></i>y<i class="fa fa-line-chart"> </i></h1></dt><dd>change x/y axis scaling with buttons at the top</dd></dl></div>'),e.join("")}},{"jade/runtime":279}],291:[function(t,e,n){var r=t("jade/runtime");e.exports=function(t){var e,n=[],o=t||{};return function(t,o){n.push('<div class="panel panel-default"><div class="panel-heading">'),o&&n.push('<span class="suptitle">'+r.escape(null==(e=o)?"":e)+"</span>"),n.push('<h4 class="panel-title"><i data-hook="indicator" class="fa fa-circle-o"></i><a data-toggle="collapse" data-parent="#panel-accordion">'+r.escape(null==(e=t)?"":e)+'</a><div class="pull-right"><i data-hook="caret" class="fa"></i></div></h4></div><div class="panel-collapse collapse"><div class="panel-body"><ul data-hook="stats" class="stats"></ul></div></div></div>')}.call(this,"subtitle"in o?o.subtitle:"undefined"!=typeof subtitle?subtitle:void 0,"suptitle"in o?o.suptitle:"undefined"!=typeof suptitle?suptitle:void 0),n.join("")}},{"jade/runtime":279}],292:[function(t,e,n){t("jade/runtime");e.exports=function(t){var e=[];return e.push('<ul class="sidebar-nav"><li><div class="input-group"><input data-hook="input" type="text" class="form-control"/><span class="input-group-btn"><button data-hook="button" type="button" class="btn btn-default">Clear</button></span></div></li><li><div data-hook="panels" id="panel-accordion" class="panel-group"></div></li></ul>'),e.join("")}},{"jade/runtime":279}],293:[function(t,e,n){var r=t("jade/runtime");e.exports=function(t){var e,n=[],o=t||{};return function(t,o){n.push('<li class="stat"><i data-hook="circle"'+r.attr("style","color:"+t,!0,!1)+' class="fa fa-circle"></i>'+r.escape(null==(e=o)?"":e)+"</li>")}.call(this,"color"in o?o.color:"undefined"!=typeof color?color:void 0,"name"in o?o.name:"undefined"!=typeof name?name:void 0),n.join("")}},{"jade/runtime":279}],294:[function(t,e,n){{var r=t("ampersand-view"),o=t("lodash"),i=t("jquery");t("debug")("view:viz")}e.exports=r.extend({_values:{},_autoWidth:!1,_autoHeight:!1,props:{data:"any",className:"any",vizFn:"any",debounceRender:{type:"boolean","default":!0},renderMode:{type:"string",values:["canvas","svg","html"],"default":"svg"},width:{type:"any","default":"auto"},height:{type:"any","default":400}},bindings:{width:[{type:"attribute",name:"width",hook:"viz-container"}],height:{type:"attribute",name:"height",hook:"viz-container"},className:{type:"attribute",name:"class",hook:"viz-container"}},initialize:function(t){switch(("auto"===this.width||void 0===this.width)&&(this._autoWidth=!0,this.width=0),("auto"===this.height||void 0===this.height)&&(this._autoHeight=!0,this.height=0),(this._autoWidth||this._autoHeight)&&(this.debounceRender?window.addEventListener("resize",o.debounce(this.redraw.bind(this),100)):window.addEventListener("resize",this.redraw.bind(this))),this.renderMode){case"canvas":this.template='<canvas data-hook="viz-container" id="canvas"></canvas>';break;case"svg":this.template='<svg data-hook="viz-container"></svg>';break;case"html":this.template='<div data-hook="viz-container"></div>'}},_measure:function(){this.el&&(this._autoWidth&&(this.width=i(this.el).parent().width()),this._autoHeight&&(this.height=i(this.el).parent().height()))},_chooseDataSource:function(){void 0!==this.model?this.data=this.model.toJSON():void 0!==this.collection&&(this.data=this.collection.toJSON())},remove:function(){return window.removeEventListener("resize",this._onResize),this},transform:function(data){return data},render:function(){return this._chooseDataSource(),this.data=this.transform(this.data),this.renderWithTemplate(this),this._measure(),this.vizFn&&(this.vizFn=this.vizFn({width:this.width,height:this.height,data:this.data,el:this.el})),this},redraw:function(){this._chooseDataSource(),this.data=this.transform(this.data),this._measure(),this.vizFn&&this.vizFn({width:this.width,height:this.height,data:this.data,el:this.el})}}),e.exports.create=function(t,n){return e.exports.extend({className:t,vizFn:n})}},{"ampersand-view":158,debug:276,jquery:280,lodash:281}],295:[function(t,e,n){{var r=t("d3"),o=t("lodash");t("debug")("viz:d3-multiline")}r.selection.prototype.moveToFront=function(){return this.each(function(){this.parentNode.appendChild(this)})},e.exports=function(t){function e(e){if(e){if(t=e,f=t.width-c.left-c.right,d=t.height-c.top-c.bottom,data=t.data,p=data.model,m=p.serialize(),F=data.series,0===F.length?S.style("visibility","hidden"):S.style("visibility","visible"),S.attr({width:f,height:d}),"relative"===m.xSetting?(g=function(t){return t.xrel},w=y,b.tickFormat(r.format(","))):(g=function(t){return t.x},w=v,b.tickFormat(x)),w.range([0,f]),(o.isEqual(w.domain(),[0,1])||o.isEqual(w.domain(),[new Date(0),new Date(1)])||m.recalcXDomain)&&(z=[r.min(F,function(t){return r.min(t.data,function(t){return g(t)})}),r.max(F,function(t){return r.max(t.data,function(t){return g(t)})})],w.domain(z),C.x(w)),F.length>0){var n=o.find(F,function(t){return t.data.length>1}).data;L=n?w(g(n[1]))-w(g(n[0])):1}else L=1;p.subSampled=m.allowSampling&&1>L,"linear"===m.ySetting?(j=_,j.domain([r.min(F,function(t){return r.min(t.data,function(t){return t.y})}),r.max(F,function(t){return r.max(t.data,function(t){return t.y})})])):(j=k,j.domain([.1,r.max(F,function(t){return r.max(t.data,function(t){return t.y})})])),j.range([d,0])}S.selectAll(".x").call(b.scale(w)),S.selectAll(".y").call(M.scale(j)),q=S.selectAll(".serie").data(F,function(t){return t.cid}),q.enter().append("g").attr("class","serie").append("path").attr("class","line").style("stroke",function(t){return t.color}),q.exit().remove(),q.selectAll(".line").attr("d",function(t){return E(g)(i(t.data))}),L>6?(D=q.selectAll(".point").data(function(t){return i(t.data).map(function(e){return{x:g(e),y:e.y,c:t.color}})}),D.enter().append("circle").attr("class","point").attr("r","3px").style("fill",function(t){return t.c}),D.exit().remove(),D.attr("cx",function(t){return w(t.x)}).attr("cy",function(t){return j(t.y)})):q.selectAll(".point").remove(),A.attr("x2",f),T.attr("y2",d+20),R.attr("width",f).attr("height",d).moveToFront()}function n(data){var t=w.domain(),e=u(g)(data,t[0]),n=u(g)(data,t[1]);return data.slice(e,n)}function i(data){data=n(data);var t=1/L;return m.allowSampling&&t>1?data.filter(function(e,n){return n%Math.ceil(t)===0}):data}function a(t,e){var n=i(e.data),r=w.invert(t),o=u(g)(n,r),a=n[o-1],s=n[o];return void 0===a?s:void 0===s?a:r-g(a)>g(s)-r?s:a}function s(){var t=r.mouse(this),e=t[0],n=t[1],o=F.map(function(t){return a(e,t)}),i=o.map(function(t){return t?Math.pow(e-w(g(t)),2)+Math.pow(n-j(t.y),2):1/0}),s=i.indexOf(Math.min.apply(Math,i)),u=F[s],l=o[s];N.attr("transform","translate("+w(g(l))+","+j(l.y)+")").moveToFront(),N.select("circle").attr("stroke",u.color),N.select("text.name").text(u.name),N.select("text.value").text(r.format(",")(l.y)),O.attr("transform","translate("+w(g(l))+","+(d+34)+")").text("relative"===m.xSetting?r.format(",")(g(l)):r.time.format("%b %d %H:%M:%S")(g(l))).moveToFront(),A.attr("y1",j(l.y)).attr("y2",j(l.y)),T.attr("x1",w(g(l))).attr("x2",w(g(l)))}function u(t){return r.bisector(function(e){return t(e)}).left}function l(){p.recalcXDomain=!1,e(t)}var c={top:80,right:20,bottom:60,left:100},f=t.width-c.left-c.right,d=t.height-c.top-c.bottom,data=t.data,h=t.el,p=data.model,m=p.serialize(),g=function(t){return t.x},v=r.time.scale(),y=r.scale.linear(),x=r.time.format.multi([[".%L",function(t){return t.getMilliseconds()}],[":%S",function(t){return t.getSeconds()}],["%b %e %H:%M",function(t){return t.getMinutes()}],["%b %e %H:%M",function(t){return t.getHours()}],["%b %e",function(t){return t.getDay()&&1!=t.getDate()}],["%b %e",function(t){return 1!=t.getDate()}],["%Y",function(t){return t.getMonth()}],["%Y",function(){return!0}]]),w="relative"===m.xSetting?y:v,b=r.svg.axis().scale(w).ticks(10).orient("bottom"),_=r.scale.linear().range([d,0]),k=r.scale.log().clamp(!0).range([d,0]).nice(),j="linear"===m.ySetting?_:k,M=r.svg.axis().scale(j).orient("left"),E=function(t){return r.svg.line().x(function(e){return w(t(e))}).y(function(t){return j(t.y)})},C=r.behavior.zoom().scaleExtent([1,50]).x(w).on("zoom",l),S=r.select(h).append("g").attr("transform","translate("+c.left+","+c.top+")").call(C);S.append("g").attr("class","x axis").attr("transform","translate(0,"+d+")"),S.append("g").attr("class","y axis");var A=S.append("line").style("stroke","#ddd").style("display","none").attr("class","x cross").attr("x1",0),T=S.append("line").style("stroke","#ddd").style("display","none").attr("class","x cross").attr("y1",0),N=S.append("g").attr("class","focus").style("display","none");N.append("circle").attr("r",6).attr("fill","none").attr("stroke-width",2);var O=S.append("text").attr("text-anchor","middle").attr("class","xlabel").attr("font-size","0.8em").attr("fill","#bbb");N.append("text").attr("class","name").attr("fill","black").attr("x",9).attr("dy","-.8em"),N.append("text").attr("class","value").attr("fill","black").attr("font-size","20px").attr("x",8).attr("dy","-1.2em");var q,D,L,F,z,R=S.append("rect").attr("class","windshield").style("opacity",0).on("mouseover",function(){A.style("display",null),T.style("display",null),N.style("display",null),O.style("display",null)}).on("mouseout",function(){N.style("display","none"),A.style("display","none"),T.style("display","none"),O.style("display","none")}).on("mousemove",s);return e}},{d3:275,debug:276,lodash:281}]},{},[1]);
}).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}]},{},[1])</script></html> \ No newline at end of file