swish/commit

Generated files

authorJan Wielemaker
Sun Dec 4 11:23:02 2016 +0100
committerJan Wielemaker
Sun Dec 4 11:23:02 2016 +0100
commitbb39a3571247e170ab3af0fcf6698db7a3ee82c7
tree89ef392af8388823aec01c5d01624075a3639c35
parent56f6f5bb27d80d5febd474c51c83aa799ee8346b
Diff style: patch stat
diff --git a/web/css/swish-min.css b/web/css/swish-min.css
index 6b6abcf..aa9d87e 100644
--- a/web/css/swish-min.css
+++ b/web/css/swish-min.css
@@ -1,8 +1,8 @@
-ul.dropdown-menu li.checkbox input{margin-left:3px}ul.dropdown-menu li.checkbox span{margin-left:20px}.dropdown-menu>li{position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;cursor:pointer}.dropdown-menu .sub-menu{left:100%;position:absolute;top:0;display:none;margin-top:-1px;border-top-left-radius:0;border-bottom-left-radius:0;border-left-color:#fff;box-shadow:none}.left-caret:after,.right-caret:after{content:"";border-bottom:5px solid transparent;border-top:5px solid transparent;display:inline-block;height:0;vertical-align:middle;width:0;margin-left:5px}.right-caret:after{border-left:5px solid #ffaf46}.left-caret:after{border-right:5px solid #ffaf46}.dropdown-icon{margin-left:-12px;margin-right:5px;padding:0;background-repeat:no-repeat;background-size:100%;background-position:50% 50%;display:inline-block;vertical-align:middle;height:18px;width:18px}a.accelerated{position:relative}a.accelerated span.accell-spacer{color:#fff}a.accelerated span.accell-text{color:#888;position:absolute;right:10px}body,html{width:100%;height:100%;padding:0;margin:0;overflow:hidden}nav.navbar{margin-bottom:5px}#content{width:100%;height:calc(100% - 55px);padding:0;background-color:#fff}.pane-container,.pane-wrapper{width:100%;height:100%;background-color:white:green}.splittable{background-color:#fff;width:100%;height:100%;padding:5px}div.tabbed{height:100%}div.tab-content{height:calc(100% - 40px)}div.tab-pane{position:relative;height:100%}span.glyphicon.xclose:hover{opacity:.8}span.glyphicon.xclose{margin-left:5px;opacity:.2}a.tab-new.compact>span{padding:6px 0}.nav>li>a.compact{padding:0 5px}span.tab-dirty{display:none;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAqCAMAAADCkShIAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAzUExURQAAAAICAQAAAAAAADAwHSkoFVtYJvj4wdHPi/37sKOfVvv3joJ+OfLsa6GaOfryVf////09bBAAAAAGdFJOUwD+LWbH9lfFP3wAAAABYktHRBCVsg0sAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AkVDAQs7+kkfQAAAetJREFUSMeVVY3WqjAMc7B1XffT93/bm3aA+l1Q7FGBQ7I0WcHH47RCCMvjhwpe9/Fr+JEBLMV4nwCBmHO8LwFkzplvEyBAIGS62dSClUveJNZ7DUn2kltNBXdsVcqNaBdriA1tX77hYndcTIG/RwuByAysFzO277sA84RXENoXidUFeMJLrcX2e/kcETthwvH5HG3YHZfWGHCrj763SNm3jCehfyBMAWYxq8HQRFLpmuFT6tnbdltLduyXj+scoolv1NFN9dNxIWE3s9BcfvbvBOrpfGrdcdgILEAJoGlIP4/WHVPYHOAChgGl3lXPJOxFwaUdhAQL3WRSU9UT3+YuF9k82FWv1rydqf4/UqvnWHh6ADAKUdrEziQsUpsdw8fQrHU53IDwN9p9o2qVKEgT+N7piVelN9/Lc3SqIMxkBJVXwnhrCl2QC/TOJAYUnRkdhDeJNURrxIcNVmGW6K/Cm2937AJkX3RPXZ2QXgjPaPfZsXHbC3gdYwI3wnO/Xxx3o+hF7dGaKrJJNGyzMNcNvworNKiNNCg1nI20+14QEaNzkljTAEwHnKvBSVvCVRoDhDa2aGGg1WppjiRYU3BXAVWDYWFo2sEU1J9Wm67KdRrWawdHUNvsH5VOT2f523z/x7xZ6+M3xvr4B2dMHj70RasaAAAAAElFTkSuQmCC);padding:0;background-repeat:no-repeat;background-size:90% 60%;background-position:0 40%;vertical-align:middle;height:30px;width:21px}.nav>li>a.compact.data-dirty>span.tab-dirty{display:inline-block}.tabbed-select:{width:100%}.tabbed-create{margin:2em 0 1em;text-align:center}label.tabbed-left{text-align:right;margin-right:.6em;white-space:nowrap;width:5em}label.tabbed-right{text-align:left;margin-left:.6em;white-space:nowrap;width:5em}.tabbed-profile>label{font-style:italic;font-weight:400;color:#888}.tab-icon{padding:0;background-repeat:no-repeat;background-size:70%;background-position:50% 40%;display:inline-block;vertical-align:middle;height:30px;width:30px}.tabbed-profile{width:100%;text-align:center}.tabbed-profile .select-profile{display:inline-block}form.search-sources{margin:3em auto 1em;width:80%}.CodeMirror{font-family:monospace;color:#000}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0!important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:-20px;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-invalidchar,.cm-s-default .cm-error{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-30px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none!important;border:none!important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper{-webkit-user-select:none;-moz-user-select:none;user-select:none}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:none;font-variant-ligatures:none}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-code{outline:0}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}.CodeMirror-focused div.CodeMirror-cursors,div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0 0}.CodeMirror-hints{position:absolute;z-index:10;overflow:hidden;list-style:none;margin:0;padding:2px;-webkit-box-shadow:2px 3px 5px rgba(0,0,0,.2);-moz-box-shadow:2px 3px 5px rgba(0,0,0,.2);box-shadow:2px 3px 5px rgba(0,0,0,.2);border-radius:3px;border:1px solid silver;background:#fff;font-size:90%;font-family:monospace;max-height:20em;overflow-y:auto}.CodeMirror-hint{margin:0;padding:0 4px;border-radius:2px;white-space:pre;color:#000;cursor:pointer}li.CodeMirror-hint-active{background:#08f;color:#fff}.CodeMirror-dialog{position:absolute;left:0;right:0;background:inherit;z-index:15;padding:.1em .8em;overflow:hidden;color:inherit}.CodeMirror-dialog-top{border-bottom:1px solid #eee;top:0}.CodeMirror-dialog-bottom{border-top:1px solid #eee;bottom:0}.CodeMirror-dialog input{border:none;outline:0;background:0 0;width:20em;color:inherit;font-family:monospace}.CodeMirror-dialog button{font-size:70%}.cm-s-prolog span.cm-neg-number,.cm-s-prolog span.cm-number{color:#000}.cm-s-prolog span.cm-atom,.cm-s-prolog span.cm-uatom{color:#762}.cm-s-prolog span.cm-qatom{color:#008}.cm-s-prolog span.cm-string,.cm-s-prolog span.cm-string_terminal{color:#008;font-style:italic}.cm-s-prolog span.cm-bqstring,.cm-s-prolog span.cm-chars,.cm-s-prolog span.cm-codes{color:#040;font-style:italic}.cm-s-prolog span.cm-functor{color:#000;font-style:italic}.cm-s-prolog span.cm-ext_quant,.cm-s-prolog span.cm-key,.cm-s-prolog span.cm-tag{color:#000;font-weight:700}.cm-s-prolog span.cm-qq_content{color:#900}.cm-s-prolog span.cm-qq_close,.cm-s-prolog span.cm-qq_open,.cm-s-prolog span.cm-qq_sep{color:#00f;font-weight:700}.cm-s-prolog span.cm-qq_type{font-weight:700}.cm-s-prolog span.cm-comment,.cm-s-prolog span.cm-comment_string{color:#060;font-style:italic;line-height:1em}.cm-s-prolog span.cm-var{color:#800}.cm-s-prolog span.cm-var-2{color:#888}.cm-s-prolog span.cm-anon{color:#800}.cm-s-prolog span.cm-singleton{color:#800;font-weight:700}.cm-s-prolog span.cm-identifier{font-weight:700}.cm-s-prolog span.cm-module{color:#549}.cm-s-prolog span.cm-head_exported{color:#00f;font-weight:700}.cm-s-prolog span.cm-head_unreferenced{color:red;font-weight:700}.cm-s-prolog span.cm-head_built_in,.cm-s-prolog span.cm-head_iso{background:orange;font-weight:700}.cm-s-prolog span.cm-head_hook{color:#00f;text-decoration:underline}.cm-s-prolog span.cm-head_extern{color:#00f;font-weight:700}.cm-s-prolog span.cm-head_public{color:#016300;font-weight:700}.cm-s-prolog span.cm-head_constraint{color:#008b8b;font-weight:700}.cm-s-prolog span.cm-head{font-weight:700}.cm-s-prolog span.cm-goal_built_in,.cm-s-prolog span.cm-goal_imported{color:#00f}.cm-s-prolog span.cm-goal_autoload{color:#008}.cm-s-prolog span.cm-goal_undefined{color:red}.cm-s-prolog span.cm-goal_dynamic{color:#f0f}.cm-s-prolog span.cm-goal_thread_local{color:#f0f;text-decoration:underline}.cm-s-prolog span.cm-goal_constraint{color:#008b8b}.cm-s-prolog span.cm-goal_recursion{text-decoration:underline}.cm-s-prolog span.cm-meta,.cm-s-prolog span.cm-op_type{color:#00f}.cm-s-prolog span.cm-file_no_depends{color:#00f;text-decoration:underline;background:#fcd}.cm-s-prolog span.cm-file{color:#00f;text-decoration:underline}.cm-s-prolog span.cm-nofile{color:red}.cm-s-prolog span.cm-option_name{color:#3434ba}.cm-s-prolog span.cm-no_option_name{color:red}.cm-s-prolog span.cm-flag_name{color:#00f}.cm-s-prolog span.cm-no_flag_name{color:red}.cm-s-prolog span.cm-error,.cm-s-prolog span.cm-instantiation_error{border-bottom:2px dotted red}.cm-s-prolog span.cm-link{color:#762}.cm-s-prolog span.cm-expanded{color:#00f;text-decoration:underline}.cm-s-prolog span.cm-undefined_import{color:red}.cm-s-prolog span.cm-unused_import{color:#00f;background:pink}.cm-s-prolog span.cm-xpce_method{font-weight:700}.cm-s-prolog span.cm-xpce_class_built_in{color:#00f}.cm-s-prolog span.cm-xpce_class_lib{color:#00f;font-style:italic}.cm-s-prolog span.cm-xpce_class_undef,.cm-s-prolog span.cm-xpce_class_user{color:#000;font-style:italic}.cm-s-prolog span.cm-outofsync{border:1px dotted red}.cm-s-prolog span.cm-html{color:#909;font-weight:700}.cm-s-prolog span.cm-entity,.cm-s-prolog span.cm-html_attribute{color:#909}.cm-s-prolog span.cm-sgml_attr_function{color:#00f}.cm-s-prolog span.cm-http_location_for_id{font-weight:700}.cm-s-prolog span.cm-http_no_location_for_id{color:red;font-weight:700}.cm-jumped{background:#ff0}.CodeMirror-hover-tooltip{background-color:infobackground;border:1px solid #000;border-radius:4px;color:infotext;font-size:10pt;overflow:hidden;padding:2px 5px;position:fixed;z-index:100;max-width:600px;opacity:0;transition:opacity .4s;-moz-transition:opacity .4s;-webkit-transition:opacity .4s;-o-transition:opacity .4s;-ms-transition:opacity .4s}.CodeMirror-hover-tooltip .pred-name{color:#00f;font-family:monospace;margin-right:5px}.CodeMirror-hover-tooltip .pred-tag{font-weight:700;margin-right:5px}.CodeMirror-hover-tooltip .pred-summary{font-style:italic}.CodeMirror-templates-variable{outline:#4664A5 solid 1px}.CodeMirror-templates-variable-selected{background-color:#B4D7FF}.CodeMirror-hint-template{background:url(data:image/gif;base64,R0lGODlhEAAQANUAAH5weoJ1g4h8kY+EoZaMsZyTv6CYyGd9qWqArG+Fr3aLs3yRuIKXvYmdwY2hxIaUroiVrIyXqoidwZGlx4+aqJScpfr9//f8//b8//n9/9Xz/+v5/5ifovH7/+n5/+36//D7//T8/+r6/+v6//P8//f9//b9//r+//n+/56inqKlm6iol62rlP7xevzndvjQasiYQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAADEALAAAAAAQABAAAAaEwJhwSCwOYcikEkmEtZ7QKKzpMhgKhIEgAHBNj6+wePwVsjTotJpFXGk88Hh8RVRpJo4GY6FIIDwqRCkaIxuFIoUjIylEHHd5e30IHxxEFRogIB2ZmpoVRBR3EgsJByGnJBREERolFyWwJhgmJRFEEBonFigoFhYZvRBED8TFxsRGyUVBADs=) left center no-repeat;padding-left:18px;margin:3px 0}.CodeMirror-hints-contextInfo{position:absolute;z-index:10;border:3px double #d4d0c8;max-height:200px;max-width:400px;min-width:400px;overflow:auto;background:#FFFFE1;font-family:Tahoma;font-size:12px;padding:5px}.CodeMirror-hints{overflow-x:visible}.CodeMirror-hint{position:relative;max-width:none;overflow:visible}.CodeMirror-hint-description{display:none}.CodeMirror-hint-description.active{display:block;position:absolute;z-index:20;left:10px;top:0}.CodeMirror,.prolog-editor{height:100%}.CodeMirror pre.CodeMirror-placeholder{color:#999}.CodeMirror .source-msg.error{color:red;border-left:2px solid red}.CodeMirror .source-msg{position:relative;border-left:2px solid #000;padding:0 5px;background-color:#ddd;cursor:hand;cursor:pointer}.CodeMirror .source-msg>span.glyphicon{color:#000;position:absolute;right:5px;top:5px}.CodeMirror .source-msg-charmark{height:1.5ex}.CodeMirror .source-msg:hover{text-decoration:line-through}.CodeMirror-hover{outline:grey solid 1px}.CodeMirror-search-match,.CodeMirror-target-line{background-color:#ff0}.CodeMirror-search-alt-match{background-color:#bee}.CodeMirror .trace.call,.CodeMirror .trace.exit{background-color:#0f0}.CodeMirror .trace.fail{background-color:red}.CodeMirror .trace.redo{background-color:#ff0}.CodeMirror .trace.exception{background-color:#f0f}.Prolog-breakpoints{width:1em}.breakpoint-marker{color:#822;padding-left:4px;font-size:120%;position:relative;top:-.2em}div.edit-modal{position:absolute;left:0;right:0;top:0;bottom:0;z-index:2000}div.edit-modal>div.mask{position:absolute;left:0;right:0;top:0;bottom:0;background:#000;opacity:.2}div.edit-modal .goto-source{position:absolute;padding:.2em .5em 0;border-radius:5px;border:1px solid #000;background:#fff;box-shadow:10px 10px 5px #888;z-index:2001}div.CodeMirror-dialog{border:1px solid #888;background:#f8f8f8;box-shadow:10px 10px 5px #888}div.prolog-query{height:100%;padding:5px;background-color:#eee;position:relative}.prolog-query-editor .buttons-left{display:block;position:absolute;bottom:10px}.prolog-query-editor .buttons-right{display:block;position:absolute;bottom:10px;right:5px}.prolog-query-editor div.prolog-prompt{position:absolute;top:5px;left:10px;heigth:100%;vertical-align:top;font-weight:700}.prolog-query-editor div.query{margin-top:3px;height:calc(100% - 35px);margin-left:2em}.prolog-query-editor div.query-buttons{margin-left:2em}span.run-chk-table{margin-right:5px;color:#777}span.run-chk-table input{position:relative;top:2px}ul.dropdown-menu.history{max-height:30ex;overflow:auto}div.prolog-runners{width:100%;height:100%;background-image:url(../icons/owl_25_years.png);background-size:90%;background-repeat:no-repeat;background-position:35% 50%;overflow:auto;padding:0 5px}div.prolog-runner{position:relative;margin:2px 0;border:1px solid #ccc;border-radius:5px}div.prolog-runner.tabled{border:0}div.prolog-runner>a.close{position:absolute;top:-4px;right:-10px;z-index:10}div.prolog-runner:focus{outline:0}div.prolog-runner.iconic>div.runner-results{display:none}div.runner-title{padding:0 5px 2px;border-width:2px;border-radius:5px;box-sizing:border-box}div.prolog-runner:focus div.runner-title{border:2px solid #000}div.runner-results{padding:2px 0;background-color:#fff;border-radius:5px}span.answer-no{float:right;color:#060;font-size:80%;margin-right:2px;font-style:italic}div.answer{padding-left:5px;border-radius:5px}div.answer.even{background-color:#eee}div.answer.odd{background-color:#fff}div.response{font-style:italic;color:#00f;font-size:90%;margin-left:10%;background-color:#eee;border:1px solid #ccc;border-radius:5px;padding:0 5px}span.prolog-true{font-weight:700}span.prolog-false{font-weight:700;color:red}div.cputime{text-align:right}div.cputime span{background-color:#ccc;border-radius:5px;border:1px solid #888;padding:0 5px;font-size:80%;font-style:italic;color:#060}span.runner-state{position:relative;top:2px;width:1.5em;height:1.5em;margin-right:5px;background-size:100%;background-repeat:no-repeat;display:inline-block}div.runners-menu{position:absolute;top:3px;right:5px;z-index:2000}div.runner-title button.dropdown-toggle{background:none;border:0;cursor:pointer;padding:0}div.runner-title>button{background:none;border:0;cursor:pointer;padding:3px 0;color:#000;float:right;font-size:21px;font-weight:700;line-height:1;opacity:.2;text-shadow:0 1px 0 #fff;margin-left:5px}div.runner-title>button.rtb-toggleIconic{padding:8px 0}div.runner-title>button:hover{opacity:.8}span.runner-state.idle,span.runner-state.wait-input,span.runner-state.wait-next{background-image:url(../icons/logo.png)}span.runner-state.wait-debug{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3wMfEyg27OEfWQAAAYdJREFUWMPtVsFtwzAMJINMwlHyt0foCIW6gUYQMkJGsP8dRauwH9GQacqiDffThoARR6LE4/EoGeBt/93w6AIG4J3N8FcA7AXVm/BBMDdP8JkIsASqHx20BtMD7bKJiBnAfErc5nzld31wDQKuBuEN3mOjHj+j9GZmVuaWv4xNRHwo+7Kgmxk4dCH/WyDuemDI2cMQIGx5ZaOv+Uz9RQNepfdYqPbzB2/9ekGwAaJ7ElpOuiTooFb7zEQw5Gyejs2TcMgZhpxhJjLRYkcjXv8mgJloQS4gpgoMO4RqsMjNEoSYGADg8XquFgqIs1et0Rm4y8BYqK9rJ+8nrm7//VwY4BDT8oh66w7wdINuY1i36FYDQr+2r5gWRoQBLcxaM71vhGbHtACkGCDEtBp7vJ4rbVhlGvc1g5ujOMWARjlMG3NeQI0xQPj4hG9dzgLeKLMkxRLzbmlBJjUQi5FqDmv/lp9O+LY3mWJAzY7F2JG5PXbBWwaZ9/hc+g3f2lCPW36Xg3nbn7EfAs3X9neMq50AAAAASUVORK5CYII=)}span.runner-state.running{background-image:url(../icons/running.gif)}span.runner-state.false,span.runner-state.stopped,span.runner-state.true{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAMAAADyHTlpAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAzUExURTxGYTxMaj9FYktZdXSHpT9FYVplamBykExLT4mYtZByMb6gSPrIbO/Sk5OTkw4LBv///4iQZ38AAAAKdFJOUwH4Xfn/K/79yv8b7m9OAAAAAWJLR0QQlbINLAAAAAlwSFlzAAAN1wAADdcBQiibeAAAAAd0SU1FB+AJFQwTJ324eWMAAAIsSURBVDjLjZXtmoQgCIVDSFSy7v9u96DWZO3uM/5oJnvj64Aty2uRr7B8s1iwaP0GjUL0HboqEyn/E8H1KImj+rl/5cKnSzgnYqXuIrDyIxUVaT4DNZRE26vY1/HWRSqpREq4AiKPQP0XBrClnxxX9vgYBkQjcYyEq3rNHGe5mw06TBGVYrZtZiXi3jc5z9XgzlKxWrdtB1yrlUbKHKtLhBCi1W2/1laNyW081AgqbnK/LQEbo/BTN0Qbty3v+wxbFA2vHmGrgsdIa28/Da6mwi//sZH7cSQnj2OwRR9mCaRnZHYcR0dTz22Lty5b15BISs+9dDScKMxCCKYUVu8TkSzROvqxWkbJTIduC2XorIT0+6N0WH/DTpQYfaCZl5QZfzletbdBnLdbPFH0nLfKyP+zTlQqUGiWEUALRJtV2/cXjxJkxKiRF2TPmNGWlpWZdDU8LR/2UbAVCjT9S5rI0vTKc2dRLrXXqoworPRyoa7zICaRXliv65H80quFSjz7RaWMXrXiZGrqiSf16OwlqZZ6lfLUw7tF0vJurVtnDx02Y8069/bKWeM8Lz4xxav/rAA6mHmCfVxwtGDIc5rcZ9/0IDCy1ee1GoYlYztqjuvk3mWGAWSHg8BKKd568C6u5S2EhmaFxgrBtUXoZxDc7dmbalILsLsBLe09HFRHc/gg/XhJ11Hc0CuVwK/D+ubhXaE/VmpWw5foL2fK718FVOGp5p+fGBys6b3/A/dgJEXSAh3eAAAAAElFTkSuQmCC)}span.runner-state.aborted,span.runner-state.error{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAMAAADyHTlpAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAzUExURTxGYTxMaj9FYktZdT9FYWBykExLT1planSHpYmYtZByMb6gSPrIbO/Sk/8AAA4LBv///y1hUbcAAAAIdFJOUwH4Xfkr/cr+eNcn5wAAAAFiS0dEEJWyDSwAAAAJcEhZcwAADdcAAA3XAUIom3gAAAAHdElNRQfgCRUMAA5e5aCdAAACE0lEQVQ4y41VCZKEMAiUIIQcjv//7TZJHDXubkmVo9FOczRkluVh5BaWN8YGo/UdlOgl1JhI+J8Ivp8UpCRyrh+58OGSHMpCbbEGGU9nfGIWnShQg5JJ24r3E5axFouk+AWoRSB+N2N8kzPHlT0VBoFJdGBkcj9tG3O60gbpVEDkXGqtpeRIETuc4V4N7liKZdu2+gF628pAPvLyEACsn6/VLXscMqsRxDhv2+dqFcTxqRuijaV+JgPWJDyE59I4kVa/DSyK8vAfu/d9V0fu+8BmmWjJYm3uy77vHao93nqNdl2DsuVOmjtUDyhoIQSThnWBMmbJZOR0suZRhtJkQ7PDNfSEmnWkrw2DHeWAQlo0QmJA8UAcv4Ua7Me6QrQGBWtq8sXt84dtDpUGbQ10YfWsazkXiDUlQHRZFbEAfXisWT39XE4oOknDPsqlYpcKAOlXGcVCQjcJUpe17Add0V4DQO+DGKw1S9ZrQpq9CdLcL94DteR78j4QcfLvTQBpy1yoUrOk+SAIESHMtUVvYwjleabxfV4Gskk6+Xf58gVcXdLop4DprbOTtJcxVx9Zv0p2mcRpL0fGgpX4K/+WMTIFP96aeGfepBdaxE6WGBoL9MYudt2J3F2ye7AKujYXioFICBGM6941T4+j8HCytrjP70rzAbte+oHjs/C/mjqrvYaavfrbCMj+oeYfUJ/LX/z/ANqPJNQJtoGtAAAAAElFTkSuQmCC)}div.controller.running>span.running,div.controller.running>span.sparklines,div.controller.wait-input>span.wait-input,div.controller.wait-next>span.sparklines,div.controller.wait-next>span.wait-next{display:inline}div.controller>span{display:none}span.wait-input button{float:right;box-sizing:border-box}span.wait-input span{display:block;overflow:hidden}span.wait-input input{width:100%;box-sizing:border-box}pre.prolog-message{white-space:pre-wrap;padding:2px;margin:0;width:100%}span.output.error-context{display:block;position:relative;padding-left:25px}span.output.error-context:hover{text-decoration:underline}span.output.error-context>span.glyphicon{position:absolute;top:5px;left:5px}a.goto-error:hover{text-decoration:none;outline:#337ab7 solid 2px}pre.msg-information,pre.msg-informational{color:#060;font-style:italic}pre.msg-warning{color:red}pre.msg-error{color:red;font-weight:700}table.prolog-answers{width:100%}table.prolog-answers td{padding:0 5px;border:1px solid #888;vertical-align:top}table.prolog-answers th{padding:0 5px;border:1px solid #888;text-align:center}table.prolog-answers tr:nth-child(odd){background-color:#eee}table.prolog-answers tr:nth-child(even){background-color:#fff}table.prolog-answers tr.projection{border-bottom:2px solid #333}tr.projection th.pl-pvar{color:#800;font-weight:700}tr.projection th.residuals{color:#888;font-weight:400;font-style:italic}.answer-nth{width:2ex;text-align:right}th.answer-nth{color:#888;font-weight:400;font-style:italic}td.answer-nth{color:#060;font-size:80%;font-style:italic;background-color:#eee;vertical-align:top}div.trace-buttons button>span{display:none}div.RIP,div.trace-buttons button{display:inline-block;width:24px;height:24px;background-size:90%;background-position:50% 50%;background-repeat:no-repeat;margin-left:5px}button.nodebug{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH3wQBDQAOjeB7qwAABLlJREFUaN7tWltMHGUU/v7ZYSmXBbpbEDXYGi6VCmpo+2BMDETJQpvyYBVvNGmIIabaGH1Aa3wg6UubGH1Qa9Rq2jRdEqlPmBhSG0LUxhZptlDKStGEWIHtUsp1F3b3P8cHdpYBamEH9kLSk5xkM5OZnG/O951z/pMF7lt8TUT6wNFzI+8w0KAAZz56MffYRgTgBZACAEKIE8GenMNNTYLiBUAx8EyK9oOZD6Fk+EzDV5y0kQBABwAcxGvZluG2xm89lg0FgJkhiUHEYJIVSpLvwpHTN20bAoAW/BaLAkkEIoaUvNsvA22Hv7uRndAAmAEKffmcTBUP2ZJCmSBIyTuFX7l06IuBgoQFQETzAcv5LFjTTdiabQYxQtfoUWb5S8NnfaUJCUDjvUYdIkZWugn5DyaDodEJuRRER/2nfU8nYAYYUoYCJYTdkqqiKC9Nn6XNMkDn6473VCYWAMnhL7/U0zeZsGNbGhQFWpbSSHLry0edLyQQhWgZhfSemmxCaX4GVJMGgpOJ+Pv9TVfqE4dCmoj57p5sVvBkYRbMZhNIEiSxSUo+ue/DzncTAkAoqP+lEhHDnCRQtj0TaSkmTTeCiD+xN146lhAUWo2rJoGyYisy0tVw5ljS+8+9d/HzpiZW4ibicOMKBXUvFwIoK7bClmXW95C32sd+O13e1K7GqQ8QpORVZ0IAKCu24QFrSrgAyCDV+UeUH8oPtm+Kj4iX9IGVnBh4qtiKvNy0cBYlUc20iX96pv5XSwwBkI5GkTkzUFpkRf4jGQt0Ii6flr4LO19t3xLTUYIiEPNiEIzHCzajpNCqzU4g4t0+Eegoeqn14RiJmMJUMuoFWzPxxHbb/GguGcy0Q1WTfi55pS0vNp1YsqEM6L1wWyZ2leSED+YMPEaCv4kkHtW4iOeBrNWIF7+DBYuoA1ioImsD4Pr7Drpdo9AwCMClkPJGVAHIJQI2dCQFw3l9FAODE/rLF83JyXudpyrGo5sB3RwkDWyDmIA/em/hn6Ep/XKqTVXFfuepiplI36caLaNS0jL+rubZzm43Rm7p4xQtIjhR191c6zeSTYMijpxCQUm47HRj9I5Pf/lkX3DiTbTUSqM6iomI/QHC5asjmJic01ebj12OqkZArKkSGKDQ4g68ks35JTqvujE149dvZD9wOaqPr8c4bUDEq+8D3tkgunrc8PqC4cchxNt9DvuX63WgMVxGpbw3hWa8AVzp9WBuLhx8gBkHXc12x3qeyAxoYGUKTU374ewbRSCgaVP4WEGt66z9x/U+ExurQlI7kS2/Pz45i2t/3oZcuDnJkDWus3s6orGVMN4H7pKB2+Oz6P9rTB+8h4Wodjn2dEVrL2RQxMv7gGfMi4HBcZBkbbK8SRCV/Q67K5qbOcMa0IvY7ZnB4NBkOHgAN4SQlf2OvYPR3o0appAGZMg9gyH3lD4bThPUqmuOKncsttMGRTwf/L/uGQwvDr4rEKTqvpbnPYiRKWsR8YgueAG0pU4Hnh1o2ROz4A2eiWnRYmthopys6Wrd50WMzdhuNCRiABACjlSL7fXeFmPjcDwo5CPS6rw4cb3o9wNdX+8KIE5mZBo9AsYBhjjnarbH/a8G9y3e9h/uU+EcypgobwAAAABJRU5ErkJggg==)}button.continue{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH3wQBDDMd/Pc1cgAABW9JREFUaN7tWV1sFFUU/s7sdLZl2+2P2NJfWloDEQIaYhPEhESJBiSBRMODPy+mkYjRBx/EFNE+SFIxGiHhzajAA0GUJ30w+CAqQlECRIEEiKVLW1pK45b+7e7M3M+H6ZRZdpew7SysSU8ymUzunXvvN+ec73z3DjBnczZn/2sTABg/8Fx1QNOLACAWd5viGV6JQTP1WyWv/zwsAj5wAKP7nt8pgnaAIAmAAAlCTd2dZ6ddwdOPIIcJDoM8RbGP2RI4Vtl24sp9BTC2f30EQH2Wi/e0qzv64aTA/rxiIPyddPxs5R7AvnV9BGoAAkbICaqUxSffYcWhrBigrDT9lNuvRyht87ee+SnHIbSuD2ANSBgrXnZA3KPRToDxUdgjEdi3IrCGL0FZca+HFBQ/ebjA2CFbTpu5AKAnhY1SgLLvHb0EIIVl0ArLUFC1HGyKwRw4g3hvF5Q5BpAaRW27YU0u5jd4UTbD9huA5o15wAY480sCBTBqW1G8cguMymW3xyU3DQ4u2c8OaL4DSEpYZftyiRZAUct6FNav9ubOS9crWt7OkQemwogKpO3bFaxfjYKq5dMsJsBHvXta6nzNAS+LJK78CIikoUo67KQVQHQD0Iughaqgh2sgRvFdJyhqWgt7tA/W2ABAhgJQ7wLwzRMS/fLpXgFr753nvVQJ6KUNMGpbEQhVZpzEGunB6N8H3XGi1UUVlX6xkiaCozNbvNNuRrsxfv4QYn1dGZNbD9dBKyp3xynrnxha41sIhUMPtUXHh3aLZQfEI5EEFkyZ5ksIqQlYbhPlAi4h+STAtSA1QiF+7XcIgOCCx9NOVFC6CPbETaeikxsB+FLgdNl82AZwdiYv39i7tIXAXpDPAsTktePQSxugFZalTlRWD/afdDwJLvOPhWZhlW+ev1KpF24geYx0QirW/2daatX0kDdMF+QFAACQLadNEO+5VGlGuwFaqUVOL/TmWHXeAACAqrcudpEcAAiaE1CTI6ke0AJetVuaVwCcjY3qdtlLmaMZGMkrW3wTcz4VFKpRBUeKKzsOMlW3JcmWfAOgRAjl1BNRVnpVm7TPyDMA7uIdnldOyKR44HZRzD8ASdtOldEDt6k0zwB45YiratODdORInnpgKjxsO60H7hSCeZYDBMSN8fQ5kCQEHxSA7q8aC40R+VSgWknKlLaBIh6RaZ630iexR+1e7QwfBW0ocAoPJ6CsnYveN0/lFEAwqr0AUVvvPGoRb5FSzHA4kCTV16ZIdZE6ACtzWolt4V+kSmQ6yUPAgFZYknaLaZTU3mWfQYA4N6Oz0Wytd3fDM7DVtwDL3MUHSxtghBciUDAPEjAyJro1+S+seBSj/X+AKuE5NMOBuJVoW9qBRM4BAEBkV32zptk/UNRiNyyC4QaEKpcBktmx5sQQopFfQDvuLl4B8k7z9vjuGZ9Oz9SufVZXAds8QuEaNxz0ovkoqV4J0VLTK3Yr4nx5Wu7iJyB4tbk9cWRWx+uzsct7WoJGPPqFAK+4PK8ZxQjXtCLgnNgDAMaHL2J86IK3mA1qgo1N7WbXrP8PzL4KQyK75n8IsT9wqVULBFFS/QQCwWKMDZ5DbKTHm7AXAkrb0Lgj1u3LDw6/rLuz/A0RtQekThCiadCNMBITN70a6Lhlxjct7sBNX2R80pORZY1PSMoHuNoZXkfwEKhKUnmeB7VE4rWmDsS87zz12IWs5v3t7KOSMwAA8E9naAXI70HWTQs8cGdze2JHut9SjXXXs5r3am91bgEAQOTjeTW2UocV2UKqbS3bza8zjjOLeZMWsLA6ktVAPdcb/MkhvwD46YH7BSCp2qxq/DWrcU5c8oe9Vi3Mct7LmLM588v+A+5od3b4azuuAAAAAElFTkSuQmCC)}button.skip{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH3wQBDDc5pJgUpwAABxRJREFUaN7tWWtsHFcV/u7MeNeveG0H2/WTxE4opVQqfamNWsEPVEoiixIwoFaVeKhQgRTSVlSQFLF/SoRQhBASUvkB6kMNWKWKVIkiNUUJCBJC+kpUoVhO7Tp27KS2d73P2dmZ8/FjPbuz3hnHXm9aKvlKI69n7s75zv3O+c65d4HNsTk2x0d6qGq+xNG7GuLpSJeirZU/MX3na/lsYst3X19QCvxQHIj/fs+gptvfUMRegoMg2wCCIEACIEhZ/lv4H1z5nARkgeQClJxW5AnHUSc6f/DG+DVzIPnsnhtAeQrglysArQ88ACk9L5/7bxK/6ni/7c8qetyuiQMcHdHTuewhivMoQKMCkKZDGQ2AKgHxB19wFbYJyWcBOoFzSZmCyHe69v332IYcuDI60txopl8gOVw0oggtsg361h1QkV4ovb4quulYYC4BO/4enKX3kF8YA20ThLiLIxD5ZWe4+afqe6/n1+0AR0dCaTNzjJR7XPCqpRdG3x1QDe01VxDaJqzZMzCnT4JWysvM0a7rxr6qvgZnzQ6QUJnn9vxJKCNunOp9t0PvuPGaSyHtHDLjf4F1+e1iWJF8oTs2/pCKQlb7ru5++NHQ7m+SPOCuvN7zGegdnypQe40vpTSEtl4PgMgvTRbugTclGyPxw6/ET12VAT493Jiqt8cA9oKEatsGY2DXh1KY0mMvw5p7082LtGj5T/btm5kOmm8AQLLe3q+WwbOuHkbvrcuKEUC5lYEkp+Gkr4BWBnRygJ0vSOWy9njVhlBQdWEoownGlh7obUPQ6vyFoHHoC3BSM7CTsyDYpBz9CQD7AhkgoVLPfnESlAGCMHpuhdY+6A9cLOSnz8BZHAfprFXnS1K5rDZKDyHcdxfC3bf42rGXJrF07nn3/fHZxs7O2wJUScs8c+8tLnjoIWitA4XVX3nZWVhjr8BZGNsQeIAQ20R28m8wp/7ha8to6Yde3+a+q7U7M/vZwBAS4H7XiNbcBVDg17Hkp09DsjFvQTsulFeVkvMCNQ9HUuWpZRc/CRiGSCc03ETh1wHeCBLZmVMwWrfBaOqqsBdq24FMZr7gsOBLAI755wDV7UChFVDNHYXVrYj5FOzYhAueUHiw/eFTR6rI0aOMfu7Q5fbZlwgOQ4jc3BvQB++tBBYZAGZOFhZL8dNBL9SoZMjtbZTRBIhTcTmxSU8o8Gj7wyePVKsyKnrcVoIn3XCyYhd8bWp1TaUQFLku0AGQLS44peu+MemYi8X4VcKXNiqVXfvPnwUYIwTMZ0ErWWFTGQ3LiyYg2B3MABguS0if1YCZLD5XdN6pSfWFvOuusJhLlQxougseICPBdcDbEtMBqHzkM19UG8CI1aZ/YMJlXhwTul/ueTrgVQpZqZ8HHdDXAacolbaWz9WIAauAi6DYvuJRLtUBDpRtRsQJ2CJ4db5mm0EW3+uGjh8Ha2OARQZ8Q8hlCKx2G736orjJW2GXHruBDJSqZiADXipVjRwQj11KIANXDSFvyWcAA2uhshoGwOUKxIAcWFMI0ZPtAQyUkryGDhTtSiADLDs0CAohT5OFVRhwWVLI1CoDSjovEtC+exTy6nXAXQ1/OWOVDExEt9WHWp3DEN5BBQVxVU920psDvklcYv7dQ42vFvwQd8uZ0cinDG9L7J9IKLbChKxbg8IR+ysi+D5AQOhtD8qZD0ri0uJ93psTBRyqX/P286TjexXiVapiwFE4B9AqAVkBXgtBC0d87YZa+nwOyEoYqPC2UaHHAn8q3TnrTIH+/dNnpw/37ib4IiitLqBw5OMIt26HXtcApRm+DET67oa9NQbbjCFx6TRAy/v4edliPaKVFQu/nVjF7mv9o+/xmdfoOLcJeN59lxmfQC52AUppq9gVUCwkZ/8DiuXRX7V/6KD10M59yGllxcKvE/X0QRupAwNPXLmgaeYugCfcd5lLE0hc/Bdo53ztmvEJxCZegzjF9isDhZGhg7lf+7YS2blzvnvYsmq9gdH/WGLxUrRnt91kPkdyL0lYmctYuvh3tPTcCc0IF+dmY+NIzL0FT0wvakr2bj9gnyjfD5DWahvwlRv0XF15IK539EQvZfrTiyMkD7s6nzdjiE0dh23GQbGRvPwWEnNvesGPK1G7VoIHAHXltzcfUODPCIauAl5APtP9w/Fve85SG9DQtmZlVcO/K5OAiUPNjyiF35A0CEJpOupCEeQy73vCVf3Tzufuvz6K+Zr9QrOiy1vzSLz8QEfL8JH5ciea7iNkFMQWH6n8o5a3vrU9GvDTDwDtAz03TKYqbm3/SfqvEO1ugBe94En8fPCA9cBq4ItHi9WOe24440zNd+vr8MD37uDB9NmpXzTembedUSjuBPDjHQfzf8CT1/5gfF3H0ImnP/GxWiP4QEMo5RNCHykHHC0l2Byb4/9r/A9GxF3/Bu0ZYwAAAABJRU5ErkJggg==)}button.up{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH3wQBDDYM6zDhxQAABQZJREFUaN7tWW1oVWUc/z3n3JdtXudUzBfyZcuRaUVSmbVerDQLC0FIkCAR+1YIUhLNivslqm9ClrhR2ZQopPrSlyAQMZGQymXZjERN0d07d9e2u3nOPef5//pwPHdznqsbe+buwD8cuFye8zy/3///+7889wJlZp3Nj6RzTcv7O3c/2ExC3Wi9VW4EFGUrqStJeaVj133vTTgCpI6TAlID0G9lP1q8aYIRCMCTGhSBQJrbd9Y/P5EiUARPaoBiU8uX53bU3hspufEEm/14RcpOXK6xPUm4AAAHCviTIhWkhmUnob18SOQUtL98zhsXLo0Lgb4vVi7VmquE3lMk7yd1DSixwOMS5XlU3bUOfW3fQnwHpIZQDuve5Mra9Bkn3Dc21sDzn69+VqAbfS2PBSBZBHg98KSGshJILdmA7tZPQQpA3aCqej4j8ZJS4JgS6Nz3XHXCkxaBrOUQsCFAKAuIVUApACIABQoDa2KTZ8GqmIZU/QvoafsmIAVuOPtB9T9Az7tjJqHuvasXWoLvKXJn6F0oC/bUOljVc2CnZgGJFJQ1fP/1tO1H/9mDoGiQQtLfWNfo7DVOgC3PTMqL+pmUJaHX7RmLEJ+9FIhXjmJnQdcvTXCyv4eSc6nkaeNltFfUJyF4QCFe+zjitz8E2AlA9CgeYso9G6Hik640OSQVrTeN5kBfy6oHtJaXQ9nE5zXAnjIfoBjZ//L5Q9Bu1+AiesAoAdFqK+mD1LBr5sOeugAIvDVqczqO47+2/YO/2lfX6O4wRiDf/PRMTf/FsFTaMxYFob9evoiGOF3QTi5ITt8BKVBKITl9EVS8CgBQ6DmHXOsegAzegzroeu5mpUBjBHxLngAlTgpU1TSoZHWo1YhxwYd7/iiczK+QQt81/QAU2JUzMH3ZFminC52/7Qa1G75+Mum56xamUTDaBwhpCOu7Pem2krqn5yB/8jv4+YtgRDMDBRQNL38BLPQhd6wZUugNNd8hgjVz08iZ78SU5SEAq3JaSfn0n/5xKPgsoY8R0g3qbopsJkWRGrnje+Dl24s5LEqvrX/HPzV4P3MRoJ4ZRsCKV0Umr+7PopD7OwQvQv3a3LntTWo9iotPv5/aRGqb1HC7ilhFERvrt/tHhu5pMgJTQznAsiMJuJfaBo0TbJn3evuuUuP0EGuse7uwf8zuA0yviJF6MikggioS1Yz83otFzQv9r0rdB64el1XTHdsLH5Y620gEMnW5ZKw/roKZR4EkEAyLV1eqy5eKEdDC1pL1YODDD/967qs35Uo5eCQG9bWP+BDfDdfJgm0dmWj06vCVD630CuufTMO/3rkxowREACWRFYjiIezSgPSH8/xQSyXcNflCxTLXd44uSSN/o3PNEMgArLxyCYGKHh+0N7jOe6W2mrUNfYBzYLhHG40AKIFbo5oYpdikaGi4M11GEY7QjJIQdRE8DQ145nOAOqgLUQCHjgzlSUCC4hdJwDx4gwQyIJMDEYiag8Q8+DGMgERKaCzMIIGB5IzyNMufgB7oAyUkVPYEgkRFySpU1gTCJgWlSuQAyzwCxQ47YSUkxW6b+etr3CwzMk73JjM+qTn8SsNCWRGo3wIX9HcCGA6DApTaYYrAVT/uPnr3iRFl2k9/LFamBDhC2CoyB85nazAe1rD4+IjWHz5RIonPZGePCwGKb0ZCownleEmo7P5mHVUfeLj20IhePnIat+yWTXT7H9J2ChlDGcHsAAAAAElFTkSuQmCC)}button.retry{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH3wQBDDgagWd5GgAAB1NJREFUaN7tmVtsHGcVx3/nm9n1+hLHzj2NY9eNMWqFBK1DUAJSIhRAQqqoCjU0IkUgQXkBBVUUpebBCBR4qaJGQmpA3ITKLShUsgJ9KWoVKanS0kJL1KYkcZr6Ejtq1vb6speZ7/AwsxfbMxvb2QQq5ZPGs96dnXP+5/zP/5z5Fm6v2+v2el8vuRk3VUUyP+tZaxP1zdFXpOZfL65taZwck97Tc7ccwPhP7+tyHN2tIrtRs0NE1oJZKyICAiJIeAZBSmfDvM+D12lBLqpw3PruH1q+duLiTQGg/Xvcq+vTnxfhO4h8rNKx8mtTfm95ICqv/Qti+lY9cuLNmgEYO3L3Xoz5hYhpj3MMcTCJenBToWNUASGggnpziPWjQHhinMONdfUHpfeYv2IAerQnMZ6b/iHGfBfEBEYM4qZIrO3GWd2B29KB1DUjTnJlteNn0clh/PfOYycvIToP8MBsqnHfht5j08sGoH/CGbvS/WdEHihGTZJNpNp2kty8HXFTtReCuWt4Q2fQqeEKEOZkY6phr/Qeyy8ZgPZjRlu7fisi+4ppTW78MA1dn0Xcupsuk/7Vs/hDL5fqy4g51rD/xBdF0CUBGDly5wFR53CRm/Udu6nv2HNLtd4f/zf+yGuVdPpq0yN//fV1AQwd2dJmbOItRBoFQ3LTvTR23/8/aVje5VNo+lIRxHBT1u2WRwdm3aoa6zuPq2ijKDirNtCw7TOgfuS1tpDFT1/Ay4yg3gxayBFkeYHEAmDATSBOHZJswGncgFnVhiQbYn1xtvRQmL6CFLIgbMmkvAPAoVgArxztSTA7vh8FFWi485OBcbsYQG70VXJDp1E/T1GdYiU2ok948hYiDs6aLhJt2xGTjNB7wV1/D97IPxAFEXlUlR+bOACbZ0d3q2oLKE6qFbd5axD9BUf28knmLv0d62UBBVUUG56D/0HR8Fx+bcvvqaLq47/3Nvm3/wbeXKQt09IOTjK8r22f/c2n74vNgLV8TkRRhWRrV2TkvZkx5oZfQgKmoMpZMfwRq2+okXEDucBBgESApQjCdZoM/jqr5oNGzKdQ9qiAnUtTGDpDYuvOSL9M00bsxGVUwMID8TUg+qGQwrir29EI7ueuvArWoiKIysDGa5selP4XvBXU6KFrP9/5MKrPqCBeehBnwz1IsmmxW03rYeKdMCjmo7EUwtpNRQqYRGOQgQVHPn2hRAGxfH+FzgOw5uunf6/os0Xq+elLkTbFbQwohKJit8UCUHQzalEUcesX8VHzGbQwF/AdTW88cO71G57trR4vBsTPXousA3GcyvpqdqsM9atVQNRijLOoBmx2MgCnoGIv1kLrRf2zVp1AuLKZyLorFz6oUFelD5QuitR+62eDSAiIMlWbduWmwUfVoLYQ3XPUR9UGo7iCG58ADSKhRBawWq8CpOZr0m1NIScqiFjU+pF2A1BaAlE1A6phH4pIJdYvg8RoDefQwC72unZVbXUA4fNtbCrLIG0tB+nQrl2C3aVQKGZ8QINuiwA19L9MXY3NQNGuVquBSpSRNaBeSYWCP7WmkMbWQNlu1QwERRKMLXEZsKiY4NGvhnsyhPyuloFA/eR6GSjKlR85LAWRsFgxNfJ+FiURJlSr1kCgfhb34o8SO6xIn4g0BNO6CXhdGQmNr4Gw2e0aenLzKyBgDKIoRs7kJ5zHOvsvZZebgeCeGmu3UuJdkKcF7g3ac6goKsUGFRbp9SJBM2p7EIOEwx2W7XWrvVPAM8urAIuoCUaUOAphUTWIgFHhX/NpUzGjoySb21D1Fx2mbjWY5Lxri7NTqL15X3hjJTUQPE8QaTc4ys8Trl2V/6bJJF3gyyUdlgTNd+zATbXi1rdGRsIYl9a79uIX5shNDJKbfKdIJ1TMhKh8YeuBodeXWQKQCLMaV8QL+o/5wLfJbevL7wc5UFR0tXkyoy+jNh9y3Y+eDMWQS18gOzFYyoRFz6nvb297bPj5lfaB4r3i7FY+2ZXkY1tf7imEh8I4YP0c6cHnA+ci5nL1cky9e4rs5GAl9V40Jrur/fHxCzfWBwKKRNktjhJFEIsEfPCQu9uqOQ6sCclC86aPUN/aVa4jL8fUyEt4uanSQ7qIHHdnUvvv6B+ZXanrVw/fvdl3/JHFe62xGwWTiwS88wnvRbGyCzgfusvUldfIjP0TtR5edoL05RcoZNMBT4OIPbl15tpDN+I8QC6h+ciNgPiNgnxsCz3Xzzo3Ufcs6MeLGxt1Desp5CdR6yNBBDxVvtV5cPrpeSQY+EbDkr2eS6v0Hiv9sDH6VNcvEfmKhBvIVTKRV+QHVWeAwX5SNpH8FfCl0u5M6WZkBNPbeXDmucrvTA08vK75/t9dXeaz2IpnkaozQGc/2bueyO9T5dCCPvEu1nxiofMAZKZv6Zaju4TYKOT7LhxKnAd+gsp/XMf0tn9vZiT6Gxk61g8v2YH2daP+yTf/j341nDravS4U8WUcK1+m1gCmbzGFag7AN9OW2+v2ev+s/wKIypfbke4fXgAAAABJRU5ErkJggg==)}button.abort{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH3wQBDTcgwTHWUAAABeFJREFUaN7tWU1sVFUU/s69b+Z1eJ15pbUF6gCagIFEWFgXXRhRSNCVisRuXECFDRsSY4IhcdHERGITQgKJuoBUVyaQKK40xhYlXbCgmyaKEgP0Jy0ghb5pp/P33j0u3kz72s5M3512xEXPcnLn3u875zv3nnMesG7r9nTs8nuQ/4e9qJY/OX0HXgewy+7u/3K14PlsZ2y2pfEIg/9KHO2/VncCTt+BV5nVBYCaobjXdjIX6aMbmVrBO3bsOASdEkRJBvbZ3f3X60agBJ5I7AUAZh6vlUQQPBElSz8DeE2HhAi7MHVp/6EgeAAgoiQEnXLs2HE+2xlbJXgAIGZ1IXVp/6E1JZC6tP+QIu4pgadYC8hqq4lEOfBktYFiLcX9xF5F3BOWBOnKhho3w2jvAEkT7uggPGcMZJih5FQOvLC3w2jvAHs5uBND4Nn70JGT0JFNCbxMJCGsVhjbXoFseSFUJKqBF1YrZCLpO6Zxs5acSNfzMpFctE6l/4E7MQTljKBSYq8EPmhealwrEhRK8xXAhyEBAGHBVyLBrIYFU0/i2MD3KxKY7tv3Jlh8HkxYY2tnRfDVSJCrzjEBkOLDsOAXkRi7Ac5MzZMAqY+bun/7KbjOWI5EbARR80KWSJA0V77OrFYY7R1wAXhTt0GGmUREnhXki4A1wAPwzxTBCoOaJUWeWzGJm45d+5aIPpvn44zBHR0EWAHCqE4ivgXRHQch7a2AmwMVwSs3B2G1hQZfiianHy5Ikri3ccPsN0vXli2izry/6fdswXgAxh6SRoILaai5KZAZB0WtKpe8AmQEsmUnOD0JlXkMVh6kvRXRXW+DGpr8NZpSBHGvbWUuUtfy67niLcSXO2NOOnYcHD75fKkwQACnH8GdGPJ1qun5sOBXfMi0SATAU3FblXV8aTXYdQEf6iXWIUFF0TPrVaW1gg9VC1HXjYxtZS6CuJeZx/3EHvHlEUjsmsALY1XgtcrpspFIbINs74BobJ2XzX/lee1yelkkmOFNj8CdHAKnHz0V8FoEgiSI1TlmngYB7Iz6QIoJGwp81lkMXqlpQJ3TBa9NoERCSGNOSNEkiMBuDpxzIMx4+EPNODjnAJ7/2JEQTUQyowteu6XUqSrDSKgwcRPKGQEBYEZN7alWBGZbGo8IQ5wXREkulgfRHQch4lv0vEaATGyBueMNSGsT2M2DiJIkxflUs3V0zSOwlp4vvXrM/tUbpp9YFYF6gtdpimqWUM2yEYb/0BUfO6ISaFoEPljFCqsN7Oa05ET18nzJqwvF3DPLPK/T2VWKhKiX593RQXhTt6Ee34Y3NggwVwVfaySoXp4PeBEgQCa2w3j25drL6gqRkEunxMkXdx6GoJ7g0CmS7KzxYDUNIEtEDZxLgQtzoAa7elMEgKIWqMGGykwBhTSIKAHCnlyDMfaSee/WlT/AZSXUdQWekOK+KI37mIFcyj9QRkPLhkp3vZCnifhTZoyj2CuHak9l1D8zlypKz587kRD3u67Aq9pSnrl6997pt54fZvBuIrEJyoVKPwRFYhBmorznZx+gMDIINTMBEgaYeZzBnySsuT4z6t7MFYyMTnvqOSMojA6Cs9MAUXGsghP2BwM/ag22APwKgOAVQGYc0d3vgja0AF5+wfNeHvk/f4DnjEEYZqkjOxE/+stXS/Y7AeALAGA3N98nQ0YB5c57nuemkL/1HTg3AzIiYK4+2Kp4C9nd/ddJ8WFmNQwZAbtZ5O8OwHtyZ8HzM5PI//2zHyHDhGIeV6xOlpseJKz01wx1kpnHyTCh0g/9/85MLnj+yR3k7w6A3SwgI1BKDZPiw9Xmoyu+xJWmdCRN7Xq+Wnu6dLhbbRqnXQuVG69DyGVzmzD1fDkSZLUByls0hQsDXqucXpQTHJg+VNB8iP3mc6I0uiNBK2p+1Z+YSiSo+O9awJcjQQRt8Nr9QDCxqyVsWAsmdpiEXZOvlPMTbCU22vHM1VrawGU5MRN7B0I9WTp5rqut5YfudVu3p2j/AkT4owo7DZieAAAAAElFTkSuQmCC)}div.RIP{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAzUExURQAAAAUHAmNlaKSkpXtpZllZWVx9LsHLo9bX2Wx9jpazUak9Lu3s797g33SZKnybRP///5NI/qoAAAAHdFJOUwVE/v+8OP47SgHcAAAAAWJLR0QQlbINLAAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB+AJFQwBEyT4/QUAAAFbSURBVDjLdVKBooMgCGxggQj2/3/7DnNb7m2kdspxgLVtN3sQw8r2y4glCaw/KAW+WivRD5EHK1trrTSqun8TcNWWjFYr0zcBD1FuxtyQ5NO9K2oTlYYyCDmYZcnC6u5wqzAJt1Kx9ZvKHsivWtu0wqLht16QXjULuGwnTv5Ngl2H5vSPDCErocAq7mnHq1IplAqPO4E0qOCqK26aIkrhVYGSgDAqAeyJF4Lj0C/SIACvNcBBWXtUyCeuHEsNUyGdUKm+tpmfgWo4ZtScSPN5D3FFP6f/J7wMPh8CH10oDq8xF12LRKhex8Od1FhT4GNkAs2RD7Yu7y7s6IfNGq5CjuPobwU7JaIboqz3nqTTQqy/auhiZgJfN5Hk9DxJlP/dfp7d8jklh2GRwR5BEEkwouY71wQ2ECrsUICN5WZznynyjS7GGDg7mLsDCjd7bmb3LwQ8xjbXx/bG2x+HDRcuxXGCugAAAABJRU5ErkJggg==)}span.depth{display:inline-block;font-weight:700;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAUCAYAAABF5ffbAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3wQBDjQRuYQ78AAAABJ0RVh0Q29tbWVudABEZXB0aCBtYXNrQcBmawAAABhJREFUGNNjYEAD7Wdr/zMxYAGjggMlCACJuAL3jmFt7AAAAABJRU5ErkJggg==)}span.port{font-weight:700;padding-right:.5ex;margin-right:.5ex;background-color:#ccf;display:inline-block;width:11ex;text-align:right;border-radius:5px}span.port.fail{color:red}span.port.redo{color:#ff0}span.port.exit{color:#0c0}span.port.exception{color:#f0f}div.prolog-exception{color:red;font-size:80%;margin-left:5em}div.controller.running>span.sparklines{margin-left:.5em}.jqstooltip{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}div.render-multi{position:relative;vertical-align:top;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAATCAQAAAA6heU+AAAAAmJLR0QA/4ePzL8AAAAJcEhZcwAAEMQAABDEAbRyZ/IAAAAHdElNRQfeCg8LIivxaI+JAAABT0lEQVQoz33SsW5SYRgG4AchbSkcYrVpo6bGoXFydvMK3HsJLt6Ct+AFeBVunVx0cjFODvofqyDQFDVttef8cg6IA4SkFXjX70ned/gqk4kV+SUVnGs8rayC54KA/e7DvdpydiZIJXbEJyyFp4IjW27IFG+Xwp9SR266LhM/PT5dAn9IfbGtJROtP2ch/C711bZELmrYOFwIB1JtOxpyfzQl1n4vgANBx65NuaGmlsR69h88EXTcUpcpNLQkknJ3dAUeS327wlr+fpxe57Av6F1iLYmxOLgEe4K+2zZkitm2xFgumsOJrs/67liTGc4qm8YyUbw7gxNdwbE9NZlixhKlXBTl+1NYaU9SPfdU5Ubz0inL5aJya3h2oBa03XdNZqzZaR5uvq5/mFyUcVSUo0JRLerlxQFqwQPVN/FF+T4Jj0YL32ial8/eJfDK6vwDMhCTheu9OHEAAAAASUVORK5CYII=);background-size:15px;background-repeat:no-repeat}#render-select{position:absolute;background-color:#fff;padding:5px 0 5px 20px;border:1px solid #000;border-radius:5px;box-shadow:5px 5px 5px #888;z-index:500;white-space:nowrap}.render-selecting{outline:#800 solid 1px}.render-multi-active{position:absolute;left:0;top:0;width:20px;height:20px}div.render-item a{float:right;padding:0 10px}div.render-error{display:inline-block}div.render-error span.error{color:red}pre.console{padding:0 9px;border:0;margin:0}span.format{white-space:pre;font-family:Menlo,Monaco,Consolas,"Courier New",monospace}a.download{margin-right:5px}a.download span.glyphicon{margin-left:1ex}.render-table{border:2px solid #333}.render-table td{padding:0 5px;border:1px solid #888}.render-table th{padding:0 5px;border:1px solid #888;text-align:center}.render-table tr:nth-child(odd){background-color:#eee}.render-table tr:nth-child(even){background-color:#fff}.render-table tr.hrow{border-bottom:2px solid #333}.render-code-list{color:#040;font-style:italic}.render-ellipsis{colour:#00f;padding:0 5px}.render-svg-tree{padding:5px;display:inline-block}.render-svg-tree svg text{padding:.5em .2em}.render-svg-tree svg g.collapsed g text{padding:0 .5ex}.render-svg-tree svg polyline{fill:none}.render-svg-tree g.noleaf text{font-weight:700;fill:#00f}.render-svg-tree g.leaf text{font-weight:400;fill:#000}.render-C3{display:inline-block}.answer svg{vertical-align:top}.render-graphviz{display:inline-block}div.R.svg svg{overflow:visible}.fold{display:none}.pl-ellipsis,.pl-functor:hover,.pl-infix:hover{color:#00f;text-decoration:underline}.pl-ovar{color:#800;font-weight:700}.pl-anon{color:#800}.pl-avar{color:#888}.pl-var{color:#800}.pl-atom{color:#762}.pl-functor{color:#000;font-style:italic}.pl-comment{color:#060;font-style:italic}span.diff-tags{margin-left:2em}.diff-tag{border:1px solid #ddd;padding:0 4px;margin-left:2px;border-radius:5px;background-color:#e1edff}.diff-tag.added{color:green}.diff-tag.deleted{text-decoration:line-through;color:red}pre.udiff .udiff-del{color:red}pre.udiff .udiff-add{color:green}/*! jQuery UI - v1.12.0 - 2016-07-08
+ul.dropdown-menu li.checkbox input{margin-left:3px}ul.dropdown-menu li.checkbox span{margin-left:20px}.dropdown-menu>li{position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;cursor:pointer}.dropdown-menu .sub-menu{left:100%;position:absolute;top:0;display:none;margin-top:-1px;border-top-left-radius:0;border-bottom-left-radius:0;border-left-color:#fff;box-shadow:none}.left-caret:after,.right-caret:after{content:"";border-bottom:5px solid transparent;border-top:5px solid transparent;display:inline-block;height:0;vertical-align:middle;width:0;margin-left:5px}.right-caret:after{border-left:5px solid #ffaf46}.left-caret:after{border-right:5px solid #ffaf46}.dropdown-icon{margin-left:-12px;margin-right:5px;padding:0;background-repeat:no-repeat;background-size:100%;background-position:50% 50%;display:inline-block;vertical-align:middle;height:18px;width:18px}a.accelerated{position:relative}a.accelerated span.accell-spacer{color:#fff}a.accelerated span.accell-text{color:#888;position:absolute;right:10px}body,html{width:100%;height:100%;padding:0;margin:0;overflow:hidden}nav.navbar{margin-bottom:5px}#content{width:100%;height:calc(100% - 55px);padding:0;background-color:#fff}.pane-container,.pane-wrapper{width:100%;height:100%;background-color:white:green}.splittable{background-color:#fff;width:100%;height:100%;padding:5px}div.tabbed{height:100%}div.tab-content{height:calc(100% - 40px)}div.tab-pane{position:relative;height:100%}span.glyphicon.xclose:hover{opacity:.8}span.glyphicon.xclose{margin-left:5px;opacity:.2}a.tab-new.compact>span{padding:6px 0}.nav>li>a.compact{padding:0 5px}span.tab-dirty{display:none;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAqCAMAAADCkShIAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAzUExURQAAAAICAQAAAAAAADAwHSkoFVtYJvj4wdHPi/37sKOfVvv3joJ+OfLsa6GaOfryVf////09bBAAAAAGdFJOUwD+LWbH9lfFP3wAAAABYktHRBCVsg0sAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AkVDAQs7+kkfQAAAetJREFUSMeVVY3WqjAMc7B1XffT93/bm3aA+l1Q7FGBQ7I0WcHH47RCCMvjhwpe9/Fr+JEBLMV4nwCBmHO8LwFkzplvEyBAIGS62dSClUveJNZ7DUn2kltNBXdsVcqNaBdriA1tX77hYndcTIG/RwuByAysFzO277sA84RXENoXidUFeMJLrcX2e/kcETthwvH5HG3YHZfWGHCrj763SNm3jCehfyBMAWYxq8HQRFLpmuFT6tnbdltLduyXj+scoolv1NFN9dNxIWE3s9BcfvbvBOrpfGrdcdgILEAJoGlIP4/WHVPYHOAChgGl3lXPJOxFwaUdhAQL3WRSU9UT3+YuF9k82FWv1rydqf4/UqvnWHh6ADAKUdrEziQsUpsdw8fQrHU53IDwN9p9o2qVKEgT+N7piVelN9/Lc3SqIMxkBJVXwnhrCl2QC/TOJAYUnRkdhDeJNURrxIcNVmGW6K/Cm2937AJkX3RPXZ2QXgjPaPfZsXHbC3gdYwI3wnO/Xxx3o+hF7dGaKrJJNGyzMNcNvworNKiNNCg1nI20+14QEaNzkljTAEwHnKvBSVvCVRoDhDa2aGGg1WppjiRYU3BXAVWDYWFo2sEU1J9Wm67KdRrWawdHUNvsH5VOT2f523z/x7xZ6+M3xvr4B2dMHj70RasaAAAAAElFTkSuQmCC);padding:0;background-repeat:no-repeat;background-size:90% 60%;background-position:0 40%;vertical-align:middle;height:30px;width:21px}.nav>li>a.compact.data-dirty>span.tab-dirty{display:inline-block}.tabbed-select:{width:100%}.tabbed-create{margin:2em 0 1em;text-align:center}label.tabbed-left{text-align:right;margin-right:.6em;white-space:nowrap;width:5em}label.tabbed-right{text-align:left;margin-left:.6em;white-space:nowrap;width:5em}.tabbed-profile>label{font-style:italic;font-weight:400;color:#888}.tab-icon{padding:0;background-repeat:no-repeat;background-size:70%;background-position:50% 40%;display:inline-block;vertical-align:middle;height:30px;width:30px}.tabbed-profile{width:100%;text-align:center}.tabbed-profile .select-profile{display:inline-block}form.search-sources{margin:3em auto 1em;width:80%}.CodeMirror{font-family:monospace;color:#000}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0!important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:-20px;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-invalidchar,.cm-s-default .cm-error{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-30px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none!important;border:none!important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper{-webkit-user-select:none;-moz-user-select:none;user-select:none}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:none;font-variant-ligatures:none}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-code{outline:0}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}.CodeMirror-focused div.CodeMirror-cursors,div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0 0}.CodeMirror-hints{position:absolute;z-index:10;overflow:hidden;list-style:none;margin:0;padding:2px;-webkit-box-shadow:2px 3px 5px rgba(0,0,0,.2);-moz-box-shadow:2px 3px 5px rgba(0,0,0,.2);box-shadow:2px 3px 5px rgba(0,0,0,.2);border-radius:3px;border:1px solid silver;background:#fff;font-size:90%;font-family:monospace;max-height:20em;overflow-y:auto}.CodeMirror-hint{margin:0;padding:0 4px;border-radius:2px;white-space:pre;color:#000;cursor:pointer}li.CodeMirror-hint-active{background:#08f;color:#fff}.CodeMirror-dialog{position:absolute;left:0;right:0;background:inherit;z-index:15;padding:.1em .8em;overflow:hidden;color:inherit}.CodeMirror-dialog-top{border-bottom:1px solid #eee;top:0}.CodeMirror-dialog-bottom{border-top:1px solid #eee;bottom:0}.CodeMirror-dialog input{border:none;outline:0;background:0 0;width:20em;color:inherit;font-family:monospace}.CodeMirror-dialog button{font-size:70%}.cm-s-prolog span.cm-neg-number,.cm-s-prolog span.cm-number{color:#000}.cm-s-prolog span.cm-atom,.cm-s-prolog span.cm-uatom{color:#762}.cm-s-prolog span.cm-qatom{color:#008}.cm-s-prolog span.cm-string,.cm-s-prolog span.cm-string_terminal{color:#008;font-style:italic}.cm-s-prolog span.cm-bqstring,.cm-s-prolog span.cm-chars,.cm-s-prolog span.cm-codes{color:#040;font-style:italic}.cm-s-prolog span.cm-functor{color:#000;font-style:italic}.cm-s-prolog span.cm-ext_quant,.cm-s-prolog span.cm-key,.cm-s-prolog span.cm-tag{color:#000;font-weight:700}.cm-s-prolog span.cm-qq_content{color:#900}.cm-s-prolog span.cm-qq_close,.cm-s-prolog span.cm-qq_open,.cm-s-prolog span.cm-qq_sep{color:#00f;font-weight:700}.cm-s-prolog span.cm-qq_type{font-weight:700}.cm-s-prolog span.cm-comment,.cm-s-prolog span.cm-comment_string{color:#060;font-style:italic;line-height:1em}.cm-s-prolog span.cm-var{color:#800}.cm-s-prolog span.cm-var-2{color:#888}.cm-s-prolog span.cm-anon{color:#800}.cm-s-prolog span.cm-singleton{color:#800;font-weight:700}.cm-s-prolog span.cm-identifier{font-weight:700}.cm-s-prolog span.cm-module{color:#549}.cm-s-prolog span.cm-head_exported{color:#00f;font-weight:700}.cm-s-prolog span.cm-head_unreferenced{color:red;font-weight:700}.cm-s-prolog span.cm-head_built_in,.cm-s-prolog span.cm-head_iso{background:orange;font-weight:700}.cm-s-prolog span.cm-head_hook{color:#00f;text-decoration:underline}.cm-s-prolog span.cm-head_extern{color:#00f;font-weight:700}.cm-s-prolog span.cm-head_public{color:#016300;font-weight:700}.cm-s-prolog span.cm-head_constraint{color:#008b8b;font-weight:700}.cm-s-prolog span.cm-head{font-weight:700}.cm-s-prolog span.cm-goal_built_in,.cm-s-prolog span.cm-goal_imported{color:#00f}.cm-s-prolog span.cm-goal_autoload{color:#008}.cm-s-prolog span.cm-goal_undefined{color:red}.cm-s-prolog span.cm-goal_dynamic{color:#f0f}.cm-s-prolog span.cm-goal_thread_local{color:#f0f;text-decoration:underline}.cm-s-prolog span.cm-goal_constraint{color:#008b8b}.cm-s-prolog span.cm-goal_recursion{text-decoration:underline}.cm-s-prolog span.cm-meta,.cm-s-prolog span.cm-op_type{color:#00f}.cm-s-prolog span.cm-file_no_depends{color:#00f;text-decoration:underline;background:#fcd}.cm-s-prolog span.cm-file{color:#00f;text-decoration:underline}.cm-s-prolog span.cm-nofile{color:red}.cm-s-prolog span.cm-option_name{color:#3434ba}.cm-s-prolog span.cm-no_option_name{color:red}.cm-s-prolog span.cm-flag_name{color:#00f}.cm-s-prolog span.cm-no_flag_name{color:red}.cm-s-prolog span.cm-error,.cm-s-prolog span.cm-instantiation_error{border-bottom:2px dotted red}.cm-s-prolog span.cm-link{color:#762}.cm-s-prolog span.cm-expanded{color:#00f;text-decoration:underline}.cm-s-prolog span.cm-undefined_import{color:red}.cm-s-prolog span.cm-unused_import{color:#00f;background:pink}.cm-s-prolog span.cm-xpce_method{font-weight:700}.cm-s-prolog span.cm-xpce_class_built_in{color:#00f}.cm-s-prolog span.cm-xpce_class_lib{color:#00f;font-style:italic}.cm-s-prolog span.cm-xpce_class_undef,.cm-s-prolog span.cm-xpce_class_user{color:#000;font-style:italic}.cm-s-prolog span.cm-outofsync{border:1px dotted red}.cm-s-prolog span.cm-html{color:#909;font-weight:700}.cm-s-prolog span.cm-entity,.cm-s-prolog span.cm-html_attribute{color:#909}.cm-s-prolog span.cm-sgml_attr_function{color:#00f}.cm-s-prolog span.cm-http_location_for_id{font-weight:700}.cm-s-prolog span.cm-http_no_location_for_id{color:red;font-weight:700}.cm-jumped{background:#ff0}.CodeMirror-hover-tooltip{background-color:infobackground;border:1px solid #000;border-radius:4px;color:infotext;font-size:10pt;overflow:hidden;padding:2px 5px;position:fixed;z-index:100;max-width:600px;opacity:0;transition:opacity .4s;-moz-transition:opacity .4s;-webkit-transition:opacity .4s;-o-transition:opacity .4s;-ms-transition:opacity .4s}.CodeMirror-hover-tooltip .pred-name{color:#00f;font-family:monospace;margin-right:5px}.CodeMirror-hover-tooltip .pred-tag{font-weight:700;margin-right:5px}.CodeMirror-hover-tooltip .pred-summary{font-style:italic}.CodeMirror-templates-variable{outline:#4664A5 solid 1px}.CodeMirror-templates-variable-selected{background-color:#B4D7FF}.CodeMirror-hint-template{background:url(data:image/gif;base64,R0lGODlhEAAQANUAAH5weoJ1g4h8kY+EoZaMsZyTv6CYyGd9qWqArG+Fr3aLs3yRuIKXvYmdwY2hxIaUroiVrIyXqoidwZGlx4+aqJScpfr9//f8//b8//n9/9Xz/+v5/5ifovH7/+n5/+36//D7//T8/+r6/+v6//P8//f9//b9//r+//n+/56inqKlm6iol62rlP7xevzndvjQasiYQP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAADEALAAAAAAQABAAAAaEwJhwSCwOYcikEkmEtZ7QKKzpMhgKhIEgAHBNj6+wePwVsjTotJpFXGk88Hh8RVRpJo4GY6FIIDwqRCkaIxuFIoUjIylEHHd5e30IHxxEFRogIB2ZmpoVRBR3EgsJByGnJBREERolFyWwJhgmJRFEEBonFigoFhYZvRBED8TFxsRGyUVBADs=) left center no-repeat;padding-left:18px;margin:3px 0}.CodeMirror-hints-contextInfo{position:absolute;z-index:10;border:3px double #d4d0c8;max-height:200px;max-width:400px;min-width:400px;overflow:auto;background:#FFFFE1;font-family:Tahoma;font-size:12px;padding:5px}.CodeMirror-hints{overflow-x:visible}.CodeMirror-hint{position:relative;max-width:none;overflow:visible}.CodeMirror-hint-description{display:none}.CodeMirror-hint-description.active{display:block;position:absolute;z-index:20;left:10px;top:0}.CodeMirror,.prolog-editor{height:100%}.CodeMirror pre.CodeMirror-placeholder{color:#999}.CodeMirror .source-msg.error{color:red;border-left:2px solid red}.CodeMirror .source-msg{position:relative;border-left:2px solid #000;padding:0 5px;background-color:#ddd;cursor:hand;cursor:pointer}.CodeMirror .source-msg>span.glyphicon{color:#000;position:absolute;right:5px;top:5px}.CodeMirror .source-msg-charmark{height:1.5ex}.CodeMirror .source-msg:hover{text-decoration:line-through}.CodeMirror-hover{outline:grey solid 1px}.CodeMirror-search-match,.CodeMirror-target-line{background-color:#ff0}.CodeMirror-search-alt-match{background-color:#bee}.CodeMirror .trace.call,.CodeMirror .trace.exit{background-color:#0f0}.CodeMirror .trace.fail{background-color:red}.CodeMirror .trace.redo{background-color:#ff0}.CodeMirror .trace.exception{background-color:#f0f}.Prolog-breakpoints{width:1em}.breakpoint-marker{color:#822;padding-left:4px;font-size:120%;position:relative;top:-.2em}div.edit-modal{position:absolute;left:0;right:0;top:0;bottom:0;z-index:2000}div.edit-modal>div.mask{position:absolute;left:0;right:0;top:0;bottom:0;background:#000;opacity:.2}div.edit-modal .goto-source{position:absolute;padding:.2em .5em 0;border-radius:5px;border:1px solid #000;background:#fff;box-shadow:10px 10px 5px #888;z-index:2001}div.CodeMirror-dialog{border:1px solid #888;background:#f8f8f8;box-shadow:10px 10px 5px #888}div.prolog-query{height:100%;padding:5px;background-color:#eee;position:relative}.prolog-query-editor .buttons-left{display:block;position:absolute;bottom:10px}.prolog-query-editor .buttons-right{display:block;position:absolute;bottom:10px;right:5px}.prolog-query-editor div.prolog-prompt{position:absolute;top:5px;left:10px;heigth:100%;vertical-align:top;font-weight:700}.prolog-query-editor div.query{margin-top:3px;height:calc(100% - 35px);margin-left:2em}.prolog-query-editor div.query-buttons{margin-left:2em}span.run-chk-table{margin-right:5px;color:#777}span.run-chk-table input{position:relative;top:2px}ul.dropdown-menu.history{max-height:30ex;overflow:auto}div.prolog-runners{width:100%;height:100%;background-image:url(../icons/owl_25_years.png);background-size:90%;background-repeat:no-repeat;background-position:35% 50%;overflow:auto;padding:0 5px}div.prolog-runner{position:relative;margin:2px 0;border:1px solid #ccc;border-radius:5px}div.prolog-runner.tabled{border:0}div.prolog-runner>a.close{position:absolute;top:-4px;right:-10px;z-index:10}div.prolog-runner:focus{outline:0}div.prolog-runner.iconic>div.runner-results{display:none}div.runner-title{padding:0 5px 2px;border-width:2px;border-radius:5px;box-sizing:border-box}div.prolog-runner:focus div.runner-title{border:2px solid #000}div.runner-results{padding:2px 0;background-color:#fff;border-radius:5px}span.answer-no{float:right;color:#060;font-size:80%;margin-right:2px;font-style:italic}div.answer{padding-left:5px;border-radius:5px}div.answer.even{background-color:#eee}div.answer.odd{background-color:#fff}div.response{font-style:italic;color:#00f;font-size:90%;margin-left:10%;background-color:#eee;border:1px solid #ccc;border-radius:5px;padding:0 5px}span.prolog-true{font-weight:700}span.prolog-false{font-weight:700;color:red}div.cputime{text-align:right}div.cputime span{background-color:#ccc;border-radius:5px;border:1px solid #888;padding:0 5px;font-size:80%;font-style:italic;color:#060}span.runner-state{position:relative;top:2px;width:1.5em;height:1.5em;margin-right:5px;background-size:100%;background-repeat:no-repeat;display:inline-block}div.runners-menu{position:absolute;top:3px;right:5px;z-index:2000}div.runner-title button.dropdown-toggle{background:none;border:0;cursor:pointer;padding:0}div.runner-title>button{background:none;border:0;cursor:pointer;padding:3px 0;color:#000;float:right;font-size:21px;font-weight:700;line-height:1;opacity:.2;text-shadow:0 1px 0 #fff;margin-left:5px}div.runner-title>button.rtb-toggleIconic{padding:8px 0}div.runner-title>button:hover{opacity:.8}span.runner-state.idle,span.runner-state.wait-input,span.runner-state.wait-next{background-image:url(../icons/logo.png)}span.runner-state.wait-debug{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3wMfEyg27OEfWQAAAYdJREFUWMPtVsFtwzAMJINMwlHyt0foCIW6gUYQMkJGsP8dRauwH9GQacqiDffThoARR6LE4/EoGeBt/93w6AIG4J3N8FcA7AXVm/BBMDdP8JkIsASqHx20BtMD7bKJiBnAfErc5nzld31wDQKuBuEN3mOjHj+j9GZmVuaWv4xNRHwo+7Kgmxk4dCH/WyDuemDI2cMQIGx5ZaOv+Uz9RQNepfdYqPbzB2/9ekGwAaJ7ElpOuiTooFb7zEQw5Gyejs2TcMgZhpxhJjLRYkcjXv8mgJloQS4gpgoMO4RqsMjNEoSYGADg8XquFgqIs1et0Rm4y8BYqK9rJ+8nrm7//VwY4BDT8oh66w7wdINuY1i36FYDQr+2r5gWRoQBLcxaM71vhGbHtACkGCDEtBp7vJ4rbVhlGvc1g5ujOMWARjlMG3NeQI0xQPj4hG9dzgLeKLMkxRLzbmlBJjUQi5FqDmv/lp9O+LY3mWJAzY7F2JG5PXbBWwaZ9/hc+g3f2lCPW36Xg3nbn7EfAs3X9neMq50AAAAASUVORK5CYII=)}span.runner-state.running{background-image:url(../icons/running.gif)}span.runner-state.false,span.runner-state.stopped,span.runner-state.true{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAMAAADyHTlpAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAzUExURTxGYTxMaj9FYktZdXSHpT9FYVplamBykExLT4mYtZByMb6gSPrIbO/Sk5OTkw4LBv///4iQZ38AAAAKdFJOUwH4Xfn/K/79yv8b7m9OAAAAAWJLR0QQlbINLAAAAAlwSFlzAAAN1wAADdcBQiibeAAAAAd0SU1FB+AJFQwTJ324eWMAAAIsSURBVDjLjZXtmoQgCIVDSFSy7v9u96DWZO3uM/5oJnvj64Aty2uRr7B8s1iwaP0GjUL0HboqEyn/E8H1KImj+rl/5cKnSzgnYqXuIrDyIxUVaT4DNZRE26vY1/HWRSqpREq4AiKPQP0XBrClnxxX9vgYBkQjcYyEq3rNHGe5mw06TBGVYrZtZiXi3jc5z9XgzlKxWrdtB1yrlUbKHKtLhBCi1W2/1laNyW081AgqbnK/LQEbo/BTN0Qbty3v+wxbFA2vHmGrgsdIa28/Da6mwi//sZH7cSQnj2OwRR9mCaRnZHYcR0dTz22Lty5b15BISs+9dDScKMxCCKYUVu8TkSzROvqxWkbJTIduC2XorIT0+6N0WH/DTpQYfaCZl5QZfzletbdBnLdbPFH0nLfKyP+zTlQqUGiWEUALRJtV2/cXjxJkxKiRF2TPmNGWlpWZdDU8LR/2UbAVCjT9S5rI0vTKc2dRLrXXqoworPRyoa7zICaRXliv65H80quFSjz7RaWMXrXiZGrqiSf16OwlqZZ6lfLUw7tF0vJurVtnDx02Y8069/bKWeM8Lz4xxav/rAA6mHmCfVxwtGDIc5rcZ9/0IDCy1ee1GoYlYztqjuvk3mWGAWSHg8BKKd568C6u5S2EhmaFxgrBtUXoZxDc7dmbalILsLsBLe09HFRHc/gg/XhJ11Hc0CuVwK/D+ubhXaE/VmpWw5foL2fK718FVOGp5p+fGBys6b3/A/dgJEXSAh3eAAAAAElFTkSuQmCC)}span.runner-state.aborted,span.runner-state.error{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAMAAADyHTlpAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAzUExURTxGYTxMaj9FYktZdT9FYWBykExLT1planSHpYmYtZByMb6gSPrIbO/Sk/8AAA4LBv///y1hUbcAAAAIdFJOUwH4Xfkr/cr+eNcn5wAAAAFiS0dEEJWyDSwAAAAJcEhZcwAADdcAAA3XAUIom3gAAAAHdElNRQfgCRUMAA5e5aCdAAACE0lEQVQ4y41VCZKEMAiUIIQcjv//7TZJHDXubkmVo9FOczRkluVh5BaWN8YGo/UdlOgl1JhI+J8Ivp8UpCRyrh+58OGSHMpCbbEGGU9nfGIWnShQg5JJ24r3E5axFouk+AWoRSB+N2N8kzPHlT0VBoFJdGBkcj9tG3O60gbpVEDkXGqtpeRIETuc4V4N7liKZdu2+gF628pAPvLyEACsn6/VLXscMqsRxDhv2+dqFcTxqRuijaV+JgPWJDyE59I4kVa/DSyK8vAfu/d9V0fu+8BmmWjJYm3uy77vHao93nqNdl2DsuVOmjtUDyhoIQSThnWBMmbJZOR0suZRhtJkQ7PDNfSEmnWkrw2DHeWAQlo0QmJA8UAcv4Ua7Me6QrQGBWtq8sXt84dtDpUGbQ10YfWsazkXiDUlQHRZFbEAfXisWT39XE4oOknDPsqlYpcKAOlXGcVCQjcJUpe17Add0V4DQO+DGKw1S9ZrQpq9CdLcL94DteR78j4QcfLvTQBpy1yoUrOk+SAIESHMtUVvYwjleabxfV4Gskk6+Xf58gVcXdLop4DprbOTtJcxVx9Zv0p2mcRpL0fGgpX4K/+WMTIFP96aeGfepBdaxE6WGBoL9MYudt2J3F2ye7AKujYXioFICBGM6941T4+j8HCytrjP70rzAbte+oHjs/C/mjqrvYaavfrbCMj+oeYfUJ/LX/z/ANqPJNQJtoGtAAAAAElFTkSuQmCC)}div.controller.running>span.running,div.controller.running>span.sparklines,div.controller.wait-input>span.wait-input,div.controller.wait-next>span.sparklines,div.controller.wait-next>span.wait-next{display:inline}div.controller>span{display:none}span.wait-input button{float:right;box-sizing:border-box}span.wait-input span{display:block;overflow:hidden}span.wait-input input{width:100%;box-sizing:border-box}pre.prolog-message{white-space:pre-wrap;padding:2px;margin:0;width:100%}span.output.error-context{display:block;position:relative;padding-left:25px}span.output.error-context:hover{text-decoration:underline}span.output.error-context>span.glyphicon{position:absolute;top:5px;left:5px}a.goto-error:hover{text-decoration:none;outline:#337ab7 solid 2px}pre.msg-information,pre.msg-informational{color:#060;font-style:italic}pre.msg-warning{color:red}pre.msg-error{color:red;font-weight:700}table.prolog-answers{width:100%}table.prolog-answers td{padding:0 5px;border:1px solid #888;vertical-align:top}table.prolog-answers th{padding:0 5px;border:1px solid #888;text-align:center}table.prolog-answers tr:nth-child(odd){background-color:#eee}table.prolog-answers tr:nth-child(even){background-color:#fff}table.prolog-answers tr.projection{border-bottom:2px solid #333}tr.projection th.pl-pvar{color:#800;font-weight:700}tr.projection th.residuals{color:#888;font-weight:400;font-style:italic}.answer-nth{width:2ex;text-align:right}th.answer-nth{color:#888;font-weight:400;font-style:italic}td.answer-nth{color:#060;font-size:80%;font-style:italic;background-color:#eee;vertical-align:top}div.trace-buttons button>span{display:none}div.RIP,div.trace-buttons button{display:inline-block;width:24px;height:24px;background-size:90%;background-position:50% 50%;background-repeat:no-repeat;margin-left:5px}button.nodebug{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH3wQBDQAOjeB7qwAABLlJREFUaN7tWltMHGUU/v7ZYSmXBbpbEDXYGi6VCmpo+2BMDETJQpvyYBVvNGmIIabaGH1Aa3wg6UubGH1Qa9Rq2jRdEqlPmBhSG0LUxhZptlDKStGEWIHtUsp1F3b3P8cHdpYBamEH9kLSk5xkM5OZnG/O951z/pMF7lt8TUT6wNFzI+8w0KAAZz56MffYRgTgBZACAEKIE8GenMNNTYLiBUAx8EyK9oOZD6Fk+EzDV5y0kQBABwAcxGvZluG2xm89lg0FgJkhiUHEYJIVSpLvwpHTN20bAoAW/BaLAkkEIoaUvNsvA22Hv7uRndAAmAEKffmcTBUP2ZJCmSBIyTuFX7l06IuBgoQFQETzAcv5LFjTTdiabQYxQtfoUWb5S8NnfaUJCUDjvUYdIkZWugn5DyaDodEJuRRER/2nfU8nYAYYUoYCJYTdkqqiKC9Nn6XNMkDn6473VCYWAMnhL7/U0zeZsGNbGhQFWpbSSHLry0edLyQQhWgZhfSemmxCaX4GVJMGgpOJ+Pv9TVfqE4dCmoj57p5sVvBkYRbMZhNIEiSxSUo+ue/DzncTAkAoqP+lEhHDnCRQtj0TaSkmTTeCiD+xN146lhAUWo2rJoGyYisy0tVw5ljS+8+9d/HzpiZW4ibicOMKBXUvFwIoK7bClmXW95C32sd+O13e1K7GqQ8QpORVZ0IAKCu24QFrSrgAyCDV+UeUH8oPtm+Kj4iX9IGVnBh4qtiKvNy0cBYlUc20iX96pv5XSwwBkI5GkTkzUFpkRf4jGQt0Ii6flr4LO19t3xLTUYIiEPNiEIzHCzajpNCqzU4g4t0+Eegoeqn14RiJmMJUMuoFWzPxxHbb/GguGcy0Q1WTfi55pS0vNp1YsqEM6L1wWyZ2leSED+YMPEaCv4kkHtW4iOeBrNWIF7+DBYuoA1ioImsD4Pr7Drpdo9AwCMClkPJGVAHIJQI2dCQFw3l9FAODE/rLF83JyXudpyrGo5sB3RwkDWyDmIA/em/hn6Ep/XKqTVXFfuepiplI36caLaNS0jL+rubZzm43Rm7p4xQtIjhR191c6zeSTYMijpxCQUm47HRj9I5Pf/lkX3DiTbTUSqM6iomI/QHC5asjmJic01ebj12OqkZArKkSGKDQ4g68ks35JTqvujE149dvZD9wOaqPr8c4bUDEq+8D3tkgunrc8PqC4cchxNt9DvuX63WgMVxGpbw3hWa8AVzp9WBuLhx8gBkHXc12x3qeyAxoYGUKTU374ewbRSCgaVP4WEGt66z9x/U+ExurQlI7kS2/Pz45i2t/3oZcuDnJkDWus3s6orGVMN4H7pKB2+Oz6P9rTB+8h4Wodjn2dEVrL2RQxMv7gGfMi4HBcZBkbbK8SRCV/Q67K5qbOcMa0IvY7ZnB4NBkOHgAN4SQlf2OvYPR3o0appAGZMg9gyH3lD4bThPUqmuOKncsttMGRTwf/L/uGQwvDr4rEKTqvpbnPYiRKWsR8YgueAG0pU4Hnh1o2ROz4A2eiWnRYmthopys6Wrd50WMzdhuNCRiABACjlSL7fXeFmPjcDwo5CPS6rw4cb3o9wNdX+8KIE5mZBo9AsYBhjjnarbH/a8G9y3e9h/uU+EcypgobwAAAABJRU5ErkJggg==)}button.continue{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH3wQBDDMd/Pc1cgAABW9JREFUaN7tWV1sFFUU/s7sdLZl2+2P2NJfWloDEQIaYhPEhESJBiSBRMODPy+mkYjRBx/EFNE+SFIxGiHhzajAA0GUJ30w+CAqQlECRIEEiKVLW1pK45b+7e7M3M+H6ZRZdpew7SysSU8ymUzunXvvN+ec73z3DjBnczZn/2sTABg/8Fx1QNOLACAWd5viGV6JQTP1WyWv/zwsAj5wAKP7nt8pgnaAIAmAAAlCTd2dZ6ddwdOPIIcJDoM8RbGP2RI4Vtl24sp9BTC2f30EQH2Wi/e0qzv64aTA/rxiIPyddPxs5R7AvnV9BGoAAkbICaqUxSffYcWhrBigrDT9lNuvRyht87ee+SnHIbSuD2ANSBgrXnZA3KPRToDxUdgjEdi3IrCGL0FZca+HFBQ/ebjA2CFbTpu5AKAnhY1SgLLvHb0EIIVl0ArLUFC1HGyKwRw4g3hvF5Q5BpAaRW27YU0u5jd4UTbD9huA5o15wAY480sCBTBqW1G8cguMymW3xyU3DQ4u2c8OaL4DSEpYZftyiRZAUct6FNav9ubOS9crWt7OkQemwogKpO3bFaxfjYKq5dMsJsBHvXta6nzNAS+LJK78CIikoUo67KQVQHQD0Iughaqgh2sgRvFdJyhqWgt7tA/W2ABAhgJQ7wLwzRMS/fLpXgFr753nvVQJ6KUNMGpbEQhVZpzEGunB6N8H3XGi1UUVlX6xkiaCozNbvNNuRrsxfv4QYn1dGZNbD9dBKyp3xynrnxha41sIhUMPtUXHh3aLZQfEI5EEFkyZ5ksIqQlYbhPlAi4h+STAtSA1QiF+7XcIgOCCx9NOVFC6CPbETaeikxsB+FLgdNl82AZwdiYv39i7tIXAXpDPAsTktePQSxugFZalTlRWD/afdDwJLvOPhWZhlW+ev1KpF24geYx0QirW/2daatX0kDdMF+QFAACQLadNEO+5VGlGuwFaqUVOL/TmWHXeAACAqrcudpEcAAiaE1CTI6ke0AJetVuaVwCcjY3qdtlLmaMZGMkrW3wTcz4VFKpRBUeKKzsOMlW3JcmWfAOgRAjl1BNRVnpVm7TPyDMA7uIdnldOyKR44HZRzD8ASdtOldEDt6k0zwB45YiratODdORInnpgKjxsO60H7hSCeZYDBMSN8fQ5kCQEHxSA7q8aC40R+VSgWknKlLaBIh6RaZ630iexR+1e7QwfBW0ocAoPJ6CsnYveN0/lFEAwqr0AUVvvPGoRb5FSzHA4kCTV16ZIdZE6ACtzWolt4V+kSmQ6yUPAgFZYknaLaZTU3mWfQYA4N6Oz0Wytd3fDM7DVtwDL3MUHSxtghBciUDAPEjAyJro1+S+seBSj/X+AKuE5NMOBuJVoW9qBRM4BAEBkV32zptk/UNRiNyyC4QaEKpcBktmx5sQQopFfQDvuLl4B8k7z9vjuGZ9Oz9SufVZXAds8QuEaNxz0ovkoqV4J0VLTK3Yr4nx5Wu7iJyB4tbk9cWRWx+uzsct7WoJGPPqFAK+4PK8ZxQjXtCLgnNgDAMaHL2J86IK3mA1qgo1N7WbXrP8PzL4KQyK75n8IsT9wqVULBFFS/QQCwWKMDZ5DbKTHm7AXAkrb0Lgj1u3LDw6/rLuz/A0RtQekThCiadCNMBITN70a6Lhlxjct7sBNX2R80pORZY1PSMoHuNoZXkfwEKhKUnmeB7VE4rWmDsS87zz12IWs5v3t7KOSMwAA8E9naAXI70HWTQs8cGdze2JHut9SjXXXs5r3am91bgEAQOTjeTW2UocV2UKqbS3bza8zjjOLeZMWsLA6ktVAPdcb/MkhvwD46YH7BSCp2qxq/DWrcU5c8oe9Vi3Mct7LmLM588v+A+5od3b4azuuAAAAAElFTkSuQmCC)}button.skip{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH3wQBDDc5pJgUpwAABxRJREFUaN7tWWtsHFcV/u7MeNeveG0H2/WTxE4opVQqfamNWsEPVEoiixIwoFaVeKhQgRTSVlSQFLF/SoRQhBASUvkB6kMNWKWKVIkiNUUJCBJC+kpUoVhO7Tp27KS2d73P2dmZ8/FjPbuz3hnHXm9aKvlKI69n7s75zv3O+c65d4HNsTk2x0d6qGq+xNG7GuLpSJeirZU/MX3na/lsYst3X19QCvxQHIj/fs+gptvfUMRegoMg2wCCIEACIEhZ/lv4H1z5nARkgeQClJxW5AnHUSc6f/DG+DVzIPnsnhtAeQrglysArQ88ACk9L5/7bxK/6ni/7c8qetyuiQMcHdHTuewhivMoQKMCkKZDGQ2AKgHxB19wFbYJyWcBOoFzSZmCyHe69v332IYcuDI60txopl8gOVw0oggtsg361h1QkV4ovb4quulYYC4BO/4enKX3kF8YA20ThLiLIxD5ZWe4+afqe6/n1+0AR0dCaTNzjJR7XPCqpRdG3x1QDe01VxDaJqzZMzCnT4JWysvM0a7rxr6qvgZnzQ6QUJnn9vxJKCNunOp9t0PvuPGaSyHtHDLjf4F1+e1iWJF8oTs2/pCKQlb7ru5++NHQ7m+SPOCuvN7zGegdnypQe40vpTSEtl4PgMgvTRbugTclGyPxw6/ET12VAT493Jiqt8cA9oKEatsGY2DXh1KY0mMvw5p7082LtGj5T/btm5kOmm8AQLLe3q+WwbOuHkbvrcuKEUC5lYEkp+Gkr4BWBnRygJ0vSOWy9njVhlBQdWEoownGlh7obUPQ6vyFoHHoC3BSM7CTsyDYpBz9CQD7AhkgoVLPfnESlAGCMHpuhdY+6A9cLOSnz8BZHAfprFXnS1K5rDZKDyHcdxfC3bf42rGXJrF07nn3/fHZxs7O2wJUScs8c+8tLnjoIWitA4XVX3nZWVhjr8BZGNsQeIAQ20R28m8wp/7ha8to6Yde3+a+q7U7M/vZwBAS4H7XiNbcBVDg17Hkp09DsjFvQTsulFeVkvMCNQ9HUuWpZRc/CRiGSCc03ETh1wHeCBLZmVMwWrfBaOqqsBdq24FMZr7gsOBLAI755wDV7UChFVDNHYXVrYj5FOzYhAueUHiw/eFTR6rI0aOMfu7Q5fbZlwgOQ4jc3BvQB++tBBYZAGZOFhZL8dNBL9SoZMjtbZTRBIhTcTmxSU8o8Gj7wyePVKsyKnrcVoIn3XCyYhd8bWp1TaUQFLku0AGQLS44peu+MemYi8X4VcKXNiqVXfvPnwUYIwTMZ0ErWWFTGQ3LiyYg2B3MABguS0if1YCZLD5XdN6pSfWFvOuusJhLlQxougseICPBdcDbEtMBqHzkM19UG8CI1aZ/YMJlXhwTul/ueTrgVQpZqZ8HHdDXAacolbaWz9WIAauAi6DYvuJRLtUBDpRtRsQJ2CJ4db5mm0EW3+uGjh8Ha2OARQZ8Q8hlCKx2G736orjJW2GXHruBDJSqZiADXipVjRwQj11KIANXDSFvyWcAA2uhshoGwOUKxIAcWFMI0ZPtAQyUkryGDhTtSiADLDs0CAohT5OFVRhwWVLI1CoDSjovEtC+exTy6nXAXQ1/OWOVDExEt9WHWp3DEN5BBQVxVU920psDvklcYv7dQ42vFvwQd8uZ0cinDG9L7J9IKLbChKxbg8IR+ysi+D5AQOhtD8qZD0ri0uJ93psTBRyqX/P286TjexXiVapiwFE4B9AqAVkBXgtBC0d87YZa+nwOyEoYqPC2UaHHAn8q3TnrTIH+/dNnpw/37ib4IiitLqBw5OMIt26HXtcApRm+DET67oa9NQbbjCFx6TRAy/v4edliPaKVFQu/nVjF7mv9o+/xmdfoOLcJeN59lxmfQC52AUppq9gVUCwkZ/8DiuXRX7V/6KD10M59yGllxcKvE/X0QRupAwNPXLmgaeYugCfcd5lLE0hc/Bdo53ztmvEJxCZegzjF9isDhZGhg7lf+7YS2blzvnvYsmq9gdH/WGLxUrRnt91kPkdyL0lYmctYuvh3tPTcCc0IF+dmY+NIzL0FT0wvakr2bj9gnyjfD5DWahvwlRv0XF15IK539EQvZfrTiyMkD7s6nzdjiE0dh23GQbGRvPwWEnNvesGPK1G7VoIHAHXltzcfUODPCIauAl5APtP9w/Fve85SG9DQtmZlVcO/K5OAiUPNjyiF35A0CEJpOupCEeQy73vCVf3Tzufuvz6K+Zr9QrOiy1vzSLz8QEfL8JH5ciea7iNkFMQWH6n8o5a3vrU9GvDTDwDtAz03TKYqbm3/SfqvEO1ugBe94En8fPCA9cBq4ItHi9WOe24440zNd+vr8MD37uDB9NmpXzTembedUSjuBPDjHQfzf8CT1/5gfF3H0ImnP/GxWiP4QEMo5RNCHykHHC0l2Byb4/9r/A9GxF3/Bu0ZYwAAAABJRU5ErkJggg==)}button.up{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH3wQBDDYM6zDhxQAABQZJREFUaN7tWW1oVWUc/z3n3JdtXudUzBfyZcuRaUVSmbVerDQLC0FIkCAR+1YIUhLNivslqm9ClrhR2ZQopPrSlyAQMZGQymXZjERN0d07d9e2u3nOPef5//pwPHdznqsbe+buwD8cuFye8zy/3///+7889wJlZp3Nj6RzTcv7O3c/2ExC3Wi9VW4EFGUrqStJeaVj133vTTgCpI6TAlID0G9lP1q8aYIRCMCTGhSBQJrbd9Y/P5EiUARPaoBiU8uX53bU3hspufEEm/14RcpOXK6xPUm4AAAHCviTIhWkhmUnob18SOQUtL98zhsXLo0Lgb4vVi7VmquE3lMk7yd1DSixwOMS5XlU3bUOfW3fQnwHpIZQDuve5Mra9Bkn3Dc21sDzn69+VqAbfS2PBSBZBHg98KSGshJILdmA7tZPQQpA3aCqej4j8ZJS4JgS6Nz3XHXCkxaBrOUQsCFAKAuIVUApACIABQoDa2KTZ8GqmIZU/QvoafsmIAVuOPtB9T9Az7tjJqHuvasXWoLvKXJn6F0oC/bUOljVc2CnZgGJFJQ1fP/1tO1H/9mDoGiQQtLfWNfo7DVOgC3PTMqL+pmUJaHX7RmLEJ+9FIhXjmJnQdcvTXCyv4eSc6nkaeNltFfUJyF4QCFe+zjitz8E2AlA9CgeYso9G6Hik640OSQVrTeN5kBfy6oHtJaXQ9nE5zXAnjIfoBjZ//L5Q9Bu1+AiesAoAdFqK+mD1LBr5sOeugAIvDVqczqO47+2/YO/2lfX6O4wRiDf/PRMTf/FsFTaMxYFob9evoiGOF3QTi5ITt8BKVBKITl9EVS8CgBQ6DmHXOsegAzegzroeu5mpUBjBHxLngAlTgpU1TSoZHWo1YhxwYd7/iiczK+QQt81/QAU2JUzMH3ZFminC52/7Qa1G75+Mum56xamUTDaBwhpCOu7Pem2krqn5yB/8jv4+YtgRDMDBRQNL38BLPQhd6wZUugNNd8hgjVz08iZ78SU5SEAq3JaSfn0n/5xKPgsoY8R0g3qbopsJkWRGrnje+Dl24s5LEqvrX/HPzV4P3MRoJ4ZRsCKV0Umr+7PopD7OwQvQv3a3LntTWo9iotPv5/aRGqb1HC7ilhFERvrt/tHhu5pMgJTQznAsiMJuJfaBo0TbJn3evuuUuP0EGuse7uwf8zuA0yviJF6MikggioS1Yz83otFzQv9r0rdB64el1XTHdsLH5Y620gEMnW5ZKw/roKZR4EkEAyLV1eqy5eKEdDC1pL1YODDD/967qs35Uo5eCQG9bWP+BDfDdfJgm0dmWj06vCVD630CuufTMO/3rkxowREACWRFYjiIezSgPSH8/xQSyXcNflCxTLXd44uSSN/o3PNEMgArLxyCYGKHh+0N7jOe6W2mrUNfYBzYLhHG40AKIFbo5oYpdikaGi4M11GEY7QjJIQdRE8DQ145nOAOqgLUQCHjgzlSUCC4hdJwDx4gwQyIJMDEYiag8Q8+DGMgERKaCzMIIGB5IzyNMufgB7oAyUkVPYEgkRFySpU1gTCJgWlSuQAyzwCxQ47YSUkxW6b+etr3CwzMk73JjM+qTn8SsNCWRGo3wIX9HcCGA6DApTaYYrAVT/uPnr3iRFl2k9/LFamBDhC2CoyB85nazAe1rD4+IjWHz5RIonPZGePCwGKb0ZCownleEmo7P5mHVUfeLj20IhePnIat+yWTXT7H9J2ChlDGcHsAAAAAElFTkSuQmCC)}button.retry{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH3wQBDDgagWd5GgAAB1NJREFUaN7tmVtsHGcVx3/nm9n1+hLHzj2NY9eNMWqFBK1DUAJSIhRAQqqoCjU0IkUgQXkBBVUUpebBCBR4qaJGQmpA3ITKLShUsgJ9KWoVKanS0kJL1KYkcZr6Ejtq1vb6speZ7/AwsxfbMxvb2QQq5ZPGs96dnXP+5/zP/5z5Fm6v2+v2el8vuRk3VUUyP+tZaxP1zdFXpOZfL65taZwck97Tc7ccwPhP7+tyHN2tIrtRs0NE1oJZKyICAiJIeAZBSmfDvM+D12lBLqpw3PruH1q+duLiTQGg/Xvcq+vTnxfhO4h8rNKx8mtTfm95ICqv/Qti+lY9cuLNmgEYO3L3Xoz5hYhpj3MMcTCJenBToWNUASGggnpziPWjQHhinMONdfUHpfeYv2IAerQnMZ6b/iHGfBfEBEYM4qZIrO3GWd2B29KB1DUjTnJlteNn0clh/PfOYycvIToP8MBsqnHfht5j08sGoH/CGbvS/WdEHihGTZJNpNp2kty8HXFTtReCuWt4Q2fQqeEKEOZkY6phr/Qeyy8ZgPZjRlu7fisi+4ppTW78MA1dn0Xcupsuk/7Vs/hDL5fqy4g51rD/xBdF0CUBGDly5wFR53CRm/Udu6nv2HNLtd4f/zf+yGuVdPpq0yN//fV1AQwd2dJmbOItRBoFQ3LTvTR23/8/aVje5VNo+lIRxHBT1u2WRwdm3aoa6zuPq2ijKDirNtCw7TOgfuS1tpDFT1/Ay4yg3gxayBFkeYHEAmDATSBOHZJswGncgFnVhiQbYn1xtvRQmL6CFLIgbMmkvAPAoVgArxztSTA7vh8FFWi485OBcbsYQG70VXJDp1E/T1GdYiU2ok948hYiDs6aLhJt2xGTjNB7wV1/D97IPxAFEXlUlR+bOACbZ0d3q2oLKE6qFbd5axD9BUf28knmLv0d62UBBVUUG56D/0HR8Fx+bcvvqaLq47/3Nvm3/wbeXKQt09IOTjK8r22f/c2n74vNgLV8TkRRhWRrV2TkvZkx5oZfQgKmoMpZMfwRq2+okXEDucBBgESApQjCdZoM/jqr5oNGzKdQ9qiAnUtTGDpDYuvOSL9M00bsxGVUwMID8TUg+qGQwrir29EI7ueuvArWoiKIysDGa5selP4XvBXU6KFrP9/5MKrPqCBeehBnwz1IsmmxW03rYeKdMCjmo7EUwtpNRQqYRGOQgQVHPn2hRAGxfH+FzgOw5uunf6/os0Xq+elLkTbFbQwohKJit8UCUHQzalEUcesX8VHzGbQwF/AdTW88cO71G57trR4vBsTPXousA3GcyvpqdqsM9atVQNRijLOoBmx2MgCnoGIv1kLrRf2zVp1AuLKZyLorFz6oUFelD5QuitR+62eDSAiIMlWbduWmwUfVoLYQ3XPUR9UGo7iCG58ADSKhRBawWq8CpOZr0m1NIScqiFjU+pF2A1BaAlE1A6phH4pIJdYvg8RoDefQwC72unZVbXUA4fNtbCrLIG0tB+nQrl2C3aVQKGZ8QINuiwA19L9MXY3NQNGuVquBSpSRNaBeSYWCP7WmkMbWQNlu1QwERRKMLXEZsKiY4NGvhnsyhPyuloFA/eR6GSjKlR85LAWRsFgxNfJ+FiURJlSr1kCgfhb34o8SO6xIn4g0BNO6CXhdGQmNr4Gw2e0aenLzKyBgDKIoRs7kJ5zHOvsvZZebgeCeGmu3UuJdkKcF7g3ac6goKsUGFRbp9SJBM2p7EIOEwx2W7XWrvVPAM8urAIuoCUaUOAphUTWIgFHhX/NpUzGjoySb21D1Fx2mbjWY5Lxri7NTqL15X3hjJTUQPE8QaTc4ys8Trl2V/6bJJF3gyyUdlgTNd+zATbXi1rdGRsIYl9a79uIX5shNDJKbfKdIJ1TMhKh8YeuBodeXWQKQCLMaV8QL+o/5wLfJbevL7wc5UFR0tXkyoy+jNh9y3Y+eDMWQS18gOzFYyoRFz6nvb297bPj5lfaB4r3i7FY+2ZXkY1tf7imEh8I4YP0c6cHnA+ci5nL1cky9e4rs5GAl9V40Jrur/fHxCzfWBwKKRNktjhJFEIsEfPCQu9uqOQ6sCclC86aPUN/aVa4jL8fUyEt4uanSQ7qIHHdnUvvv6B+ZXanrVw/fvdl3/JHFe62xGwWTiwS88wnvRbGyCzgfusvUldfIjP0TtR5edoL05RcoZNMBT4OIPbl15tpDN+I8QC6h+ciNgPiNgnxsCz3Xzzo3Ufcs6MeLGxt1Desp5CdR6yNBBDxVvtV5cPrpeSQY+EbDkr2eS6v0Hiv9sDH6VNcvEfmKhBvIVTKRV+QHVWeAwX5SNpH8FfCl0u5M6WZkBNPbeXDmucrvTA08vK75/t9dXeaz2IpnkaozQGc/2bueyO9T5dCCPvEu1nxiofMAZKZv6Zaju4TYKOT7LhxKnAd+gsp/XMf0tn9vZiT6Gxk61g8v2YH2daP+yTf/j341nDravS4U8WUcK1+m1gCmbzGFag7AN9OW2+v2ev+s/wKIypfbke4fXgAAAABJRU5ErkJggg==)}button.abort{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH3wQBDTcgwTHWUAAABeFJREFUaN7tWU1sVFUU/s69b+Z1eJ15pbUF6gCagIFEWFgXXRhRSNCVisRuXECFDRsSY4IhcdHERGITQgKJuoBUVyaQKK40xhYlXbCgmyaKEgP0Jy0ghb5pp/P33j0u3kz72s5M3512xEXPcnLn3u875zv3nnMesG7r9nTs8nuQ/4e9qJY/OX0HXgewy+7u/3K14PlsZ2y2pfEIg/9KHO2/VncCTt+BV5nVBYCaobjXdjIX6aMbmVrBO3bsOASdEkRJBvbZ3f3X60agBJ5I7AUAZh6vlUQQPBElSz8DeE2HhAi7MHVp/6EgeAAgoiQEnXLs2HE+2xlbJXgAIGZ1IXVp/6E1JZC6tP+QIu4pgadYC8hqq4lEOfBktYFiLcX9xF5F3BOWBOnKhho3w2jvAEkT7uggPGcMZJih5FQOvLC3w2jvAHs5uBND4Nn70JGT0JFNCbxMJCGsVhjbXoFseSFUJKqBF1YrZCLpO6Zxs5acSNfzMpFctE6l/4E7MQTljKBSYq8EPmhealwrEhRK8xXAhyEBAGHBVyLBrIYFU0/i2MD3KxKY7tv3Jlh8HkxYY2tnRfDVSJCrzjEBkOLDsOAXkRi7Ac5MzZMAqY+bun/7KbjOWI5EbARR80KWSJA0V77OrFYY7R1wAXhTt0GGmUREnhXki4A1wAPwzxTBCoOaJUWeWzGJm45d+5aIPpvn44zBHR0EWAHCqE4ivgXRHQch7a2AmwMVwSs3B2G1hQZfiianHy5Ikri3ccPsN0vXli2izry/6fdswXgAxh6SRoILaai5KZAZB0WtKpe8AmQEsmUnOD0JlXkMVh6kvRXRXW+DGpr8NZpSBHGvbWUuUtfy67niLcSXO2NOOnYcHD75fKkwQACnH8GdGPJ1qun5sOBXfMi0SATAU3FblXV8aTXYdQEf6iXWIUFF0TPrVaW1gg9VC1HXjYxtZS6CuJeZx/3EHvHlEUjsmsALY1XgtcrpspFIbINs74BobJ2XzX/lee1yelkkmOFNj8CdHAKnHz0V8FoEgiSI1TlmngYB7Iz6QIoJGwp81lkMXqlpQJ3TBa9NoERCSGNOSNEkiMBuDpxzIMx4+EPNODjnAJ7/2JEQTUQyowteu6XUqSrDSKgwcRPKGQEBYEZN7alWBGZbGo8IQ5wXREkulgfRHQch4lv0vEaATGyBueMNSGsT2M2DiJIkxflUs3V0zSOwlp4vvXrM/tUbpp9YFYF6gtdpimqWUM2yEYb/0BUfO6ISaFoEPljFCqsN7Oa05ET18nzJqwvF3DPLPK/T2VWKhKiX593RQXhTt6Ee34Y3NggwVwVfaySoXp4PeBEgQCa2w3j25drL6gqRkEunxMkXdx6GoJ7g0CmS7KzxYDUNIEtEDZxLgQtzoAa7elMEgKIWqMGGykwBhTSIKAHCnlyDMfaSee/WlT/AZSXUdQWekOK+KI37mIFcyj9QRkPLhkp3vZCnifhTZoyj2CuHak9l1D8zlypKz587kRD3u67Aq9pSnrl6997pt54fZvBuIrEJyoVKPwRFYhBmorznZx+gMDIINTMBEgaYeZzBnySsuT4z6t7MFYyMTnvqOSMojA6Cs9MAUXGsghP2BwM/ag22APwKgOAVQGYc0d3vgja0AF5+wfNeHvk/f4DnjEEYZqkjOxE/+stXS/Y7AeALAGA3N98nQ0YB5c57nuemkL/1HTg3AzIiYK4+2Kp4C9nd/ddJ8WFmNQwZAbtZ5O8OwHtyZ8HzM5PI//2zHyHDhGIeV6xOlpseJKz01wx1kpnHyTCh0g/9/85MLnj+yR3k7w6A3SwgI1BKDZPiw9Xmoyu+xJWmdCRN7Xq+Wnu6dLhbbRqnXQuVG69DyGVzmzD1fDkSZLUByls0hQsDXqucXpQTHJg+VNB8iP3mc6I0uiNBK2p+1Z+YSiSo+O9awJcjQQRt8Nr9QDCxqyVsWAsmdpiEXZOvlPMTbCU22vHM1VrawGU5MRN7B0I9WTp5rqut5YfudVu3p2j/AkT4owo7DZieAAAAAElFTkSuQmCC)}div.RIP{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAzUExURQAAAAUHAmNlaKSkpXtpZllZWVx9LsHLo9bX2Wx9jpazUak9Lu3s797g33SZKnybRP///5NI/qoAAAAHdFJOUwVE/v+8OP47SgHcAAAAAWJLR0QQlbINLAAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB+AJFQwBEyT4/QUAAAFbSURBVDjLdVKBooMgCGxggQj2/3/7DnNb7m2kdspxgLVtN3sQw8r2y4glCaw/KAW+WivRD5EHK1trrTSqun8TcNWWjFYr0zcBD1FuxtyQ5NO9K2oTlYYyCDmYZcnC6u5wqzAJt1Kx9ZvKHsivWtu0wqLht16QXjULuGwnTv5Ngl2H5vSPDCErocAq7mnHq1IplAqPO4E0qOCqK26aIkrhVYGSgDAqAeyJF4Lj0C/SIACvNcBBWXtUyCeuHEsNUyGdUKm+tpmfgWo4ZtScSPN5D3FFP6f/J7wMPh8CH10oDq8xF12LRKhex8Od1FhT4GNkAs2RD7Yu7y7s6IfNGq5CjuPobwU7JaIboqz3nqTTQqy/auhiZgJfN5Hk9DxJlP/dfp7d8jklh2GRwR5BEEkwouY71wQ2ECrsUICN5WZznynyjS7GGDg7mLsDCjd7bmb3LwQ8xjbXx/bG2x+HDRcuxXGCugAAAABJRU5ErkJggg==)}span.depth{display:inline-block;font-weight:700;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAUCAYAAABF5ffbAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3wQBDjQRuYQ78AAAABJ0RVh0Q29tbWVudABEZXB0aCBtYXNrQcBmawAAABhJREFUGNNjYEAD7Wdr/zMxYAGjggMlCACJuAL3jmFt7AAAAABJRU5ErkJggg==)}span.port{font-weight:700;padding-right:.5ex;margin-right:.5ex;background-color:#ccf;display:inline-block;width:11ex;text-align:right;border-radius:5px}span.port.fail{color:red}span.port.redo{color:#ff0}span.port.exit{color:#0c0}span.port.exception{color:#f0f}div.prolog-exception{color:red;font-size:80%;margin-left:5em}div.controller.running>span.sparklines{margin-left:.5em}.jqstooltip{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}div.render-multi{position:relative;vertical-align:top;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAATCAQAAAA6heU+AAAAAmJLR0QA/4ePzL8AAAAJcEhZcwAAEMQAABDEAbRyZ/IAAAAHdElNRQfeCg8LIivxaI+JAAABT0lEQVQoz33SsW5SYRgG4AchbSkcYrVpo6bGoXFydvMK3HsJLt6Ct+AFeBVunVx0cjFODvofqyDQFDVttef8cg6IA4SkFXjX70ned/gqk4kV+SUVnGs8rayC54KA/e7DvdpydiZIJXbEJyyFp4IjW27IFG+Xwp9SR266LhM/PT5dAn9IfbGtJROtP2ch/C711bZELmrYOFwIB1JtOxpyfzQl1n4vgANBx65NuaGmlsR69h88EXTcUpcpNLQkknJ3dAUeS327wlr+fpxe57Av6F1iLYmxOLgEe4K+2zZkitm2xFgumsOJrs/67liTGc4qm8YyUbw7gxNdwbE9NZlixhKlXBTl+1NYaU9SPfdU5Ubz0inL5aJya3h2oBa03XdNZqzZaR5uvq5/mFyUcVSUo0JRLerlxQFqwQPVN/FF+T4Jj0YL32ial8/eJfDK6vwDMhCTheu9OHEAAAAASUVORK5CYII=);background-size:15px;background-repeat:no-repeat}#render-select{position:absolute;background-color:#fff;padding:5px 0 5px 20px;border:1px solid #000;border-radius:5px;box-shadow:5px 5px 5px #888;z-index:500;white-space:nowrap}.render-selecting{outline:#800 solid 1px}.render-multi-active{position:absolute;left:0;top:0;width:20px;height:20px}div.render-item a{float:right;padding:0 10px}div.render-error{display:inline-block}div.render-error span.error{color:red}pre.console{padding:0 9px;border:0;margin:0}span.format{white-space:pre;font-family:Menlo,Monaco,Consolas,"Courier New",monospace}a.download{margin-right:5px}a.download span.glyphicon{margin-left:1ex}.render-table{border:2px solid #333}.render-table td{padding:0 5px;border:1px solid #888}.render-table th{padding:0 5px;border:1px solid #888;text-align:center}.render-table tr:nth-child(odd){background-color:#eee}.render-table tr:nth-child(even){background-color:#fff}.render-table tr.hrow{border-bottom:2px solid #333}.render-code-list{color:#040;font-style:italic}.render-ellipsis{colour:#00f;padding:0 5px}.render-svg-tree{padding:5px;display:inline-block}.render-svg-tree svg text{padding:.5em .2em}.render-svg-tree svg g.collapsed g text{padding:0 .5ex}.render-svg-tree svg polyline{fill:none}.render-svg-tree g.noleaf text{font-weight:700;fill:#00f}.render-svg-tree g.leaf text{font-weight:400;fill:#000}.render-C3{display:inline-block}.answer svg{vertical-align:top}.render-graphviz{display:inline-block}div.R.svg svg{overflow:visible}.fold{display:none}.pl-ellipsis,.pl-functor:hover,.pl-infix:hover{color:#00f;text-decoration:underline}.pl-ovar{color:#800;font-weight:700}.pl-anon{color:#800}.pl-avar{color:#888}.pl-var{color:#800}.pl-atom{color:#762}.pl-functor{color:#000;font-style:italic}.pl-comment{color:#060;font-style:italic}span.diff-tags{margin-left:2em}.diff-tag{border:1px solid #ddd;padding:0 4px;margin-left:2px;border-radius:5px;background-color:#e1edff}.diff-tag.added{color:green}.diff-tag.deleted{text-decoration:line-through;color:red}pre.udiff .udiff-del{color:red}pre.udiff .udiff-add{color:green}/*! jQuery UI - v1.12.1 - 2016-09-14
 * http://jqueryui.com
 * Includes: core.css, accordion.css, autocomplete.css, menu.css, button.css, controlgroup.css, checkboxradio.css, datepicker.css, dialog.css, draggable.css, resizable.css, progressbar.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css
 * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=highlight_soft&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=flat&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=glass&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=glass&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=glass&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=glass&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=flat&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=flat&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
-* Copyright jQuery Foundation and other contributors; Licensed MIT */.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:after,.ui-helper-clearfix:before{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important;pointer-events:none}.ui-icon{display:inline-block;vertical-align:middle;margin-top:-.25em;position:relative;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-icon-block{left:50%;margin-left:-8px;display:block}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin:2px 0 0;padding:.5em .5em .5em .7em;font-size:100%}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:0}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{margin:0;cursor:pointer;list-style-image:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}.ui-menu .ui-menu-item-wrapper{position:relative;padding:3px 1em 3px .4em}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0}.ui-menu .ui-state-active,.ui-menu .ui-state-focus{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item-wrapper{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0}.ui-button{padding:.4em 1em;display:inline-block;position:relative;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:visible}.ui-button,.ui-button:active,.ui-button:hover,.ui-button:link,.ui-button:visited{text-decoration:none}.ui-button-icon-only{width:2em;box-sizing:border-box;text-indent:-9999px;white-space:nowrap}input.ui-button.ui-button-icon-only{text-indent:0}.ui-button-icon-only .ui-icon{position:absolute;top:50%;left:50%;margin-top:-8px;margin-left:-8px}.ui-button.ui-icon-notext .ui-icon{padding:0;width:2.1em;height:2.1em;text-indent:-9999px;white-space:nowrap}input.ui-button.ui-icon-notext .ui-icon{width:auto;height:auto;text-indent:0;white-space:normal;padding:.4em 1em}button.ui-button::-moz-focus-inner,input.ui-button::-moz-focus-inner{border:0;padding:0}.ui-controlgroup{vertical-align:middle;display:inline-block}.ui-controlgroup>.ui-controlgroup-item{float:left;margin-left:0;margin-right:0}.ui-controlgroup>.ui-controlgroup-item.ui-visual-focus,.ui-controlgroup>.ui-controlgroup-item:focus{z-index:9999}.ui-controlgroup-vertical>.ui-controlgroup-item{display:block;float:none;width:100%;margin-top:0;margin-bottom:0;text-align:left}.ui-controlgroup-vertical .ui-controlgroup-item{box-sizing:border-box}.ui-controlgroup .ui-controlgroup-label{padding:.4em 1em}.ui-controlgroup .ui-controlgroup-label span{font-size:80%}.ui-controlgroup-horizontal .ui-controlgroup-label+.ui-controlgroup-item{border-left:none}.ui-controlgroup-vertical .ui-controlgroup-label+.ui-controlgroup-item{border-top:none}.ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content{border-right:none}.ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content{border-bottom:none}.ui-controlgroup-vertical .ui-spinner-input{width:75%;width:calc(100% - 2.4em)}.ui-controlgroup-vertical .ui-spinner .ui-spinner-up{border-top-style:solid}.ui-checkboxradio-label .ui-icon-background{box-shadow:inset 1px 1px 1px #ccc;border-radius:.12em;border:none}.ui-checkboxradio-radio-label .ui-icon-background{width:16px;height:16px;border-radius:1em;overflow:visible;border:none}.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon,.ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon{background-image:none;width:8px;height:8px;border-width:4px;border-style:solid}.ui-checkboxradio-disabled{pointer-events:none}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-next,.ui-datepicker .ui-datepicker-prev{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-next-hover,.ui-datepicker .ui-datepicker-prev-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-next span,.ui-datepicker .ui-datepicker-prev span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:45%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:700;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td a,.ui-datepicker td span{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-datepicker .ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat;left:.5em;top:.3em}.ui-dialog{position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:20px;margin:-10px 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:0 0;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-n{height:2px;top:0}.ui-dialog .ui-resizable-e{width:2px;right:0}.ui-dialog .ui-resizable-s{height:2px;bottom:0}.ui-dialog .ui-resizable-w{width:2px;left:0}.ui-dialog .ui-resizable-ne,.ui-dialog .ui-resizable-nw,.ui-dialog .ui-resizable-se,.ui-dialog .ui-resizable-sw{width:7px;height:7px}.ui-dialog .ui-resizable-se{right:0;bottom:0}.ui-dialog .ui-resizable-sw{left:0;bottom:0}.ui-dialog .ui-resizable-ne{right:0;top:0}.ui-dialog .ui-resizable-nw{left:0;top:0}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-draggable-handle{-ms-touch-action:none;touch-action:none}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;display:block;-ms-touch-action:none;touch-action:none}.ui-resizable-autohide .ui-resizable-handle,.ui-resizable-disabled .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url(data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==);height:100%;filter:alpha(opacity=25);opacity:.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-selectable{-ms-touch-action:none;touch-action:none}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted #000}.ui-selectmenu-menu{padding:0;margin:0;position:absolute;top:0;left:0;display:none}.ui-selectmenu-menu .ui-menu{overflow:auto;overflow-x:hidden;padding-bottom:1px}.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup{font-size:1em;font-weight:700;line-height:1.5;padding:2px .4em;margin:.5em 0 0;height:auto;border:0}.ui-selectmenu-open{display:block}.ui-selectmenu-text{display:block;margin-right:20px;overflow:hidden;text-overflow:ellipsis}.ui-selectmenu-button.ui-button{text-align:left;white-space:nowrap;width:14em}.ui-selectmenu-icon.ui-icon{float:right;margin-top:0}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default;-ms-touch-action:none;touch-action:none}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-sortable-handle{-ms-touch-action:none;touch-action:none}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:none;background:0 0;color:inherit;padding:.222em 0;margin:.2em 2em .2em .4em;vertical-align:middle}.ui-spinner-button{width:1.6em;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top-style:none;border-bottom-style:none;border-right-style:none}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav .ui-tabs-anchor{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor{cursor:text}.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:0 0}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget button,.ui-widget input,.ui-widget select,.ui-widget textarea{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget.ui-widget-content{border:1px solid #d3d3d3}.ui-widget-content{border:1px solid #aaa;background:#fff;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAABkEAAAAAAy19n/AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0T//xSrMc0AAAAHdElNRQfgBwgUCS/MOMhhAAAATUlEQVQY073OoQ2AQBAF0Z/p4qrZbuiMam414iQUQLKg+Sgc+pInR4yODWmKof1EgQM3XLjwhbvGjTtOnLjzrLhw4vrKwA0typx1++MFHrwm/bbhD4gAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTYtMDctMDhUMjA6MDk6NDcrMDI6MDDHOgbTAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE2LTA3LTA4VDIwOjA5OjQ3KzAyOjAwtme+bwAAAABJRU5ErkJggg==) 50% 50% repeat-x #ccc;color:#222;font-weight:700}.ui-widget-header a{color:#222}.ui-button,.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default,html .ui-button.ui-state-disabled:active,html .ui-button.ui-state-disabled:hover{border:1px solid #d3d3d3;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAGQEAAAAAAao4lEAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0T//xSrMc0AAAAHdElNRQfgBwgUCS/MOMhhAAAATElEQVQ4y2N4l8fEwDCKRhF1EcOzZwzPjRie32Fi3MvEeIGJ8SsT4zcmRg4mRk4mxm9MjF+ZGB8zfGRmYljF8EmOiUF4wB08ioYEAgDUMBI63vAgyAAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNi0wNy0wOFQyMDowOTo0NyswMjowMMc6BtMAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTYtMDctMDhUMjA6MDk6NDcrMDI6MDC2Z75vAAAAAElFTkSuQmCC) 50% 50% repeat-x #e6e6e6;font-weight:400;color:#555}.ui-button,.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited,a.ui-button,a:link.ui-button,a:visited.ui-button{color:#555;text-decoration:none}.ui-button:focus,.ui-button:hover,.ui-state-focus,.ui-state-hover,.ui-widget-content .ui-state-focus,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-focus,.ui-widget-header .ui-state-hover{border:1px solid #999;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAGQEAAAAAAao4lEAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0T//xSrMc0AAAAHdElNRQfgBwgUCS/MOMhhAAAAS0lEQVQ4y2N4+p+JgWEUjSIqo6+3GW57MTH+YWIUZ2I0Ybj/h4kph+HRByamdoanjxme+zExBjAxmjAx/mZiXMHEIDPwDh5FQwEBABzuEyBfPm9/AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE2LTA3LTA4VDIwOjA5OjQ3KzAyOjAwxzoG0wAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNi0wNy0wOFQyMDowOTo0NyswMjowMLZnvm8AAAAASUVORK5CYII=) 50% 50% repeat-x #dadada;font-weight:400;color:#212121}.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited,.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,a.ui-button:focus,a.ui-button:hover{color:#212121;text-decoration:none}.ui-visual-focus{box-shadow:0 0 3px 1px #5e9ed6}.ui-button.ui-state-active:hover,.ui-button:active,.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active,a.ui-button:active{border:1px solid #aaa;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAGQAQAAAABHIzd2AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QAAd2KE6QAAAAHdElNRQfgBwgUCS/MOMhhAAAAEUlEQVQoz2NoYBiFo3AU4oAAlWjIAdM0sWkAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTYtMDctMDhUMjA6MDk6NDcrMDI6MDDHOgbTAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE2LTA3LTA4VDIwOjA5OjQ3KzAyOjAwtme+bwAAAABJRU5ErkJggg==) 50% 50% repeat-x #fff;font-weight:400;color:#212121}.ui-icon-background,.ui-state-active .ui-icon-background{border:#aaa;background-color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAGQEAIAAACwqkHPAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0T///////8JWPfcAAAAB3RJTUUH4AcIFAkvzDjIYQAAAI1JREFUSMftzyEKAkEUgOF/nmIQbIOIsKMGQRgxewjrVqtZMGnd+3gDwYN4hRV2i+MbweIVRMNLX/jTT77ppjkLABiGYRjfBtWU6prcffbuXvAESmHIjK0wYu52QkHkJBQs3VGYsKIiXzQ08dPIDz20U3FjFux5Rb22SfAEVwoDPGtB6ND/i2nDMIwf8gY8YSRTiOx5LgAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNi0wNy0wOFQyMDowOTo0NyswMjowMMc6BtMAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTYtMDctMDhUMjA6MDk6NDcrMDI6MDC2Z75vAAAAAElFTkSuQmCC) 50% 50% repeat-x #fbf9ee;color:#363636}.ui-state-checked{border:1px solid #fcefa1;background:#fbf9ee}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAGQEAIAAACwqkHPAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0T///////8JWPfcAAAAB3RJTUUH4AcIFAkvzDjIYQAAAIpJREFUSMftz7ENAWEYh/Hn/xYS51whVhCN1g5KI1jAAJbQ0ItEfRMYgA0uZvg+yR2J7j4FsYFQvNWveKqHtHjM7hMDAMdxHOfb0LZ1HQLJmnGckrJmFyvS8Da6ro0eW52NXKXCh4KjktHXm1ejVDRy7bkYmTY6GV1WOhgd5iwNKBj8xbTjOM4PeQJHLShkmp8JSAAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNi0wNy0wOFQyMDowOTo0NyswMjowMMc6BtMAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTYtMDctMDhUMjA6MDk6NDcrMDI6MDC2Z75vAAAAAElFTkSuQmCC) 50% 50% repeat-x #fef1ec;color:#cd0a0a}.ui-state-error a,.ui-state-error-text,.ui-widget-content .ui-state-error a,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error a,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:700}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:400}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon,.ui-widget-header .ui-icon{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAADwCAQAAABFnnJAAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QAIn/tYtYAAAAHdElNRQffChMXNR3//v8QAAAaVElEQVR42u2dbZAlVXnHfw0kFCEsaAggLLsllQgmhsruQKV8SZWURe6Yqk3UcsndsYJEyQ7RCMYyO+Nmhg8MwtyJQV4kNbsFxqJqXrJLlEBVuKMCFsYtEHdXo4SYRGAW4q58iHH9kCKWdD706+nz2t33zr0zff5Tu/fefs45ffo8/z6n+zzPeU5wCR5NximDroDHYOEJ0HB4AohoE9IedCXWEp4AebRZApaaRIFeE2Dw90+bsHLOJWAXOgokJQ/+GnsIkQDmDjBM/0yw3T/6/GF89rY2je3ciRKrXUGk/uWYAqaSN1AfkSdALzrAXTVKSPIm92F51MkLAQHLwDIBgaHkOtc4dAjSeYDkEpP7QIcQpObJIyonqJQ/uct057edO6xZd9eSbde4jpD1AOYO0BWme9A+fERnN6nQXEq9e9M0BOVLrtfPDBmC0jOB5rvIdA9mjVr13rGXYL43zXU394FZybZ+Zl2hPAHMCAfeNG2WKhPMPAQlJQ/+GnuIXhNgvaPN0kZSrx2eAA2HnwlsODwBGg5PgIbDE6Dh8ARoODwBGg5PgIbD+wMU8w66/muMMv4Abh4BNmNM2+gPYD6DXT11/AHs5vCo7huKJOX8AdwsYOYm1Ctol+a7a9k29dtKXyp86kvfMN4Asj9ABP1seJLKZG/Ty225XfwBTLUzn92e34wwLjv53BAQ/QFU30UsO/UC6jT2+9PFH8B0/7nVTU+f0OptUOZM6wJVjEEmg+uw+wOYyGXrf5Ir9+ZgAwbfOHX9AQZd/zWGNwc3HH4iqOHwBGg4PAEaDk+AhsMToOHwBGg4PAEajtMGXYGhQzjAWf76c6Wl639avex9aYRB1iC01qC6KciecwBXLg4BIRht/S7xAcIKkrKoeg5b/SPVB8ZS7OSomtvtClxSlch7ipDAdvmBwwXo8wcODeRyCaHB2ONSv8AgEz/LnSOR2FvAfIVmAoWW3GC7iYX654cA18vXeevYGynoQQcfGi2RtlG0Tg3CNHeglObPrjpLcnvp6xAa5Oays6sz3wb5WgZQ9iEwdLh7bKlc2FntHndTbuBQuklBLuVWbQHTLehStr0NJHmZ18Csi3NJpZaZu0A7g81l2LpYty7adgfZzu7yEFkVdorb5UINyvQAbl1nvafcwLGX6VcdA2MH61Zu4JCmKszDtHkAVOY9TZNocBh0Ddbz+Svk9TOBDYcnQMPhCdBweAI0HJ4ADYcnQMPhCdBwiItDk2Cpg4M9Hng/4dICLhbRavlsa6Ndz1IKGQGShVEu4d6rNUDvUK0sW83dWsAUajazxrVL547slMmf/hralVsgLNQSUC8ONS/hdLFotxXHekcBXVluoSH09XdrAd052oXlte1SubMrsPVA9ZamSwt0xaVhLuHUbUuwdQtE3Txp7DXQlWMP4W6vuVtAerXFQFZtUJDbFpZnylGtTwyFks0GY53BOpDTlCWAewMEJfK61cDchC7nt6/t15/flttGAHsbmBVoJ4CZQBoClHsLyBqgiskiyJWhLj0UPk3nr4Ks3lWfIUxn3xVLkxFcHUHAdP4kp/oZwFZyFrvBtL65WMuS/gCmBhAfYEyXb66c6RJNZeQvze72pVKBnYCmK1guBJBYLl2CG0zqXU63vXGrJWWHADd3qtAaIsI8CtbJ7da86utwG4Pru7SZyqm+qY39GUAJHx8gj7Z1x6QNB0+AhsNPBTccngANhydAw+EJ0HB4AjQcngC9xiDN2RVQ9AewwWSvcrn0dk17d79Rv3aBZbJ7yK5d9gcwwWQxd5klTCx2uxwWmOpRd3GVeXl4YF3+alewLr+p9AEhmwjKV8se7VeebMwvjay2+7frRDOYLHa23IE2Xf6oztppWjwaOkndr3RNoH4G0DkdmO1V2dBQxWkhunPsblP6GAYhrra+oMRR1XlV57evbB5KFPcLyJqw7A7cxSEkKJE3kbotgbYv3q4eQsKkRlsP4V6yKUbAGiPrAfKGwipVs+0kYDe21h0dg1wPou4hxE9Vit7cxaoziL3HkKhfHAKW00qpOvCog4/cvdRYNvoDuFj77eEhzMh8AdQuFeamzwYhfXSRJGVQUppPUdWhpi9QWwNDbQfuYizVPQT2wtjq5rVY9UHT5SESsBB0aJTrAm8OFjE0XfNawc8EimiY+j0BGg9PgIbDE6Dh8ARoODwBGo7hI0BruKxlGx1FArjZsk0mm9BJqkvRorsmr2KDjoMwNCgXLt4lnHTAaI36dElI0jKmqxqyPsMG2gG8DkQCmGepzbPdyV3doqukQJhOlKrX7kVd/2iaoqvJn3yrFlQ93/u4bTW/wZERQAz3LiOzh+tCpgcEsfpXlOcyd+1R17/CqGHtbHJ29flFj4JiKW7hIxqHxBbgtrrdhMTXRqf+oi9OsRex/TYdlSXFdMXwEaZdzhuFvEtYgKymIvSuDG4OEXqnsiKBdC4Z6hrawieIBN9gW8DXQRYtPN9k+gAj9l0vXLeV0MkjCoTSc0RiCFZH5Rfr06uw8g1AmbeArIl1Pnm2LZlM8tFU2gUCaSAJcmdXPQOY/YnE8BEeKcT9Amyeaia3y7o7WaykZbu8RgaOxxIs45/6lRg2hxD9Q6RHXzBsO4f67nmNMXy2AI81hSdAw+EJ0HB4AjQcG4kAU+lMw1Rfyr+E7fHfkL061UFEgPm44VaZr1zSYxZLvw0hzwjeAmWVOMVM+n1GmXuqFj0u4Xmu5jCHuZrnlRSYstZ+dyzdrTmHXm7LCfcV/sxnSLUUzQOEPMJzwNmM5xJnr2Tz6fF93KApOpskOshOw8oiufQICzyXUyEs8gGhcWcK6ae5tYRcrKGqdrvZJ/weZ7/weztXM8sIcJhJvsIRbQuoz+FibtPv/GnbFDtKkbW87RrTKb+EAHMAPC4kX8kVLhPkGFs1zXsQlBQIGUm/H1Zc4re4IvdbJEBkCRhLZcUlYiHTAgWmmdGu39UZs0aE38UabucwI2wG3sKnGdEQ4DgAb6i4wigkmdIOnCX5FGYCFCkeQDYRlKi+W0wQ4zngKD/mS4bqb48/d2pTbDLkXuQ5gQBF7BNMyfuEvgrgVkgpMM2thR4ha0B9Q27iifT7Vco6bOZ8As401PLPDTJzD5jI1RtQB4pSylEsUf9n+GT+cDYT2LUUcJQfS2nEKpwb2/JChT9PhF8xlD/Gt4znf5LMZLyPJyUCZBSQO/8IrcKnXLv3G2s6yT9yN3Ajk8r8J4AXct9lTDOT/ltbJOq/nzNECrhOBavUX8TrATiF17QpzgHQPKDYeoCEArCPJ7VpAtA+5F1Z+CxiE5+Pv31IIb2IDjALTNJhhzQEFC2pVZeZ2qMk2FJ8geukY5H6D3IG8FGAeNAvYQuQ1V+8wHOsZfxS+m1Ektl6ALgkVvyTXMLzCvkUzzMPPMmUpg8w45e5Mf1WRJutPMxuJoFTCZnkTINDyTS3KpW0NfdPh+3YYEvxQQUBxtkH7ORg/Bw1x0QkqG4Mkvl9pjXP3fHniEJm6wEipUcUUL2GTQlyVS+wufCpaiKYJLrPxSFmK7OQey+Y1QwDEWZqdPGHa6ZQ+3Tsh5gCkFO/iQDTue9ypyOr/3E+I/ySYe4SzT3AtOI1r4wckiEq+yw20X4g5BeYkV4BI0oUj3QKV2d7yIPrc/9kLKZvObBYMYUeCQUE9Q+TP8AU8Obc7+cqdeN1EYJC/b0sPcJgzN672Seqf5gI4DEQbCRbgEcFeAI0HJ4ADYcnQMPhCbCx8ETOnuEEkQAth4XZerjsvOmGKaVFfTpny5bf8ucJhb+iZ8OBgvyA4rx5a/nuPsgBvmZpn05hfqEM3hn/mbHAAgvJj/xrYIsu08CMwjd/lffGM1CP8RXeyLjSnPsCO4GDvJErCsZacH/3TWz7YvppbomPRqXdrLD3HUx/7ZTyu9rjoxm+2b7IkzQBsCCYuwE67GGULjBKt/i+TosucJBrOMBOUK6feInNwMtcbGjdhXgyaZHHuT9PgEj9kTVNpkDILks0cNtcYbSe8Iu8jy/yPh5hh6aBpriVecYlm1625ap681WX7dv/i4v4EefzMps1i08n6RASMMGsVg4Y5E9zkk38jlKeNP8iMFayBRPpwdTcnpcfkIzwB7lGcf55xlnkAbqJv0XeHJxMp84wXSlQS35Jl9pyeAsvsspRjnOYHypTTDHDZm7g5T7MA77AhfyA8/gBF/GiNlU0lz5plCPa1AWc5IjWXJPcfWNK6ajQaroFcmpvi191OALwbuAsrgWgxUpGgGeE2fQZpnlGazbVYQVbMOebeYQdfJnf42u8U+FcNsUM+xjvi/rhjfwrv8F/8Ov8C9cpTCofAxJnqQlF/kQOGOSb2K5xfFkQFF+cy++wJy0/WiI7pzyLGlfxz7w99/sbCpeWDwNbgB3k/K0SAlxJ4kwRfd7aFxXcwov8N09xnKdYlaSJ+qeN5w4N9vDRNDyNqgd6ljfzPX6N7/Gb2UNQijZ3k9j7JxTGn0x+Kj83yLNnABHZ2Bvh6yXbbrRwTcUe4h1Cq7xDe/7CDZp/CEzuXrVP2gi7uYEPx+4cMjtDIa88wspum4EkN6m/GAJCNUYmBFhRyj/Mp5jkDj7B7fwtnxXkYxIlRJNQXXmm/uKjX4ZWYQhYMch10peJzN1F+QJj8dhf8OV0J4BblP4WyVBQPsQMYLj7k7eABKq3gNE0QpGaICLk95RP8jfG2tWRB4RG9dsfozMKqN4A7uDjPMg1wAHez518QpAuMMYj/JSxYt5ikKjsXb4sDhIS0qVLGHsG6y9RV7qp85/h5tyvm6X+ZJyo4+/G1zCukJt+wy6t+urLF63qj5y0oo59lNRlS8AKo6BZQP8zPh8/91/D5/mZIsUOxlgs5nU1B0/UmJ7wKIMOlHj4c0c0REkU9P4ADYe3BTQcngANhydAw+EJ0HA0jwCR2Vj1TtNJTbkfcyjnLOXRodse3oY8ASbSBqj+GlI9PkBdtAjT5VpHtF4NX43f//dIFPhr9rCf/XyEj3A3H5dyRq3zcPzrLOCs+C/CXj5HyC3cQsjn2CvlN4evKHozFP0ZZLkthRzpQZTHyF4DJ5jlGI8C13F6avaUC7Htsg398npfYIxJOkwwq5hUic58lO0cYZumFsmE7PXchzxT+Nb0+0meVcyFHuWbjDNJJy5HnA63m8OT2fuu0pBsnntVhc/sFlIEqaPMjCLkZ8hoLkdqzs7MwbPxLPERTudVad3LMGAMmOVyxoAxiQBH2QZsS9V/VFHC+fGnennq8/wiPwHO5v+U8m9yA+O8PrXpl+8nr4znL0NUs55TzKSrClW30AoP57wo5B4uouDlue8y/pifA/BSciA/BDwKHGEbR/lC6Utz31LGlFvZSaWI7Gxjue95bI9Vnqhftsm3eJexDv/LTwD4Ce9RSA8xTgi0Y/XL07ojuT81ZjTfo/rPADNsZ4QRpUdBix3APJFhV4Y53HdAl0k2s5WLuTjzGRLXBkbq366MFBQWvlUz9piqaEMnvvthUdk/bc/d/Sr1dwWfh+Jc+7OczAXCOSTlfzsdYA9b0Nn0NnGy9DVluCj9fBj4A0WKvwQiG8Y4kd1PREhGK/n2mQJ+CPycU9nMbTwWHc7vF/Aqp8dNt8qWCi5fGFO4OTyZzpC30queUb4Td38g+8WJ6lcpcII/yv26l/sNZ1cRLAqNEQ0eJ5UhcEaFUbs4xl8vHA+5X3oGyBuLj/Kp0s8AeyH2wljIWjcbAiY5nVf5JvOsskXRxWaB1tUh1/NHVSmCwp9ZqjrDbKy87HseifqjgWBzNsoBmcPbHKMEyvu3w4Nsi/9k9cMsR3kEeIzoSUPGCl/ma5zF6Up3rGlLgI1zOIf7OIfXxf+bsU1xLHkGuBz1DbWVU9nKVrYCe5MUeWNQxvFJ7SPgsL8FvMzFsW+syt5vc7I6wn8CFyr8aaJAWhOEzPE4XeRewLxljXh0N/sLKeYl87QYjy1ULCm/T9kDXE4UokvuAbIQUePs5bZ8lDB3DJIAZrToph3/S2wuWM3Vz93q2qvrHz1fvMofshI7Zmzip4W8y/w7z7GsbaWQIF0vsE+KQvb7zMQuedP8U6GPmVf4L4gUKaaQA/op4xd4c3AeO/gr4NM8opQucBb3xrRqcYi3SRTLQ0WAvFucnY5rAk+AhqN5tgAPAZ4ADYcnQMNRJMC8Nl74PXw7naT9NvcMuuIevYH4EPhvXAp8n8ukdF+S5scf4r2DrrxHfeR7gLu4FIBLuauQ6p5U/dkM3XuUvcBxwjhitgr/E/cgdkvj8Nkio2tL/o7XL244kCdACxhlFNnU+DZlXtXRC+J/apwdf+6x1KqjcNiAhbjxF7T5bCls8pDjqbuGrOI3aL6va2RDwF3cSLY07G5uEhpGk1s6Yp8JbMVbw+qRrJMVJ24XhCiZqtl8W4oFxriLB7iWmzQluAV0t13hukJGgGj8HyVaYCU+B4gXbmqGA+zUhCaIEKn/mCJccidWt1r9duVEKRZ5gGsZQ62+u2JXrzu5SVvCibQHawQBkiGgE4//3dhmdWnFUfgFspj5KnSBVxTxc5JOX6d+VzzACg8YpOJnBhcXlingBCc4AX3almoASHqAvBlENom49wA2RGt4i4sbM7Xr1T/4HuB47unmxEZ5Coh6gOxub+UeALOjTyvzqo52LM/4gWJjeJiI/XNMd/+i5rt4dIxuGoVHlt/EnWznTm4yxNq+wEmiT7XOkGwapZHGn3fwFwrpZwtr0LOS9D2D3pxs7/ztQRZsKWzykBPcG1vpjmvu8ao7gQwpIgIcVzI6380t0S5Il9mlyNNhj3H8NvkT2PIOBzYkAVwwy++mb/6H+Lpxx4yNjMYSwGNDwlsDGw5PgIbDE6Dh8ARoODwBGg5PgCI6RptAx2oxWGfIEyBk1WIC6t2WEIPCMzxjlHeMvgodqyfDuoPYA2xhj5UEamTkaWlL6LAaWxo6rEoUEul3QCE/IJSkoqB+aXmS7wquMFyfu/pdvJrWBYqxgiMcY1k5JauPJhwK+UKKc/pR4wVAhzZbonMbSjjATkke+Rno8otXoN+tQycVg1HbpRtkRlBNAFDvOGEjACTOHqJRKPu1GisPSwk6Aujzi2X0QsV6aahYfLlOoX4IPMacwatHj2PMpeqfyzVQwFx8dCtzHHMoQQdb/rXBhlB9BJkAkQrK2+SSfC1WmZP23JggYI5VWkxoleh25onKJDDFHoikc8a8eWloSLuuIA4BurE/S6HfUWD4Ye7kI2TPKuWl6xL5GEH2CwucUw4jXGo9gclp3Sxdl/Dm4IbDzwQ2HJ4ADYcnQMPhCdBweAI0HEUCmNbeemxAZARo8RAA5/EhTaz9yM72VY3UY10iIUCLbhp+9FK6SiVPMsch3kXXYaK4aJA9UIgEfmCN5R4aJBNBR9jGU7yVkK9yNaEyHHKEFvvZYggmG0EOVFr8LQZK7LfcQ4OIAC26vML5wFc4wgQ/4jzFGt4QOMq93M8qWzQbmEbpVJFqR+Jw6ps4ySYpnnbIVTzBVbmA62r5E2ksfpV8hMPxPxTxuj0UiGwBVwLfBeBqAL7Lu7hSUvAklzPGfcBuunxUSwA1LgMuBOACTlGsRYyCy1zAKcBrireTC+N/lwGvKcq/AHhTLH+Tf7txRbEHiKDuAZKUx9jKEbZpwyGrewBxffFnpS68v3IPDZJngFW2pIumFxhTBnGJjMDzjHM9VzJeigAH2Cn8Lvob9VvuoUFCgGivgFf4Lr/Feah3DMi8AeaAPcp9rsKN5TC18ZHfNu5P4jhB3+fvNorPq4cN3h+g4fBPyw2HJ0DD4QnQcHgCNBwZAWz7AdSVz/KNVP4Nxb5//Zb3+/oGLa+I5C3Ath9AXbktzFy/5f2+vkHLK+PU1wHcw7WS5DLO5dH4e135HfypJH8LZ6eTzf2W9/v6Bi2vgWgIyCL/55dNvU3xLY+ifDndWnZZmz8w5LeVXyyhH/lt12+rvzn/CWFhmi6/SZ6vhfqqS6IYKlYdDNoWSjZb/bsE7EK9Orhu+S757eWrwmG75g9QLzALS/wOc6XI8oMA7NS2X3L0U9xGT1Zo5Qkg77UbKH/p5Mm4m43H6gbWNZC9/EBZmqsC7OWbCVC/fYL0eDV5suNvpP6eEOC0+kXk8Fru//IIrT2CGfnl6FVKyK98rJI/dMhrM5M9aJDt5XZuJ1N/T9DrIWAB+ADVh4D6Xby+fnIJ1bpwU/luPYith9Kdfy+3C+rvQQ8QPQTa9gNwky8BY4zF3/Ly/E7YoeLokZzUJscoRykX6x9KR58WJDZ51fZJri+sLL9NUL/6rCUREeCQUIEEhxTf8ijK22kDtrX5Q0N+W/nFEvqR33b9tvqb8heDV5WVA0Lnr77qkojmAVa4jLcUJMu5nX3qyh/lt6XNKB/ig2sm7/f1DVpeAxEB4B84g1O4OD56iEX+TEhXV/73nMvpqSvod3gwp561kPf7+gYtrwzvENJweGtgw+EJ0HB4AjQcngANhydAw+EJ0HDkjUHum6cPp9yjAkRr4Ej67bAydV25x9BBHgLqqe6wtYR6d25QuwQPAUUC2BR4mMNGeRKeQQebAnWxvBOEFW39HhoUCTACRgWOMGKURxE69AgxO0yYNnwBu0OFR0nIQ8BIhVLE3OYS6t2/NgJ5lIR+y5jhe8r3bwF9QJn9AoZd7lEBfiKo4fAEaDg8ARoOT4CGwxOg4fAEaDjWLwHafkKoFxAJUH+eLWSKkKm+17vNkhAAwqMiRALsiv8NGra7O1L/8qCruREgEmCJZF3fIGG7u736ewjXHiCkLf0rh1D6UyNSr56Gifr9M0BPIHoELbHMkvLeCoDlwr9ymHZKlah/l1G+7J8BegWRAKYeYFeqmuRfORLMSEfkeP7tXPmq0kX1+0GgBxDXBtYP9B4yzYxyswb5zaCYJq9+VR28+vsA1x6gPuz7d5RTf1uTzqMUhuktIGA5/idDpX7/DNADiENAm2XaQ9m5hnGnX/z0qAkfH6DhWL+2AI+e4P8BepjE/N9O74IAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTUtMTAtMTlUMjM6NTM6MjkrMDI6MDC1OmPTAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE1LTEwLTE5VDIzOjUzOjI5KzAyOjAwxGfbbwAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAASUVORK5CYII=)}.ui-button .ui-icon{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAADwCAQAAABFnnJAAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QAiEnuKCAAAAAHdElNRQffChMXNR3//v8QAAAaqklEQVR42u2de5BlRX3HPwdIKGJYiCGwwrJbUolgopidgUr5SJWUIXeSqk3UYsndsaJGyQ7RqGiZnZHM8Aez4tzRAAuS2qXAWFTNI7tEDVSFOyJiYdxScXd9hrwEB4m7+keM6x8pYsnJH+fVfU6/zjn3zr1zT3+n7txzz6+7T3f/fv04/fv1r4MFPJqMMwadAY/BwgtAw+EFQEabkPagM7GR8AIgos0KsNIkEei1AAy+/bQJK8dcAfagE4Ek5cGXsYeQBcDcAYbpnwm29qOPH8ZPb2vD2J6dMLFaCSL2r8YiYEp5hPoIUQB60QHuqZFCEjdph+VRJy4EBKwCqwQEhpTrlHHoEKTrAEkRk3agQwiF6hERpRNUip+0Mt3zbc8Oa+bdNWVbGTcRsh7A3AG6wtQG7cNH9HQTC82p1GubpiFITLlePzNkCEqvBJpbkakNZpVate3YUzC3TXPezX1glrKtn9lUOKt0DBvz9FVTv8u0p7CKqf8KHOLqhkAx5ZFhf5UeYLTRZmWU2GuHF4CGw68ENhxeABoOLwANhxeAhsMLQMPhBaDh8ALQcHh7gHzcQed/g1HGHsDNIsCmjGkb7QHMT7Czp449gF0dHuV9pISknD2AmwbMXIV6Bu3RXLumbWO/LfWV3Lc+9ZGxBijaA0TQr4YnoUz6Nj3dFtvFHsCUO/PT7fHNCOO0k++RgGwPoLqWserUC6jD2Nuniz2Aqf255U0vPqHV2qDMkzYFqiiD2qwY29gw2wOYhMvW/yQlD0dJX9hrbeDgK8ckni5xB53/DYZXBzccfiGo4fAC0HB4AWg4vAA0HF4AGg4vAA2HF4CGo/zGkFFHOMBV/vprpaXzf1a96H2phEHmILTmoLoqyB5zACWXh4AQjLp+F/8AYQVKWVR9hi3/EesDYyp24aga260ELqFKxD1DCmArfuBQAH38wKGCXIoQGpQ9LvkLDDT5u9wzEoq9BswlNAtQaIkNtkYs5V8cAlyLr7PWsVdS0IMOPjRqIm2jaJ0chGnsQEkVn656StK89HkIDXRz2lnpzM1AzGUAZSeBoUPrsYVykc5qbdyNuYFD6iYGuaRbtQZMTdAlbXsdFOhlXgOzLs4llJpm7gLtEmxOw9bFunXRthZke7rLJLIq7CJup0s5KNMDuHWd9Wa5gWMv0688BsYO1i3dwCFMVZiHafMAqIx7libQ4DDoHGzm51eI61cCGw4vAA2HF4CGwwtAw+EFoOHwAtBweAFoOOTNoYmz1MHB7g+8n3CpAReNaLV4tr3Rrk8phUwAko1RLu7eq1VA71AtLVvO3WrA5Go208a1S8eO9JTJn74M7co1EOZyCag3h5q3cLpotNuKe70TAV1abq4h9Pl3qwHdM9q57bXtUrGzEth6oHpb0wsbdOWtYS7u1G1bsHUbRN0saew50KVjd+Fuz7mbQ3q1xqDI2iBHt20sbxt9EYdSymaFsU5hHRTDlBUA9woISsR1y4G5Cl2eb9/br3++LbZNAOx1YGagXQDaFmfWSgEo9xaQVUAVlUUgpKFOPZS+Tc+vgizfVecQpqfvianJCK72IGB6fhJTPQewpZz5bjDtb87nsqQ9gKkC5AmMqfjmzJmKaEpDLJrd7EvFArsAmkqwmnMg0S+n+Sb2rqbH3rjlkrJDgJs5VWh1EWEeBevEdqtedTncxuD6Jm2mdKofamOfAyjh/QOIMAvgSMILQMPhl4IbDi8ADYcXgIbDC0DD4QWg4fAC0GsMUp1dAXl7ABtM+iqXordr6rv7jfq5CyyL3UNW9qI9gAkmjbnLKmGisdvjsMFUj7qbq8zbwwPr9lc7g3XxTakPCNlCkJgtu7ff4mKjuDWy2unfrgvNYNLY2WIH2nDiXZ2207R5NHSiupd0Q6CeA+iMDsz6qmxoqGK0ELUcu9mU3odBiKuuLyhxV/Vc1fPtO5uHEpkAyIrC8gfIRwesJ+wrHz8g0+VV20CdhanrgqLac91C1PHx0QdkAiAqCqvIsO0kAbuyte7oGAg9iLqHkL9VIXrTilVPkHuPoeknxCFgNc2UqgOPOvjI3EuNVaM9gIu23+4ewozMFkBtUmGu+mwQ0nsXSUIGJaliiKoGNX2BWhuom8aAi7JUNwnshbLVzWqx6kTTZRKJIQeb8DAZrw6WMTRd80bBrwTKaBj7vQA0Hl4AGg4vAA2HF4CGwwtAwzF8AtAalkXSZiAvAG66bJPKJnSi6kK06G7Iq9ig/SAMDcq5i3dTxUzUyE+XREhaxnBVXdZnGKETwOtAFgDzKrV5tTtp1S26ShEI04VS9d69qOufSEN0NfGTq2pO1cXep7zGcgSRCYDs7r2ITB+uc5keEMTsX1M+y9y1R13/GhOGvbPJ09XPly0K8qm4uY9oHBJfwVmVmT1e2zRZCfurj+NrTq6c1bv/9U7VE2O2jD5CR8DXQSIASdWaTKZAPDRBjfpHouj6D/np+TzIByEUc7giPTugYVtA9ci8hYtVpncwYj/1wvVYCR09EoGwMI9IFMFqr/xyfnrlVr4BKPMWkFWxzibPdiSTiT6RUrtAUOgHAuHpqoHIbE8ku4/wSCGfF2A7cMRkdln3JIu1NG2X18jA8V6CVfysX4n8QpCp85bbYH/akXkOUAervuWrMGwnh3ombTCGTxfgsaHwAtBweAFoOLwANByjJACz6UrDbF/Sv4yx+O+yQRe1d4gE4GBccescrJzSYxZNvw0hT0rWAmWZOMt8ej2vjD1bSzwu42mu5RjHuJanlSIwa8393pi6V/MMPd0WE+7L/ZmfkHIp2hgS8jBPAecxJQTOXskOpvcPcaMm6WyR6Ai7DTuLiqlHWOIpgYWwzFukyp3PhZ9jfwm6nENV7vZySPo9xb3S7zGuZYFx4BgzPMpxbQ2on+HiTFp/8qftUOwoRFbztjKmS36JACwC8Hkp+JqQeFFAnmWHpnqPgFIEQsbT62OKIn6Nq4TfsgBEmoDJlJbfIhYyJ4nAHPNaDwa6jW/j0u98Dsc4xjjbgFfwYcY1AnASgJdU3GEUkixpB84UMYRZAPIiHkC2EJSwvpsPEOMp4AQ/5tOG7I/F37u1IbYYYi/zlCQAeRwSChVySOqrAPZDKgJz7M/1CFkF6ityC4+n19co87CNiwh4kSGXf2mgmXtAszo+UKRSTsQS9n+MD4q3s5XAriWBE/y4EEbOwgWxLi9U2PNE+FVD+pN8zfj8J8iU1Yd4oiAAmQgUO/8Irdx3MXfXGXM6wz9yF/BeZpTxTwHPCNdFzDGffjYWCfvv5xxZBFyXglXsz+PFAJzBC9oQ5wNoJii2HiARATjEE9owAWgneVfnvvPYwifiq3coqJfQARaAGTrsKgwBeU1q1W2mdi8JthCf5O2FexH7j3AO8G6AeNAvoQsosj9fwPOtafxSejVeoNl6ALgsZvwTXMbTCvosT3MQeIJZTR9gxi/z3vQqjzY7eIi9zABnEjLDiwwGJXPsVzJph/DRYQwbbCHephCAKQ4BuzkSz6MWmY4I1ZVBRfl+kTXOXfH3uIJm6wEipkcioHoNm5Xoql5gW+5bVUUwQ9TO5SFmBwsgvBcsaIaBCPM1uvhjNUOobTruhVgEQGC/SQDmhOtip1Nk/+f5mPSrCHOXaO4B5hSveWXokAxR2Xe+iu4FQn6B+cIrYCQS+TudXOlskzy4QfgUsZy+5cByxRB6JCIgsX+YHETMAi8Xfj9VqRuvixAU7O9l6hEGo/beyyGZ/cMkAB4DwSjpAjwqwAtAw+EFoOHwAtBweAEYLTwu6DOcIAtAy2Fjth4uJ2+6YVapUZ8TdNnFt/yDhNJf3rLhcI5+WPFcUVu+tw90gC9Y6qeTW18og9fHf2YsscRS8kN8DWzRZQ6YV9jmr/OmeAXqMR7lpUwp1bnPsBs4wku5KqesBfd330S3L4ef49b4bpTaLQp935H01+5CfFd9fLTCt9AXehImAJYkdTdAh31M0AUm6Obf12nRBY5wPYfZDcr9E99nG/AclxpqdyleTFrm89wvCkDE/kibVhSBkD25nTVlTw+P9hN+ijfzKd7Mw+zSVNAs+znIVEGnJ279VD3B5fj2/+ISfshFPMc2jY+DGTqEBEyzoKUDBvpXOM0WfkdJT6p/GZgsWYMJ9UiqbhfphwtK+CNcr3j+QaZY5gG6ib2FqA5OllPnmavkqEXc0qXWHN7K91jnBCc5xg+UIWaZZxs38lwf1gGf4WK+y4V8l0v4njZUtJY+Y6Qj69QlnOa4Vl2TtL5JJXVCqjXdBjm1tcWvOdwB+APgXN4KQIu1TACelFbT55njSa3aVIc1bM6cb+FhdvFZfp8v8HqFcdks8xxiqi/sh5fyL/wm/8Fv8E3erlCpvAdIjKWmFfETOmCgb2FMY/iyJDE+v5bfYV+afrRFdlH5FDWu4Z95rfD7SwqTlncC24FdCPZWiQBcTWJMEX3v7wsLbuV7/Ddf5iRfZr1ATdg/Z3x2aNCHT6TuaVQ90Hd4Od/m1/k2v5VNglK0uYtE3z+tUP5k9DP5uYGezQFkZGNvhC+WrLuJXJnyPcTrpFp5nfb5uQYqTgKT1qu2SRtnLzfyzticoyidoRS3OMIWzTaDAt3Efvm8omIeQzIBWFPS38mHmOF2PsBH+FvukOiTBZGQVUJ16Rn781O/DK3cELBmoOuozxGpu/P0JSbjsT9ny+kuAG5e+lskQ0HZOUTEYH3rT94CEqjeAiZSFzVqAZFRfE/5IH9jzF0dekBoZL99Gp2JgOoN4HZu4kGuBw5zHXfyAYm6xCQP81Mm83HzTqKyd/myOEJISJcuYWwZrC+iLnVT5z/PLcKvWwr9yRRRx9+NyzCloJt+wx4t++rTl63sj4y0oo59gtRkS8IaE6DZQP8zPhHP+6/nE/xMEWIXkyzn47qqg6drLE94lEEHSkz+3BENUQUR9PYADYfXBTQcXgAaDi8ADYcXgIajeQIQqY1V7zSdVJX7Hod0zlXeHbrj4W0QBWA6rYDqryHV/QPURYsw3a51XGvV8Ln4/X9fQQQ+yj7u5V7exbu4i5sKMaPaeSj+dS5wbvwX4WY+Tsit3ErIx7m5EN/sviJvzZC3ZyjSbSGKnh5keozsNXCaBZ7lEeDtnJ2qPYuJ2E7Zhn5ZvS8xyQwdpllQLKpETz7BGMfZqclFsiB7A/dRXCl8dXp9mu8o1kJP8FWmmKETpyMvh9vV4cnqfVepSDavvarcZ3ZzIYLUUGZe4fIzZEKIkaqzM3XwQrxKfJyzeb6w72UYMAkscCWTwGRBAE6wE9iZsv+EIoWL4m/19tSn+UV+ApzH/ynpX+VGpnhxqtMv309eHa9fhqhWPWeZT3cVqprQGg8JVhTFHi4SwSuF6yL+lJ8D8P3khjgEPAIcZycn+GTporkfKWOKreykUkR6tknhWsRYzPKE/UWdfIs3GPPwv/wEgJ/wRgX1KFOEQDtmf3FZd1z4U2Necx3lfx6YZ4xxxpUWBS12AQeJFLtFmN19B3SZYRs7uJRLM5sheW9gxP4xpaegMHdVTdljyqINnbj1w7KyfxoTWr+K/V3J5iG/1v4dTguOcI4W4r+WDrCP7eh0els4XbpMGS5Jvx8C/kgR4q+ASIcxRaT3kxGSiVWx+cwCPwB+zpls4zYei25nc4CQ5zk7rrp1tlcw+cIYws3gyfQEUUuvmqN8I+7+oGgXJ7NfxcBp/kT4dQ/3G56uErDINUY0eJxWusCZkEbt/Bh/g3Q/5P7CHEBUFp/gQ6XnADdDbIWxlNVuNgTMcDbP81UOss52RRebOYhWu4q2OZMOcn9mquoJCzHzsmsRCfujgWBbNsoBmcHbIhMEyvbb4UF2xn9F9sMCJ3gYeIxoplHEGp/lC5zL2UpzrDmLg43zOZ/7OJ9fif+bsVNxL5kDXIm6Qe3gTHawgx3AzUmIbAiI/F9EneDMEE4Bo83RM3T4JguKzdER+59jLLaNzXsBiNhvmrjdxnX8J3Cxgv0AjzJNyDE+SpedWsu/hzWp7xecRuwt7D8+FG+uz/4fyoXYlttUXvRyIFpKqa2mFJ4RymoDB/kaaEaLbtrxf59tOa25et6tzr06/9H84nn+mLXYMGMLP83FXeXfeYpVbS2FBOl+gUMFL2R/yHxskjfHP+X6mIMK+wXZZV8+RNGhn9J/gVcHi9jFXwMf1rTiJc7lnlisWhzlNQURE6ESANEszi6OGwIvAA1H83QBHhK8ADQcXgAajrwAHNT6C7+br6eLtF/n7kFn3KM3kJeC/5XLgddzRSHcp6X18VfxKrbxpkFn3qM+xB7gAJcDcDkHcqHuTtmfrdC9UdkLnCSMPWar8D9xD2JfZhrGhaiTgqLqZP3khgOiALSACSYoqhpfo4yrurs1/qhxXvy9z5KrjsJgA5biyl/SxrOFsNFDTqbmGkUWv0RzvamRCUDU/tdYo9gHZIueoprW7tU2j4DA4VzQaJ9sXgSyzY2TGgbaQiwxyQHGOaBNAbYyHwuJXoxHCpkAtOL/LeFXEbYTQ4+AZltY8pQu8KyC0km/o/4hv24/qbmW7y4zEbtfUNEPcBPHuYkDmhRA5+h9ZJEIQCce/7uxzuryiqPwM2Q+81XoAj9S+M9JOn0d+13xAGs8YKDK3xlcTFhmgVOc4hT06ViqASBZChbVIEWViOzjto7H22gPb35zY8Z2PfvtrphDYJkHeCuTyhAhB2Jjzzt5nzaFU2nnnw9xUhgWTo3KLCDqAbLW3hI6/+zuV5RxVXc7ljl+oDgYHqZj+xxT61/WXMt3J+mmXniK9PdxJ2PcyfsMvra3OlFGZoaQHBqlocbft/N+BfWO3B70LCV9z6BXJ9s7f7uTBVsIGz3kFPfEWrqTmjZe9SSQIUUkACeVEi12cyu0c9RV9ijidNhnHL9N9gS2uMOBkRQAFyzwu+mb/1G+aDwxY5TRWAHwGEl4bWDD4QWg4fAC0HB4AWg4vAA0HF4A8uhYvPlvMgcQNogCELJuUQH17kiIQeFJnjTSO0ZbhY7VkmHTQe4BtrPPKgRqZMLT0qbQYT3WNHRYL4iQLH6HFfTDUkoqEdRvLU/iXcVVhvK5s9/FqmlTIO8rOMKzrCqXZPXehEMpXkh+TT+qvADo0GZ79GxDCofZXaBHRyDo4ssl0J/WoaPKzqjt1BFZEVQLAKhPnLAJABD7GZGVQtmv9Zh5WFLQCYA+vpxGL1isp4aK7debFOpJ4LMsKg8cseFZFlP2LwoVFLAY393BotIeKJ+CDrb4G4ORYH2EogBELCivk0vitVhnsXDmxjQBi6zTYlrLRLcnT1cWApPvgYi6aIwrUkND2E0FeQjQjf1ZCP2JAsMPcycfIZurlKduSogbQ+wFC5xDDiNccj2NyWjdTN2U8OrghsOvBDYcXgAaDi8ADYcXgIbDC0DDkRcA095bjxGEuDn0MwBcyDs0W0MjPdvntBtHPTYhEgFo0U3dj15OV8nkGRY5yhvoOiwU5xWyh3OewA9vMN1Dg2Qh6Dg7+TKvJuRzXEuodIccocW9bLc6ky26Ks7/lh0l9pvuoUEkAC26/IiLgEc5zjQ/5ELFHt4QOME93M862zUHmEbhVL6qx2N36ls4zZaCP+2Qa3icawSH62r646kvfhV9nGPxB4W/bg8FIl3A1cC3ALgWgG/xBq4uMHiGK5nkPmAvXd6tFQA1rgAuBmArZyj2IkbOZbZyBvCC4u3k4vhzBfCCIv2twMti+sv8240rIgF4EnilcPeV8T0ZHeAButzCDk6wS5me3kziQunXHbFn+wxbeb8gFkX6hbw//pjiR2G2KugeSiRzgHW2p5uml5jMnzIPJErgg0xxA1czpfWHrRoCDrNb+p23N+o33UODRACi8zB+xLd4JReiPjEgswZYBPYpz7kKR8tgavQhHhv3Z7GfoH/j70bF5tXDBm8P0HD42XLD4QWg4fAC0HB4AWg4MgGwnQdQl77Al1L6lxTn/vWb3u/yDZpeEclbwKcL5+V+RjoPoC7d5mau3/R+l2/Q9Mo48/cA7uatBcoVXMAj8XVd+u38eYH+Cs5LtQn9pve7fIOm10A0BGSe/8VtU69RXInI01fTo2VXtfEDQ3xb+vkU+hHfVn5b/s3xT0kb03TxTXQxF+pSl0TeVazaGbTNlWy2+3cF2IN6d3Dd9F3i29NXucN2jR+g3mAWlvgdCqkU6ZGr/d3a+kvufojb6MkOLdXWsHwx83Q09DAed4vjcT6dUHPfnL69wEkPZIsdaEXOJXVd/lzSDzF7FrjOmIObuU1gf09wVv0kBLwg/C+P0NojmNEbBusbgD3/9rg2NdmDBtrNfISP0FP2934IWALeQvUhoH4Xr89fMYVqXbgpfVP+iucvlKNHIiCyvwdDQDQJtJ0H4EZfASaZjK9EungSdqi4e1yg2ugY6Sjpcv7Dwt2vSBQbvWr9JOULK9Nvk9ivfmpJRAJwVMpAgqOKKxF5ejutwLY2fmiIb0s/n0I/4tvKb8u/KX7eeVVZOiB1/upSl0S0DrDGFbwiR1kVTvapS3+E3y4cRvkZ3rZh9H6Xb9D0GogEAP6BcziDS+O7R1nmL6Rwdel/zwWcndr8fYMHBfZsBL3f5Rs0vTK8QUjD4bWBDYcXgIbDC0DD4QWg4fAC0HB4AWg4RGWQ7XTeYad7VICsDRxPr44pQ9elewwdikNAPdYds6ZQr+UGtVPwkJAXABsDj3HMSE/cM+hgY6DOl3eCsKKu30ODvACMg5GB44wb6ZGHDj1CzAYTpgNfwG5Q4VESxSFgvEIqcmxzCvXar02APEpCf2TM8M3y/VtAH1DmvIBhp3tUgF8Iaji8ADQcXgAaDi8ADYcXgIbDC0DDsXkFoO0XhHoBWQDqr7OFzBIy2/d8t1mRHEB4VIQsAHviz6Bha90R+1cHnc1RgCwAKyT7+gYJW+v27O8hXHuAkHbhUw5h4U+NiL16MUzY7+cAPYFsEbTCKivKthUAq7lPObi5b0/Yv8dIX/VzgF5BFgBTD7AnZU3yKScE84U7xSNd2kL6qtRl9vtBoAcYph5AZH+gpXv29xSuPUB92I9wKsf+tiacRykM01tAwGr8KULFfj8H6AHk7eFtVmkPZecaxp1+/tujJrx/gIZj8+oCPHqC/wc2957uSJx+mQAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNS0xMC0xOVQyMzo1MzoyOSswMjowMLU6Y9MAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTUtMTAtMTlUMjM6NTM6MjkrMDI6MDDEZ9tvAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAABJRU5ErkJggg==)}.ui-button:active .ui-icon,.ui-button:focus .ui-icon,.ui-button:hover .ui-icon,.ui-state-active .ui-icon,.ui-state-default .ui-icon,.ui-state-focus .ui-icon,.ui-state-hover .ui-icon{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAADwCAQAAABFnnJAAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QARaw7li0AAAAHdElNRQffChMXNR3//v8QAAAalUlEQVR42u2da4wlR3XHf207sQjx2iHEXuz1rnASbBIw2RlbEY9IWMi5k0ibAPI6dwcFCDg7DoSnyM7gzPiDZzFzh8T4gaNdyybI0jyy6wCxpfgOxhiZsALM7PKMQxJsZnHYhQ8hLB8iB+HOh+pXdderu++de+d2/Ud3bt8+VdVVdU49us6pU8G1eDQZZw06Ax6DhReAhsMLgIw2Ie1BZ2Iz4QUgizYrwEqTRKDXAjD49tMmrBxzBdiHTgTilAdfxh5CFgBzBxgmfybY2o8+fhg9va0NY3t2zMRqJRDsX41EwJTyCPURWQHoRQe4r0YKcdy4HZZHnbgQELAKrBIQGFKuU8ahQ5CsA8RFjNuBDiEUqicLkU5QKX7cynTPtz07rJl315RtZdxCSHsAcwfoClMbtA8f4ukmFppTqdc2TUNQNuV6/cyQISi9EmhuRaY2mFZq1bZjT8HcNs15N/eBacq2fmZLobwAmBEOvGrarFQWMPMQFKc8+DL2EL0WgK2ONiujxF47vAA0HH4lsOHwAtBweAFoOLwANBxeABoOLwANhxeAhsPbA+TjDjr/m4wy9gBuFgE2ZUzbaA9gfoKdPXXsAezqcJH3kRKScvYAbhowcxXqGbRPc+2ato39ttRXct/61EfGGqBoDyCgXw2PQ5n0bXq6LbaLPYApd+an2+ObEUZpx98jAdkeQHUtY9WpF1CHsbdPF3sAU/tzy5tefEKrtUGZJ20JVFEGmRSuw24PYBIuW/8Tl9yrgw0YfOXUtQcYdP43GV4d3HD4haCGwwtAw+EFoOHwAtBweAFoOLwANBxeABqOcwadgaFDOMBV/vprpaXzf0696H2phEHmILTmoLoqyB5zACWXh4AQjLp+F/8AYQVKWVR9hi3/gvWBMRW7cFSN7VYCl1Al4p4lBbAVP3AogD5+4FBBLkUIDcoel/wFBpr8Xe4ZMcVeA+YSmgUotMQGWyOW8p8dAlyLr7PWsVdS0IMOPjRqIm2jaJ0chEnsQEnNPl31lLh56fMQGujmtNPSmZtBNpcBlJ0Ehg6txxbKRTqrtXE35gYOqZsY5JJu1RowNUGXtO11UKCXeQ1MuziXUGqauQu0S7A5DVsX69ZF21qQ7ekuk8iqsIu4nS7loEwP4NZ11pvlBo69TL/yGBg7WLd0A4cwVWEeps0DoDLuOZpAg8Ogc7CVn18hrl8JbDi8ADQcXgAaDi8ADYcXgIbDC0DD4QWg4ZA3h8bOUgcHuz/wfsKlBlw0otXi2fZGuz6lFFIBiDdGubh7r1YBvUO1tGw5d6sBk6vZVBvXLh1b6CnjP30Z2pVrIMzlElBvDjVv4XTRaLcV93onArq03FxD6PPvVgO6Z7Rz22vbpWKnJbD1QPW2phc26Mpbw1zcqdu2YOs2iLpZ0thzoEvH7sLdnnM3h/RqjUGRtUGObttYnjJHtT8xlFI2K4x1CuugGKasALhXQFAirlsOzFXo8nz73n79822xbQJgrwMzA+0CYBYgjQCUewtIK6CKyiLIpKFOPZS+Tc+vgjTfVecQpqfvi6jxCK72IGB6fhxTPQewpZz6bjDtb87nsqQ9gKkC5AmMqfjmzJmKaEojWzS72ZeKBXYBNJVgNedAYrV0Cm4wsXc1OfbGLZeUHQLczKlCq4sI8yhYJ7Zb9arL4TYG1zdpM6VT/VAb+xxACe8fIIu29cSkkYMXgIbDLwU3HF4AGg4vAA2HF4CGwwtAw+EFoNcYpDq7AvL2ADaY9FUuRW/X1Hf3G/VzF1gWu4es7EV7ABNMGnOXVcJYY7fPYYOpHnU3V5m3hwfW7a92Buvim1IfENKFoGy27N5+i4uN2a2R1U7/dl1oBpPGzhY70IbL3tVpO02bR0MnqntJNwXqOYDO6MCsr0qHhipGC6Ll2M2m9D4MQlx1fUGJu6rnqp5v39k8lMifF5BWYdkTuPNDSFAibkx12wJt37xd3YWEiY22HsI9ZZOPgE1G2gNkFYVVsmY7ScCubK07OgaZHkTdQ8jfqhC9acWqJ8i9x5CwXx4CVpNMqTpw0cELcy81Vo32AC7afrt7CDNSWwC1SYW56tNBSO9dJA4ZlKRmQ1Q1qOkL1NrAUNuBuyhLdZPAXihb3awWq040XSaRgEVAh4a5LvDqYBlD0zVvFvxKoIyGsd8LQOPhBaDh8ALQcHgBaDi8ADQcwycAreHSlo068gLgpss2qWxCJ6ouRIvupryKDdoPwtCgnLt4F3fSARM18tMlFpKWMVxVl/UpRugE8DqQBcC8Sm1e7Y5bdYuuUgTCZKFUvXdPdP0TSYiuJn58Vc2perb3cTtqfsSRCoDs7r2IVB+uc5keEETsX1M+y9y1i65/jQnD3tn46ernyxYF+VTc3Ec0DrGv4LTKzB6vbZqsmP3Vx/E1J1fOOm29ziIgtlZI6SN0BHwdZE3Cgtx/FfSmDG4GEXqjspge9x86kwx1Dm3uE+TWP2JHwNdB6i08W2V6ByP2Uy9cj5XQ0YUIhIV5RKwIVnvll/PTK7fyDUCZt4C0inU2ebYjmUz0iYTaBYLCPCLIPF01EJntiWT3ER4J5PMCbJZqJrPLuidZrCVpu7xGBo73YqziZ/1KDJtBSKh9h/DoC4bt5FDfPW8yhk8X4LGp8ALQcHgBaDi8ADQcoyQAs8lKw2xf0r+MsejvskEXtXcQAnAoqrgNDlVO6VGLpt+GkCcka4GyTJxlPrmeV8aerSUel/EU17LOOtfylFIEZq253x9R92ueoafbYsK9uT/zExIuiXWAkId4EjifqUzg9JXsUHL/MDdqkk4XiY6y17CzqJi6wBJPZlgIy7xJqtz5XPg5DpagyzlU5W4/h6XfU9wj/R7jWhYYB9aZ4RGOa2tA/QwXZ9L6kz9th2KLEGnN28qYLPnFArAIwOek4GuZxIsCcpJdmuo9CkoRCBlPrtcVRfwqV2V+ywIgNAGTCS2/RSxkThKBOea1+3d1yqxx6Xc+h2OsM84O4GV8iHGNAJwC4EUVdxiFxEvagTMlG8IsAHkRDyBdCIpZ380HiPAkcIIf8ylD9sei773aENsMsZd5UhKAPA5L278PS30VwEFIRGCOg7keIa1AfUVu47Hk+hplHnZwEQHPN+TyLw00cw9oVscHilTKiVjM/r/hA9nb6Upg15LACX5cCCNn4YWRLi9U2PMI/Koh/Um+anz+46Qq48M8XhCAVASKnb9AK/ddzN11xpzO8E/cCbybGWX808DTmesi5phPPpuLmP338TxZBFyXglXsz+MFAJzFc9oQFwBoJii2HiAWATjM49owAWgneVfnvvPYxsejq7cpqJfQARaAGTrsKQwBeU1q1W2mdi8JthCf4K2Fe4L9R3ke8E6AaNAvoQsosj9fwAusafxScjVeoNl6ALgsYvzjXMZTCvosT3EIeJxZTR9gxi/z7uQqjza7eJD9zABnEzLD8w0GJXMcVDJpV+ajwxg22EK8RSEAUxwG9nI0mkctMi0I1ZVBRfl+vjXOndH3uIJm6wEE04UIqF7DZiW6qhfYkftWVRHMINq5PMTsYgEy7wULmmFAYL5GF79eM4TapuMeiEQAMuw3CcBc5rrY6RTZ/zn+RvpVhLlLNPcAc4rXvDJ0iIeo9DtfRfcAIb/AfOEVUIhE/k4nVzrbJA9uyHyKWE7ecmC5Ygg9YhGQ2D9M9gCzwEszv5+s1I3XRQgK9vcydYHBqL33c1hm/zAJgMdAMEq6AI8K8ALQcHgBaDi8ADQcXgBGC49l9BlOkAWg5bAxWw+XkzfdMKvUqM9ldNnFt/xDhNJf3rLhSI5+RPHcrLZ8fx/oAJ+31E8nt75QBq+N/sxYYoml+Ef2NbBFlzlgXmGbv8EbohWoR3mEFzOlVOc+zV7gKC/mqpyyFtzffWPdvhx+jluiuyK1mxX6vqPJr72F+K76eLHCt9AXehwmAJYkdTdAhwNM0AUm6Obf12nRBY5yPUfYC8r9E99nB/AMlxpqdylaTFrmc9yXFQDBfqFNK4pAyD6LN3DbWqHYT/hJ3sgneSMPsUdTQbMc5BBTBZ1eeuSq+vBVl+Pb/4tL+CEX8Qw7NJtPZ+gQEjDNgpYOGOhf5gzb+F0lPa7+ZWCyZA3G1KOJuj1LP1JQwh/lesXzDzHFMvfTje0tsurgeDl1nrlKjlqyW7rUmsNb+B4bnOAU6/xAGWKWeXZwI8/0YR3waS7mu1zId7mE72lDibX0GSMdWacu4QzHteqauPVNKqkTUq3pNsiprS1+zeEOwB8A5/FmAFqspQLwhLSaPs8cT2jVpjqsYXPmfDMPsYfP8Pt8ntcqjMtmmecwU31hP7yYf+W3+A9+k2/wVoVK5V1AbCw1rYgf0wEDfRtjGsOXJYnx+bX8DgeS9MUW2UXlU9S4hn/h1ZnfX1SYtLwd2AnsIWNvFQvA1cTGFOL7YF9YcAvf47/5Eqf4EhsFasz+OeOzQ4M+fCJxT6Pqgb7NS/kWv8G3+O10EpSgzZ3E+v5phfInpZ/Nzw30dA4gIx17Bb5Qsu4mcmXK9xCvkWrlNdrn5xpodhIYt161Tdo4+7mRt0fmHEXpDKW4xRG2aLYZFOgm9uddQKjGyFgA1pT0t/NBZriN9/Nh/o6PSvTJgkjIKqG69JT9+alfilZuCFgz0HXUZxDq7jx9iclo7M/ZcroLgJuX/hbxUFB2DiEYrG/98VtADNVbwETiokYtIDKK7ykf4G+NuatDDwiN7LdPo1MRUL0B3MZ7eYDrgSNcx+28X6IuMclD/JTJfNy8k6j0Xb4sjhIS0qVLGFkG64uoS93U+c9zc+bXzYX+ZArR8XejMkwp6KbfsE/Lvvr0ZSv7hZGW6NgnSEy2JKwxAZoN9D/j49G8/3o+zs8UIfYwyXI+rqs6eLrG8oRHGXSgxOTPHWKIKoigtwdoOLwuoOHwAtBweAFoOLwANBzNEwChNla903QSVe67HNI5T3l36I6HtyErANNJBVR/DanuH6AuWoTJdq3jWquGz0bv/wcKIvARDnAP9/AO3sGdvLcQU9TOg9Gv84Dzoj+Bm/gYIbdwCyEf46ZCfLP7irw1Q96eoUi3hSh6epDpEdLXwGkWOMnDwFs5N1F7FhOxnbIN/bJ6X2KSGTpMs6BYVBFPPsEYx9mtyUW8IHsD91JcKXxlcn2GbyvWQk/wFaaYoROlIy+H29Xh8ep9V6lINq+9qtxndnMhgsRQZl7h8jNkIhMjUWen6uCFaJX4OOfybGHfyzBgEljgSiaByYIAnGA3sDth/wlFChdF3+rtqU/xi/wEOJ//U9K/wo1M8YJEp1++n7w6Wr8MUa16zjKf7CpUNaE1HsxYURR7OCGCV2aui/hTfg7A9+Mb2SHgYeA4uznBJ0oXzf1IGVNsZSeVQOjZJjPXWYxFLI/ZX9TJt3idMQ//y08A+AmvV1CPMUUItCP2F5d1xzN/asxrrkX+54F5xhhnXGlR0GIPcAih2C3C7O47oMsMO9jFpVya2gzJewMF+8eUnoLC3FU1ZY8pizZ0otYPy8r+aSzT+lXs70o2D/m19m9zJuMI51gh/qvpAAfYiU6nt40zpcuU4pLk+0HgjxQh/goQOowphN5PRkgqVsXmMwv8APg5Z7ODW3lU3M6eF/As50ZVt8HOCiZfGEO4GTyZnpDV0qvmKF+Puj8o2sXJ7FcxcJo/yfy6m/sMT1cJmHCNIQaPM0oXOBPSqJ0f42+Q7ofcV5gDZJXFJ/hg6TnATRBZYSyltZsOATOcy7N8hUNssFPRxaaO1tUu17N3VSGC3J+ZqnrCQsS89DqLmP1iINiRjnJAavC2yASBsv12eIDd0V+R/bDACR4CHkXMNIpY4zN8nvM4V2mONWdxsHEBF3AvF/Ar0X8zdivuxXOAK1E3qF2czS52sQu4KQ6RDgHC/4XoBGeGcAooNkfP0OEbLCg2Rwv2P8NYZBub9wIg2G+auN3KdfwncLGC/QCPME3IOh+hy26t5d9DmtQPZpxG7C/sPz4cba5P/x/OhdiR21Re9HKQtZRSW00pPCOU1QYO8jXQjBbdpOP/PjtyWnP1vFude3X+xfziWf6YtcgwYxs/zcVd5d95klVtLYUEyX6BwwUvZH/IfGSSN8c/5/qYQwr7BdllXz5E0aGf0n+BVwdnsYe/Bj6kacVLnMfdkVi1OMarCiKWhUoAsmZxdnHcFHgBaDiapwvwkOAFoOHwAtBw5AXgkNZf+F18LVmk/Rp3DTrjHr2BvBT8b1wOvJYrCuE+Ja2Pv4JXsIM3DDrzHvWR7QHu4HIALueOXKi7EvanK3SvV/YCpwgjj9kq/E/Ug9iXmYZxIepURlF1qn5yw4GsALSACSYoqhpfpYyrurs9+qhxfvR9wJKrjsJgA5aiyl/SxrOFsNFDTiXmGkUWv0hzvaWRCoBo/2usUewD0kXPrJrW7tU2j4DA4VxQsU82LwLp5sZJDQNtIZaY5A7GuUObAmxnPhISvRiPFNKFIDH+TyA2WH1HmgfIHi5N/i6PsFfjmkBALKKeVLhL7kTr9PE26fy6vd0Rawgscz9vZlIZIuSOyNTrdt6jTeF0wvoyJ3psWcQ9QCca/7uRzuryiqPw06Q+81XoAj9S+M+JO30d+11xP2vcb6DK3ylcTFhmgdOc5jT06ViqASDuAbJqkKJKxL0HsEHs4c1vbkzZrmf/4HuAU5lh4fSozAJED5C29lZmApje/bIyrupuxzLHDxQHw8N0ZJ9jav3Lmmv57iTdxAtPkf4ebmeM23mPwdf2difKyMwQ4kOjNNTo+zbep6B+NLcHPU1J3zPo1cn2zt/uZMEWwkYPOc3dkZbulKaNVz0JZEghBOCUUqKz3dwK7Rx1lX2KOB0OGMdvkz2BLe5wYCQFwAUL/F7y5n+MLxhPzBhlNFYAPEYSXhvYcHgBaDi8ADQcXgAaDi8ADYcXgDw6Rp1Ax6ox2GLICkDIhkUF1LsjIQaFJ3jCSO8YbRU6VkuGLQe5B9jJAasQqJEKT0ubQoeNSNPQYaMgQrL4HVHQj0gpqURQv7U8jncVVxnK585+F6umLYG8r2CBk6wql2T13oRDKV5Ifk1fVF4AdGizUzzbkMIR9hbows5AF18ugf60Dh1VdkZtp47IiqBaAEB94oRNACA29pCVQumvjYh5WFLQCYA+vpxGL1isp4aK7ddbFOpJ4EkWDVY9epxkMWH/YqaCAhaju7tY5KRDCjrY4m8ORoL1AkUBECwor5OL47XYYLFw5sY0AYts0GJay0S3J09XFgKT7wFBXTTGzVJDQ9gtBXkI0I39aQj9iQLDD3MnL5DOVcpTtySyG0PsBQucQw4jXHI9jclo3UzdkvDq4IbDrwQ2HF4AGg4vAA2HF4CGwwtAw5EXANPeW48RRCoALT4NwIW8TeNrX+jZPquhemxJxALQopu4H72crpLJMyxyjNfRdVgozitkj+Q8gR/ZZLqHBvFC0HF28yVeSchnuZZQ6Q5ZoMU97LQ6ky26Ks7/lh0l9pvuoYEQgBZdfsRFwCMcZ5ofcqFiD28InOBu7mODnZoDTEU4la/q8cid+jbOsK3gTzvkGh7jmozDdTX9scQXv4o+znr0QeGv20MBoQu4GvgmAKJD+Cav4+oCg2e4kknuBfbT5Z1aAVDjCuBiALZzlmIvonAus52zgOcUbycXR58rgOcU6W8HXhLRX+LfblwhBOAJ4OWZuy+P7snoAPfT5WZ2cYI9yvT0ZhIXSr8+Gnm2T7Gd92XEoki/kPdFH1N8EWa7gu6hRDwH2GBnsml6iUmlExehBD7EFDdwNVNaf9iqIeAIe6XfeXujftM9NIgFQJyH8SO+ycu5EPWJAak1wCJwQHnOVThaBlOjj+yxcX8W+Qn6Dn8/KjavHjZ4e4CGw8+WGw4vAA2HF4CGwwtAw5EKgO08gLr0Bb6Y0L+oOPev3/R+l2/Q9IqI3wI+VTgv99PSeQB16TY3c/2m97t8g6ZXxtm/DnAXby5QruCFPBxd16Xfxp8X6C/j/ESb0G96v8s3aHoNiCEg9fyf3Tb1KsVVFnn6anK07Ko2fmCIb0s/n0I/4tvKb8u/Of5paWOaLr6Jns2FutQlkXcVq3YGbXMlm+7+XQH2od4dXDd9l/j29FXusF3jB6g3mIUlfoeZVIr0owDs1dZffPeD3EpPdmiptobli5mno6GH0bhbHI/z6YSa++b07QWOeyBb7EArci6p6/Lnkn6I2bPAdcYc3MStGfb3BOfUTyKD5zL/yyO09ghm9IbB+gZgz789rk1N9oCBdhMf5sP0lP29HwKWgDdRfQio38Xr81dMoVoXbkrflL/i+Qvl6EIEsuzvwRAgJoG28wDc6CvAJJPRVZaePQk7VNw9nqHa6BjpKOly/sPC3S9LFBu9av3E5Qsr02+V2K9+akkIATgmZSDGMcVVFnl6O6nAtjZ+aIhvSz+fQj/i28pvy78pft55VVk6IHX+6lKXhFgHWOMKXpajrGZO9qlLf5jfKRxG+Wnesmn0fpdv0PQaEAIA/8jzOItLo7vHWOYvpHB16f/ACzk3sfn7Og9k2LMZ9H6Xb9D0yvAGIQ2H1wY2HF4AGg4vAA2HF4CGwwtAw+EFoOHIKoNsp/MOO92jAmRt4Hhyta4MXZfuMXQoDgH1WLduTaFeyw1qp+AhIS8ANgaus26kx+4ZdLAxUOfLO0ZYUdfvoUFeAMbByMBxxo104aFDjxCzwYTpwBewG1R4lERxCBivkIoc25xCvfZrEyCPktAfGTN8s3z/FtAHlDkvYNjpHhXgF4IaDi8ADYcXgIbDC0DD4QWg4fAC0HBsXQFo+wWhXkAWgPrrbCGzhMz2Pd9tViQHEB4VIQvAvugzaNhat2D/6qCzOQqQBWCFeF/fIGFr3Z79PYRrDxDSLnzKISz8qSHYqxfDmP1+DtATyBZBK6yyomxbAbCa+5SDm/v2mP37jPRVPwfoFWQBMPUA+xLWxJ9yQjBfuFM80qWdSV+Vusx+Pwj0APLewPqO3kPmmFee11N8M8iHybJflQfP/j7AtQeoD/sRTuXY39aE8yiFYXoLCFiNPkWo2O/nAD2APAS0WaU9lJ1rGHX6+W+PmvD+ARqOrasL8OgJ/h+DVadYm94w9wAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNS0xMC0xOVQyMzo1MzoyOSswMjowMLU6Y9MAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTUtMTAtMTlUMjM6NTM6MjkrMDI6MDDEZ9tvAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAABJRU5ErkJggg==)}.ui-button .ui-state-highlight.ui-icon,.ui-state-highlight .ui-icon{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAADwCAMAAADYSUr5AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABLFBMVEUug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8p2Tp3AAAAY3RSTlMAWEd8IjKY4b3Ld2acsomqpVpOeudAQGVmhVOLRpGUY2NhTaBobXqbc6W/fcC8463l6eSBjl3f3eC51tvSxNXU12LacP4Nzplp+DgqFhzFedHjp4FYyJPQ2K/wzZCniLC7x6vHwZbrAAAAAWJLR0QAiAUdSAAAAAd0SU1FB98KExc1Hf/+/xAAAA+BSURBVHja7V0LYxvFEd67iyQsxycZJGgDCYrBKSR1WjdJX5RCGiJICzFpmxCamFLm//+H7t5rZ2f2oeNk6Wzv58T23D7nu9m9md09WYiIiIgeIIFk213Ysv7QcwY6dy8Bv/4JZkBl3iwhxAJBwSSA9sdIV6kJvgLAGgBPA6R88etGTYJaICcgof0x0ukdZATQ4rwBljnZIAOs/3YVPOmcQUFy+2u3ZU68mdYKZsG8i/QGcwvx3mFuAZ4ObN4C7KSwLvoIYKWBmYindmKCm58DVuDjTJ8CdAht/imwdVx2RygiIiIiIiKixzhzT3DLflDCojWgzntCS9DsRoCfsAZ86wFsQUjWvlFKLB1gBLAMNLsZLiasAUqAJ7pUtW8yGGL9t/fYk2xZUUk8xUVgCRAKAja2HMAtWNhs1ojWVlgPSMzafCNq2xZgReLpcff1AD5CtjoHhHHRnwIREREREREREdtDN8c/6JoG6+8ceHSsAPh2KrTI3bl//DgA61CgNvBf4eqRZOBZzOLgSrM34O2AJdXfvq0GH0EsnVXGNODNAUkER2LNKKuPFABX4grt83AZQgTwBSDwaxAu7sliKljlJmtWZnZaoZc/aw6vCXkHkLBZCGHcUtxvouEW2qgXHOOWM0TgTw/USG4HBG9IoAEQ1jbdqdt+Cpxx+fBjMiIiIiIiIuKyovux1I5uRmI5je6u0uaHBreqAs2368BKDfjjeba3aukAShd4c2oFr05ldgcnYN3e551kVbrbt8S3VAFf3WC9qYgfgbcneW8th90TLwGBs+HCamY+Brz8JZblnsDygxHO1uFwfYHtnRMLYuGwJRpnr2yIFTpgT7UyTGqn5S024C7OCGA94N0z0+kQCxNg74DzFq6UzAJmNwHWvXW+Q++8AWwIkCESHAL2UZ44czCGvYcDeB6LgQmzAsF26AMEkEmQpLJpKbSCQ9u33CN/sr0XDgJXCd4DFsAz93s9YNvvx0RERERERPQaZ/sU544KeVXWUmK9jkW4OmiXvaX+wK/g6M9aArO20n450ZhmBqfIdnb8G1/tAey0uOk7lnuTnrfDA66+JQMwhYURfXoJAXudXQlwv99dJHk+H8C2nmHuV7P++oKDuiy4iq+dgDrcdBGQWMJh3nVPPMXTbbvTQFLBnxnWSEFi6SELdwGbKHjHsKU2uiDiPbNiJYAOibWHd3pSU4sJLDoz3++3pBPBNuwxIYyfACEhwrvDXNFh0Sl5YyQQvYYOAYXWH/zrRxcQF12/iIiIiIiLjfScP8gsbgf4tquoN/xz9O/TVoB1m8X0vtLgbiCkpFKvKESvNkPY0WWB4hWlagopCobM+C6F0gJ0fmHdAmcE9mXYAI9e6PF6qb8RnRkEQEmCEc9SEeubQL8IsGy/c4JSIlMC8E9hid3QtaQZYn0ZAitYAMtvntgoCXJYAD2vUNPdG/2ZjmwOIDmsKzSpthI6B1gOyPTG/HWfDAn/cEz5KH9qVwgsvyls8LMyWzDA6Wh3k+gz0IekhwR0RRv9IyIiIiIuFzLlJ2Sr578ykLiyqd4NZedGQ1+ONwKeG+yUrpJLxYwmZ34+rogxwFhcIRWgErtS3BUOmSaKqxVIgVol2MvzIXL2it8NQgq3aMJPP9fitNJwaujb9JjKbGdrt0qvez0Yw2AA44HRAcGCCXrW1iqUFya2FpsgLc/ztAQhZGQQgBgAZaID3eKOQYCsel+icaWhtgDXfndZna5wAIM333wLMAGz2cz/BobABIgAAbsGgaBURxckIQkmpOygSfh8/vZ87rIAGAL6oRqu5gBAHTR6PC+KzzUBb77zi18aBFy7do0dj3fL5AIlQOn/LibANCmQ+ps2Bu+l6gs1eE3BaQH7SnUY7ut1gKyw/4YAVT9aYiur0xXKIXD9Oh4CMyFvgfzeFMiKr59JgNL/6o133QQk5IK8kiT7CQph4P3Fwj0HwL5kQOqPCSj+NQQUkyAi4KYqffNmfeGgnAQPiDqoACeAvaIhCAEf4PWJyfSq/J67CKANwocFUIOHh4egTZRZQLY/HMpveggUspuAwxLVhWQM74zHt2CM3xFCQ0he+FXxhfUdUAIGhAAwLGCi9fcQ0FT3UQFicoOGAGoB2X6B+hYxGdQcOwRjTI7HzVNgXLc/dloAJyA0BHB6OQfmTeaGgMxsr6mu9APgDeEAsQD62MtY/ZPyHuAqMv3oBq5wYNL7uBA/Fo4LlICCgVysD1k2LdDC12Mcmq5LODu0Wq6h2F2r/hERERERPcft2/70FLzr2gC2o48EmQ537xSPqTu1WAXbTYw9qeRJU7Z0TXZXloX4NelP7n2uyWhrTi7JxzbWP8s0AyPlRR6Nh9oP2ZFdnuw0jpyVikxfv1O54jUDsrAC2WkyPZuxcgVXlsv70WiQK2cubZ7tqeJ2gu/pXYC7RH/luC20/so3b6JfejqcOWYCfiO/9nCHMnmfM5Tf2BuksYX4rTgWv8Px7VgKY0MWpvz24G0kq/5Pp64OQuXsV3JtcMjiZGenae251isWTXTFCShXBxAB927ef3DjJlo2yqR9Z7g/XgJ+D3+QX3/ECirXn8g4+JCx8QClT80OVs58am/vdi2ieWAEe1PJQSnsVM56tuMioJoFkAXswZ/gtu6Q1B8t2YUt4M/iE/EXvaR0SCzgkFjAobKAuZanRuwhR0A5STXxLWnv01L6tOlgEcxrAygC1AzpGybg3s0PPpRfdv0rTx0TkEKx6lTLf4XP5Nfn6MSEMcYL+S0io/Ri/Ep86CCgju5So0PEfgSGOcvDYCgWRrxICMgIw0T/5kSESQCSH35ybXTtb48qeb+ubnc1eWrePcGGQCVj8e5dLSvbb9Y7rQQIAnlBrQ+6j9CQRe47VYf1U0AdMRKuIaGGO6nOLwuiPw/gU6y/uP+FnP4mX9xvCJDjP/WUZ4pO2CRqLrKyRX7iB9BlbyLbPgHGJ0+p/vQxKMpDXTq52BG4mjflgdVgYCzOIfIWAb7hA0VEREREbAFDvDCtXDk4ZHke61/P+GhhsRXhffpBlx6ksJTfl/jRfATI1XwXvvzyq6/gEerOntK/gPzl1g24dw9u3KrTy9gNc1liSGR6oQneqN80htFw+MRgwP/hYiFMZV1jFG2CZGBJvfGF9rz+rvAP7Youh7KCKQtumnQjNmUvWVfBq84jXcdMBjt6c7BM0MGVcoyX8MRyWvZnEqBcLVRC6V78Nw1AE/D1N48ff/O17s9QQD7V7honoIxG6p2mYjEKHXhIRblUkWpfO1PrMYiAB2qvDje4VKy7CKDhJVeXpJe7e9qiloWs9U/N/FDY+m5T/KlMGiF3FQbkQIZZvtgHRRlABZ4ynhPYAiYTfF59fHKiwktNgNRfoCUwyjgNFuwiMfGm/7UNIP3LO1jPAZ/BrgQ8bTLkuVEe5n4CDuSvB+pfnawMbAgLZAEken3wYP/BCRw1FT5RvRutjwBqAd8W8jNTf63geFlgYRbXhEH63nw+Nwio7mz5Y7FYvP9wsXhIDjwsnXPAyYkaAHgSfDIcjtY4CZI54NtqDqgYUPrnRjh6S/V3oYsv9+AIMaAqOkDTXgYmAR99VP0jBuKcA4bZyckJnGAG6GNw3U+BZ+IZjv9p6LacTPSClZwB5b9UMwDGj/rX3foCfQwqiyjhmANgqIAJsN3DLgQQpMW9f1b7AZYzguYMK63lSapmysd16j//9W/zY11EMWtU0iBTS3pZfWCjvR+wfRw8f36AxOme4ip93DBGO2w8BiMiIiI6Y4hPR7/4Tk0x373Ydqc2iJcALxvh+3rW/X7b3doYrit1r1fCi/KJo75rG5jBDBf4j8WZEes7eTYr+J91r2hVvFQBVG0CrzQBr5ocxG2w+RG5poRtPdALVIaZeqbPvPWfIa6XCl9HjVPXg/UnpRdybRTl5i1SkF6YwuvBa3N3ljW3SQLkDKBC6JdG42YfJnhjrNRfby/mpv62o7vTdIr1ey2/vTYyzLZIQF7f79xNQE6GPMBxitOw/jYCUsNkioPmAyOcNgjIYDabbc7T1Qq7CeBlkP5Sd2NS7GwBm50ECwMoX5opdHiuCXiOMuX+CnB65zlgs9EanfTua/E+zkQKEQYMfjo/BYTY4BQ40wqXPTitxVOsI50DsJSv//T5VoP1H9SyLDz9YZt96NNqRURERERExBkjB5941oARcWRWekOiC3Z2qP7gEc+eACAUGAQUaSnOkI9S9c3IoELmWp6UmdzhbU5855wlQ7FDtkECTApMAsq0ps/F7ZHq0QwGATidE0CDRb4YYB7G3QgB+DAwJaBY/qg6WfwY4T5XGTABI4tOYY0NcZ1/P2AlAjZoASsRsGEL2OwcQLH1OWDDTwG+3rHlp0APsF0/ICIiIiLicsP/HtlFR/pfAT8+RGc3pZdydIk+J1e9Rwo/5uh9hnH+1PICRe2b0M8/aCv3Dkv4nyRAoNPJipURY4C+WarP67eT+4YUjoX4MRfH+G3r5UJGtOb7tVqRwXwg/zXHt2FunmdXMpjyQH0NeureZtW5+SN9h8ZTUKft9xwEFB+NluzXn68HCSSJulDL++pLf/6eSpdXkv2eElBYgMQxvuNqXlgap5MRAY9KNCbeUu4dRsUzcIrOvMhgdAiLoYOACzcJjgGOj47xtF8uR+iQFNb8Fy77hvFLeX9ensu35iMiIiIiOoO+HxCS6SGqtnLb9rrKIdD3A0IyPUbXVm7bXlc5eP+hwYtVZHqQsq3ctr2uchD0/YBXuoJaPlW+4Wkll0dpi/TnjQxUFs70Vzr9lbN9Ad50daKTpAvaf4Hfd/ABdAPQyHUlotoNPj3Fu8Oh/Dyd5ddb5LZ0vHtm/wlGf8RPP/0kzP4IcbLi/hqgd3odshq9p6TDuEMsv2AK+fMTAoL9EfV/h3xS6r8+AqboM+gsBNh+tlEo2L7FQnwWcCJK/VcmIDwE1KdvtTHx0BCBEIHeISVIfipLBk6a/EHQ9wMsk1o9CepJjE5SQGX3pGqdJGn7dJI102t+XLIaA40cxKYfY10fo23lMDbtyHR1pNrKYWzale3qSreVIyIiIiIiIjyoHIczk3sP8vcDw/IFJAD8BBRfWEHhJ0DQP3rYb5QfSQgemRAE9TeXTP78Xd8RLeDSzwGX/SkQERERERERsW4k58cTCJ6ChKz9QdeE/H2gPiMRgb6uQAC93+dJ/3VYANX3XOlvWkBxvL34chDQ7L2Z+hocqtIXdg7Iapj64zte6n9+bKCrBZT5z6/+XS3g3Ovf9Sng0P/CzgEBaP3Pjw0ELaANlN71/4iInuP/VPKCJpghgS4AAAAldEVYdGRhdGU6Y3JlYXRlADIwMTUtMTAtMTlUMjM6NTM6MjkrMDI6MDC1OmPTAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE1LTEwLTE5VDIzOjUzOjI5KzAyOjAwxGfbbwAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAASUVORK5CYII=)}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAADwCAMAAADYSUr5AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABLFBMVEXNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgoYgUqcAAAAY3RSTlMAWEd8IjKY4b3Ld2acsomqpVpOeudAQGVmhVOLRpGUY2NhTaBobXqbc6W/fcC8463l6eSBjl3f3eC51tvSxNXU12LacP4Nzplp+DgqFhzFedHjp4FYyJPQ2K/wzZCniLC7x6vHwZbrAAAAAWJLR0QAiAUdSAAAAAd0SU1FB98KExc1Hf/+/xAAAA+BSURBVHja7V0LYxvFEd67iyQsxycZJGgDCYrBKSR1WjdJX5RCGiJICzFpmxCamFLm//+H7t5rZ2f2oeNk6Wzv58T23D7nu9m9md09WYiIiIgeIIFk213Ysv7QcwY6dy8Bv/4JZkBl3iwhxAJBwSSA9sdIV6kJvgLAGgBPA6R88etGTYJaICcgof0x0ukdZATQ4rwBljnZIAOs/3YVPOmcQUFy+2u3ZU68mdYKZsG8i/QGcwvx3mFuAZ4ObN4C7KSwLvoIYKWBmYindmKCm58DVuDjTJ8CdAht/imwdVx2RygiIiIiIiKixzhzT3DLflDCojWgzntCS9DsRoCfsAZ86wFsQUjWvlFKLB1gBLAMNLsZLiasAUqAJ7pUtW8yGGL9t/fYk2xZUUk8xUVgCRAKAja2HMAtWNhs1ojWVlgPSMzafCNq2xZgReLpcff1AD5CtjoHhHHRnwIREREREREREdtDN8c/6JoG6+8ceHSsAPh2KrTI3bl//DgA61CgNvBf4eqRZOBZzOLgSrM34O2AJdXfvq0GH0EsnVXGNODNAUkER2LNKKuPFABX4grt83AZQgTwBSDwaxAu7sliKljlJmtWZnZaoZc/aw6vCXkHkLBZCGHcUtxvouEW2qgXHOOWM0TgTw/USG4HBG9IoAEQ1jbdqdt+Cpxx+fBjMiIiIiIiIuKyovux1I5uRmI5je6u0uaHBreqAs2368BKDfjjeba3aukAShd4c2oFr05ldgcnYN3e551kVbrbt8S3VAFf3WC9qYgfgbcneW8th90TLwGBs+HCamY+Brz8JZblnsDygxHO1uFwfYHtnRMLYuGwJRpnr2yIFTpgT7UyTGqn5S024C7OCGA94N0z0+kQCxNg74DzFq6UzAJmNwHWvXW+Q++8AWwIkCESHAL2UZ44czCGvYcDeB6LgQmzAsF26AMEkEmQpLJpKbSCQ9u33CN/sr0XDgJXCd4DFsAz93s9YNvvx0RERERERPQaZ/sU544KeVXWUmK9jkW4OmiXvaX+wK/g6M9aArO20n450ZhmBqfIdnb8G1/tAey0uOk7lnuTnrfDA66+JQMwhYURfXoJAXudXQlwv99dJHk+H8C2nmHuV7P++oKDuiy4iq+dgDrcdBGQWMJh3nVPPMXTbbvTQFLBnxnWSEFi6SELdwGbKHjHsKU2uiDiPbNiJYAOibWHd3pSU4sJLDoz3++3pBPBNuwxIYyfACEhwrvDXNFh0Sl5YyQQvYYOAYXWH/zrRxcQF12/iIiIiIiLjfScP8gsbgf4tquoN/xz9O/TVoB1m8X0vtLgbiCkpFKvKESvNkPY0WWB4hWlagopCobM+C6F0gJ0fmHdAmcE9mXYAI9e6PF6qb8RnRkEQEmCEc9SEeubQL8IsGy/c4JSIlMC8E9hid3QtaQZYn0ZAitYAMtvntgoCXJYAD2vUNPdG/2ZjmwOIDmsKzSpthI6B1gOyPTG/HWfDAn/cEz5KH9qVwgsvyls8LMyWzDA6Wh3k+gz0IekhwR0RRv9IyIiIiIuFzLlJ2Sr578ykLiyqd4NZedGQ1+ONwKeG+yUrpJLxYwmZ34+rogxwFhcIRWgErtS3BUOmSaKqxVIgVol2MvzIXL2it8NQgq3aMJPP9fitNJwaujb9JjKbGdrt0qvez0Yw2AA44HRAcGCCXrW1iqUFya2FpsgLc/ztAQhZGQQgBgAZaID3eKOQYCsel+icaWhtgDXfndZna5wAIM333wLMAGz2cz/BobABIgAAbsGgaBURxckIQkmpOygSfh8/vZ87rIAGAL6oRqu5gBAHTR6PC+KzzUBb77zi18aBFy7do0dj3fL5AIlQOn/LibANCmQ+ps2Bu+l6gs1eE3BaQH7SnUY7ut1gKyw/4YAVT9aYiur0xXKIXD9Oh4CMyFvgfzeFMiKr59JgNL/6o133QQk5IK8kiT7CQph4P3Fwj0HwL5kQOqPCSj+NQQUkyAi4KYqffNmfeGgnAQPiDqoACeAvaIhCAEf4PWJyfSq/J67CKANwocFUIOHh4egTZRZQLY/HMpveggUspuAwxLVhWQM74zHt2CM3xFCQ0he+FXxhfUdUAIGhAAwLGCi9fcQ0FT3UQFicoOGAGoB2X6B+hYxGdQcOwRjTI7HzVNgXLc/dloAJyA0BHB6OQfmTeaGgMxsr6mu9APgDeEAsQD62MtY/ZPyHuAqMv3oBq5wYNL7uBA/Fo4LlICCgVysD1k2LdDC12Mcmq5LODu0Wq6h2F2r/hERERERPcft2/70FLzr2gC2o48EmQ537xSPqTu1WAXbTYw9qeRJU7Z0TXZXloX4NelP7n2uyWhrTi7JxzbWP8s0AyPlRR6Nh9oP2ZFdnuw0jpyVikxfv1O54jUDsrAC2WkyPZuxcgVXlsv70WiQK2cubZ7tqeJ2gu/pXYC7RH/luC20/so3b6JfejqcOWYCfiO/9nCHMnmfM5Tf2BuksYX4rTgWv8Px7VgKY0MWpvz24G0kq/5Pp64OQuXsV3JtcMjiZGenae251isWTXTFCShXBxAB927ef3DjJlo2yqR9Z7g/XgJ+D3+QX3/ECirXn8g4+JCx8QClT80OVs58am/vdi2ieWAEe1PJQSnsVM56tuMioJoFkAXswZ/gtu6Q1B8t2YUt4M/iE/EXvaR0SCzgkFjAobKAuZanRuwhR0A5STXxLWnv01L6tOlgEcxrAygC1AzpGybg3s0PPpRfdv0rTx0TkEKx6lTLf4XP5Nfn6MSEMcYL+S0io/Ri/Ep86CCgju5So0PEfgSGOcvDYCgWRrxICMgIw0T/5kSESQCSH35ybXTtb48qeb+ubnc1eWrePcGGQCVj8e5dLSvbb9Y7rQQIAnlBrQ+6j9CQRe47VYf1U0AdMRKuIaGGO6nOLwuiPw/gU6y/uP+FnP4mX9xvCJDjP/WUZ4pO2CRqLrKyRX7iB9BlbyLbPgHGJ0+p/vQxKMpDXTq52BG4mjflgdVgYCzOIfIWAb7hA0VEREREbAFDvDCtXDk4ZHke61/P+GhhsRXhffpBlx6ksJTfl/jRfATI1XwXvvzyq6/gEerOntK/gPzl1g24dw9u3KrTy9gNc1liSGR6oQneqN80htFw+MRgwP/hYiFMZV1jFG2CZGBJvfGF9rz+rvAP7Youh7KCKQtumnQjNmUvWVfBq84jXcdMBjt6c7BM0MGVcoyX8MRyWvZnEqBcLVRC6V78Nw1AE/D1N48ff/O17s9QQD7V7honoIxG6p2mYjEKHXhIRblUkWpfO1PrMYiAB2qvDje4VKy7CKDhJVeXpJe7e9qiloWs9U/N/FDY+m5T/KlMGiF3FQbkQIZZvtgHRRlABZ4ynhPYAiYTfF59fHKiwktNgNRfoCUwyjgNFuwiMfGm/7UNIP3LO1jPAZ/BrgQ8bTLkuVEe5n4CDuSvB+pfnawMbAgLZAEken3wYP/BCRw1FT5RvRutjwBqAd8W8jNTf63geFlgYRbXhEH63nw+Nwio7mz5Y7FYvP9wsXhIDjwsnXPAyYkaAHgSfDIcjtY4CZI54NtqDqgYUPrnRjh6S/V3oYsv9+AIMaAqOkDTXgYmAR99VP0jBuKcA4bZyckJnGAG6GNw3U+BZ+IZjv9p6LacTPSClZwB5b9UMwDGj/rX3foCfQwqiyjhmANgqIAJsN3DLgQQpMW9f1b7AZYzguYMK63lSapmysd16j//9W/zY11EMWtU0iBTS3pZfWCjvR+wfRw8f36AxOme4ip93DBGO2w8BiMiIiI6Y4hPR7/4Tk0x373Ydqc2iJcALxvh+3rW/X7b3doYrit1r1fCi/KJo75rG5jBDBf4j8WZEes7eTYr+J91r2hVvFQBVG0CrzQBr5ocxG2w+RG5poRtPdALVIaZeqbPvPWfIa6XCl9HjVPXg/UnpRdybRTl5i1SkF6YwuvBa3N3ljW3SQLkDKBC6JdG42YfJnhjrNRfby/mpv62o7vTdIr1ey2/vTYyzLZIQF7f79xNQE6GPMBxitOw/jYCUsNkioPmAyOcNgjIYDabbc7T1Qq7CeBlkP5Sd2NS7GwBm50ECwMoX5opdHiuCXiOMuX+CnB65zlgs9EanfTua/E+zkQKEQYMfjo/BYTY4BQ40wqXPTitxVOsI50DsJSv//T5VoP1H9SyLDz9YZt96NNqRURERERExBkjB5941oARcWRWekOiC3Z2qP7gEc+eACAUGAQUaSnOkI9S9c3IoELmWp6UmdzhbU5855wlQ7FDtkECTApMAsq0ps/F7ZHq0QwGATidE0CDRb4YYB7G3QgB+DAwJaBY/qg6WfwY4T5XGTABI4tOYY0NcZ1/P2AlAjZoASsRsGEL2OwcQLH1OWDDTwG+3rHlp0APsF0/ICIiIiLicsP/HtlFR/pfAT8+RGc3pZdydIk+J1e9Rwo/5uh9hnH+1PICRe2b0M8/aCv3Dkv4nyRAoNPJipURY4C+WarP67eT+4YUjoX4MRfH+G3r5UJGtOb7tVqRwXwg/zXHt2FunmdXMpjyQH0NeureZtW5+SN9h8ZTUKft9xwEFB+NluzXn68HCSSJulDL++pLf/6eSpdXkv2eElBYgMQxvuNqXlgap5MRAY9KNCbeUu4dRsUzcIrOvMhgdAiLoYOACzcJjgGOj47xtF8uR+iQFNb8Fy77hvFLeX9ensu35iMiIiIiOoO+HxCS6SGqtnLb9rrKIdD3A0IyPUbXVm7bXlc5eP+hwYtVZHqQsq3ctr2uchD0/YBXuoJaPlW+4Wkll0dpi/TnjQxUFs70Vzr9lbN9Ad50daKTpAvaf4Hfd/ABdAPQyHUlotoNPj3Fu8Oh/Dyd5ddb5LZ0vHtm/wlGf8RPP/0kzP4IcbLi/hqgd3odshq9p6TDuEMsv2AK+fMTAoL9EfV/h3xS6r8+AqboM+gsBNh+tlEo2L7FQnwWcCJK/VcmIDwE1KdvtTHx0BCBEIHeISVIfipLBk6a/EHQ9wMsk1o9CepJjE5SQGX3pGqdJGn7dJI102t+XLIaA40cxKYfY10fo23lMDbtyHR1pNrKYWzale3qSreVIyIiIiIiIjyoHIczk3sP8vcDw/IFJAD8BBRfWEHhJ0DQP3rYb5QfSQgemRAE9TeXTP78Xd8RLeDSzwGX/SkQERERERERsW4k58cTCJ6ChKz9QdeE/H2gPiMRgb6uQAC93+dJ/3VYANX3XOlvWkBxvL34chDQ7L2Z+hocqtIXdg7Iapj64zte6n9+bKCrBZT5z6/+XS3g3Ovf9Sng0P/CzgEBaP3Pjw0ELaANlN71/4iInuP/VPKCJpghgS4AAAAldEVYdGRhdGU6Y3JlYXRlADIwMTUtMTAtMTlUMjM6NTM6MjkrMDI6MDC1OmPTAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE1LTEwLTE5VDIzOjUzOjI5KzAyOjAwxGfbbwAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAASUVORK5CYII=)}.ui-icon-blank{background-position:16px 16px}.ui-icon-caret-1-n{background-position:0 0}.ui-icon-caret-1-ne{background-position:-16px 0}.ui-icon-caret-1-e{background-position:-32px 0}.ui-icon-caret-1-se{background-position:-48px 0}.ui-icon-caret-1-s{background-position:-65px 0}.ui-icon-caret-1-sw{background-position:-80px 0}.ui-icon-caret-1-w{background-position:-96px 0}.ui-icon-caret-1-nw{background-position:-112px 0}.ui-icon-caret-2-n-s{background-position:-128px 0}.ui-icon-caret-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-65px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-65px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:1px -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-first,.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-left,.ui-corner-tl,.ui-corner-top{border-top-left-radius:4px}.ui-corner-all,.ui-corner-right,.ui-corner-top,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bl,.ui-corner-bottom,.ui-corner-left{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-br,.ui-corner-right{border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{-webkit-box-shadow:-8px -8px 8px #aaa;box-shadow:-8px -8px 8px #aaa}/*!
+* Copyright jQuery Foundation and other contributors; Licensed MIT */.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:after,.ui-helper-clearfix:before{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important;pointer-events:none}.ui-icon{display:inline-block;vertical-align:middle;margin-top:-.25em;position:relative;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-icon-block{left:50%;margin-left:-8px;display:block}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin:2px 0 0;padding:.5em .5em .5em .7em;font-size:100%}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:0}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{margin:0;cursor:pointer;list-style-image:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}.ui-menu .ui-menu-item-wrapper{position:relative;padding:3px 1em 3px .4em}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0}.ui-menu .ui-state-active,.ui-menu .ui-state-focus{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item-wrapper{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0}.ui-button{padding:.4em 1em;display:inline-block;position:relative;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:visible}.ui-button,.ui-button:active,.ui-button:hover,.ui-button:link,.ui-button:visited{text-decoration:none}.ui-button-icon-only{width:2em;box-sizing:border-box;text-indent:-9999px;white-space:nowrap}input.ui-button.ui-button-icon-only{text-indent:0}.ui-button-icon-only .ui-icon{position:absolute;top:50%;left:50%;margin-top:-8px;margin-left:-8px}.ui-button.ui-icon-notext .ui-icon{padding:0;width:2.1em;height:2.1em;text-indent:-9999px;white-space:nowrap}input.ui-button.ui-icon-notext .ui-icon{width:auto;height:auto;text-indent:0;white-space:normal;padding:.4em 1em}button.ui-button::-moz-focus-inner,input.ui-button::-moz-focus-inner{border:0;padding:0}.ui-controlgroup{vertical-align:middle;display:inline-block}.ui-controlgroup>.ui-controlgroup-item{float:left;margin-left:0;margin-right:0}.ui-controlgroup>.ui-controlgroup-item.ui-visual-focus,.ui-controlgroup>.ui-controlgroup-item:focus{z-index:9999}.ui-controlgroup-vertical>.ui-controlgroup-item{display:block;float:none;width:100%;margin-top:0;margin-bottom:0;text-align:left}.ui-controlgroup-vertical .ui-controlgroup-item{box-sizing:border-box}.ui-controlgroup .ui-controlgroup-label{padding:.4em 1em}.ui-controlgroup .ui-controlgroup-label span{font-size:80%}.ui-controlgroup-horizontal .ui-controlgroup-label+.ui-controlgroup-item{border-left:none}.ui-controlgroup-vertical .ui-controlgroup-label+.ui-controlgroup-item{border-top:none}.ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content{border-right:none}.ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content{border-bottom:none}.ui-controlgroup-vertical .ui-spinner-input{width:75%;width:calc(100% - 2.4em)}.ui-controlgroup-vertical .ui-spinner .ui-spinner-up{border-top-style:solid}.ui-checkboxradio-label .ui-icon-background{box-shadow:inset 1px 1px 1px #ccc;border-radius:.12em;border:none}.ui-checkboxradio-radio-label .ui-icon-background{width:16px;height:16px;border-radius:1em;overflow:visible;border:none}.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon,.ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon{background-image:none;width:8px;height:8px;border-width:4px;border-style:solid}.ui-checkboxradio-disabled{pointer-events:none}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-next,.ui-datepicker .ui-datepicker-prev{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-next-hover,.ui-datepicker .ui-datepicker-prev-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-next span,.ui-datepicker .ui-datepicker-prev span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:45%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:700;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td a,.ui-datepicker td span{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-datepicker .ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat;left:.5em;top:.3em}.ui-dialog{position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:20px;margin:-10px 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:0 0;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-n{height:2px;top:0}.ui-dialog .ui-resizable-e{width:2px;right:0}.ui-dialog .ui-resizable-s{height:2px;bottom:0}.ui-dialog .ui-resizable-w{width:2px;left:0}.ui-dialog .ui-resizable-ne,.ui-dialog .ui-resizable-nw,.ui-dialog .ui-resizable-se,.ui-dialog .ui-resizable-sw{width:7px;height:7px}.ui-dialog .ui-resizable-se{right:0;bottom:0}.ui-dialog .ui-resizable-sw{left:0;bottom:0}.ui-dialog .ui-resizable-ne{right:0;top:0}.ui-dialog .ui-resizable-nw{left:0;top:0}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-draggable-handle{-ms-touch-action:none;touch-action:none}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;display:block;-ms-touch-action:none;touch-action:none}.ui-resizable-autohide .ui-resizable-handle,.ui-resizable-disabled .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url(data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==);height:100%;filter:alpha(opacity=25);opacity:.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-selectable{-ms-touch-action:none;touch-action:none}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted #000}.ui-selectmenu-menu{padding:0;margin:0;position:absolute;top:0;left:0;display:none}.ui-selectmenu-menu .ui-menu{overflow:auto;overflow-x:hidden;padding-bottom:1px}.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup{font-size:1em;font-weight:700;line-height:1.5;padding:2px .4em;margin:.5em 0 0;height:auto;border:0}.ui-selectmenu-open{display:block}.ui-selectmenu-text{display:block;margin-right:20px;overflow:hidden;text-overflow:ellipsis}.ui-selectmenu-button.ui-button{text-align:left;white-space:nowrap;width:14em}.ui-selectmenu-icon.ui-icon{float:right;margin-top:0}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default;-ms-touch-action:none;touch-action:none}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-sortable-handle{-ms-touch-action:none;touch-action:none}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:none;background:0 0;color:inherit;padding:.222em 0;margin:.2em 2em .2em .4em;vertical-align:middle}.ui-spinner-button{width:1.6em;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top-style:none;border-bottom-style:none;border-right-style:none}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav .ui-tabs-anchor{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor{cursor:text}.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:0 0}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget button,.ui-widget input,.ui-widget select,.ui-widget textarea{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget.ui-widget-content{border:1px solid #d3d3d3}.ui-widget-content{border:1px solid #aaa;background:#fff;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAABkEAAAAAAy19n/AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0T//xSrMc0AAAAHdElNRQfgCQ4NIgiW7vkhAAAATUlEQVQY073OoQ2AQBAF0Z/p4qrZbuiMam414iQUQLKg+Sgc+pInR4yODWmKof1EgQM3XLjwhbvGjTtOnLjzrLhw4vrKwA0typx1++MFHrwm/bbhD4gAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTYtMDktMTRUMTM6MzQ6MDgtMDQ6MDBfRG64AAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE2LTA5LTE0VDEzOjM0OjA4LTA0OjAwLhnWBAAAAABJRU5ErkJggg==) 50% 50% repeat-x #ccc;color:#222;font-weight:700}.ui-widget-header a{color:#222}.ui-button,.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default,html .ui-button.ui-state-disabled:active,html .ui-button.ui-state-disabled:hover{border:1px solid #d3d3d3;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAGQEAAAAAAao4lEAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0T//xSrMc0AAAAHdElNRQfgCQ4NIgiW7vkhAAAATElEQVQ4y2N4l8fEwDCKRhF1EcOzZwzPjRie32Fi3MvEeIGJ8SsT4zcmRg4mRk4mxm9MjF+ZGB8zfGRmYljF8EmOiUF4wB08ioYEAgDUMBI63vAgyAAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNi0wOS0xNFQxMzozNDowOC0wNDowMF9EbrgAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTYtMDktMTRUMTM6MzQ6MDgtMDQ6MDAuGdYEAAAAAElFTkSuQmCC) 50% 50% repeat-x #e6e6e6;font-weight:400;color:#555}.ui-button,.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited,a.ui-button,a:link.ui-button,a:visited.ui-button{color:#555;text-decoration:none}.ui-button:focus,.ui-button:hover,.ui-state-focus,.ui-state-hover,.ui-widget-content .ui-state-focus,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-focus,.ui-widget-header .ui-state-hover{border:1px solid #999;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAGQEAAAAAAao4lEAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0T//xSrMc0AAAAHdElNRQfgCQ4NIgiW7vkhAAAAS0lEQVQ4y2N4+p+JgWEUjSIqo6+3GW57MTH+YWIUZ2I0Ybj/h4kph+HRByamdoanjxme+zExBjAxmjAx/mZiXMHEIDPwDh5FQwEBABzuEyBfPm9/AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE2LTA5LTE0VDEzOjM0OjA4LTA0OjAwX0RuuAAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNi0wOS0xNFQxMzozNDowOC0wNDowMC4Z1gQAAAAASUVORK5CYII=) 50% 50% repeat-x #dadada;font-weight:400;color:#212121}.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited,.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,a.ui-button:focus,a.ui-button:hover{color:#212121;text-decoration:none}.ui-visual-focus{box-shadow:0 0 3px 1px #5e9ed6}.ui-button.ui-state-active:hover,.ui-button:active,.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active,a.ui-button:active{border:1px solid #aaa;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAGQAQAAAABHIzd2AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QAAd2KE6QAAAAHdElNRQfgCQ4NIgiW7vkhAAAAEUlEQVQoz2NoYBiFo3AU4oAAlWjIAdM0sWkAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTYtMDktMTRUMTM6MzQ6MDgtMDQ6MDBfRG64AAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE2LTA5LTE0VDEzOjM0OjA4LTA0OjAwLhnWBAAAAABJRU5ErkJggg==) 50% 50% repeat-x #fff;font-weight:400;color:#212121}.ui-icon-background,.ui-state-active .ui-icon-background{border:#aaa;background-color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAGQEAIAAACwqkHPAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0T///////8JWPfcAAAAB3RJTUUH4AkODSIIlu75IQAAAI1JREFUSMftzyEKAkEUgOF/nmIQbIOIsKMGQRgxewjrVqtZMGnd+3gDwYN4hRV2i+MbweIVRMNLX/jTT77ppjkLABiGYRjfBtWU6prcffbuXvAESmHIjK0wYu52QkHkJBQs3VGYsKIiXzQ08dPIDz20U3FjFux5Rb22SfAEVwoDPGtB6ND/i2nDMIwf8gY8YSRTiOx5LgAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNi0wOS0xNFQxMzozNDowOC0wNDowMF9EbrgAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTYtMDktMTRUMTM6MzQ6MDgtMDQ6MDAuGdYEAAAAAElFTkSuQmCC) 50% 50% repeat-x #fbf9ee;color:#363636}.ui-state-checked{border:1px solid #fcefa1;background:#fbf9ee}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAGQEAIAAACwqkHPAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0T///////8JWPfcAAAAB3RJTUUH4AkODSIIlu75IQAAAIpJREFUSMftz7ENAWEYh/Hn/xYS51whVhCN1g5KI1jAAJbQ0ItEfRMYgA0uZvg+yR2J7j4FsYFQvNWveKqHtHjM7hMDAMdxHOfb0LZ1HQLJmnGckrJmFyvS8Da6ro0eW52NXKXCh4KjktHXm1ejVDRy7bkYmTY6GV1WOhgd5iwNKBj8xbTjOM4PeQJHLShkmp8JSAAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNi0wOS0xNFQxMzozNDowOC0wNDowMF9EbrgAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTYtMDktMTRUMTM6MzQ6MDgtMDQ6MDAuGdYEAAAAAElFTkSuQmCC) 50% 50% repeat-x #fef1ec;color:#cd0a0a}.ui-state-error a,.ui-state-error-text,.ui-widget-content .ui-state-error a,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error a,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:700}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:400}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon,.ui-widget-header .ui-icon{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAADwCAQAAABFnnJAAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QAIn/tYtYAAAAHdElNRQffBgEKJRWQ+SdFAAAaVElEQVR42u2dbZAlVXnHfw0kFCEsaAggLLsllQgmhsruQKV8SZWURe6Yqk3UcsndsYJEyQ7RCMYyO+Nmhg8MwtyJQV4kNbsFxqJqXrJLlEBVuKMCFsYtEHdXo4SYRGAW4q58iHH9kCKWdD706+nz2t33zr0zff5Tu/fefs45ffo8/z6n+zzPeU5wCR5NximDroDHYOEJ0HB4AohoE9IedCXWEp4AebRZApaaRIFeE2Dw90+bsHLOJWAXOgokJQ/+GnsIkQDmDjBM/0yw3T/6/GF89rY2je3ciRKrXUGk/uWYAqaSN1AfkSdALzrAXTVKSPIm92F51MkLAQHLwDIBgaHkOtc4dAjSeYDkEpP7QIcQpObJIyonqJQ/uct057edO6xZd9eSbde4jpD1AOYO0BWme9A+fERnN6nQXEq9e9M0BOVLrtfPDBmC0jOB5rvIdA9mjVr13rGXYL43zXU394FZybZ+Zl2hPAHMCAfeNG2WKhPMPAQlJQ/+GnuIXhNgvaPN0kZSrx2eAA2HnwlsODwBGg5PgIbDE6Dh8ARoODwBGg5PgIbD+wMU8w66/muMMv4Abh4BNmNM2+gPYD6DXT11/AHs5vCo7huKJOX8AdwsYOYm1Ctol+a7a9k29dtKXyp86kvfMN4Asj9ABP1seJLKZG/Ty225XfwBTLUzn92e34wwLjv53BAQ/QFU30UsO/UC6jT2+9PFH8B0/7nVTU+f0OptUOZM6wJVjEEmg+uw+wOYyGXrf5Ir9+ZgAwbfOHX9AQZd/zWGNwc3HH4iqOHwBGg4PAEaDk+AhsMToOHwBGg4PAEajtMGXYGhQzjAWf76c6Wl639avex9aYRB1iC01qC6KciecwBXLg4BIRht/S7xAcIKkrKoeg5b/SPVB8ZS7OSomtvtClxSlch7ipDAdvmBwwXo8wcODeRyCaHB2ONSv8AgEz/LnSOR2FvAfIVmAoWW3GC7iYX654cA18vXeevYGynoQQcfGi2RtlG0Tg3CNHeglObPrjpLcnvp6xAa5Oays6sz3wb5WgZQ9iEwdLh7bKlc2FntHndTbuBQuklBLuVWbQHTLehStr0NJHmZ18Csi3NJpZaZu0A7g81l2LpYty7adgfZzu7yEFkVdorb5UINyvQAbl1nvafcwLGX6VcdA2MH61Zu4JCmKszDtHkAVOY9TZNocBh0Ddbz+Svk9TOBDYcnQMPhCdBweAI0HJ4ADYcnQMPhCdBwiItDk2Cpg4M9Hng/4dICLhbRavlsa6Ndz1IKGQGShVEu4d6rNUDvUK0sW83dWsAUajazxrVL547slMmf/hralVsgLNQSUC8ONS/hdLFotxXHekcBXVluoSH09XdrAd052oXlte1SubMrsPVA9ZamSwt0xaVhLuHUbUuwdQtE3Txp7DXQlWMP4W6vuVtAerXFQFZtUJDbFpZnylGtTwyFks0GY53BOpDTlCWAewMEJfK61cDchC7nt6/t15/flttGAHsbmBVoJ4CZQBoClHsLyBqgiskiyJWhLj0UPk3nr4Ks3lWfIUxn3xVLkxFcHUHAdP4kp/oZwFZyFrvBtL65WMuS/gCmBhAfYEyXb66c6RJNZeQvze72pVKBnYCmK1guBJBYLl2CG0zqXU63vXGrJWWHADd3qtAaIsI8CtbJ7da86utwG4Pru7SZyqm+qY39GUAJHx8gj7Z1x6QNB0+AhsNPBTccngANhydAw+EJ0HB4AjQcngC9xiDN2RVQ9AewwWSvcrn0dk17d79Rv3aBZbJ7yK5d9gcwwWQxd5klTCx2uxwWmOpRd3GVeXl4YF3+alewLr+p9AEhmwjKV8se7VeebMwvjay2+7frRDOYLHa23IE2Xf6oztppWjwaOkndr3RNoH4G0DkdmO1V2dBQxWkhunPsblP6GAYhrra+oMRR1XlV57evbB5KFPcLyJqw7A7cxSEkKJE3kbotgbYv3q4eQsKkRlsP4V6yKUbAGiPrAfKGwipVs+0kYDe21h0dg1wPou4hxE9Vit7cxaoziL3HkKhfHAKW00qpOvCog4/cvdRYNvoDuFj77eEhzMh8AdQuFeamzwYhfXSRJGVQUppPUdWhpi9QWwNDbQfuYizVPQT2wtjq5rVY9UHT5SESsBB0aJTrAm8OFjE0XfNawc8EimiY+j0BGg9PgIbDE6Dh8ARoODwBGo7hI0BruKxlGx1FArjZsk0mm9BJqkvRorsmr2KDjoMwNCgXLt4lnHTAaI36dElI0jKmqxqyPsMG2gG8DkQCmGepzbPdyV3doqukQJhOlKrX7kVd/2iaoqvJn3yrFlQ93/u4bTW/wZERQAz3LiOzh+tCpgcEsfpXlOcyd+1R17/CqGHtbHJ29flFj4JiKW7hIxqHxBbgtrrdhMTXRqf+oi9OsRex/TYdlSXFdMXwEaZdzhuFvEtYgKymIvSuDG4OEXqnsiKBdC4Z6hrawieIBN9gW8DXQRYtPN9k+gAj9l0vXLeV0MkjCoTSc0RiCFZH5Rfr06uw8g1AmbeArIl1Pnm2LZlM8tFU2gUCaSAJcmdXPQOY/YnE8BEeKcT9Amyeaia3y7o7WaykZbu8RgaOxxIs45/6lRg2hxD9Q6RHXzBsO4f67nmNMXy2AI81hSdAw+EJ0HB4AjQcG4kAU+lMw1Rfyr+E7fHfkL061UFEgPm44VaZr1zSYxZLvw0hzwjeAmWVOMVM+n1GmXuqFj0u4Xmu5jCHuZrnlRSYstZ+dyzdrTmHXm7LCfcV/sxnSLUUzQOEPMJzwNmM5xJnr2Tz6fF93KApOpskOshOw8oiufQICzyXUyEs8gGhcWcK6ae5tYRcrKGqdrvZJ/weZ7/weztXM8sIcJhJvsIRbQuoz+FibtPv/GnbFDtKkbW87RrTKb+EAHMAPC4kX8kVLhPkGFs1zXsQlBQIGUm/H1Zc4re4IvdbJEBkCRhLZcUlYiHTAgWmmdGu39UZs0aE38UabucwI2wG3sKnGdEQ4DgAb6i4wigkmdIOnCX5FGYCFCkeQDYRlKi+W0wQ4zngKD/mS4bqb48/d2pTbDLkXuQ5gQBF7BNMyfuEvgrgVkgpMM2thR4ha0B9Q27iifT7Vco6bOZ8As401PLPDTJzD5jI1RtQB4pSylEsUf9n+GT+cDYT2LUUcJQfS2nEKpwb2/JChT9PhF8xlD/Gt4znf5LMZLyPJyUCZBSQO/8IrcKnXLv3G2s6yT9yN3Ajk8r8J4AXct9lTDOT/ltbJOq/nzNECrhOBavUX8TrATiF17QpzgHQPKDYeoCEArCPJ7VpAtA+5F1Z+CxiE5+Pv31IIb2IDjALTNJhhzQEFC2pVZeZ2qMk2FJ8geukY5H6D3IG8FGAeNAvYQuQ1V+8wHOsZfxS+m1Ektl6ALgkVvyTXMLzCvkUzzMPPMmUpg8w45e5Mf1WRJutPMxuJoFTCZnkTINDyTS3KpW0NfdPh+3YYEvxQQUBxtkH7ORg/Bw1x0QkqG4Mkvl9pjXP3fHniEJm6wEipUcUUL2GTQlyVS+wufCpaiKYJLrPxSFmK7OQey+Y1QwDEWZqdPGHa6ZQ+3Tsh5gCkFO/iQDTue9ypyOr/3E+I/ySYe4SzT3AtOI1r4wckiEq+yw20X4g5BeYkV4BI0oUj3QKV2d7yIPrc/9kLKZvObBYMYUeCQUE9Q+TP8AU8Obc7+cqdeN1EYJC/b0sPcJgzN672Seqf5gI4DEQbCRbgEcFeAI0HJ4ADYcnQMPhCbCx8ETOnuEEkQAth4XZerjsvOmGKaVFfTpny5bf8ucJhb+iZ8OBgvyA4rx5a/nuPsgBvmZpn05hfqEM3hn/mbHAAgvJj/xrYIsu08CMwjd/lffGM1CP8RXeyLjSnPsCO4GDvJErCsZacH/3TWz7YvppbomPRqXdrLD3HUx/7ZTyu9rjoxm+2b7IkzQBsCCYuwE67GGULjBKt/i+TosucJBrOMBOUK6feInNwMtcbGjdhXgyaZHHuT9PgEj9kTVNpkDILks0cNtcYbSe8Iu8jy/yPh5hh6aBpriVecYlm1625ap681WX7dv/i4v4EefzMps1i08n6RASMMGsVg4Y5E9zkk38jlKeNP8iMFayBRPpwdTcnpcfkIzwB7lGcf55xlnkAbqJv0XeHJxMp84wXSlQS35Jl9pyeAsvsspRjnOYHypTTDHDZm7g5T7MA77AhfyA8/gBF/GiNlU0lz5plCPa1AWc5IjWXJPcfWNK6ajQaroFcmpvi191OALwbuAsrgWgxUpGgGeE2fQZpnlGazbVYQVbMOebeYQdfJnf42u8U+FcNsUM+xjvi/rhjfwrv8F/8Ov8C9cpTCofAxJnqQlF/kQOGOSb2K5xfFkQFF+cy++wJy0/WiI7pzyLGlfxz7w99/sbCpeWDwNbgB3k/K0SAlxJ4kwRfd7aFxXcwov8N09xnKdYlaSJ+qeN5w4N9vDRNDyNqgd6ljfzPX6N7/Gb2UNQijZ3k9j7JxTGn0x+Kj83yLNnABHZ2Bvh6yXbbrRwTcUe4h1Cq7xDe/7CDZp/CEzuXrVP2gi7uYEPx+4cMjtDIa88wspum4EkN6m/GAJCNUYmBFhRyj/Mp5jkDj7B7fwtnxXkYxIlRJNQXXmm/uKjX4ZWYQhYMch10peJzN1F+QJj8dhf8OV0J4BblP4WyVBQPsQMYLj7k7eABKq3gNE0QpGaICLk95RP8jfG2tWRB4RG9dsfozMKqN4A7uDjPMg1wAHez518QpAuMMYj/JSxYt5ikKjsXb4sDhIS0qVLGHsG6y9RV7qp85/h5tyvm6X+ZJyo4+/G1zCukJt+wy6t+urLF63qj5y0oo59lNRlS8AKo6BZQP8zPh8/91/D5/mZIsUOxlgs5nU1B0/UmJ7wKIMOlHj4c0c0REkU9P4ADYe3BTQcngANhydAw+EJ0HA0jwCR2Vj1TtNJTbkfcyjnLOXRodse3oY8ASbSBqj+GlI9PkBdtAjT5VpHtF4NX43f//dIFPhr9rCf/XyEj3A3H5dyRq3zcPzrLOCs+C/CXj5HyC3cQsjn2CvlN4evKHozFP0ZZLkthRzpQZTHyF4DJ5jlGI8C13F6avaUC7Htsg398npfYIxJOkwwq5hUic58lO0cYZumFsmE7PXchzxT+Nb0+0meVcyFHuWbjDNJJy5HnA63m8OT2fuu0pBsnntVhc/sFlIEqaPMjCLkZ8hoLkdqzs7MwbPxLPERTudVad3LMGAMmOVyxoAxiQBH2QZsS9V/VFHC+fGnennq8/wiPwHO5v+U8m9yA+O8PrXpl+8nr4znL0NUs55TzKSrClW30AoP57wo5B4uouDlue8y/pifA/BSciA/BDwKHGEbR/lC6Utz31LGlFvZSaWI7Gxjue95bI9Vnqhftsm3eJexDv/LTwD4Ce9RSA8xTgi0Y/XL07ojuT81ZjTfo/rPADNsZ4QRpUdBix3APJFhV4Y53HdAl0k2s5WLuTjzGRLXBkbq366MFBQWvlUz9piqaEMnvvthUdk/bc/d/Sr1dwWfh+Jc+7OczAXCOSTlfzsdYA9b0Nn0NnGy9DVluCj9fBj4A0WKvwQiG8Y4kd1PREhGK/n2mQJ+CPycU9nMbTwWHc7vF/Aqp8dNt8qWCi5fGFO4OTyZzpC30queUb4Td38g+8WJ6lcpcII/yv26l/sNZ1cRLAqNEQ0eJ5UhcEaFUbs4xl8vHA+5X3oGyBuLj/Kp0s8AeyH2wljIWjcbAiY5nVf5JvOsskXRxWaB1tUh1/NHVSmCwp9ZqjrDbKy87HseifqjgWBzNsoBmcPbHKMEyvu3w4Nsi/9k9cMsR3kEeIzoSUPGCl/ma5zF6Up3rGlLgI1zOIf7OIfXxf+bsU1xLHkGuBz1DbWVU9nKVrYCe5MUeWNQxvFJ7SPgsL8FvMzFsW+syt5vc7I6wn8CFyr8aaJAWhOEzPE4XeRewLxljXh0N/sLKeYl87QYjy1ULCm/T9kDXE4UokvuAbIQUePs5bZ8lDB3DJIAZrToph3/S2wuWM3Vz93q2qvrHz1fvMofshI7Zmzip4W8y/w7z7GsbaWQIF0vsE+KQvb7zMQuedP8U6GPmVf4L4gUKaaQA/op4xd4c3AeO/gr4NM8opQucBb3xrRqcYi3SRTLQ0WAvFucnY5rAk+AhqN5tgAPAZ4ADYcnQMNRJMC8Nl74PXw7naT9NvcMuuIevYH4EPhvXAp8n8ukdF+S5scf4r2DrrxHfeR7gLu4FIBLuauQ6p5U/dkM3XuUvcBxwjhitgr/E/cgdkvj8Nkio2tL/o7XL244kCdACxhlFNnU+DZlXtXRC+J/apwdf+6x1KqjcNiAhbjxF7T5bCls8pDjqbuGrOI3aL6va2RDwF3cSLY07G5uEhpGk1s6Yp8JbMVbw+qRrJMVJ24XhCiZqtl8W4oFxriLB7iWmzQluAV0t13hukJGgGj8HyVaYCU+B4gXbmqGA+zUhCaIEKn/mCJccidWt1r9duVEKRZ5gGsZQ62+u2JXrzu5SVvCibQHawQBkiGgE4//3dhmdWnFUfgFspj5KnSBVxTxc5JOX6d+VzzACg8YpOJnBhcXlingBCc4AX3almoASHqAvBlENom49wA2RGt4i4sbM7Xr1T/4HuB47unmxEZ5Coh6gOxub+UeALOjTyvzqo52LM/4gWJjeJiI/XNMd/+i5rt4dIxuGoVHlt/EnWznTm4yxNq+wEmiT7XOkGwapZHGn3fwFwrpZwtr0LOS9D2D3pxs7/ztQRZsKWzykBPcG1vpjmvu8ao7gQwpIgIcVzI6380t0S5Il9mlyNNhj3H8NvkT2PIOBzYkAVwwy++mb/6H+Lpxx4yNjMYSwGNDwlsDGw5PgIbDE6Dh8ARoODwBGg5PgCI6RptAx2oxWGfIEyBk1WIC6t2WEIPCMzxjlHeMvgodqyfDuoPYA2xhj5UEamTkaWlL6LAaWxo6rEoUEul3QCE/IJSkoqB+aXmS7wquMFyfu/pdvJrWBYqxgiMcY1k5JauPJhwK+UKKc/pR4wVAhzZbonMbSjjATkke+Rno8otXoN+tQycVg1HbpRtkRlBNAFDvOGEjACTOHqJRKPu1GisPSwk6Aujzi2X0QsV6aahYfLlOoX4IPMacwatHj2PMpeqfyzVQwFx8dCtzHHMoQQdb/rXBhlB9BJkAkQrK2+SSfC1WmZP23JggYI5VWkxoleh25onKJDDFHoikc8a8eWloSLuuIA4BurE/S6HfUWD4Ye7kI2TPKuWl6xL5GEH2CwucUw4jXGo9gclp3Sxdl/Dm4IbDzwQ2HJ4ADYcnQMPhCdBweAI0HEUCmNbeemxAZARo8RAA5/EhTaz9yM72VY3UY10iIUCLbhp+9FK6SiVPMsch3kXXYaK4aJA9UIgEfmCN5R4aJBNBR9jGU7yVkK9yNaEyHHKEFvvZYggmG0EOVFr8LQZK7LfcQ4OIAC26vML5wFc4wgQ/4jzFGt4QOMq93M8qWzQbmEbpVJFqR+Jw6ps4ySYpnnbIVTzBVbmA62r5E2ksfpV8hMPxPxTxuj0UiGwBVwLfBeBqAL7Lu7hSUvAklzPGfcBuunxUSwA1LgMuBOACTlGsRYyCy1zAKcBrireTC+N/lwGvKcq/AHhTLH+Tf7txRbEHiKDuAZKUx9jKEbZpwyGrewBxffFnpS68v3IPDZJngFW2pIumFxhTBnGJjMDzjHM9VzJeigAH2Cn8Lvob9VvuoUFCgGivgFf4Lr/Feah3DMi8AeaAPcp9rsKN5TC18ZHfNu5P4jhB3+fvNorPq4cN3h+g4fBPyw2HJ0DD4QnQcHgCNBwZAWz7AdSVz/KNVP4Nxb5//Zb3+/oGLa+I5C3Ath9AXbktzFy/5f2+vkHLK+PU1wHcw7WS5DLO5dH4e135HfypJH8LZ6eTzf2W9/v6Bi2vgWgIyCL/55dNvU3xLY+ifDndWnZZmz8w5LeVXyyhH/lt12+rvzn/CWFhmi6/SZ6vhfqqS6IYKlYdDNoWSjZb/bsE7EK9Orhu+S757eWrwmG75g9QLzALS/wOc6XI8oMA7NS2X3L0U9xGT1Zo5Qkg77UbKH/p5Mm4m43H6gbWNZC9/EBZmqsC7OWbCVC/fYL0eDV5suNvpP6eEOC0+kXk8Fru//IIrT2CGfnl6FVKyK98rJI/dMhrM5M9aJDt5XZuJ1N/T9DrIWAB+ADVh4D6Xby+fnIJ1bpwU/luPYith9Kdfy+3C+rvQQ8QPQTa9gNwky8BY4zF3/Ly/E7YoeLokZzUJscoRykX6x9KR58WJDZ51fZJri+sLL9NUL/6rCUREeCQUIEEhxTf8ijK22kDtrX5Q0N+W/nFEvqR33b9tvqb8heDV5WVA0Lnr77qkojmAVa4jLcUJMu5nX3qyh/lt6XNKB/ig2sm7/f1DVpeAxEB4B84g1O4OD56iEX+TEhXV/73nMvpqSvod3gwp561kPf7+gYtrwzvENJweGtgw+EJ0HB4AjQcngANhydAw+EJ0HDkjUHum6cPp9yjAkRr4Ej67bAydV25x9BBHgLqqe6wtYR6d25QuwQPAUUC2BR4mMNGeRKeQQebAnWxvBOEFW39HhoUCTACRgWOMGKURxE69AgxO0yYNnwBu0OFR0nIQ8BIhVLE3OYS6t2/NgJ5lIR+y5jhe8r3bwF9QJn9AoZd7lEBfiKo4fAEaDg8ARoOT4CGwxOg4fAEaDjWLwHafkKoFxAJUH+eLWSKkKm+17vNkhAAwqMiRALsiv8NGra7O1L/8qCruREgEmCJZF3fIGG7u736ewjXHiCkLf0rh1D6UyNSr56Gifr9M0BPIHoELbHMkvLeCoDlwr9ymHZKlah/l1G+7J8BegWRAKYeYFeqmuRfORLMSEfkeP7tXPmq0kX1+0GgBxDXBtYP9B4yzYxyswb5zaCYJq9+VR28+vsA1x6gPuz7d5RTf1uTzqMUhuktIGA5/idDpX7/DNADiENAm2XaQ9m5hnGnX/z0qAkfH6DhWL+2AI+e4P8BepjE/N9O74IAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTYtMDktMTRUMTM6MzI6MzktMDQ6MDB6ohKoAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE1LTA2LTAxVDEwOjM3OjIxLTA0OjAwKEFuvAAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAASUVORK5CYII=)}.ui-button:active .ui-icon,.ui-button:focus .ui-icon,.ui-button:hover .ui-icon,.ui-state-active .ui-icon,.ui-state-focus .ui-icon,.ui-state-hover .ui-icon{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAADwCAQAAABFnnJAAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QARaw7li0AAAAHdElNRQffBgEKJRWQ+SdFAAAalUlEQVR42u2da4wlR3XHf207sQjx2iHEXuz1rnASbBIw2RlbEY9IWMi5k0ibAPI6dwcFCDg7DoSnyM7gzPiDZzFzh8T4gaNdyybI0jyy6wCxpfgOxhiZsALM7PKMQxJsZnHYhQ8hLB8iB+HOh+pXdderu++de+d2/Ud3bt8+VdVVdU49us6pU8G1eDQZZw06Ax6DhReAhsMLgIw2Ie1BZ2Iz4QUgizYrwEqTRKDXAjD49tMmrBxzBdiHTgTilAdfxh5CFgBzBxgmfybY2o8+fhg9va0NY3t2zMRqJRDsX41EwJTyCPURWQHoRQe4r0YKcdy4HZZHnbgQELAKrBIQGFKuU8ahQ5CsA8RFjNuBDiEUqicLkU5QKX7cynTPtz07rJl315RtZdxCSHsAcwfoClMbtA8f4ukmFppTqdc2TUNQNuV6/cyQISi9EmhuRaY2mFZq1bZjT8HcNs15N/eBacq2fmZLobwAmBEOvGrarFQWMPMQFKc8+DL2EL0WgK2ONiujxF47vAA0HH4lsOHwAtBweAFoOLwANBxeABoOLwANhxeAhsPbA+TjDjr/m4wy9gBuFgE2ZUzbaA9gfoKdPXXsAezqcJH3kRKScvYAbhowcxXqGbRPc+2ato39ttRXct/61EfGGqBoDyCgXw2PQ5n0bXq6LbaLPYApd+an2+ObEUZpx98jAdkeQHUtY9WpF1CHsbdPF3sAU/tzy5tefEKrtUGZJ20JVFEGmRSuw24PYBIuW/8Tl9yrgw0YfOXUtQcYdP43GV4d3HD4haCGwwtAw+EFoOHwAtBweAFoOLwANBxeABqOcwadgaFDOMBV/vprpaXzf0696H2phEHmILTmoLoqyB5zACWXh4AQjLp+F/8AYQVKWVR9hi3/gvWBMRW7cFSN7VYCl1Al4p4lBbAVP3AogD5+4FBBLkUIDcoel/wFBpr8Xe4ZMcVeA+YSmgUotMQGWyOW8p8dAlyLr7PWsVdS0IMOPjRqIm2jaJ0chEnsQEnNPl31lLh56fMQGujmtNPSmZtBNpcBlJ0Ehg6txxbKRTqrtXE35gYOqZsY5JJu1RowNUGXtO11UKCXeQ1MuziXUGqauQu0S7A5DVsX69ZF21qQ7ekuk8iqsIu4nS7loEwP4NZ11pvlBo69TL/yGBg7WLd0A4cwVWEeps0DoDLuOZpAg8Ogc7CVn18hrl8JbDi8ADQcXgAaDi8ADYcXgIbDC0DD4QWg4ZA3h8bOUgcHuz/wfsKlBlw0otXi2fZGuz6lFFIBiDdGubh7r1YBvUO1tGw5d6sBk6vZVBvXLh1b6CnjP30Z2pVrIMzlElBvDjVv4XTRaLcV93onArq03FxD6PPvVgO6Z7Rz22vbpWKnJbD1QPW2phc26Mpbw1zcqdu2YOs2iLpZ0thzoEvH7sLdnnM3h/RqjUGRtUGObttYnjJHtT8xlFI2K4x1CuugGKasALhXQFAirlsOzFXo8nz73n79822xbQJgrwMzA+0CYBYgjQCUewtIK6CKyiLIpKFOPZS+Tc+vgjTfVecQpqfvi6jxCK72IGB6fhxTPQewpZz6bjDtb87nsqQ9gKkC5AmMqfjmzJmKaEojWzS72ZeKBXYBNJVgNedAYrV0Cm4wsXc1OfbGLZeUHQLczKlCq4sI8yhYJ7Zb9arL4TYG1zdpM6VT/VAb+xxACe8fIIu29cSkkYMXgIbDLwU3HF4AGg4vAA2HF4CGwwtAw+EFoNcYpDq7AvL2ADaY9FUuRW/X1Hf3G/VzF1gWu4es7EV7ABNMGnOXVcJYY7fPYYOpHnU3V5m3hwfW7a92Buvim1IfENKFoGy27N5+i4uN2a2R1U7/dl1oBpPGzhY70IbL3tVpO02bR0MnqntJNwXqOYDO6MCsr0qHhipGC6Ll2M2m9D4MQlx1fUGJu6rnqp5v39k8lMifF5BWYdkTuPNDSFAibkx12wJt37xd3YWEiY22HsI9ZZOPgE1G2gNkFYVVsmY7ScCubK07OgaZHkTdQ8jfqhC9acWqJ8i9x5CwXx4CVpNMqTpw0cELcy81Vo32AC7afrt7CDNSWwC1SYW56tNBSO9dJA4ZlKRmQ1Q1qOkL1NrAUNuBuyhLdZPAXihb3awWq040XSaRgEVAh4a5LvDqYBlD0zVvFvxKoIyGsd8LQOPhBaDh8ALQcHgBaDi8ADQcwycAreHSlo068gLgpss2qWxCJ6ouRIvupryKDdoPwtCgnLt4F3fSARM18tMlFpKWMVxVl/UpRugE8DqQBcC8Sm1e7Y5bdYuuUgTCZKFUvXdPdP0TSYiuJn58Vc2perb3cTtqfsSRCoDs7r2IVB+uc5keEETsX1M+y9y1i65/jQnD3tn46ernyxYF+VTc3Ec0DrGv4LTKzB6vbZqsmP3Vx/E1J1fOOm29ziIgtlZI6SN0BHwdZE3Cgtx/FfSmDG4GEXqjspge9x86kwx1Dm3uE+TWP2JHwNdB6i08W2V6ByP2Uy9cj5XQ0YUIhIV5RKwIVnvll/PTK7fyDUCZt4C0inU2ebYjmUz0iYTaBYLCPCLIPF01EJntiWT3ER4J5PMCbJZqJrPLuidZrCVpu7xGBo73YqziZ/1KDJtBSKh9h/DoC4bt5FDfPW8yhk8X4LGp8ALQcHgBaDi8ADQcoyQAs8lKw2xf0r+MsejvskEXtXcQAnAoqrgNDlVO6VGLpt+GkCcka4GyTJxlPrmeV8aerSUel/EU17LOOtfylFIEZq253x9R92ueoafbYsK9uT/zExIuiXWAkId4EjifqUzg9JXsUHL/MDdqkk4XiY6y17CzqJi6wBJPZlgIy7xJqtz5XPg5DpagyzlU5W4/h6XfU9wj/R7jWhYYB9aZ4RGOa2tA/QwXZ9L6kz9th2KLEGnN28qYLPnFArAIwOek4GuZxIsCcpJdmuo9CkoRCBlPrtcVRfwqV2V+ywIgNAGTCS2/RSxkThKBOea1+3d1yqxx6Xc+h2OsM84O4GV8iHGNAJwC4EUVdxiFxEvagTMlG8IsAHkRDyBdCIpZ380HiPAkcIIf8ylD9sei773aENsMsZd5UhKAPA5L278PS30VwEFIRGCOg7keIa1AfUVu47Hk+hplHnZwEQHPN+TyLw00cw9oVscHilTKiVjM/r/hA9nb6Upg15LACX5cCCNn4YWRLi9U2PMI/Koh/Um+anz+46Qq48M8XhCAVASKnb9AK/ddzN11xpzO8E/cCbybGWX808DTmesi5phPPpuLmP338TxZBFyXglXsz+MFAJzFc9oQFwBoJii2HiAWATjM49owAWgneVfnvvPYxsejq7cpqJfQARaAGTrsKQwBeU1q1W2mdi8JthCf4K2Fe4L9R3ke8E6AaNAvoQsosj9fwAusafxScjVeoNl6ALgsYvzjXMZTCvosT3EIeJxZTR9gxi/z7uQqjza7eJD9zABnEzLD8w0GJXMcVDJpV+ajwxg22EK8RSEAUxwG9nI0mkctMi0I1ZVBRfl+vjXOndH3uIJm6wEE04UIqF7DZiW6qhfYkftWVRHMINq5PMTsYgEy7wULmmFAYL5GF79eM4TapuMeiEQAMuw3CcBc5rrY6RTZ/zn+RvpVhLlLNPcAc4rXvDJ0iIeo9DtfRfcAIb/AfOEVUIhE/k4nVzrbJA9uyHyKWE7ecmC5Ygg9YhGQ2D9M9gCzwEszv5+s1I3XRQgK9vcydYHBqL33c1hm/zAJgMdAMEq6AI8K8ALQcHgBaDi8ADQcXgBGC49l9BlOkAWg5bAxWw+XkzfdMKvUqM9ldNnFt/xDhNJf3rLhSI5+RPHcrLZ8fx/oAJ+31E8nt75QBq+N/sxYYoml+Ef2NbBFlzlgXmGbv8EbohWoR3mEFzOlVOc+zV7gKC/mqpyyFtzffWPdvhx+jluiuyK1mxX6vqPJr72F+K76eLHCt9AXehwmAJYkdTdAhwNM0AUm6Obf12nRBY5yPUfYC8r9E99nB/AMlxpqdylaTFrmc9yXFQDBfqFNK4pAyD6LN3DbWqHYT/hJ3sgneSMPsUdTQbMc5BBTBZ1eeuSq+vBVl+Pb/4tL+CEX8Qw7NJtPZ+gQEjDNgpYOGOhf5gzb+F0lPa7+ZWCyZA3G1KOJuj1LP1JQwh/lesXzDzHFMvfTje0tsurgeDl1nrlKjlqyW7rUmsNb+B4bnOAU6/xAGWKWeXZwI8/0YR3waS7mu1zId7mE72lDibX0GSMdWacu4QzHteqauPVNKqkTUq3pNsiprS1+zeEOwB8A5/FmAFqspQLwhLSaPs8cT2jVpjqsYXPmfDMPsYfP8Pt8ntcqjMtmmecwU31hP7yYf+W3+A9+k2/wVoVK5V1AbCw1rYgf0wEDfRtjGsOXJYnx+bX8DgeS9MUW2UXlU9S4hn/h1ZnfX1SYtLwd2AnsIWNvFQvA1cTGFOL7YF9YcAvf47/5Eqf4EhsFasz+OeOzQ4M+fCJxT6Pqgb7NS/kWv8G3+O10EpSgzZ3E+v5phfInpZ/Nzw30dA4gIx17Bb5Qsu4mcmXK9xCvkWrlNdrn5xpodhIYt161Tdo4+7mRt0fmHEXpDKW4xRG2aLYZFOgm9uddQKjGyFgA1pT0t/NBZriN9/Nh/o6PSvTJgkjIKqG69JT9+alfilZuCFgz0HXUZxDq7jx9iclo7M/ZcroLgJuX/hbxUFB2DiEYrG/98VtADNVbwETiokYtIDKK7ykf4G+NuatDDwiN7LdPo1MRUL0B3MZ7eYDrgSNcx+28X6IuMclD/JTJfNy8k6j0Xb4sjhIS0qVLGFkG64uoS93U+c9zc+bXzYX+ZArR8XejMkwp6KbfsE/Lvvr0ZSv7hZGW6NgnSEy2JKwxAZoN9D/j49G8/3o+zs8UIfYwyXI+rqs6eLrG8oRHGXSgxOTPHWKIKoigtwdoOLwuoOHwAtBweAFoOLwANBzNEwChNla903QSVe67HNI5T3l36I6HtyErANNJBVR/DanuH6AuWoTJdq3jWquGz0bv/wcKIvARDnAP9/AO3sGdvLcQU9TOg9Gv84Dzoj+Bm/gYIbdwCyEf46ZCfLP7irw1Q96eoUi3hSh6epDpEdLXwGkWOMnDwFs5N1F7FhOxnbIN/bJ6X2KSGTpMs6BYVBFPPsEYx9mtyUW8IHsD91JcKXxlcn2GbyvWQk/wFaaYoROlIy+H29Xh8ep9V6lINq+9qtxndnMhgsRQZl7h8jNkIhMjUWen6uCFaJX4OOfybGHfyzBgEljgSiaByYIAnGA3sDth/wlFChdF3+rtqU/xi/wEOJ//U9K/wo1M8YJEp1++n7w6Wr8MUa16zjKf7CpUNaE1HsxYURR7OCGCV2aui/hTfg7A9+Mb2SHgYeA4uznBJ0oXzf1IGVNsZSeVQOjZJjPXWYxFLI/ZX9TJt3idMQ//y08A+AmvV1CPMUUItCP2F5d1xzN/asxrrkX+54F5xhhnXGlR0GIPcAih2C3C7O47oMsMO9jFpVya2gzJewMF+8eUnoLC3FU1ZY8pizZ0otYPy8r+aSzT+lXs70o2D/m19m9zJuMI51gh/qvpAAfYiU6nt40zpcuU4pLk+0HgjxQh/goQOowphN5PRkgqVsXmMwv8APg5Z7ODW3lU3M6eF/As50ZVt8HOCiZfGEO4GTyZnpDV0qvmKF+Puj8o2sXJ7FcxcJo/yfy6m/sMT1cJmHCNIQaPM0oXOBPSqJ0f42+Q7ofcV5gDZJXFJ/hg6TnATRBZYSyltZsOATOcy7N8hUNssFPRxaaO1tUu17N3VSGC3J+ZqnrCQsS89DqLmP1iINiRjnJAavC2yASBsv12eIDd0V+R/bDACR4CHkXMNIpY4zN8nvM4V2mONWdxsHEBF3AvF/Ar0X8zdivuxXOAK1E3qF2czS52sQu4KQ6RDgHC/4XoBGeGcAooNkfP0OEbLCg2Rwv2P8NYZBub9wIg2G+auN3KdfwncLGC/QCPME3IOh+hy26t5d9DmtQPZpxG7C/sPz4cba5P/x/OhdiR21Re9HKQtZRSW00pPCOU1QYO8jXQjBbdpOP/PjtyWnP1vFude3X+xfziWf6YtcgwYxs/zcVd5d95klVtLYUEyX6BwwUvZH/IfGSSN8c/5/qYQwr7BdllXz5E0aGf0n+BVwdnsYe/Bj6kacVLnMfdkVi1OMarCiKWhUoAsmZxdnHcFHgBaDiapwvwkOAFoOHwAtBw5AXgkNZf+F18LVmk/Rp3DTrjHr2BvBT8b1wOvJYrCuE+Ja2Pv4JXsIM3DDrzHvWR7QHu4HIALueOXKi7EvanK3SvV/YCpwgjj9kq/E/Ug9iXmYZxIepURlF1qn5yw4GsALSACSYoqhpfpYyrurs9+qhxfvR9wJKrjsJgA5aiyl/SxrOFsNFDTiXmGkUWv0hzvaWRCoBo/2usUewD0kXPrJrW7tU2j4DA4VxQsU82LwLp5sZJDQNtIZaY5A7GuUObAmxnPhISvRiPFNKFIDH+TyA2WH1HmgfIHi5N/i6PsFfjmkBALKKeVLhL7kTr9PE26fy6vd0Rawgscz9vZlIZIuSOyNTrdt6jTeF0wvoyJ3psWcQ9QCca/7uRzuryiqPw06Q+81XoAj9S+M+JO30d+11xP2vcb6DK3ylcTFhmgdOc5jT06ViqASDuAbJqkKJKxL0HsEHs4c1vbkzZrmf/4HuAU5lh4fSozAJED5C29lZmApje/bIyrupuxzLHDxQHw8N0ZJ9jav3Lmmv57iTdxAtPkf4ebmeM23mPwdf2difKyMwQ4kOjNNTo+zbep6B+NLcHPU1J3zPo1cn2zt/uZMEWwkYPOc3dkZbulKaNVz0JZEghBOCUUqKz3dwK7Rx1lX2KOB0OGMdvkz2BLe5wYCQFwAUL/F7y5n+MLxhPzBhlNFYAPEYSXhvYcHgBaDi8ADQcXgAaDi8ADYcXgDw6Rp1Ax6ox2GLICkDIhkUF1LsjIQaFJ3jCSO8YbRU6VkuGLQe5B9jJAasQqJEKT0ubQoeNSNPQYaMgQrL4HVHQj0gpqURQv7U8jncVVxnK585+F6umLYG8r2CBk6wql2T13oRDKV5Ifk1fVF4AdGizUzzbkMIR9hbows5AF18ugf60Dh1VdkZtp47IiqBaAEB94oRNACA29pCVQumvjYh5WFLQCYA+vpxGL1isp4aK7ddbFOpJ4EkWDVY9epxkMWH/YqaCAhaju7tY5KRDCjrY4m8ORoL1AkUBECwor5OL47XYYLFw5sY0AYts0GJay0S3J09XFgKT7wFBXTTGzVJDQ9gtBXkI0I39aQj9iQLDD3MnL5DOVcpTtySyG0PsBQucQw4jXHI9jclo3UzdkvDq4IbDrwQ2HF4AGg4vAA2HF4CGwwtAw5EXANPeW48RRCoALT4NwIW8TeNrX+jZPquhemxJxALQopu4H72crpLJMyxyjNfRdVgozitkj+Q8gR/ZZLqHBvFC0HF28yVeSchnuZZQ6Q5ZoMU97LQ6ky26Ks7/lh0l9pvuoYEQgBZdfsRFwCMcZ5ofcqFiD28InOBu7mODnZoDTEU4la/q8cid+jbOsK3gTzvkGh7jmozDdTX9scQXv4o+znr0QeGv20MBoQu4GvgmAKJD+Cav4+oCg2e4kknuBfbT5Z1aAVDjCuBiALZzlmIvonAus52zgOcUbycXR58rgOcU6W8HXhLRX+LfblwhBOAJ4OWZuy+P7snoAPfT5WZ2cYI9yvT0ZhIXSr8+Gnm2T7Gd92XEoki/kPdFH1N8EWa7gu6hRDwH2GBnsml6iUmlExehBD7EFDdwNVNaf9iqIeAIe6XfeXujftM9NIgFQJyH8SO+ycu5EPWJAak1wCJwQHnOVThaBlOjj+yxcX8W+Qn6Dn8/KjavHjZ4e4CGw8+WGw4vAA2HF4CGwwtAw5EKgO08gLr0Bb6Y0L+oOPev3/R+l2/Q9IqI3wI+VTgv99PSeQB16TY3c/2m97t8g6ZXxtm/DnAXby5QruCFPBxd16Xfxp8X6C/j/ESb0G96v8s3aHoNiCEg9fyf3Tb1KsVVFnn6anK07Ko2fmCIb0s/n0I/4tvKb8u/Of5paWOaLr6Jns2FutQlkXcVq3YGbXMlm+7+XQH2od4dXDd9l/j29FXusF3jB6g3mIUlfoeZVIr0owDs1dZffPeD3EpPdmiptobli5mno6GH0bhbHI/z6YSa++b07QWOeyBb7EArci6p6/Lnkn6I2bPAdcYc3MStGfb3BOfUTyKD5zL/yyO09ghm9IbB+gZgz789rk1N9oCBdhMf5sP0lP29HwKWgDdRfQio38Xr81dMoVoXbkrflL/i+Qvl6EIEsuzvwRAgJoG28wDc6CvAJJPRVZaePQk7VNw9nqHa6BjpKOly/sPC3S9LFBu9av3E5Qsr02+V2K9+akkIATgmZSDGMcVVFnl6O6nAtjZ+aIhvSz+fQj/i28pvy78pft55VVk6IHX+6lKXhFgHWOMKXpajrGZO9qlLf5jfKRxG+Wnesmn0fpdv0PQaEAIA/8jzOItLo7vHWOYvpHB16f/ACzk3sfn7Og9k2LMZ9H6Xb9D0yvAGIQ2H1wY2HF4AGg4vAA2HF4CGwwtAw+EFoOHIKoNsp/MOO92jAmRt4Hhyta4MXZfuMXQoDgH1WLduTaFeyw1qp+AhIS8ANgaus26kx+4ZdLAxUOfLO0ZYUdfvoUFeAMbByMBxxo104aFDjxCzwYTpwBewG1R4lERxCBivkIoc25xCvfZrEyCPktAfGTN8s3z/FtAHlDkvYNjpHhXgF4IaDi8ADYcXgIbDC0DD4QWg4fAC0HBsXQFo+wWhXkAWgPrrbCGzhMz2Pd9tViQHEB4VIQvAvugzaNhat2D/6qCzOQqQBWCFeF/fIGFr3Z79PYRrDxDSLnzKISz8qSHYqxfDmP1+DtATyBZBK6yyomxbAbCa+5SDm/v2mP37jPRVPwfoFWQBMPUA+xLWxJ9yQjBfuFM80qWdSV+Vusx+Pwj0APLewPqO3kPmmFee11N8M8iHybJflQfP/j7AtQeoD/sRTuXY39aE8yiFYXoLCFiNPkWo2O/nAD2APAS0WaU9lJ1rGHX6+W+PmvD+ARqOrasL8OgJ/h+DVadYm94w9wAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNi0wOS0xNFQxMzozMjozOS0wNDowMHqiEqgAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTUtMDYtMDFUMTA6Mzc6MjEtMDQ6MDAoQW68AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAABJRU5ErkJggg==)}.ui-button .ui-state-highlight.ui-icon,.ui-state-highlight .ui-icon{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAADwCAMAAADYSUr5AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABLFBMVEUug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8ug/8p2Tp3AAAAY3RSTlMAWEd8IjKY4b3Ld2acsomqpVpOeudAQGVmhVOLRpGUY2NhTaBobXqbc6W/fcC8463l6eSBjl3f3eC51tvSxNXU12LacP4Nzplp+DgqFhzFedHjp4FYyJPQ2K/wzZCniLC7x6vHwZbrAAAAAWJLR0QAiAUdSAAAAAd0SU1FB98GAQolFZD5J0UAAA+BSURBVHja7V0LYxvFEd67iyQsxycZJGgDCYrBKSR1WjdJX5RCGiJICzFpmxCamFLm//+H7t5rZ2f2oeNk6Wzv58T23D7nu9m9md09WYiIiIgeIIFk213Ysv7QcwY6dy8Bv/4JZkBl3iwhxAJBwSSA9sdIV6kJvgLAGgBPA6R88etGTYJaICcgof0x0ukdZATQ4rwBljnZIAOs/3YVPOmcQUFy+2u3ZU68mdYKZsG8i/QGcwvx3mFuAZ4ObN4C7KSwLvoIYKWBmYindmKCm58DVuDjTJ8CdAht/imwdVx2RygiIiIiIiKixzhzT3DLflDCojWgzntCS9DsRoCfsAZ86wFsQUjWvlFKLB1gBLAMNLsZLiasAUqAJ7pUtW8yGGL9t/fYk2xZUUk8xUVgCRAKAja2HMAtWNhs1ojWVlgPSMzafCNq2xZgReLpcff1AD5CtjoHhHHRnwIREREREREREdtDN8c/6JoG6+8ceHSsAPh2KrTI3bl//DgA61CgNvBf4eqRZOBZzOLgSrM34O2AJdXfvq0GH0EsnVXGNODNAUkER2LNKKuPFABX4grt83AZQgTwBSDwaxAu7sliKljlJmtWZnZaoZc/aw6vCXkHkLBZCGHcUtxvouEW2qgXHOOWM0TgTw/USG4HBG9IoAEQ1jbdqdt+Cpxx+fBjMiIiIiIiIuKyovux1I5uRmI5je6u0uaHBreqAs2368BKDfjjeba3aukAShd4c2oFr05ldgcnYN3e551kVbrbt8S3VAFf3WC9qYgfgbcneW8th90TLwGBs+HCamY+Brz8JZblnsDygxHO1uFwfYHtnRMLYuGwJRpnr2yIFTpgT7UyTGqn5S024C7OCGA94N0z0+kQCxNg74DzFq6UzAJmNwHWvXW+Q++8AWwIkCESHAL2UZ44czCGvYcDeB6LgQmzAsF26AMEkEmQpLJpKbSCQ9u33CN/sr0XDgJXCd4DFsAz93s9YNvvx0RERERERPQaZ/sU544KeVXWUmK9jkW4OmiXvaX+wK/g6M9aArO20n450ZhmBqfIdnb8G1/tAey0uOk7lnuTnrfDA66+JQMwhYURfXoJAXudXQlwv99dJHk+H8C2nmHuV7P++oKDuiy4iq+dgDrcdBGQWMJh3nVPPMXTbbvTQFLBnxnWSEFi6SELdwGbKHjHsKU2uiDiPbNiJYAOibWHd3pSU4sJLDoz3++3pBPBNuwxIYyfACEhwrvDXNFh0Sl5YyQQvYYOAYXWH/zrRxcQF12/iIiIiIiLjfScP8gsbgf4tquoN/xz9O/TVoB1m8X0vtLgbiCkpFKvKESvNkPY0WWB4hWlagopCobM+C6F0gJ0fmHdAmcE9mXYAI9e6PF6qb8RnRkEQEmCEc9SEeubQL8IsGy/c4JSIlMC8E9hid3QtaQZYn0ZAitYAMtvntgoCXJYAD2vUNPdG/2ZjmwOIDmsKzSpthI6B1gOyPTG/HWfDAn/cEz5KH9qVwgsvyls8LMyWzDA6Wh3k+gz0IekhwR0RRv9IyIiIiIuFzLlJ2Sr578ykLiyqd4NZedGQ1+ONwKeG+yUrpJLxYwmZ34+rogxwFhcIRWgErtS3BUOmSaKqxVIgVol2MvzIXL2it8NQgq3aMJPP9fitNJwaujb9JjKbGdrt0qvez0Yw2AA44HRAcGCCXrW1iqUFya2FpsgLc/ztAQhZGQQgBgAZaID3eKOQYCsel+icaWhtgDXfndZna5wAIM333wLMAGz2cz/BobABIgAAbsGgaBURxckIQkmpOygSfh8/vZ87rIAGAL6oRqu5gBAHTR6PC+KzzUBb77zi18aBFy7do0dj3fL5AIlQOn/LibANCmQ+ps2Bu+l6gs1eE3BaQH7SnUY7ut1gKyw/4YAVT9aYiur0xXKIXD9Oh4CMyFvgfzeFMiKr59JgNL/6o133QQk5IK8kiT7CQph4P3Fwj0HwL5kQOqPCSj+NQQUkyAi4KYqffNmfeGgnAQPiDqoACeAvaIhCAEf4PWJyfSq/J67CKANwocFUIOHh4egTZRZQLY/HMpveggUspuAwxLVhWQM74zHt2CM3xFCQ0he+FXxhfUdUAIGhAAwLGCi9fcQ0FT3UQFicoOGAGoB2X6B+hYxGdQcOwRjTI7HzVNgXLc/dloAJyA0BHB6OQfmTeaGgMxsr6mu9APgDeEAsQD62MtY/ZPyHuAqMv3oBq5wYNL7uBA/Fo4LlICCgVysD1k2LdDC12Mcmq5LODu0Wq6h2F2r/hERERERPcft2/70FLzr2gC2o48EmQ537xSPqTu1WAXbTYw9qeRJU7Z0TXZXloX4NelP7n2uyWhrTi7JxzbWP8s0AyPlRR6Nh9oP2ZFdnuw0jpyVikxfv1O54jUDsrAC2WkyPZuxcgVXlsv70WiQK2cubZ7tqeJ2gu/pXYC7RH/luC20/so3b6JfejqcOWYCfiO/9nCHMnmfM5Tf2BuksYX4rTgWv8Px7VgKY0MWpvz24G0kq/5Pp64OQuXsV3JtcMjiZGenae251isWTXTFCShXBxAB927ef3DjJlo2yqR9Z7g/XgJ+D3+QX3/ECirXn8g4+JCx8QClT80OVs58am/vdi2ieWAEe1PJQSnsVM56tuMioJoFkAXswZ/gtu6Q1B8t2YUt4M/iE/EXvaR0SCzgkFjAobKAuZanRuwhR0A5STXxLWnv01L6tOlgEcxrAygC1AzpGybg3s0PPpRfdv0rTx0TkEKx6lTLf4XP5Nfn6MSEMcYL+S0io/Ri/Ep86CCgju5So0PEfgSGOcvDYCgWRrxICMgIw0T/5kSESQCSH35ybXTtb48qeb+ubnc1eWrePcGGQCVj8e5dLSvbb9Y7rQQIAnlBrQ+6j9CQRe47VYf1U0AdMRKuIaGGO6nOLwuiPw/gU6y/uP+FnP4mX9xvCJDjP/WUZ4pO2CRqLrKyRX7iB9BlbyLbPgHGJ0+p/vQxKMpDXTq52BG4mjflgdVgYCzOIfIWAb7hA0VEREREbAFDvDCtXDk4ZHke61/P+GhhsRXhffpBlx6ksJTfl/jRfATI1XwXvvzyq6/gEerOntK/gPzl1g24dw9u3KrTy9gNc1liSGR6oQneqN80htFw+MRgwP/hYiFMZV1jFG2CZGBJvfGF9rz+rvAP7Youh7KCKQtumnQjNmUvWVfBq84jXcdMBjt6c7BM0MGVcoyX8MRyWvZnEqBcLVRC6V78Nw1AE/D1N48ff/O17s9QQD7V7honoIxG6p2mYjEKHXhIRblUkWpfO1PrMYiAB2qvDje4VKy7CKDhJVeXpJe7e9qiloWs9U/N/FDY+m5T/KlMGiF3FQbkQIZZvtgHRRlABZ4ynhPYAiYTfF59fHKiwktNgNRfoCUwyjgNFuwiMfGm/7UNIP3LO1jPAZ/BrgQ8bTLkuVEe5n4CDuSvB+pfnawMbAgLZAEken3wYP/BCRw1FT5RvRutjwBqAd8W8jNTf63geFlgYRbXhEH63nw+Nwio7mz5Y7FYvP9wsXhIDjwsnXPAyYkaAHgSfDIcjtY4CZI54NtqDqgYUPrnRjh6S/V3oYsv9+AIMaAqOkDTXgYmAR99VP0jBuKcA4bZyckJnGAG6GNw3U+BZ+IZjv9p6LacTPSClZwB5b9UMwDGj/rX3foCfQwqiyjhmANgqIAJsN3DLgQQpMW9f1b7AZYzguYMK63lSapmysd16j//9W/zY11EMWtU0iBTS3pZfWCjvR+wfRw8f36AxOme4ip93DBGO2w8BiMiIiI6Y4hPR7/4Tk0x373Ydqc2iJcALxvh+3rW/X7b3doYrit1r1fCi/KJo75rG5jBDBf4j8WZEes7eTYr+J91r2hVvFQBVG0CrzQBr5ocxG2w+RG5poRtPdALVIaZeqbPvPWfIa6XCl9HjVPXg/UnpRdybRTl5i1SkF6YwuvBa3N3ljW3SQLkDKBC6JdG42YfJnhjrNRfby/mpv62o7vTdIr1ey2/vTYyzLZIQF7f79xNQE6GPMBxitOw/jYCUsNkioPmAyOcNgjIYDabbc7T1Qq7CeBlkP5Sd2NS7GwBm50ECwMoX5opdHiuCXiOMuX+CnB65zlgs9EanfTua/E+zkQKEQYMfjo/BYTY4BQ40wqXPTitxVOsI50DsJSv//T5VoP1H9SyLDz9YZt96NNqRURERERExBkjB5941oARcWRWekOiC3Z2qP7gEc+eACAUGAQUaSnOkI9S9c3IoELmWp6UmdzhbU5855wlQ7FDtkECTApMAsq0ps/F7ZHq0QwGATidE0CDRb4YYB7G3QgB+DAwJaBY/qg6WfwY4T5XGTABI4tOYY0NcZ1/P2AlAjZoASsRsGEL2OwcQLH1OWDDTwG+3rHlp0APsF0/ICIiIiLicsP/HtlFR/pfAT8+RGc3pZdydIk+J1e9Rwo/5uh9hnH+1PICRe2b0M8/aCv3Dkv4nyRAoNPJipURY4C+WarP67eT+4YUjoX4MRfH+G3r5UJGtOb7tVqRwXwg/zXHt2FunmdXMpjyQH0NeureZtW5+SN9h8ZTUKft9xwEFB+NluzXn68HCSSJulDL++pLf/6eSpdXkv2eElBYgMQxvuNqXlgap5MRAY9KNCbeUu4dRsUzcIrOvMhgdAiLoYOACzcJjgGOj47xtF8uR+iQFNb8Fy77hvFLeX9ensu35iMiIiIiOoO+HxCS6SGqtnLb9rrKIdD3A0IyPUbXVm7bXlc5eP+hwYtVZHqQsq3ctr2uchD0/YBXuoJaPlW+4Wkll0dpi/TnjQxUFs70Vzr9lbN9Ad50daKTpAvaf4Hfd/ABdAPQyHUlotoNPj3Fu8Oh/Dyd5ddb5LZ0vHtm/wlGf8RPP/0kzP4IcbLi/hqgd3odshq9p6TDuEMsv2AK+fMTAoL9EfV/h3xS6r8+AqboM+gsBNh+tlEo2L7FQnwWcCJK/VcmIDwE1KdvtTHx0BCBEIHeISVIfipLBk6a/EHQ9wMsk1o9CepJjE5SQGX3pGqdJGn7dJI102t+XLIaA40cxKYfY10fo23lMDbtyHR1pNrKYWzale3qSreVIyIiIiIiIjyoHIczk3sP8vcDw/IFJAD8BBRfWEHhJ0DQP3rYb5QfSQgemRAE9TeXTP78Xd8RLeDSzwGX/SkQERERERERsW4k58cTCJ6ChKz9QdeE/H2gPiMRgb6uQAC93+dJ/3VYANX3XOlvWkBxvL34chDQ7L2Z+hocqtIXdg7Iapj64zte6n9+bKCrBZT5z6/+XS3g3Ovf9Sng0P/CzgEBaP3Pjw0ELaANlN71/4iInuP/VPKCJpghgS4AAAAldEVYdGRhdGU6Y3JlYXRlADIwMTYtMDktMTRUMTM6MzI6MzktMDQ6MDB6ohKoAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE1LTA2LTAxVDEwOjM3OjIxLTA0OjAwKEFuvAAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAASUVORK5CYII=)}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAADwCAMAAADYSUr5AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABLFBMVEXNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgrNCgoYgUqcAAAAY3RSTlMAWEd8IjKY4b3Ld2acsomqpVpOeudAQGVmhVOLRpGUY2NhTaBobXqbc6W/fcC8463l6eSBjl3f3eC51tvSxNXU12LacP4Nzplp+DgqFhzFedHjp4FYyJPQ2K/wzZCniLC7x6vHwZbrAAAAAWJLR0QAiAUdSAAAAAd0SU1FB98GAQolFZD5J0UAAA+BSURBVHja7V0LYxvFEd67iyQsxycZJGgDCYrBKSR1WjdJX5RCGiJICzFpmxCamFLm//+H7t5rZ2f2oeNk6Wzv58T23D7nu9m9md09WYiIiIgeIIFk213Ysv7QcwY6dy8Bv/4JZkBl3iwhxAJBwSSA9sdIV6kJvgLAGgBPA6R88etGTYJaICcgof0x0ukdZATQ4rwBljnZIAOs/3YVPOmcQUFy+2u3ZU68mdYKZsG8i/QGcwvx3mFuAZ4ObN4C7KSwLvoIYKWBmYindmKCm58DVuDjTJ8CdAht/imwdVx2RygiIiIiIiKixzhzT3DLflDCojWgzntCS9DsRoCfsAZ86wFsQUjWvlFKLB1gBLAMNLsZLiasAUqAJ7pUtW8yGGL9t/fYk2xZUUk8xUVgCRAKAja2HMAtWNhs1ojWVlgPSMzafCNq2xZgReLpcff1AD5CtjoHhHHRnwIREREREREREdtDN8c/6JoG6+8ceHSsAPh2KrTI3bl//DgA61CgNvBf4eqRZOBZzOLgSrM34O2AJdXfvq0GH0EsnVXGNODNAUkER2LNKKuPFABX4grt83AZQgTwBSDwaxAu7sliKljlJmtWZnZaoZc/aw6vCXkHkLBZCGHcUtxvouEW2qgXHOOWM0TgTw/USG4HBG9IoAEQ1jbdqdt+Cpxx+fBjMiIiIiIiIuKyovux1I5uRmI5je6u0uaHBreqAs2368BKDfjjeba3aukAShd4c2oFr05ldgcnYN3e551kVbrbt8S3VAFf3WC9qYgfgbcneW8th90TLwGBs+HCamY+Brz8JZblnsDygxHO1uFwfYHtnRMLYuGwJRpnr2yIFTpgT7UyTGqn5S024C7OCGA94N0z0+kQCxNg74DzFq6UzAJmNwHWvXW+Q++8AWwIkCESHAL2UZ44czCGvYcDeB6LgQmzAsF26AMEkEmQpLJpKbSCQ9u33CN/sr0XDgJXCd4DFsAz93s9YNvvx0RERERERPQaZ/sU544KeVXWUmK9jkW4OmiXvaX+wK/g6M9aArO20n450ZhmBqfIdnb8G1/tAey0uOk7lnuTnrfDA66+JQMwhYURfXoJAXudXQlwv99dJHk+H8C2nmHuV7P++oKDuiy4iq+dgDrcdBGQWMJh3nVPPMXTbbvTQFLBnxnWSEFi6SELdwGbKHjHsKU2uiDiPbNiJYAOibWHd3pSU4sJLDoz3++3pBPBNuwxIYyfACEhwrvDXNFh0Sl5YyQQvYYOAYXWH/zrRxcQF12/iIiIiIiLjfScP8gsbgf4tquoN/xz9O/TVoB1m8X0vtLgbiCkpFKvKESvNkPY0WWB4hWlagopCobM+C6F0gJ0fmHdAmcE9mXYAI9e6PF6qb8RnRkEQEmCEc9SEeubQL8IsGy/c4JSIlMC8E9hid3QtaQZYn0ZAitYAMtvntgoCXJYAD2vUNPdG/2ZjmwOIDmsKzSpthI6B1gOyPTG/HWfDAn/cEz5KH9qVwgsvyls8LMyWzDA6Wh3k+gz0IekhwR0RRv9IyIiIiIuFzLlJ2Sr578ykLiyqd4NZedGQ1+ONwKeG+yUrpJLxYwmZ34+rogxwFhcIRWgErtS3BUOmSaKqxVIgVol2MvzIXL2it8NQgq3aMJPP9fitNJwaujb9JjKbGdrt0qvez0Yw2AA44HRAcGCCXrW1iqUFya2FpsgLc/ztAQhZGQQgBgAZaID3eKOQYCsel+icaWhtgDXfndZna5wAIM333wLMAGz2cz/BobABIgAAbsGgaBURxckIQkmpOygSfh8/vZ87rIAGAL6oRqu5gBAHTR6PC+KzzUBb77zi18aBFy7do0dj3fL5AIlQOn/LibANCmQ+ps2Bu+l6gs1eE3BaQH7SnUY7ut1gKyw/4YAVT9aYiur0xXKIXD9Oh4CMyFvgfzeFMiKr59JgNL/6o133QQk5IK8kiT7CQph4P3Fwj0HwL5kQOqPCSj+NQQUkyAi4KYqffNmfeGgnAQPiDqoACeAvaIhCAEf4PWJyfSq/J67CKANwocFUIOHh4egTZRZQLY/HMpveggUspuAwxLVhWQM74zHt2CM3xFCQ0he+FXxhfUdUAIGhAAwLGCi9fcQ0FT3UQFicoOGAGoB2X6B+hYxGdQcOwRjTI7HzVNgXLc/dloAJyA0BHB6OQfmTeaGgMxsr6mu9APgDeEAsQD62MtY/ZPyHuAqMv3oBq5wYNL7uBA/Fo4LlICCgVysD1k2LdDC12Mcmq5LODu0Wq6h2F2r/hERERERPcft2/70FLzr2gC2o48EmQ537xSPqTu1WAXbTYw9qeRJU7Z0TXZXloX4NelP7n2uyWhrTi7JxzbWP8s0AyPlRR6Nh9oP2ZFdnuw0jpyVikxfv1O54jUDsrAC2WkyPZuxcgVXlsv70WiQK2cubZ7tqeJ2gu/pXYC7RH/luC20/so3b6JfejqcOWYCfiO/9nCHMnmfM5Tf2BuksYX4rTgWv8Px7VgKY0MWpvz24G0kq/5Pp64OQuXsV3JtcMjiZGenae251isWTXTFCShXBxAB927ef3DjJlo2yqR9Z7g/XgJ+D3+QX3/ECirXn8g4+JCx8QClT80OVs58am/vdi2ieWAEe1PJQSnsVM56tuMioJoFkAXswZ/gtu6Q1B8t2YUt4M/iE/EXvaR0SCzgkFjAobKAuZanRuwhR0A5STXxLWnv01L6tOlgEcxrAygC1AzpGybg3s0PPpRfdv0rTx0TkEKx6lTLf4XP5Nfn6MSEMcYL+S0io/Ri/Ep86CCgju5So0PEfgSGOcvDYCgWRrxICMgIw0T/5kSESQCSH35ybXTtb48qeb+ubnc1eWrePcGGQCVj8e5dLSvbb9Y7rQQIAnlBrQ+6j9CQRe47VYf1U0AdMRKuIaGGO6nOLwuiPw/gU6y/uP+FnP4mX9xvCJDjP/WUZ4pO2CRqLrKyRX7iB9BlbyLbPgHGJ0+p/vQxKMpDXTq52BG4mjflgdVgYCzOIfIWAb7hA0VEREREbAFDvDCtXDk4ZHke61/P+GhhsRXhffpBlx6ksJTfl/jRfATI1XwXvvzyq6/gEerOntK/gPzl1g24dw9u3KrTy9gNc1liSGR6oQneqN80htFw+MRgwP/hYiFMZV1jFG2CZGBJvfGF9rz+rvAP7Youh7KCKQtumnQjNmUvWVfBq84jXcdMBjt6c7BM0MGVcoyX8MRyWvZnEqBcLVRC6V78Nw1AE/D1N48ff/O17s9QQD7V7honoIxG6p2mYjEKHXhIRblUkWpfO1PrMYiAB2qvDje4VKy7CKDhJVeXpJe7e9qiloWs9U/N/FDY+m5T/KlMGiF3FQbkQIZZvtgHRRlABZ4ynhPYAiYTfF59fHKiwktNgNRfoCUwyjgNFuwiMfGm/7UNIP3LO1jPAZ/BrgQ8bTLkuVEe5n4CDuSvB+pfnawMbAgLZAEken3wYP/BCRw1FT5RvRutjwBqAd8W8jNTf63geFlgYRbXhEH63nw+Nwio7mz5Y7FYvP9wsXhIDjwsnXPAyYkaAHgSfDIcjtY4CZI54NtqDqgYUPrnRjh6S/V3oYsv9+AIMaAqOkDTXgYmAR99VP0jBuKcA4bZyckJnGAG6GNw3U+BZ+IZjv9p6LacTPSClZwB5b9UMwDGj/rX3foCfQwqiyjhmANgqIAJsN3DLgQQpMW9f1b7AZYzguYMK63lSapmysd16j//9W/zY11EMWtU0iBTS3pZfWCjvR+wfRw8f36AxOme4ip93DBGO2w8BiMiIiI6Y4hPR7/4Tk0x373Ydqc2iJcALxvh+3rW/X7b3doYrit1r1fCi/KJo75rG5jBDBf4j8WZEes7eTYr+J91r2hVvFQBVG0CrzQBr5ocxG2w+RG5poRtPdALVIaZeqbPvPWfIa6XCl9HjVPXg/UnpRdybRTl5i1SkF6YwuvBa3N3ljW3SQLkDKBC6JdG42YfJnhjrNRfby/mpv62o7vTdIr1ey2/vTYyzLZIQF7f79xNQE6GPMBxitOw/jYCUsNkioPmAyOcNgjIYDabbc7T1Qq7CeBlkP5Sd2NS7GwBm50ECwMoX5opdHiuCXiOMuX+CnB65zlgs9EanfTua/E+zkQKEQYMfjo/BYTY4BQ40wqXPTitxVOsI50DsJSv//T5VoP1H9SyLDz9YZt96NNqRURERERExBkjB5941oARcWRWekOiC3Z2qP7gEc+eACAUGAQUaSnOkI9S9c3IoELmWp6UmdzhbU5855wlQ7FDtkECTApMAsq0ps/F7ZHq0QwGATidE0CDRb4YYB7G3QgB+DAwJaBY/qg6WfwY4T5XGTABI4tOYY0NcZ1/P2AlAjZoASsRsGEL2OwcQLH1OWDDTwG+3rHlp0APsF0/ICIiIiLicsP/HtlFR/pfAT8+RGc3pZdydIk+J1e9Rwo/5uh9hnH+1PICRe2b0M8/aCv3Dkv4nyRAoNPJipURY4C+WarP67eT+4YUjoX4MRfH+G3r5UJGtOb7tVqRwXwg/zXHt2FunmdXMpjyQH0NeureZtW5+SN9h8ZTUKft9xwEFB+NluzXn68HCSSJulDL++pLf/6eSpdXkv2eElBYgMQxvuNqXlgap5MRAY9KNCbeUu4dRsUzcIrOvMhgdAiLoYOACzcJjgGOj47xtF8uR+iQFNb8Fy77hvFLeX9ensu35iMiIiIiOoO+HxCS6SGqtnLb9rrKIdD3A0IyPUbXVm7bXlc5eP+hwYtVZHqQsq3ctr2uchD0/YBXuoJaPlW+4Wkll0dpi/TnjQxUFs70Vzr9lbN9Ad50daKTpAvaf4Hfd/ABdAPQyHUlotoNPj3Fu8Oh/Dyd5ddb5LZ0vHtm/wlGf8RPP/0kzP4IcbLi/hqgd3odshq9p6TDuEMsv2AK+fMTAoL9EfV/h3xS6r8+AqboM+gsBNh+tlEo2L7FQnwWcCJK/VcmIDwE1KdvtTHx0BCBEIHeISVIfipLBk6a/EHQ9wMsk1o9CepJjE5SQGX3pGqdJGn7dJI102t+XLIaA40cxKYfY10fo23lMDbtyHR1pNrKYWzale3qSreVIyIiIiIiIjyoHIczk3sP8vcDw/IFJAD8BBRfWEHhJ0DQP3rYb5QfSQgemRAE9TeXTP78Xd8RLeDSzwGX/SkQERERERERsW4k58cTCJ6ChKz9QdeE/H2gPiMRgb6uQAC93+dJ/3VYANX3XOlvWkBxvL34chDQ7L2Z+hocqtIXdg7Iapj64zte6n9+bKCrBZT5z6/+XS3g3Ovf9Sng0P/CzgEBaP3Pjw0ELaANlN71/4iInuP/VPKCJpghgS4AAAAldEVYdGRhdGU6Y3JlYXRlADIwMTYtMDktMTRUMTM6MzI6MzktMDQ6MDB6ohKoAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE1LTA2LTAxVDEwOjM3OjIxLTA0OjAwKEFuvAAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAAASUVORK5CYII=)}.ui-button .ui-icon{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAADwCAQAAABFnnJAAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QAiEnuKCAAAAAHdElNRQffBgEKJRWQ+SdFAAAaqklEQVR42u2de5BlRX3HPwdIKGJYiCGwwrJbUolgopidgUr5SJWUIXeSqk3UYsndsaJGyQ7RqGiZnZHM8Aez4tzRAAuS2qXAWFTNI7tEDVSFOyJiYdxScXd9hrwEB4m7+keM6x8pYsnJH+fVfU6/zjn3zr1zT3+n7txzz6+7T3f/fv04/fv1r4MFPJqMMwadAY/BwgtAw+EFQEabkPagM7GR8AIgos0KsNIkEei1AAy+/bQJK8dcAfagE4Ek5cGXsYeQBcDcAYbpnwm29qOPH8ZPb2vD2J6dMLFaCSL2r8YiYEp5hPoIUQB60QHuqZFCEjdph+VRJy4EBKwCqwQEhpTrlHHoEKTrAEkRk3agQwiF6hERpRNUip+0Mt3zbc8Oa+bdNWVbGTcRsh7A3AG6wtQG7cNH9HQTC82p1GubpiFITLlePzNkCEqvBJpbkakNZpVate3YUzC3TXPezX1glrKtn9lUOKt0DBvz9FVTv8u0p7CKqf8KHOLqhkAx5ZFhf5UeYLTRZmWU2GuHF4CGw68ENhxeABoOLwANhxeAhsMLQMPhBaDh8ALQcHh7gHzcQed/g1HGHsDNIsCmjGkb7QHMT7Czp449gF0dHuV9pISknD2AmwbMXIV6Bu3RXLumbWO/LfWV3Lc+9ZGxBijaA0TQr4YnoUz6Nj3dFtvFHsCUO/PT7fHNCOO0k++RgGwPoLqWserUC6jD2Nuniz2Aqf255U0vPqHV2qDMkzYFqiiD2qwY29gw2wOYhMvW/yQlD0dJX9hrbeDgK8ckni5xB53/DYZXBzccfiGo4fAC0HB4AWg4vAA0HF4AGg4vAA2HF4CGo/zGkFFHOMBV/vprpaXzf1a96H2phEHmILTmoLoqyB5zACWXh4AQjLp+F/8AYQVKWVR9hi3/EesDYyp24aga260ELqFKxD1DCmArfuBQAH38wKGCXIoQGpQ9LvkLDDT5u9wzEoq9BswlNAtQaIkNtkYs5V8cAlyLr7PWsVdS0IMOPjRqIm2jaJ0chGnsQEkVn656StK89HkIDXRz2lnpzM1AzGUAZSeBoUPrsYVykc5qbdyNuYFD6iYGuaRbtQZMTdAlbXsdFOhlXgOzLs4llJpm7gLtEmxOw9bFunXRthZke7rLJLIq7CJup0s5KNMDuHWd9Wa5gWMv0688BsYO1i3dwCFMVZiHafMAqIx7libQ4DDoHGzm51eI61cCGw4vAA2HF4CGwwtAw+EFoOHwAtBweAFoOOTNoYmz1MHB7g+8n3CpAReNaLV4tr3Rrk8phUwAko1RLu7eq1VA71AtLVvO3WrA5Go208a1S8eO9JTJn74M7co1EOZyCag3h5q3cLpotNuKe70TAV1abq4h9Pl3qwHdM9q57bXtUrGzEth6oHpb0wsbdOWtYS7u1G1bsHUbRN0saew50KVjd+Fuz7mbQ3q1xqDI2iBHt20sbxt9EYdSymaFsU5hHRTDlBUA9woISsR1y4G5Cl2eb9/br3++LbZNAOx1YGagXQDaFmfWSgEo9xaQVUAVlUUgpKFOPZS+Tc+vgizfVecQpqfvianJCK72IGB6fhJTPQewpZz5bjDtb87nsqQ9gKkC5AmMqfjmzJmKaEpDLJrd7EvFArsAmkqwmnMg0S+n+Sb2rqbH3rjlkrJDgJs5VWh1EWEeBevEdqtedTncxuD6Jm2mdKofamOfAyjh/QOIMAvgSMILQMPhl4IbDi8ADYcXgIbDC0DD4QWg4fAC0GsMUp1dAXl7ABtM+iqXordr6rv7jfq5CyyL3UNW9qI9gAkmjbnLKmGisdvjsMFUj7qbq8zbwwPr9lc7g3XxTakPCNlCkJgtu7ff4mKjuDWy2unfrgvNYNLY2WIH2nDiXZ2207R5NHSiupd0Q6CeA+iMDsz6qmxoqGK0ELUcu9mU3odBiKuuLyhxV/Vc1fPtO5uHEpkAyIrC8gfIRwesJ+wrHz8g0+VV20CdhanrgqLac91C1PHx0QdkAiAqCqvIsO0kAbuyte7oGAg9iLqHkL9VIXrTilVPkHuPoeknxCFgNc2UqgOPOvjI3EuNVaM9gIu23+4ewozMFkBtUmGu+mwQ0nsXSUIGJaliiKoGNX2BWhuom8aAi7JUNwnshbLVzWqx6kTTZRKJIQeb8DAZrw6WMTRd80bBrwTKaBj7vQA0Hl4AGg4vAA2HF4CGwwtAwzF8AtAalkXSZiAvAG66bJPKJnSi6kK06G7Iq9ig/SAMDcq5i3dTxUzUyE+XREhaxnBVXdZnGKETwOtAFgDzKrV5tTtp1S26ShEI04VS9d69qOufSEN0NfGTq2pO1cXep7zGcgSRCYDs7r2ITB+uc5keEMTsX1M+y9y1R13/GhOGvbPJ09XPly0K8qm4uY9oHBJfwVmVmT1e2zRZCfurj+NrTq6c1bv/9U7VE2O2jD5CR8DXQSIASdWaTKZAPDRBjfpHouj6D/np+TzIByEUc7giPTugYVtA9ci8hYtVpncwYj/1wvVYCR09EoGwMI9IFMFqr/xyfnrlVr4BKPMWkFWxzibPdiSTiT6RUrtAUOgHAuHpqoHIbE8ku4/wSCGfF2A7cMRkdln3JIu1NG2X18jA8V6CVfysX4n8QpCp85bbYH/akXkOUAervuWrMGwnh3ombTCGTxfgsaHwAtBweAFoOLwANByjJACz6UrDbF/Sv4yx+O+yQRe1d4gE4GBccescrJzSYxZNvw0hT0rWAmWZOMt8ej2vjD1bSzwu42mu5RjHuJanlSIwa8393pi6V/MMPd0WE+7L/ZmfkHIp2hgS8jBPAecxJQTOXskOpvcPcaMm6WyR6Ai7DTuLiqlHWOIpgYWwzFukyp3PhZ9jfwm6nENV7vZySPo9xb3S7zGuZYFx4BgzPMpxbQ2on+HiTFp/8qftUOwoRFbztjKmS36JACwC8Hkp+JqQeFFAnmWHpnqPgFIEQsbT62OKIn6Nq4TfsgBEmoDJlJbfIhYyJ4nAHPNaDwa6jW/j0u98Dsc4xjjbgFfwYcY1AnASgJdU3GEUkixpB84UMYRZAPIiHkC2EJSwvpsPEOMp4AQ/5tOG7I/F37u1IbYYYi/zlCQAeRwSChVySOqrAPZDKgJz7M/1CFkF6ityC4+n19co87CNiwh4kSGXf2mgmXtAszo+UKRSTsQS9n+MD4q3s5XAriWBE/y4EEbOwgWxLi9U2PNE+FVD+pN8zfj8J8iU1Yd4oiAAmQgUO/8Irdx3MXfXGXM6wz9yF/BeZpTxTwHPCNdFzDGffjYWCfvv5xxZBFyXglXsz+PFAJzBC9oQ5wNoJii2HiARATjEE9owAWgneVfnvvPYwifiq3coqJfQARaAGTrsKgwBeU1q1W2mdi8JthCf5O2FexH7j3AO8G6AeNAvoQsosj9fwPOtafxSejVeoNl6ALgsZvwTXMbTCvosT3MQeIJZTR9gxi/z3vQqjzY7eIi9zABnEjLDiwwGJXPsVzJph/DRYQwbbCHephCAKQ4BuzkSz6MWmY4I1ZVBRfl+kTXOXfH3uIJm6wEipkcioHoNm5Xoql5gW+5bVUUwQ9TO5SFmBwsgvBcsaIaBCPM1uvhjNUOobTruhVgEQGC/SQDmhOtip1Nk/+f5mPSrCHOXaO4B5hSveWXokAxR2Xe+iu4FQn6B+cIrYCQS+TudXOlskzy4QfgUsZy+5cByxRB6JCIgsX+YHETMAi8Xfj9VqRuvixAU7O9l6hEGo/beyyGZ/cMkAB4DwSjpAjwqwAtAw+EFoOHwAtBweAEYLTwu6DOcIAtAy2Fjth4uJ2+6YVapUZ8TdNnFt/yDhNJf3rLhcI5+WPFcUVu+tw90gC9Y6qeTW18og9fHf2YsscRS8kN8DWzRZQ6YV9jmr/OmeAXqMR7lpUwp1bnPsBs4wku5KqesBfd330S3L4ef49b4bpTaLQp935H01+5CfFd9fLTCt9AXehImAJYkdTdAh31M0AUm6Obf12nRBY5wPYfZDcr9E99nG/AclxpqdyleTFrm89wvCkDE/kibVhSBkD25nTVlTw+P9hN+ijfzKd7Mw+zSVNAs+znIVEGnJ279VD3B5fj2/+ISfshFPMc2jY+DGTqEBEyzoKUDBvpXOM0WfkdJT6p/GZgsWYMJ9UiqbhfphwtK+CNcr3j+QaZY5gG6ib2FqA5OllPnmavkqEXc0qXWHN7K91jnBCc5xg+UIWaZZxs38lwf1gGf4WK+y4V8l0v4njZUtJY+Y6Qj69QlnOa4Vl2TtL5JJXVCqjXdBjm1tcWvOdwB+APgXN4KQIu1TACelFbT55njSa3aVIc1bM6cb+FhdvFZfp8v8HqFcdks8xxiqi/sh5fyL/wm/8Fv8E3erlCpvAdIjKWmFfETOmCgb2FMY/iyJDE+v5bfYV+afrRFdlH5FDWu4Z95rfD7SwqTlncC24FdCPZWiQBcTWJMEX3v7wsLbuV7/Ddf5iRfZr1ATdg/Z3x2aNCHT6TuaVQ90Hd4Od/m1/k2v5VNglK0uYtE3z+tUP5k9DP5uYGezQFkZGNvhC+WrLuJXJnyPcTrpFp5nfb5uQYqTgKT1qu2SRtnLzfyzticoyidoRS3OMIWzTaDAt3Efvm8omIeQzIBWFPS38mHmOF2PsBH+FvukOiTBZGQVUJ16Rn781O/DK3cELBmoOuozxGpu/P0JSbjsT9ny+kuAG5e+lskQ0HZOUTEYH3rT94CEqjeAiZSFzVqAZFRfE/5IH9jzF0dekBoZL99Gp2JgOoN4HZu4kGuBw5zHXfyAYm6xCQP81Mm83HzTqKyd/myOEJISJcuYWwZrC+iLnVT5z/PLcKvWwr9yRRRx9+NyzCloJt+wx4t++rTl63sj4y0oo59gtRkS8IaE6DZQP8zPhHP+6/nE/xMEWIXkyzn47qqg6drLE94lEEHSkz+3BENUQUR9PYADYfXBTQcXgAaDi8ADYcXgIajeQIQqY1V7zSdVJX7Hod0zlXeHbrj4W0QBWA6rYDqryHV/QPURYsw3a51XGvV8Ln4/X9fQQQ+yj7u5V7exbu4i5sKMaPaeSj+dS5wbvwX4WY+Tsit3ErIx7m5EN/sviJvzZC3ZyjSbSGKnh5keozsNXCaBZ7lEeDtnJ2qPYuJ2E7Zhn5ZvS8xyQwdpllQLKpETz7BGMfZqclFsiB7A/dRXCl8dXp9mu8o1kJP8FWmmKETpyMvh9vV4cnqfVepSDavvarcZ3ZzIYLUUGZe4fIzZEKIkaqzM3XwQrxKfJyzeb6w72UYMAkscCWTwGRBAE6wE9iZsv+EIoWL4m/19tSn+UV+ApzH/ynpX+VGpnhxqtMv309eHa9fhqhWPWeZT3cVqprQGg8JVhTFHi4SwSuF6yL+lJ8D8P3khjgEPAIcZycn+GTporkfKWOKreykUkR6tknhWsRYzPKE/UWdfIs3GPPwv/wEgJ/wRgX1KFOEQDtmf3FZd1z4U2Necx3lfx6YZ4xxxpUWBS12AQeJFLtFmN19B3SZYRs7uJRLM5sheW9gxP4xpaegMHdVTdljyqINnbj1w7KyfxoTWr+K/V3J5iG/1v4dTguOcI4W4r+WDrCP7eh0els4XbpMGS5Jvx8C/kgR4q+ASIcxRaT3kxGSiVWx+cwCPwB+zpls4zYei25nc4CQ5zk7rrp1tlcw+cIYws3gyfQEUUuvmqN8I+7+oGgXJ7NfxcBp/kT4dQ/3G56uErDINUY0eJxWusCZkEbt/Bh/g3Q/5P7CHEBUFp/gQ6XnADdDbIWxlNVuNgTMcDbP81UOss52RRebOYhWu4q2OZMOcn9mquoJCzHzsmsRCfujgWBbNsoBmcHbIhMEyvbb4UF2xn9F9sMCJ3gYeIxoplHEGp/lC5zL2UpzrDmLg43zOZ/7OJ9fif+bsVNxL5kDXIm6Qe3gTHawgx3AzUmIbAiI/F9EneDMEE4Bo83RM3T4JguKzdER+59jLLaNzXsBiNhvmrjdxnX8J3Cxgv0AjzJNyDE+SpedWsu/hzWp7xecRuwt7D8+FG+uz/4fyoXYlttUXvRyIFpKqa2mFJ4RymoDB/kaaEaLbtrxf59tOa25et6tzr06/9H84nn+mLXYMGMLP83FXeXfeYpVbS2FBOl+gUMFL2R/yHxskjfHP+X6mIMK+wXZZV8+RNGhn9J/gVcHi9jFXwMf1rTiJc7lnlisWhzlNQURE6ESANEszi6OGwIvAA1H83QBHhK8ADQcXgAajrwAHNT6C7+br6eLtF/n7kFn3KM3kJeC/5XLgddzRSHcp6X18VfxKrbxpkFn3qM+xB7gAJcDcDkHcqHuTtmfrdC9UdkLnCSMPWar8D9xD2JfZhrGhaiTgqLqZP3khgOiALSACSYoqhpfo4yrurs1/qhxXvy9z5KrjsJgA5biyl/SxrOFsNFDTqbmGkUWv0RzvamRCUDU/tdYo9gHZIueoprW7tU2j4DA4VzQaJ9sXgSyzY2TGgbaQiwxyQHGOaBNAbYyHwuJXoxHCpkAtOL/LeFXEbYTQ4+AZltY8pQu8KyC0km/o/4hv24/qbmW7y4zEbtfUNEPcBPHuYkDmhRA5+h9ZJEIQCce/7uxzuryiqPwM2Q+81XoAj9S+M9JOn0d+13xAGs8YKDK3xlcTFhmgVOc4hT06ViqASBZChbVIEWViOzjto7H22gPb35zY8Z2PfvtrphDYJkHeCuTyhAhB2Jjzzt5nzaFU2nnnw9xUhgWTo3KLCDqAbLW3hI6/+zuV5RxVXc7ljl+oDgYHqZj+xxT61/WXMt3J+mmXniK9PdxJ2PcyfsMvra3OlFGZoaQHBqlocbft/N+BfWO3B70LCV9z6BXJ9s7f7uTBVsIGz3kFPfEWrqTmjZe9SSQIUUkACeVEi12cyu0c9RV9ijidNhnHL9N9gS2uMOBkRQAFyzwu+mb/1G+aDwxY5TRWAHwGEl4bWDD4QWg4fAC0HB4AWg4vAA0HF4A8uhYvPlvMgcQNogCELJuUQH17kiIQeFJnjTSO0ZbhY7VkmHTQe4BtrPPKgRqZMLT0qbQYT3WNHRYL4iQLH6HFfTDUkoqEdRvLU/iXcVVhvK5s9/FqmlTIO8rOMKzrCqXZPXehEMpXkh+TT+qvADo0GZ79GxDCofZXaBHRyDo4ssl0J/WoaPKzqjt1BFZEVQLAKhPnLAJABD7GZGVQtmv9Zh5WFLQCYA+vpxGL1isp4aK7debFOpJ4LMsKg8cseFZFlP2LwoVFLAY393BotIeKJ+CDrb4G4ORYH2EogBELCivk0vitVhnsXDmxjQBi6zTYlrLRLcnT1cWApPvgYi6aIwrUkND2E0FeQjQjf1ZCP2JAsMPcycfIZurlKduSogbQ+wFC5xDDiNccj2NyWjdTN2U8OrghsOvBDYcXgAaDi8ADYcXgIbDC0DDkRcA095bjxGEuDn0MwBcyDs0W0MjPdvntBtHPTYhEgFo0U3dj15OV8nkGRY5yhvoOiwU5xWyh3OewA9vMN1Dg2Qh6Dg7+TKvJuRzXEuodIccocW9bLc6ky26Ks7/lh0l9pvuoUEkAC26/IiLgEc5zjQ/5ELFHt4QOME93M862zUHmEbhVL6qx2N36ls4zZaCP+2Qa3icawSH62r646kvfhV9nGPxB4W/bg8FIl3A1cC3ALgWgG/xBq4uMHiGK5nkPmAvXd6tFQA1rgAuBmArZyj2IkbOZbZyBvCC4u3k4vhzBfCCIv2twMti+sv8240rIgF4EnilcPeV8T0ZHeAButzCDk6wS5me3kziQunXHbFn+wxbeb8gFkX6hbw//pjiR2G2KugeSiRzgHW2p5uml5jMnzIPJErgg0xxA1czpfWHrRoCDrNb+p23N+o33UODRACi8zB+xLd4JReiPjEgswZYBPYpz7kKR8tgavQhHhv3Z7GfoH/j70bF5tXDBm8P0HD42XLD4QWg4fAC0HB4AWg4MgGwnQdQl77Al1L6lxTn/vWb3u/yDZpeEclbwKcL5+V+RjoPoC7d5mau3/R+l2/Q9Mo48/cA7uatBcoVXMAj8XVd+u38eYH+Cs5LtQn9pve7fIOm10A0BGSe/8VtU69RXInI01fTo2VXtfEDQ3xb+vkU+hHfVn5b/s3xT0kb03TxTXQxF+pSl0TeVazaGbTNlWy2+3cF2IN6d3Dd9F3i29NXucN2jR+g3mAWlvgdCqkU6ZGr/d3a+kvufojb6MkOLdXWsHwx83Q09DAed4vjcT6dUHPfnL69wEkPZIsdaEXOJXVd/lzSDzF7FrjOmIObuU1gf09wVv0kBLwg/C+P0NojmNEbBusbgD3/9rg2NdmDBtrNfISP0FP2934IWALeQvUhoH4Xr89fMYVqXbgpfVP+iucvlKNHIiCyvwdDQDQJtJ0H4EZfASaZjK9EungSdqi4e1yg2ugY6Sjpcv7Dwt2vSBQbvWr9JOULK9Nvk9ivfmpJRAJwVMpAgqOKKxF5ejutwLY2fmiIb0s/n0I/4tvKb8u/KX7eeVVZOiB1/upSl0S0DrDGFbwiR1kVTvapS3+E3y4cRvkZ3rZh9H6Xb9D0GogEAP6BcziDS+O7R1nmL6Rwdel/zwWcndr8fYMHBfZsBL3f5Rs0vTK8QUjD4bWBDYcXgIbDC0DD4QWg4fAC0HB4AWg4RGWQ7XTeYad7VICsDRxPr44pQ9elewwdikNAPdYds6ZQr+UGtVPwkJAXABsDj3HMSE/cM+hgY6DOl3eCsKKu30ODvACMg5GB44wb6ZGHDj1CzAYTpgNfwG5Q4VESxSFgvEIqcmxzCvXar02APEpCf2TM8M3y/VtAH1DmvIBhp3tUgF8Iaji8ADQcXgAaDi8ADYcXgIbDC0DDsXkFoO0XhHoBWQDqr7OFzBIy2/d8t1mRHEB4VIQsAHviz6Bha90R+1cHnc1RgCwAKyT7+gYJW+v27O8hXHuAkHbhUw5h4U+NiL16MUzY7+cAPYFsEbTCKivKthUAq7lPObi5b0/Yv8dIX/VzgF5BFgBTD7AnZU3yKScE84U7xSNd2kL6qtRl9vtBoAcYph5AZH+gpXv29xSuPUB92I9wKsf+tiacRykM01tAwGr8KULFfj8H6AHk7eFtVmkPZecaxp1+/tujJrx/gIZj8+oCPHqC/wc2957uSJx+mQAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNi0wOS0xNFQxMzozMjozOS0wNDowMHqiEqgAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTUtMDYtMDFUMTA6Mzc6MjEtMDQ6MDAoQW68AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAABJRU5ErkJggg==)}.ui-icon-blank{background-position:16px 16px}.ui-icon-caret-1-n{background-position:0 0}.ui-icon-caret-1-ne{background-position:-16px 0}.ui-icon-caret-1-e{background-position:-32px 0}.ui-icon-caret-1-se{background-position:-48px 0}.ui-icon-caret-1-s{background-position:-65px 0}.ui-icon-caret-1-sw{background-position:-80px 0}.ui-icon-caret-1-w{background-position:-96px 0}.ui-icon-caret-1-nw{background-position:-112px 0}.ui-icon-caret-2-n-s{background-position:-128px 0}.ui-icon-caret-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-65px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-65px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:1px -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-first,.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-left,.ui-corner-tl,.ui-corner-top{border-top-left-radius:4px}.ui-corner-all,.ui-corner-right,.ui-corner-top,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bl,.ui-corner-bottom,.ui-corner-left{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-br,.ui-corner-right{border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{-webkit-box-shadow:-8px -8px 8px #aaa;box-shadow:-8px -8px 8px #aaa}/*!
  * StyleSheet for JQuery splitter Plugin
  * Copyright (C) 2010 Jakub Jankiewicz <http://jcubic.pl>
  *
diff --git a/web/css/swish-min.css.gz b/web/css/swish-min.css.gz
index 8cb1865..16230b5 100644
Binary files a/web/css/swish-min.css.gz and b/web/css/swish-min.css.gz differ
diff --git a/web/js/require.js b/web/js/require.js
index 929c0a8..4db1424 100644
--- a/web/js/require.js
+++ b/web/js/require.js
@@ -1,5 +1,5 @@
 /** vim: et:ts=4:sw=4:sts=4
- * @license RequireJS 2.3.1 Copyright jQuery Foundation and other contributors.
+ * @license RequireJS 2.3.2 Copyright jQuery Foundation and other contributors.
  * Released under MIT license, https://github.com/requirejs/requirejs/blob/master/LICENSE
  */
 //Not using strict: uneven strict support in browsers, #392, and causes
@@ -11,7 +11,7 @@ var requirejs, require, define;
 (function (global, setTimeout) {
     var req, s, head, baseElement, dataMain, src,
         interactiveScript, currentlyAddingScript, mainScript, subPath,
-        version = '2.3.1',
+        version = '2.3.2',
         commentRegExp = /\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/mg,
         cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
         jsSuffixRegExp = /\.js$/,
@@ -2139,4 +2139,4 @@ var requirejs, require, define;
 
     //Set up with config info.
     req(cfg);
-}(this, setTimeout));
+}(this, (typeof setTimeout === 'undefined' ? undefined : setTimeout)));
diff --git a/web/js/swish-min.js b/web/js/swish-min.js
index 458542d..6942206 100644
--- a/web/js/swish-min.js
+++ b/web/js/swish-min.js
@@ -1,4 +1,4 @@
-/*! jQuery v3.1.0 | (c) jQuery Foundation | jquery.org/license */
+/*! jQuery v3.1.1 | (c) jQuery Foundation | jquery.org/license */
 
 /*  Part of SWISH
 
@@ -111,7 +111,7 @@
  * Licensed under the MIT license
  */
 
-/*! jQuery UI - v1.12.0 - 2016-07-08
+/*! jQuery UI - v1.12.1 - 2016-09-14
 * http://jqueryui.com
 * Includes: widget.js, position.js, data.js, disable-selection.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js, focusable.js, form-reset-mixin.js, jquery-1-7.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/draggable.js, widgets/droppable.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/resizable.js, widgets/selectable.js, widgets/selectmenu.js, widgets/slider.js, widgets/sortable.js, widgets/spinner.js, widgets/tabs.js, widgets/tooltip.js
 * Copyright jQuery Foundation and other contributors; Licensed MIT */
@@ -467,4 +467,4 @@ or implied, of Chas Emerick.
  * http://www.opensource.org/licenses/MIT
  */
 
-!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function v(e,t){t=t||r;var n=t.createElement("script");n.text=e,t.head.appendChild(n).parentNode.removeChild(n)}function S(e){var t=!!e&&"length"in e&&e.length,n=g.type(e);return"function"!==n&&!g.isWindow(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function A(e,t,n){if(g.isFunction(t))return g.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return g.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(L.test(t))return g.filter(t,e,n);t=g.filter(t,e)}return g.grep(e,function(e){return a.call(t,e)>-1!==n&&1===e.nodeType})}function H(e,t){while((e=e[t])&&1!==e.nodeType);return e}function j(e){var t={};return g.each(e.match(B)||[],function(e,n){t[n]=!0}),t}function F(e){return e}function I(e){throw e}function q(e,t,n){var r;try{e&&g.isFunction(r=e.promise)?r.call(e).done(t).fail(n):e&&g.isFunction(r=e.then)?r.call(e,t,n):t.call(void 0,e)}catch(e){n.call(void 0,e)}}function z(){r.removeEventListener("DOMContentLoaded",z),e.removeEventListener("load",z),g.ready()}function V(){this.expando=g.expando+V.uid++}function G(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(Q,"-$&").toLowerCase(),n=e.getAttribute(r),"string"==typeof n){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:K.test(n)?JSON.parse(n):n)}catch(i){}J.set(e,t,n)}else n=void 0;return n}function rt(e,t,n,r){var i,s=1,o=20,u=r?function(){return r.cur()}:function(){return g.css(e,t,"")},a=u(),f=n&&n[3]||(g.cssNumber[t]?"":"px"),l=(g.cssNumber[t]||"px"!==f&&+a)&&Z.exec(g.css(e,t));if(l&&l[3]!==f){f=f||l[3],n=n||[],l=+a||1;do s=s||".5",l/=s,g.style(e,t,l+f);while(s!==(s=u()/a)&&1!==s&&--o)}return n&&(l=+l||+a||0,i=n[1]?l+(n[1]+1)*n[2]:+n[2],r&&(r.unit=f,r.start=l,r.end=i)),i}function st(e){var t,n=e.ownerDocument,r=e.nodeName,i=it[r];return i?i:(t=n.body.appendChild(n.createElement(r)),i=g.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),it[r]=i,i)}function ot(e,t){for(var n,r,i=[],s=0,o=e.length;s<o;s++)r=e[s],r.style&&(n=r.style.display,t?("none"===n&&(i[s]=$.get(r,"display")||null,i[s]||(r.style.display="")),""===r.style.display&&tt(r)&&(i[s]=st(r))):"none"!==n&&(i[s]="none",$.set(r,"display",n)));for(s=0;s<o;s++)null!=i[s]&&(e[s].style.display=i[s]);return e}function ct(e,t){var n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&g.nodeName(e,t)?g.merge([e],n):n}function ht(e,t){for(var n=0,r=e.length;n<r;n++)$.set(e[n],"globalEval",!t||$.get(t[n],"globalEval"))}function dt(e,t,n,r,i){for(var s,o,u,a,f,l,c=t.createDocumentFragment(),h=[],p=0,d=e.length;p<d;p++)if(s=e[p],s||0===s)if("object"===g.type(s))g.merge(h,s.nodeType?[s]:s);else if(pt.test(s)){o=o||c.appendChild(t.createElement("div")),u=(at.exec(s)||["",""])[1].toLowerCase(),a=lt[u]||lt._default,o.innerHTML=a[1]+g.htmlPrefilter(s)+a[2],l=a[0];while(l--)o=o.lastChild;g.merge(h,o.childNodes),o=c.firstChild,o.textContent=""}else h.push(t.createTextNode(s));c.textContent="",p=0;while(s=h[p++])if(r&&g.inArray(s,r)>-1)i&&i.push(s);else if(f=g.contains(s.ownerDocument,s),o=ct(c.appendChild(s),"script"),f&&ht(o),n){l=0;while(s=o[l++])ft.test(s.type||"")&&n.push(s)}return c}function bt(){return!0}function wt(){return!1}function Et(){try{return r.activeElement}catch(e){}}function St(e,t,n,r,i,s){var o,u;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(u in t)St(e,u,n,r,t[u],s);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),i===!1)i=wt;else if(!i)return e;return 1===s&&(o=i,i=function(e){return g().off(e),o.apply(this,arguments)},i.guid=o.guid||(o.guid=g.guid++)),e.each(function(){g.event.add(this,t,i,r,n)})}function Lt(e,t){return g.nodeName(e,"table")&&g.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e:e}function At(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Ot(e){var t=Ct.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Mt(e,t){var n,r,i,s,o,u,a,f;if(1===t.nodeType){if($.hasData(e)&&(s=$.access(e),o=$.set(t,s),f=s.events)){delete o.handle,o.events={};for(i in f)for(n=0,r=f[i].length;n<r;n++)g.event.add(t,i,f[i][n])}J.hasData(e)&&(u=J.access(e),a=g.extend({},u),J.set(t,a))}}function _t(e,t){var n=t.nodeName.toLowerCase();"input"===n&&ut.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function Dt(e,t,n,r){t=o.apply([],t);var i,s,u,a,f,l,c=0,h=e.length,p=h-1,m=t[0],y=g.isFunction(m);if(y||h>1&&"string"==typeof m&&!d.checkClone&&Nt.test(m))return e.each(function(i){var s=e.eq(i);y&&(t[0]=m.call(this,i,s.html())),Dt(s,t,n,r)});if(h&&(i=dt(t,e[0].ownerDocument,!1,e,r),s=i.firstChild,1===i.childNodes.length&&(i=s),s||r)){for(u=g.map(ct(i,"script"),At),a=u.length;c<h;c++)f=i,c!==p&&(f=g.clone(f,!0,!0),a&&g.merge(u,ct(f,"script"))),n.call(e[c],f,c);if(a)for(l=u[u.length-1].ownerDocument,g.map(u,Ot),c=0;c<a;c++)f=u[c],ft.test(f.type||"")&&!$.access(f,"globalEval")&&g.contains(l,f)&&(f.src?g._evalUrl&&g._evalUrl(f.src):v(f.textContent.replace(kt,""),l))}return e}function Pt(e,t,n){for(var r,i=t?g.filter(t,e):e,s=0;null!=(r=i[s]);s++)n||1!==r.nodeType||g.cleanData(ct(r)),r.parentNode&&(n&&g.contains(r.ownerDocument,r)&&ht(ct(r,"script")),r.parentNode.removeChild(r));return e}function Ft(e,t,n){var r,i,s,o,u=e.style;return n=n||jt(e),n&&(o=n.getPropertyValue(t)||n[t],""!==o||g.contains(e.ownerDocument,e)||(o=g.style(e,t)),!d.pixelMarginRight()&&Bt.test(o)&&Ht.test(t)&&(r=u.width,i=u.minWidth,s=u.maxWidth,u.minWidth=u.maxWidth=u.width=o,o=n.width,u.width=r,u.minWidth=i,u.maxWidth=s)),void 0!==o?o+"":o}function It(e,t){return{get:function(){return e()?void delete this.get:(this.get=t).apply(this,arguments)}}}function Xt(e){if(e in Wt)return e;var t=e[0].toUpperCase()+e.slice(1),n=zt.length;while(n--)if(e=zt[n]+t,e in Wt)return e}function Vt(e,t,n){var r=Z.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function $t(e,t,n,r,i){for(var s=n===(r?"border":"content")?4:"width"===t?1:0,o=0;s<4;s+=2)"margin"===n&&(o+=g.css(e,n+et[s],!0,i)),r?("content"===n&&(o-=g.css(e,"padding"+et[s],!0,i)),"margin"!==n&&(o-=g.css(e,"border"+et[s]+"Width",!0,i))):(o+=g.css(e,"padding"+et[s],!0,i),"padding"!==n&&(o+=g.css(e,"border"+et[s]+"Width",!0,i)));return o}function Jt(e,t,n){var r,i=!0,s=jt(e),o="border-box"===g.css(e,"boxSizing",!1,s);if(e.getClientRects().length&&(r=e.getBoundingClientRect()[t]),r<=0||null==r){if(r=Ft(e,t,s),(r<0||null==r)&&(r=e.style[t]),Bt.test(r))return r;i=o&&(d.boxSizingReliable()||r===e.style[t]),r=parseFloat(r)||0}return r+$t(e,t,n||(o?"border":"content"),i,s)+"px"}function Kt(e,t,n,r,i){return new Kt.prototype.init(e,t,n,r,i)}function en(){Gt&&(e.requestAnimationFrame(en),g.fx.tick())}function tn(){return e.setTimeout(function(){Qt=void 0}),Qt=g.now()}function nn(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)n=et[r],i["margin"+n]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function rn(e,t,n){for(var r,i=(un.tweeners[t]||[]).concat(un.tweeners["*"]),s=0,o=i.length;s<o;s++)if(r=i[s].call(n,t,e))return r}function sn(e,t,n){var r,i,s,o,u,a,f,l,c="width"in t||"height"in t,h=this,p={},d=e.style,v=e.nodeType&&tt(e),m=$.get(e,"fxshow");n.queue||(o=g._queueHooks(e,"fx"),null==o.unqueued&&(o.unqueued=0,u=o.empty.fire,o.empty.fire=function(){o.unqueued||u()}),o.unqueued++,h.always(function(){h.always(function(){o.unqueued--,g.queue(e,"fx").length||o.empty.fire()})}));for(r in t)if(i=t[r],Yt.test(i)){if(delete t[r],s=s||"toggle"===i,i===(v?"hide":"show")){if("show"!==i||!m||void 0===m[r])continue;v=!0}p[r]=m&&m[r]||g.style(e,r)}if(a=!g.isEmptyObject(t),a||!g.isEmptyObject(p)){c&&1===e.nodeType&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],f=m&&m.display,null==f&&(f=$.get(e,"display")),l=g.css(e,"display"),"none"===l&&(f?l=f:(ot([e],!0),f=e.style.display||f,l=g.css(e,"display"),ot([e]))),("inline"===l||"inline-block"===l&&null!=f)&&"none"===g.css(e,"float")&&(a||(h.done(function(){d.display=f}),null==f&&(l=d.display,f="none"===l?"":l)),d.display="inline-block")),n.overflow&&(d.overflow="hidden",h.always(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]})),a=!1;for(r in p)a||(m?"hidden"in m&&(v=m.hidden):m=$.access(e,"fxshow",{display:f}),s&&(m.hidden=!v),v&&ot([e],!0),h.done(function(){v||ot([e]),$.remove(e,"fxshow");for(r in p)g.style(e,r,p[r])})),a=rn(v?m[r]:0,r,h),r in m||(m[r]=a.start,v&&(a.end=a.start,a.start=0))}}function on(e,t){var n,r,i,s,o;for(n in e)if(r=g.camelCase(n),i=t[r],s=e[n],g.isArray(s)&&(i=s[1],s=e[n]=s[0]),n!==r&&(e[r]=s,delete e[n]),o=g.cssHooks[r],o&&"expand"in o){s=o.expand(s),delete e[r];for(n in s)n in e||(e[n]=s[n],t[n]=i)}else t[r]=i}function un(e,t,n){var r,i,s=0,o=un.prefilters.length,u=g.Deferred().always(function(){delete a.elem}),a=function(){if(i)return!1;for(var t=Qt||tn(),n=Math.max(0,f.startTime+f.duration-t),r=n/f.duration||0,s=1-r,o=0,a=f.tweens.length;o<a;o++)f.tweens[o].run(s);return u.notifyWith(e,[f,s,n]),s<1&&a?n:(u.resolveWith(e,[f]),!1)},f=u.promise({elem:e,props:g.extend({},t),opts:g.extend(!0,{specialEasing:{},easing:g.easing._default},n),originalProperties:t,originalOptions:n,startTime:Qt||tn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=g.Tween(e,f.opts,t,n,f.opts.specialEasing[t]||f.opts.easing);return f.tweens.push(r),r},stop:function(t){var n=0,r=t?f.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)f.tweens[n].run(1);return t?(u.notifyWith(e,[f,1,0]),u.resolveWith(e,[f,t])):u.rejectWith(e,[f,t]),this}}),l=f.props;for(on(l,f.opts.specialEasing);s<o;s++)if(r=un.prefilters[s].call(f,e,l,f.opts))return g.isFunction(r.stop)&&(g._queueHooks(f.elem,f.opts.queue).stop=g.proxy(r.stop,r)),r;return g.map(l,rn,f),g.isFunction(f.opts.start)&&f.opts.start.call(e,f),g.fx.timer(g.extend(a,{elem:e,anim:f,queue:f.opts.queue})),f.progress(f.opts.progress).done(f.opts.done,f.opts.complete).fail(f.opts.fail).always(f.opts.always)}function pn(e){return e.getAttribute&&e.getAttribute("class")||""}function Tn(e,t,n,r){var i;if(g.isArray(t))g.each(t,function(t,i){n||wn.test(e)?r(e,i):Tn(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)});else if(n||"object"!==g.type(t))r(e,t);else for(i in t)Tn(e+"["+i+"]",t[i],n,r)}function Bn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,s=t.toLowerCase().match(B)||[];if(g.isFunction(n))while(r=s[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function jn(e,t,n,r){function o(u){var a;return i[u]=!0,g.each(e[u]||[],function(e,u){var f=u(t,n,r);return"string"!=typeof f||s||i[f]?s?!(a=f):void 0:(t.dataTypes.unshift(f),o(f),!1)}),a}var i={},s=e===Dn;return o(t.dataTypes[0])||!i["*"]&&o("*")}function Fn(e,t){var n,r,i=g.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&g.extend(!0,e,r),e}function In(e,t,n){var r,i,s,o,u=e.contents,a=e.dataTypes;while("*"===a[0])a.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in u)if(u[i]&&u[i].test(r)){a.unshift(i);break}if(a[0]in n)s=a[0];else{for(i in n){if(!a[0]||e.converters[i+" "+a[0]]){s=i;break}o||(o=i)}s=s||o}if(s)return s!==a[0]&&a.unshift(s),n[s]}function qn(e,t,n,r){var i,s,o,u,a,f={},l=e.dataTypes.slice();if(l[1])for(o in e.converters)f[o.toLowerCase()]=e.converters[o];s=l.shift();while(s)if(e.responseFields[s]&&(n[e.responseFields[s]]=t),!a&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),a=s,s=l.shift())if("*"===s)s=a;else if("*"!==a&&a!==s){if(o=f[a+" "+s]||f["* "+s],!o)for(i in f)if(u=i.split(" "),u[1]===s&&(o=f[a+" "+u[0]]||f["* "+u[0]])){o===!0?o=f[i]:f[i]!==!0&&(s=u[0],l.unshift(u[1]));break}if(o!==!0)if(o&&e["throws"])t=o(t);else try{t=o(t)}catch(c){return{state:"parsererror",error:o?c:"No conversion from "+a+" to "+s}}}return{state:"success",data:t}}function Xn(e){return g.isWindow(e)?e:9===e.nodeType&&e.defaultView}var n=[],r=e.document,i=Object.getPrototypeOf,s=n.slice,o=n.concat,u=n.push,a=n.indexOf,f={},l=f.toString,c=f.hasOwnProperty,h=c.toString,p=h.call(Object),d={},m="3.1.0",g=function(e,t){return new g.fn.init(e,t)},y=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,b=/^-ms-/,w=/-([a-z])/g,E=function(e,t){return t.toUpperCase()};g.fn=g.prototype={jquery:m,constructor:g,length:0,toArray:function(){return s.call(this)},get:function(e){return null!=e?e<0?this[e+this.length]:this[e]:s.call(this)},pushStack:function(e){var t=g.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return g.each(this,e)},map:function(e){return this.pushStack(g.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:n.sort,splice:n.splice},g.extend=g.fn.extend=function(){var e,t,n,r,i,s,o=arguments[0]||{},u=1,a=arguments.length,f=!1;for("boolean"==typeof o&&(f=o,o=arguments[u]||{},u++),"object"==typeof o||g.isFunction(o)||(o={}),u===a&&(o=this,u--);u<a;u++)if(null!=(e=arguments[u]))for(t in e)n=o[t],r=e[t],o!==r&&(f&&r&&(g.isPlainObject(r)||(i=g.isArray(r)))?(i?(i=!1,s=n&&g.isArray(n)?n:[]):s=n&&g.isPlainObject(n)?n:{},o[t]=g.extend(f,s,r)):void 0!==r&&(o[t]=r));return o},g.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return"function"===g.type(e)},isArray:Array.isArray,isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){var t=g.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},isPlainObject:function(e){var t,n;return!!e&&"[object Object]"===l.call(e)&&(!(t=i(e))||(n=c.call(t,"constructor")&&t.constructor,"function"==typeof n&&h.call(n)===p))},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?f[l.call(e)]||"object":typeof e},globalEval:function(e){v(e)},camelCase:function(e){return e.replace(b,"ms-").replace(w,E)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t){var n,r=0;if(S(e)){for(n=e.length;r<n;r++)if(t.call(e[r],r,e[r])===!1)break}else for(r in e)if(t.call(e[r],r,e[r])===!1)break;return e},trim:function(e){return null==e?"":(e+"").replace(y,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(S(Object(e))?g.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:a.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r,i=[],s=0,o=e.length,u=!n;s<o;s++)r=!t(e[s],s),r!==u&&i.push(e[s]);return i},map:function(e,t,n){var r,i,s=0,u=[];if(S(e))for(r=e.length;s<r;s++)i=t(e[s],s,n),null!=i&&u.push(i);else for(s in e)i=t(e[s],s,n),null!=i&&u.push(i);return o.apply([],u)},guid:1,proxy:function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),g.isFunction(e))return r=s.call(arguments,2),i=function(){return e.apply(t||this,r.concat(s.call(arguments)))},i.guid=e.guid=e.guid||g.guid++,i},now:Date.now,support:d}),"function"==typeof Symbol&&(g.fn[Symbol.iterator]=n[Symbol.iterator]),g.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){f["[object "+t+"]"]=t.toLowerCase()});var x=function(e){function ot(e,t,r,i){var s,u,f,l,c,d,g,y=t&&t.ownerDocument,S=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==S&&9!==S&&11!==S)return r;if(!i&&((t?t.ownerDocument||t:E)!==p&&h(t),t=t||p,v)){if(11!==S&&(c=G.exec(e)))if(s=c[1]){if(9===S){if(!(f=t.getElementById(s)))return r;if(f.id===s)return r.push(f),r}else if(y&&(f=y.getElementById(s))&&b(t,f)&&f.id===s)return r.push(f),r}else{if(c[2])return _.apply(r,t.getElementsByTagName(e)),r;if((s=c[3])&&n.getElementsByClassName&&t.getElementsByClassName)return _.apply(r,t.getElementsByClassName(s)),r}if(n.qsa&&!C[e+" "]&&(!m||!m.test(e))){if(1!==S)y=t,g=e;else if("object"!==t.nodeName.toLowerCase()){(l=t.getAttribute("id"))?l=l.replace(tt,nt):t.setAttribute("id",l=w),d=o(e),u=d.length;while(u--)d[u]="#"+l+" "+yt(d[u]);g=d.join(","),y=Y.test(e)&&mt(t.parentNode)||t}if(g)try{return _.apply(r,y.querySelectorAll(g)),r}catch(x){}finally{l===w&&t.removeAttribute("id")}}}return a(e.replace(R,"$1"),t,r,i)}function ut(){function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}var e=[];return t}function at(e){return e[w]=!0,e}function ft(e){var t=p.createElement("fieldset");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function lt(e,t){var n=e.split("|"),i=n.length;while(i--)r.attrHandle[n[i]]=t}function ct(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ht(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function pt(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function dt(e){return function(t){return"label"in t&&t.disabled===e||"form"in t&&t.disabled===e||"form"in t&&t.disabled===!1&&(t.isDisabled===e||t.isDisabled!==!e&&("label"in t||!it(t))!==e)}}function vt(e){return at(function(t){return t=+t,at(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function mt(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function gt(){}function yt(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function bt(e,t,n){var r=t.dir,i=t.next,s=i||r,o=n&&"parentNode"===s,u=x++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,a){var f,l,c,h=[S,u];if(a){while(t=t[r])if((1===t.nodeType||o)&&e(t,n,a))return!0}else while(t=t[r])if(1===t.nodeType||o)if(c=t[w]||(t[w]={}),l=c[t.uniqueID]||(c[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[r]||t;else{if((f=l[s])&&f[0]===S&&f[1]===u)return h[2]=f[2];if(l[s]=h,h[2]=e(t,n,a))return!0}}}function wt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function Et(e,t,n){for(var r=0,i=t.length;r<i;r++)ot(e,t[r],n);return n}function St(e,t,n,r,i){for(var s,o=[],u=0,a=e.length,f=null!=t;u<a;u++)(s=e[u])&&(n&&!n(s,r,i)||(o.push(s),f&&t.push(u)));return o}function xt(e,t,n,r,i,s){return r&&!r[w]&&(r=xt(r)),i&&!i[w]&&(i=xt(i,s)),at(function(s,o,u,a){var f,l,c,h=[],p=[],d=o.length,v=s||Et(t||"*",u.nodeType?[u]:u,[]),m=!e||!s&&t?v:St(v,h,e,u,a),g=n?i||(s?e:d||r)?[]:o:m;if(n&&n(m,g,u,a),r){f=St(g,p),r(f,[],u,a),l=f.length;while(l--)(c=f[l])&&(g[p[l]]=!(m[p[l]]=c))}if(s){if(i||e){if(i){f=[],l=g.length;while(l--)(c=g[l])&&f.push(m[l]=c);i(null,g=[],f,a)}l=g.length;while(l--)(c=g[l])&&(f=i?P(s,c):h[l])>-1&&(s[f]=!(o[f]=c))}}else g=St(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):_.apply(o,g)})}function Tt(e){for(var t,n,i,s=e.length,o=r.relative[e[0].type],u=o||r.relative[" "],a=o?1:0,l=bt(function(e){return e===t},u,!0),c=bt(function(e){return P(t,e)>-1},u,!0),h=[function(e,n,r){var i=!o&&(r||n!==f)||((t=n).nodeType?l(e,n,r):c(e,n,r));return t=null,i}];a<s;a++)if(n=r.relative[e[a].type])h=[bt(wt(h),n)];else{if(n=r.filter[e[a].type].apply(null,e[a].matches),n[w]){for(i=++a;i<s;i++)if(r.relative[e[i].type])break;return xt(a>1&&wt(h),a>1&&yt(e.slice(0,a-1).concat({value:" "===e[a-2].type?"*":""})).replace(R,"$1"),n,a<i&&Tt(e.slice(a,i)),i<s&&Tt(e=e.slice(i)),i<s&&yt(e))}h.push(n)}return wt(h)}function Nt(e,t){var n=t.length>0,i=e.length>0,s=function(s,o,u,a,l){var c,d,m,g=0,y="0",b=s&&[],w=[],E=f,x=s||i&&r.find.TAG("*",l),T=S+=null==E?1:Math.random()||.1,N=x.length;for(l&&(f=o===p||o||l);y!==N&&null!=(c=x[y]);y++){if(i&&c){d=0,o||c.ownerDocument===p||(h(c),u=!v);while(m=e[d++])if(m(c,o||p,u)){a.push(c);break}l&&(S=T)}n&&((c=!m&&c)&&g--,s&&b.push(c))}if(g+=y,n&&y!==g){d=0;while(m=t[d++])m(b,w,o,u);if(s){if(g>0)while(y--)b[y]||w[y]||(w[y]=O.call(a));w=St(w)}_.apply(a,w),l&&!s&&w.length>0&&g+t.length>1&&ot.uniqueSort(a)}return l&&(S=T,f=E),b};return n?at(s):s}var t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w="sizzle"+1*new Date,E=e.document,S=0,x=0,T=ut(),N=ut(),C=ut(),k=function(e,t){return e===t&&(c=!0),0},L={}.hasOwnProperty,A=[],O=A.pop,M=A.push,_=A.push,D=A.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},H="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",B="[\\x20\\t\\r\\n\\f]",j="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",F="\\["+B+"*("+j+")(?:"+B+"*([*^$|!~]?=)"+B+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+j+"))|)"+B+"*\\]",I=":("+j+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+F+")*)|.*)\\)|)",q=new RegExp(B+"+","g"),R=new RegExp("^"+B+"+|((?:^|[^\\\\])(?:\\\\.)*)"+B+"+$","g"),U=new RegExp("^"+B+"*,"+B+"*"),z=new RegExp("^"+B+"*([>+~]|"+B+")"+B+"*"),W=new RegExp("="+B+"*([^\\]'\"]*?)"+B+"*\\]","g"),X=new RegExp(I),V=new RegExp("^"+j+"$"),$={ID:new RegExp("^#("+j+")"),CLASS:new RegExp("^\\.("+j+")"),TAG:new RegExp("^("+j+"|[*])"),ATTR:new RegExp("^"+F),PSEUDO:new RegExp("^"+I),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+B+"*(even|odd|(([+-]|)(\\d*)n|)"+B+"*(?:([+-]|)"+B+"*(\\d+)|))"+B+"*\\)|)","i"),bool:new RegExp("^(?:"+H+")$","i"),needsContext:new RegExp("^"+B+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+B+"*((?:-\\d)?\\d*)"+B+"*\\)|)(?=[^-]|$)","i")},J=/^(?:input|select|textarea|button)$/i,K=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,G=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Y=/[+~]/,Z=new RegExp("\\\\([\\da-f]{1,6}"+B+"?|("+B+")|.)","ig"),et=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},tt=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,nt=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},rt=function(){h()},it=bt(function(e){return e.disabled===!0},{dir:"parentNode",next:"legend"});try{_.apply(A=D.call(E.childNodes),E.childNodes),A[E.childNodes.length].nodeType}catch(st){_={apply:A.length?function(e,t){M.apply(e,D.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}n=ot.support={},s=ot.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},h=ot.setDocument=function(e){var t,i,o=e?e.ownerDocument||e:E;return o!==p&&9===o.nodeType&&o.documentElement?(p=o,d=p.documentElement,v=!s(p),E!==p&&(i=p.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",rt,!1):i.attachEvent&&i.attachEvent("onunload",rt)),n.attributes=ft(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ft(function(e){return e.appendChild(p.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Q.test(p.getElementsByClassName),n.getById=ft(function(e){return d.appendChild(e).id=w,!p.getElementsByName||!p.getElementsByName(w).length}),n.getById?(r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&v){var n=t.getElementById(e);return n?[n]:[]}},r.filter.ID=function(e){var t=e.replace(Z,et);return function(e){return e.getAttribute("id")===t}}):(delete r.find.ID,r.filter.ID=function(e){var t=e.replace(Z,et);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}}),r.find.TAG=n.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,s=t.getElementsByTagName(e);if("*"===e){while(n=s[i++])1===n.nodeType&&r.push(n);return r}return s},r.find.CLASS=n.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&v)return t.getElementsByClassName(e)},g=[],m=[],(n.qsa=Q.test(p.querySelectorAll))&&(ft(function(e){d.appendChild(e).innerHTML="<a id='"+w+"'></a><select id='"+w+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+B+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||m.push("\\["+B+"*(?:value|"+H+")"),e.querySelectorAll("[id~="+w+"-]").length||m.push("~="),e.querySelectorAll(":checked").length||m.push(":checked"),e.querySelectorAll("a#"+w+"+*").length||m.push(".#.+[+~]")}),ft(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=p.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&m.push("name"+B+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&m.push(":enabled",":disabled"),d.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&m.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),m.push(",.*:")})),(n.matchesSelector=Q.test(y=d.matches||d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ft(function(e){n.disconnectedMatch=y.call(e,"*"),y.call(e,"[s!='']:x"),g.push("!=",I)}),m=m.length&&new RegExp(m.join("|")),g=g.length&&new RegExp(g.join("|")),t=Q.test(d.compareDocumentPosition),b=t||Q.test(d.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!!r&&1===r.nodeType&&!!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},k=t?function(e,t){if(e===t)return c=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r?r:(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&r||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===p||e.ownerDocument===E&&b(E,e)?-1:t===p||t.ownerDocument===E&&b(E,t)?1:l?P(l,e)-P(l,t):0:4&r?-1:1)}:function(e,t){if(e===t)return c=!0,0;var n,r=0,i=e.parentNode,s=t.parentNode,o=[e],u=[t];if(!i||!s)return e===p?-1:t===p?1:i?-1:s?1:l?P(l,e)-P(l,t):0;if(i===s)return ct(e,t);n=e;while(n=n.parentNode)o.unshift(n);n=t;while(n=n.parentNode)u.unshift(n);while(o[r]===u[r])r++;return r?ct(o[r],u[r]):o[r]===E?-1:u[r]===E?1:0},p):p},ot.matches=function(e,t){return ot(e,null,null,t)},ot.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&h(e),t=t.replace(W,"='$1']"),n.matchesSelector&&v&&!C[t+" "]&&(!g||!g.test(t))&&(!m||!m.test(t)))try{var r=y.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(i){}return ot(t,p,null,[e]).length>0},ot.contains=function(e,t){return(e.ownerDocument||e)!==p&&h(e),b(e,t)},ot.attr=function(e,t){(e.ownerDocument||e)!==p&&h(e);var i=r.attrHandle[t.toLowerCase()],s=i&&L.call(r.attrHandle,t.toLowerCase())?i(e,t,!v):void 0;return void 0!==s?s:n.attributes||!v?e.getAttribute(t):(s=e.getAttributeNode(t))&&s.specified?s.value:null},ot.escape=function(e){return(e+"").replace(tt,nt)},ot.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ot.uniqueSort=function(e){var t,r=[],i=0,s=0;if(c=!n.detectDuplicates,l=!n.sortStable&&e.slice(0),e.sort(k),c){while(t=e[s++])t===e[s]&&(i=r.push(s));while(i--)e.splice(r[i],1)}return l=null,e},i=ot.getText=function(e){var t,n="",r=0,s=e.nodeType;if(s){if(1===s||9===s||11===s){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===s||4===s)return e.nodeValue}else while(t=e[r++])n+=i(t);return n},r=ot.selectors={cacheLength:50,createPseudo:at,match:$,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Z,et),e[3]=(e[3]||e[4]||e[5]||"").replace(Z,et),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||ot.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&ot.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return $.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=o(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Z,et).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=T[e+" "];return t||(t=new RegExp("(^|"+B+")"+e+"("+B+"|$)"))&&T(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=ot.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(q," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var s="nth"!==e.slice(0,3),o="last"!==e.slice(-4),u="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,a){var f,l,c,h,p,d,v=s!==o?"nextSibling":"previousSibling",m=t.parentNode,g=u&&t.nodeName.toLowerCase(),y=!a&&!u,b=!1;if(m){if(s){while(v){h=t;while(h=h[v])if(u?h.nodeName.toLowerCase()===g:1===h.nodeType)return!1;d=v="only"===e&&!d&&"nextSibling"}return!0}if(d=[o?m.firstChild:m.lastChild],o&&y){h=m,c=h[w]||(h[w]={}),l=c[h.uniqueID]||(c[h.uniqueID]={}),f=l[e]||[],p=f[0]===S&&f[1],b=p&&f[2],h=p&&m.childNodes[p];while(h=++p&&h&&h[v]||(b=p=0)||d.pop())if(1===h.nodeType&&++b&&h===t){l[e]=[S,p,b];break}}else if(y&&(h=t,c=h[w]||(h[w]={}),l=c[h.uniqueID]||(c[h.uniqueID]={}),f=l[e]||[],p=f[0]===S&&f[1],b=p),b===!1)while(h=++p&&h&&h[v]||(b=p=0)||d.pop())if((u?h.nodeName.toLowerCase()===g:1===h.nodeType)&&++b&&(y&&(c=h[w]||(h[w]={}),l=c[h.uniqueID]||(c[h.uniqueID]={}),l[e]=[S,b]),h===t))break;return b-=i,b===r||b%r===0&&b/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||ot.error("unsupported pseudo: "+e);return i[w]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?at(function(e,n){var r,s=i(e,t),o=s.length;while(o--)r=P(e,s[o]),e[r]=!(n[r]=s[o])}):function(e){return i(e,0,n)}):i}},pseudos:{not:at(function(e){var t=[],n=[],r=u(e.replace(R,"$1"));return r[w]?at(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)(s=o[u])&&(e[u]=!(t[u]=s))}):function(e,i,s){return t[0]=e,r(t,null,s,n),t[0]=null,!n.pop()}}),has:at(function(e){return function(t){return ot(e,t).length>0}}),contains:at(function(e){return e=e.replace(Z,et),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:at(function(e){return V.test(e||"")||ot.error("unsupported lang: "+e),e=e.replace(Z,et).toLowerCase(),function(t){var n;do if(n=v?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:dt(!1),disabled:dt(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return K.test(e.nodeName)},input:function(e){return J.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:vt(function(){return[0]}),last:vt(function(e,t){return[t-1]}),eq:vt(function(e,t,n){return[n<0?n+t:n]}),even:vt(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:vt(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:vt(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:vt(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}},r.pseudos.nth=r.pseudos.eq;for(t in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=ht(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=pt(t);return gt.prototype=r.filters=r.pseudos,r.setFilters=new gt,o=ot.tokenize=function(e,t){var n,i,s,o,u,a,f,l=N[e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=r.preFilter;while(u){n&&!(i=U.exec(u))||(i&&(u=u.slice(i[0].length)||u),a.push(s=[])),n=!1,(i=z.exec(u))&&(n=i.shift(),s.push({value:n,type:i[0].replace(R," ")}),u=u.slice(n.length));for(o in r.filter)!(i=$[o].exec(u))||f[o]&&!(i=f[o](i))||(n=i.shift(),s.push({value:n,type:o,matches:i}),u=u.slice(n.length));if(!n)break}return t?u.length:u?ot.error(e):N(e,a).slice(0)},u=ot.compile=function(e,t){var n,r=[],i=[],s=C[e+" "];if(!s){t||(t=o(e)),n=t.length;while(n--)s=Tt(t[n]),s[w]?r.push(s):i.push(s);s=C(e,Nt(i,r)),s.selector=e}return s},a=ot.select=function(e,t,i,s){var a,f,l,c,h,p="function"==typeof e&&e,d=!s&&o(e=p.selector||e);if(i=i||[],1===d.length){if(f=d[0]=d[0].slice(0),f.length>2&&"ID"===(l=f[0]).type&&n.getById&&9===t.nodeType&&v&&r.relative[f[1].type]){if(t=(r.find.ID(l.matches[0].replace(Z,et),t)||[])[0],!t)return i;p&&(t=t.parentNode),e=e.slice(f.shift().value.length)}a=$.needsContext.test(e)?0:f.length;while(a--){if(l=f[a],r.relative[c=l.type])break;if((h=r.find[c])&&(s=h(l.matches[0].replace(Z,et),Y.test(f[0].type)&&mt(t.parentNode)||t))){if(f.splice(a,1),e=s.length&&yt(f),!e)return _.apply(i,s),i;break}}}return(p||u(e,d))(s,t,!v,i,!t||Y.test(e)&&mt(t.parentNode)||t),i},n.sortStable=w.split("").sort(k).join("")===w,n.detectDuplicates=!!c,h(),n.sortDetached=ft(function(e){return 1&e.compareDocumentPosition(p.createElement("fieldset"))}),ft(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||lt("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ft(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||lt("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ft(function(e){return null==e.getAttribute("disabled")})||lt(H,function(e,t,n){var r;if(!n)return e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),ot}(e);g.find=x,g.expr=x.selectors,g.expr[":"]=g.expr.pseudos,g.uniqueSort=g.unique=x.uniqueSort,g.text=x.getText,g.isXMLDoc=x.isXML,g.contains=x.contains,g.escapeSelector=x.escape;var T=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&g(e).is(n))break;r.push(e)}return r},N=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},C=g.expr.match.needsContext,k=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,L=/^.[^:#\[\.,]*$/;g.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?g.find.matchesSelector(r,e)?[r]:[]:g.find.matches(e,g.grep(t,function(e){return 1===e.nodeType}))},g.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(g(e).filter(function(){for(t=0;t<r;t++)if(g.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)g.find(e,i[t],n);return r>1?g.uniqueSort(n):n},filter:function(e){return this.pushStack(A(this,e||[],!1))},not:function(e){return this.pushStack(A(this,e||[],!0))},is:function(e){return!!A(this,"string"==typeof e&&C.test(e)?g(e):e||[],!1).length}});var O,M=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,_=g.fn.init=function(e,t,n){var i,s;if(!e)return this;if(n=n||O,"string"==typeof e){if(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:M.exec(e),!i||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof g?t[0]:t,g.merge(this,g.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:r,!0)),k.test(i[1])&&g.isPlainObject(t))for(i in t)g.isFunction(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return s=r.getElementById(i[2]),s&&(this[0]=s,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):g.isFunction(e)?void 0!==n.ready?n.ready(e):e(g):g.makeArray(e,this)};_.prototype=g.fn,O=g(r);var D=/^(?:parents|prev(?:Until|All))/,P={children:!0,contents:!0,next:!0,prev:!0};g.fn.extend({has:function(e){var t=g(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(g.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,s=[],o="string"!=typeof e&&g(e);if(!C.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(o?o.index(n)>-1:1===n.nodeType&&g.find.matchesSelector(n,e))){s.push(n);break}return this.pushStack(s.length>1?g.uniqueSort(s):s)},index:function(e){return e?"string"==typeof e?a.call(g(e),this[0]):a.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(g.uniqueSort(g.merge(this.get(),g(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),g.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return T(e,"parentNode")},parentsUntil:function(e,t,n){return T(e,"parentNode",n)},next:function(e){return H(e,"nextSibling")},prev:function(e){return H(e,"previousSibling")},nextAll:function(e){return T(e,"nextSibling")},prevAll:function(e){return T(e,"previousSibling")},nextUntil:function(e,t,n){return T(e,"nextSibling",n)},prevUntil:function(e,t,n){return T(e,"previousSibling",n)},siblings:function(e){return N((e.parentNode||{}).firstChild,e)},children:function(e){return N(e.firstChild)},contents:function(e){return e.contentDocument||g.merge([],e.childNodes)}},function(e,t){g.fn[e]=function(n,r){var i=g.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=g.filter(r,i)),this.length>1&&(P[e]||g.uniqueSort(i),D.test(e)&&i.reverse()),this.pushStack(i)}});var B=/\S+/g;g.Callbacks=function(e){e="string"==typeof e?j(e):g.extend({},e);var t,n,r,i,s=[],o=[],u=-1,a=function(){for(i=e.once,r=t=!0;o.length;u=-1){n=o.shift();while(++u<s.length)s[u].apply(n[0],n[1])===!1&&e.stopOnFalse&&(u=s.length,n=!1)}e.memory||(n=!1),t=!1,i&&(s=n?[]:"")},f={add:function(){return s&&(n&&!t&&(u=s.length-1,o.push(n)),function r(t){g.each(t,function(t,n){g.isFunction(n)?e.unique&&f.has(n)||s.push(n):n&&n.length&&"string"!==g.type(n)&&r(n)})}(arguments),n&&!t&&a()),this},remove:function(){return g.each(arguments,function(e,t){var n;while((n=g.inArray(t,s,n))>-1)s.splice(n,1),n<=u&&u--}),this},has:function(e){return e?g.inArray(e,s)>-1:s.length>0},empty:function(){return s&&(s=[]),this},disable:function(){return i=o=[],s=n="",this},disabled:function(){return!s},lock:function(){return i=o=[],n||t||(s=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=n||[],n=[e,n.slice?n.slice():n],o.push(n),t||a()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!r}};return f},g.extend({Deferred:function(t){var n=[["notify","progress",g.Callbacks("memory"),g.Callbacks("memory"),2],["resolve","done",g.Callbacks("once memory"),g.Callbacks("once memory"),0,"resolved"],["reject","fail",g.Callbacks("once memory"),g.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return i.then(null,e)},pipe:function(){var e=arguments;return g.Deferred(function(t){g.each(n,function(n,r){var i=g.isFunction(e[r[4]])&&e[r[4]];s[r[1]](function(){var e=i&&i.apply(this,arguments);e&&g.isFunction(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,r,i){function o(t,n,r,i){return function(){var u=this,a=arguments,f=function(){var e,f;if(!(t<s)){if(e=r.apply(u,a),e===n.promise())throw new TypeError("Thenable self-resolution");f=e&&("object"==typeof e||"function"==typeof e)&&e.then,g.isFunction(f)?i?f.call(e,o(s,n,F,i),o(s,n,I,i)):(s++,f.call(e,o(s,n,F,i),o(s,n,I,i),o(s,n,F,n.notifyWith))):(r!==F&&(u=void 0,a=[e]),(i||n.resolveWith)(u,a))}},l=i?f:function(){try{f()}catch(e){g.Deferred.exceptionHook&&g.Deferred.exceptionHook(e,l.stackTrace),t+1>=s&&(r!==I&&(u=void 0,a=[e]),n.rejectWith(u,a))}};t?l():(g.Deferred.getStackHook&&(l.stackTrace=g.Deferred.getStackHook()),e.setTimeout(l))}}var s=0;return g.Deferred(function(e){n[0][3].add(o(0,e,g.isFunction(i)?i:F,e.notifyWith)),n[1][3].add(o(0,e,g.isFunction(t)?t:F)),n[2][3].add(o(0,e,g.isFunction(r)?r:I))}).promise()},promise:function(e){return null!=e?g.extend(e,i):i}},s={};return g.each(n,function(e,t){var o=t[2],u=t[5];i[t[1]]=o.add,u&&o.add(function(){r=u},n[3-e][2].disable,n[0][2].lock),o.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=o.fireWith}),i.promise(s),t&&t.call(s,s),s},when:function(e){var t=arguments.length,n=t,r=Array(n),i=s.call(arguments),o=g.Deferred(),u=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?s.call(arguments):n,--t||o.resolveWith(r,i)}};if(t<=1&&(q(e,o.done(u(n)).resolve,o.reject),"pending"===o.state()||g.isFunction(i[n]&&i[n].then)))return o.then();while(n--)q(i[n],u(n),o.reject);return o.promise()}});var R=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;g.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&R.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},g.readyException=function(t){e.setTimeout(function(){throw t})};var U=g.Deferred();g.fn.ready=function(e){return U.then(e)["catch"](function(e){g.readyException(e)}),this},g.extend({isReady:!1,readyWait:1,holdReady:function(e){e?g.readyWait++:g.ready(!0)},ready:function(e){(e===!0?--g.readyWait:g.isReady)||(g.isReady=!0,e!==!0&&--g.readyWait>0||U.resolveWith(r,[g]))}}),g.ready.then=U.then,"complete"===r.readyState||"loading"!==r.readyState&&!r.documentElement.doScroll?e.setTimeout(g.ready):(r.addEventListener("DOMContentLoaded",z),e.addEventListener("load",z));var W=function(e,t,n,r,i,s,o){var u=0,a=e.length,f=null==n;if("object"===g.type(n)){i=!0;for(u in n)W(e,t,u,n[u],!0,s,o)}else if(void 0!==r&&(i=!0,g.isFunction(r)||(o=!0),f&&(o?(t.call(e,r),t=null):(f=t,t=function(e,t,n){return f.call(g(e),n)})),t))for(;u<a;u++)t(e[u],n,o?r:r.call(e[u],u,t(e[u],n)));return i?e:f?t.call(e):a?t(e[0],n):s},X=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};V.uid=1,V.prototype={cache:function(e){var t=e[this.expando];return t||(t={},X(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[g.camelCase(t)]=n;else for(r in t)i[g.camelCase(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][g.camelCase(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){g.isArray(t)?t=t.map(g.camelCase):(t=g.camelCase(t),t=t in r?[t]:t.match(B)||[]),n=t.length;while(n--)delete r[t[n]]}(void 0===t||g.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!g.isEmptyObject(t)}};var $=new V,J=new V,K=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Q=/[A-Z]/g;g.extend({hasData:function(e){return J.hasData(e)||$.hasData(e)},data:function(e,t,n){return J.access(e,t,n)},removeData:function(e,t){J.remove(e,t)},_data:function(e,t,n){return $.access(e,t,n)},_removeData:function(e,t){$.remove(e,t)}}),g.fn.extend({data:function(e,t){var n,r,i,s=this[0],o=s&&s.attributes;if(void 0===e){if(this.length&&(i=J.get(s),1===s.nodeType&&!$.get(s,"hasDataAttrs"))){n=o.length;while(n--)o[n]&&(r=o[n].name,0===r.indexOf("data-")&&(r=g.camelCase(r.slice(5)),G(s,r,i[r])));$.set(s,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){J.set(this,e)}):W(this,function(t){var n;if(s&&void 0===t){if(n=J.get(s,e),void 0!==n)return n;if(n=G(s,e),void 0!==n)return n}else this.each(function(){J.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){J.remove(this,e)})}}),g.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=$.get(e,t),n&&(!r||g.isArray(n)?r=$.access(e,t,g.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=g.queue(e,t),r=n.length,i=n.shift(),s=g._queueHooks(e,t),o=function(){g.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return $.get(e,n)||$.access(e,n,{empty:g.Callbacks("once memory").add(function(){$.remove(e,[t+"queue",n])})})}}),g.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?g.queue(this[0],e):void 0===t?this:this.each(function(){var n=g.queue(this,e,t);g._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&g.dequeue(this,e)})},dequeue:function(e){return this.each(function(){g.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=g.Deferred(),s=this,o=this.length,u=function(){--r||i.resolveWith(s,[s])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(o--)n=$.get(s[o],e+"queueHooks"),n&&n.empty&&(r++,n.empty.add(u));return u(),i.promise(t)}});var Y=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Z=new RegExp("^(?:([+-])=|)("+Y+")([a-z%]*)$","i"),et=["Top","Right","Bottom","Left"],tt=function(e,t){return e=t||e,"none"===e.style.display||""===e.style.display&&g.contains(e.ownerDocument,e)&&"none"===g.css(e,"display")},nt=function(e,t,n,r){var i,s,o={};for(s in t)o[s]=e.style[s],e.style[s]=t[s];i=n.apply(e,r||[]);for(s in t)e.style[s]=o[s];return i},it={};g.fn.extend({show:function(){return ot(this,!0)},hide:function(){return ot(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){tt(this)?g(this).show():g(this).hide()})}});var ut=/^(?:checkbox|radio)$/i,at=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,ft=/^$|\/(?:java|ecma)script/i,lt={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,"",""]};lt.optgroup=lt.option,lt.tbody=lt.tfoot=lt.colgroup=lt.caption=lt.thead,lt.th=lt.td;var pt=/<|&#?\w+;/;!function(){var e=r.createDocumentFragment(),t=e.appendChild(r.createElement("div")),n=r.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),d.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="<textarea>x</textarea>",d.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var vt=r.documentElement,mt=/^key/,gt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,yt=/^([^.]*)(?:\.(.+)|)/;g.event={global:{},add:function(e,t,n,r,i){var s,o,u,a,f,l,c,h,p,d,v,m=$.get(e);if(m){n.handler&&(s=n,n=s.handler,i=s.selector),i&&g.find.matchesSelector(vt,i),n.guid||(n.guid=g.guid++),(a=m.events)||(a=m.events={}),(o=m.handle)||(o=m.handle=function(t){return"undefined"!=typeof g&&g.event.triggered!==t.type?g.event.dispatch.apply(e,arguments):void 0}),t=(t||"").match(B)||[""],f=t.length;while(f--)u=yt.exec(t[f])||[],p=v=u[1],d=(u[2]||"").split(".").sort(),p&&(c=g.event.special[p]||{},p=(i?c.delegateType:c.bindType)||p,c=g.event.special[p]||{},l=g.extend({type:p,origType:v,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&g.expr.match.needsContext.test(i),namespace:d.join(".")},s),(h=a[p])||(h=a[p]=[],h.delegateCount=0,c.setup&&c.setup.call(e,r,d,o)!==!1||e.addEventListener&&e.addEventListener(p,o)),c.add&&(c.add.call(e,l),l.handler.guid||(l.handler.guid=n.guid)),i?h.splice(h.delegateCount++,0,l):h.push(l),g.event.global[p]=!0)}},remove:function(e,t,n,r,i){var s,o,u,a,f,l,c,h,p,d,v,m=$.hasData(e)&&$.get(e);if(m&&(a=m.events)){t=(t||"").match(B)||[""],f=t.length;while(f--)if(u=yt.exec(t[f])||[],p=v=u[1],d=(u[2]||"").split(".").sort(),p){c=g.event.special[p]||{},p=(r?c.delegateType:c.bindType)||p,h=a[p]||[],u=u[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=s=h.length;while(s--)l=h[s],!i&&v!==l.origType||n&&n.guid!==l.guid||u&&!u.test(l.namespace)||r&&r!==l.selector&&("**"!==r||!l.selector)||(h.splice(s,1),l.selector&&h.delegateCount--,c.remove&&c.remove.call(e,l));o&&!h.length&&(c.teardown&&c.teardown.call(e,d,m.handle)!==!1||g.removeEvent(e,p,m.handle),delete a[p])}else for(p in a)g.event.remove(e,p+t[f],n,r,!0);g.isEmptyObject(a)&&$.remove(e,"handle events")}},dispatch:function(e){var t=g.event.fix(e),n,r,i,s,o,u,a=new Array(arguments.length),f=($.get(this,"events")||{})[t.type]||[],l=g.event.special[t.type]||{};for(a[0]=t,n=1;n<arguments.length;n++)a[n]=arguments[n];if(t.delegateTarget=this,!l.preDispatch||l.preDispatch.call(this,t)!==!1){u=g.event.handlers.call(this,t,f),n=0;while((s=u[n++])&&!t.isPropagationStopped()){t.currentTarget=s.elem,r=0;while((o=s.handlers[r++])&&!t.isImmediatePropagationStopped())t.rnamespace&&!t.rnamespace.test(o.namespace)||(t.handleObj=o,t.data=o.data,i=((g.event.special[o.origType]||{}).handle||o.handler).apply(s.elem,a),void 0!==i&&(t.result=i)===!1&&(t.preventDefault(),t.stopPropagation()))}return l.postDispatch&&l.postDispatch.call(this,t),t.result}},handlers:function(e,t){var n,r,i,s,o=[],u=t.delegateCount,a=e.target;if(u&&a.nodeType&&("click"!==e.type||isNaN(e.button)||e.button<1))for(;a!==this;a=a.parentNode||this)if(1===a.nodeType&&(a.disabled!==!0||"click"!==e.type)){for(r=[],n=0;n<u;n++)s=t[n],i=s.selector+" ",void 0===r[i]&&(r[i]=s.needsContext?g(i,this).index(a)>-1:g.find(i,this,null,[a]).length),r[i]&&r.push(s);r.length&&o.push({elem:a,handlers:r})}return u<t.length&&o.push({elem:this,handlers:t.slice(u)}),o},addProp:function(e,t){Object.defineProperty(g.Event.prototype,e,{enumerable:!0,configurable:!0,get:g.isFunction(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[g.expando]?e:new g.Event(e)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==Et()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===Et()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&g.nodeName(this,"input"))return this.click(),!1},_default:function(e){return g.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},g.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},g.Event=function(e,t){return this instanceof g.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&e.returnValue===!1?bt:wt,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&g.extend(this,t),this.timeStamp=e&&e.timeStamp||g.now(),void (this[g.expando]=!0)):new g.Event(e,t)},g.Event.prototype={constructor:g.Event,isDefaultPrevented:wt,isPropagationStopped:wt,isImmediatePropagationStopped:wt,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=bt,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=bt,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=bt,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},g.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&mt.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&gt.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},g.event.addProp),g.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){g.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,s=e.handleObj;return i&&(i===r||g.contains(r,i))||(e.type=s.origType,n=s.handler.apply(this,arguments),e.type=t),n}}}),g.fn.extend({on:function(e,t,n,r){return St(this,e,t,n,r)},one:function(e,t,n,r){return St(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,g(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return t!==!1&&"function"!=typeof t||(n=t,t=void 0),n===!1&&(n=wt),this.each(function(){g.event.remove(this,e,n,t)})}});var xt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,Tt=/<script|<style|<link/i,Nt=/checked\s*(?:[^=]|=\s*.checked.)/i,Ct=/^true\/(.*)/,kt=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;g.extend({htmlPrefilter:function(e){return e.replace(xt,"<$1></$2>")},clone:function(e,t,n){var r,i,s,o,u=e.cloneNode(!0),a=g.contains(e.ownerDocument,e);if(!(d.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||g.isXMLDoc(e)))for(o=ct(u),s=ct(e),r=0,i=s.length;r<i;r++)_t(s[r],o[r]);if(t)if(n)for(s=s||ct(e),o=o||ct(u),r=0,i=s.length;r<i;r++)Mt(s[r],o[r]);else Mt(e,u);return o=ct(u,"script"),o.length>0&&ht(o,!a&&ct(e,"script")),u},cleanData:function(e){for(var t,n,r,i=g.event.special,s=0;void 0!==(n=e[s]);s++)if(X(n)){if(t=n[$.expando]){if(t.events)for(r in t.events)i[r]?g.event.remove(n,r):g.removeEvent(n,r,t.handle);n[$.expando]=void 0}n[J.expando]&&(n[J.expando]=void 0)}}}),g.fn.extend({detach:function(e){return Pt(this,e,!0)},remove:function(e){return Pt(this,e)},text:function(e){return W(this,function(e){return void 0===e?g.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Dt(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.appendChild(e)}})},prepend:function(){return Dt(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Dt(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Dt(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(g.cleanData(ct(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return g.clone(this,e,t)})},html:function(e){return W(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Tt.test(e)&&!lt[(at.exec(e)||["",""])[1].toLowerCase()]){e=g.htmlPrefilter(e);try{for(;n<r;n++)t=this[n]||{},1===t.nodeType&&(g.cleanData(ct(t,!1)),t.innerHTML=e);t=0}catch(i){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return Dt(this,arguments,function(t){var n=this.parentNode;g.inArray(this,e)<0&&(g.cleanData(ct(this)),n&&n.replaceChild(t,this))},e)}}),g.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){g.fn[e]=function(e){for(var n,r=[],i=g(e),s=i.length-1,o=0;o<=s;o++)n=o===s?this:this.clone(!0),g(i[o])[t](n),u.apply(r,n.get());return this.pushStack(r)}});var Ht=/^margin/,Bt=new RegExp("^("+Y+")(?!px)[a-z%]+$","i"),jt=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)};!function(){function t(){if(a){a.style.cssText="box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",a.innerHTML="",vt.appendChild(u);var t=e.getComputedStyle(a);n="1%"!==t.top,o="2px"===t.marginLeft,i="4px"===t.width,a.style.marginRight="50%",s="4px"===t.marginRight,vt.removeChild(u),a=null}}var n,i,s,o,u=r.createElement("div"),a=r.createElement("div");a.style&&(a.style.backgroundClip="content-box",a.cloneNode(!0).style.backgroundClip="",d.clearCloneStyle="content-box"===a.style.backgroundClip,u.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",u.appendChild(a),g.extend(d,{pixelPosition:function(){return t(),n},boxSizingReliable:function(){return t(),i},pixelMarginRight:function(){return t(),s},reliableMarginLeft:function(){return t(),o}}))}();var qt=/^(none|table(?!-c[ea]).+)/,Rt={position:"absolute",visibility:"hidden",display:"block"},Ut={letterSpacing:"0",fontWeight:"400"},zt=["Webkit","Moz","ms"],Wt=r.createElement("div").style;g.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Ft(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,s,o,u=g.camelCase(t),a=e.style;return t=g.cssProps[u]||(g.cssProps[u]=Xt(u)||u),o=g.cssHooks[t]||g.cssHooks[u],void 0===n?o&&"get"in o&&void 0!==(i=o.get(e,!1,r))?i:a[t]:(s=typeof n,"string"===s&&(i=Z.exec(n))&&i[1]&&(n=rt(e,t,i),s="number"),null!=n&&n===n&&("number"===s&&(n+=i&&i[3]||(g.cssNumber[u]?"":"px")),d.clearCloneStyle||""!==n||0!==t.indexOf("background")||(a[t]="inherit"),o&&"set"in o&&void 0===(n=o.set(e,n,r))||(a[t]=n)),void 0)}},css:function(e,t,n,r){var i,s,o,u=g.camelCase(t);return t=g.cssProps[u]||(g.cssProps[u]=Xt(u)||u),o=g.cssHooks[t]||g.cssHooks[u],o&&"get"in o&&(i=o.get(e,!0,n)),void 0===i&&(i=Ft(e,t,r)),"normal"===i&&t in Ut&&(i=Ut[t]),""===n||n?(s=parseFloat(i),n===!0||isFinite(s)?s||0:i):i}}),g.each(["height","width"],function(e,t){g.cssHooks[t]={get:function(e,n,r){if(n)return!qt.test(g.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Jt(e,t,r):nt(e,Rt,function(){return Jt(e,t,r)})},set:function(e,n,r){var i,s=r&&jt(e),o=r&&$t(e,t,r,"border-box"===g.css(e,"boxSizing",!1,s),s);return o&&(i=Z.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=g.css(e,t)),Vt(e,n,o)}}}),g.cssHooks.marginLeft=It(d.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Ft(e,"marginLeft"))||e.getBoundingClientRect().left-nt(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),g.each({margin:"",padding:"",border:"Width"},function(e,t){g.cssHooks[e+t]={expand:function(n){for(var r=0,i={},s="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+et[r]+t]=s[r]||s[r-2]||s[0];return i}},Ht.test(e)||(g.cssHooks[e+t].set=Vt)}),g.fn.extend({css:function(e,t){return W(this,function(e,t,n){var r,i,s={},o=0;if(g.isArray(t)){for(r=jt(e),i=t.length;o<i;o++)s[t[o]]=g.css(e,t[o],!1,r);return s}return void 0!==n?g.style(e,t,n):g.css(e,t)},e,t,arguments.length>1)}}),g.Tween=Kt,Kt.prototype={constructor:Kt,init:function(e,t,n,r,i,s){this.elem=e,this.prop=n,this.easing=i||g.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=s||(g.cssNumber[n]?"":"px")},cur:function(){var e=Kt.propHooks[this.prop];return e&&e.get?e.get(this):Kt.propHooks._default.get(this)},run:function(e){var t,n=Kt.propHooks[this.prop];return this.options.duration?this.pos=t=g.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Kt.propHooks._default.set(this),this}},Kt.prototype.init.prototype=Kt.prototype,Kt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=g.css(e.elem,e.prop,""),t&&"auto"!==t?t:0)},set:function(e){g.fx.step[e.prop]?g.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[g.cssProps[e.prop]]&&!g.cssHooks[e.prop]?e.elem[e.prop]=e.now:g.style(e.elem,e.prop,e.now+e.unit)}}},Kt.propHooks.scrollTop=Kt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},g.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},g.fx=Kt.prototype.init,g.fx.step={};var Qt,Gt,Yt=/^(?:toggle|show|hide)$/,Zt=/queueHooks$/;g.Animation=g.extend(un,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return rt(n.elem,e,Z.exec(t),n),n}]},tweener:function(e,t){g.isFunction(e)?(t=e,e=["*"]):e=e.match(B);for(var n,r=0,i=e.length;r<i;r++)n=e[r],un.tweeners[n]=un.tweeners[n]||[],un.tweeners[n].unshift(t)},prefilters:[sn],prefilter:function(e,t){t?un.prefilters.unshift(e):un.prefilters.push(e)}}),g.speed=function(e,t,n){var i=e&&"object"==typeof e?g.extend({},e):{complete:n||!n&&t||g.isFunction(e)&&e,duration:e,easing:n&&t||t&&!g.isFunction(t)&&t};return g.fx.off||r.hidden?i.duration=0:i.duration="number"==typeof i.duration?i.duration:i.duration in g.fx.speeds?g.fx.speeds[i.duration]:g.fx.speeds._default,null!=i.queue&&i.queue!==!0||(i.queue="fx"),i.old=i.complete,i.complete=function(){g.isFunction(i.old)&&i.old.call(this),i.queue&&g.dequeue(this,i.queue)},i},g.fn.extend({fadeTo:function(e,t,n,r){return this.filter(tt).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=g.isEmptyObject(e),s=g.speed(t,n,r),o=function(){var t=un(this,g.extend({},e),s);(i||$.get(this,"finish"))&&t.stop(!0)};return o.finish=o,i||s.queue===!1?this.each(o):this.queue(s.queue,o)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",s=g.timers,o=$.get(this);if(i)o[i]&&o[i].stop&&r(o[i]);else for(i in o)o[i]&&o[i].stop&&Zt.test(i)&&r(o[i]);for(i=s.length;i--;)s[i].elem!==this||null!=e&&s[i].queue!==e||(s[i].anim.stop(n),t=!1,s.splice(i,1));!t&&n||g.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=$.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],s=g.timers,o=r?r.length:0;for(n.finish=!0,g.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=s.length;t--;)s[t].elem===this&&s[t].queue===e&&(s[t].anim.stop(!0),s.splice(t,1));for(t=0;t<o;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),g.each(["toggle","show","hide"],function(e,t){var n=g.fn[t];g.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(nn(t,!0),e,r,i)}}),g.each({slideDown:nn("show"),slideUp:nn("hide"),slideToggle:nn("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){g.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),g.timers=[],g.fx.tick=function(){var e,t=0,n=g.timers;for(Qt=g.now();t<n.length;t++)e=n[t],e()||n[t]!==e||n.splice(t--,1);n.length||g.fx.stop(),Qt=void 0},g.fx.timer=function(e){g.timers.push(e),e()?g.fx.start():g.timers.pop()},g.fx.interval=13,g.fx.start=function(){Gt||(Gt=e.requestAnimationFrame?e.requestAnimationFrame(en):e.setInterval(g.fx.tick,g.fx.interval))},g.fx.stop=function(){e.cancelAnimationFrame?e.cancelAnimationFrame(Gt):e.clearInterval(Gt),Gt=null},g.fx.speeds={slow:600,fast:200,_default:400},g.fn.delay=function(t,n){return t=g.fx?g.fx.speeds[t]||t:t,n=n||"fx",this.queue(n,function(n,r){var i=e.setTimeout(n,t);r.stop=function(){e.clearTimeout(i)}})},function(){var e=r.createElement("input"),t=r.createElement("select"),n=t.appendChild(r.createElement("option"));e.type="checkbox",d.checkOn=""!==e.value,d.optSelected=n.selected,e=r.createElement("input"),e.value="t",e.type="radio",d.radioValue="t"===e.value}();var an,fn=g.expr.attrHandle;g.fn.extend({attr:function(e,t){return W(this,g.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){g.removeAttr(this,e)})}}),g.extend({attr:function(e,t,n){var r,i,s=e.nodeType;if(3!==s&&8!==s&&2!==s)return"undefined"==typeof e.getAttribute?g.prop(e,t,n):(1===s&&g.isXMLDoc(e)||(i=g.attrHooks[t.toLowerCase()]||(g.expr.match.bool.test(t)?an:void 0)),void 0!==n?null===n?void g.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:(r=g.find.attr(e,t),null==r?void 0:r))},attrHooks:{type:{set:function(e,t){if(!d.radioValue&&"radio"===t&&g.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(B);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),an={set:function(e,t,n){return t===!1?g.removeAttr(e,n):e.setAttribute(n,n),n}},g.each(g.expr.match.bool.source.match(/\w+/g),function(e,t){var n=fn[t]||g.find.attr;fn[t]=function(e,t,r){var i,s,o=t.toLowerCase();return r||(s=fn[o],fn[o]=i,i=null!=n(e,t,r)?o:null,fn[o]=s),i}});var ln=/^(?:input|select|textarea|button)$/i,cn=/^(?:a|area)$/i;g.fn.extend({prop:function(e,t){return W(this,g.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[g.propFix[e]||e]})}}),g.extend({prop:function(e,t,n){var r,i,s=e.nodeType;if(3!==s&&8!==s&&2!==s)return 1===s&&g.isXMLDoc(e)||(t=g.propFix[t]||t,i=g.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=g.find.attr(e,"tabindex");return t?parseInt(t,10):ln.test(e.nodeName)||cn.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),d.optSelected||(g.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),g.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){g.propFix[this.toLowerCase()]=this});var hn=/[\t\r\n\f]/g;g.fn.extend({addClass:function(e){var t,n,r,i,s,o,u,a=0;if(g.isFunction(e))return this.each(function(t){g(this).addClass(e.call(this,t,pn(this)))});if("string"==typeof e&&e){t=e.match(B)||[];while(n=this[a++])if(i=pn(n),r=1===n.nodeType&&(" "+i+" ").replace(hn," ")){o=0;while(s=t[o++])r.indexOf(" "+s+" ")<0&&(r+=s+" ");u=g.trim(r),i!==u&&n.setAttribute("class",u)}}return this},removeClass:function(e){var t,n,r,i,s,o,u,a=0;if(g.isFunction(e))return this.each(function(t){g(this).removeClass(e.call(this,t,pn(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e){t=e.match(B)||[];while(n=this[a++])if(i=pn(n),r=1===n.nodeType&&(" "+i+" ").replace(hn," ")){o=0;while(s=t[o++])while(r.indexOf(" "+s+" ")>-1)r=r.replace(" "+s+" "," ");u=g.trim(r),i!==u&&n.setAttribute("class",u)}}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):g.isFunction(e)?this.each(function(n){g(this).toggleClass(e.call(this,n,pn(this),t),t)}):this.each(function(){var t,r,i,s;if("string"===n){r=0,i=g(this),s=e.match(B)||[];while(t=s[r++])i.hasClass(t)?i.removeClass(t):i.addClass(t)}else void 0!==e&&"boolean"!==n||(t=pn(this),t&&$.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||e===!1?"":$.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&(" "+pn(n)+" ").replace(hn," ").indexOf(t)>-1)return!0;return!1}});var dn=/\r/g,vn=/[\x20\t\r\n\f]+/g;g.fn.extend({val:function(e){var t,n,r,i=this[0];if(arguments.length)return r=g.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(i=r?e.call(this,n,g(this).val()):e,null==i?i="":"number"==typeof i?i+="":g.isArray(i)&&(i=g.map(i,function(e){return null==e?"":e+""})),t=g.valHooks[this.type]||g.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return t=g.valHooks[i.type]||g.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(dn,""):null==n?"":n)}}),g.extend({valHooks:{option:{get:function(e){var t=g.find.attr(e,"value");return null!=t?t:g.trim(g.text(e)).replace(vn," ")}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,s="select-one"===e.type,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;a<u;a++)if(n=r[a],(n.selected||a===i)&&!n.disabled&&(!n.parentNode.disabled||!g.nodeName(n.parentNode,"optgroup"))){if(t=g(n).val(),s)return t;o.push(t)}return o},set:function(e,t){var n,r,i=e.options,s=g.makeArray(t),o=i.length;while(o--)r=i[o],(r.selected=g.inArray(g.valHooks.option.get(r),s)>-1)&&(n=!0);return n||(e.selectedIndex=-1),s}}}}),g.each(["radio","checkbox"],function(){g.valHooks[this]={set:function(e,t){if(g.isArray(t))return e.checked=g.inArray(g(e).val(),t)>-1}},d.checkOn||(g.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var mn=/^(?:focusinfocus|focusoutblur)$/;g.extend(g.event,{trigger:function(t,n,i,s){var o,u,a,f,l,h,p,d=[i||r],v=c.call(t,"type")?t.type:t,m=c.call(t,"namespace")?t.namespace.split("."):[];if(u=a=i=i||r,3!==i.nodeType&&8!==i.nodeType&&!mn.test(v+g.event.triggered)&&(v.indexOf(".")>-1&&(m=v.split("."),v=m.shift(),m.sort()),l=v.indexOf(":")<0&&"on"+v,t=t[g.expando]?t:new g.Event(v,"object"==typeof t&&t),t.isTrigger=s?2:3,t.namespace=m.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),n=null==n?[t]:g.makeArray(n,[t]),p=g.event.special[v]||{},s||!p.trigger||p.trigger.apply(i,n)!==!1)){if(!s&&!p.noBubble&&!g.isWindow(i)){for(f=p.delegateType||v,mn.test(f+v)||(u=u.parentNode);u;u=u.parentNode)d.push(u),a=u;a===(i.ownerDocument||r)&&d.push(a.defaultView||a.parentWindow||e)}o=0;while((u=d[o++])&&!t.isPropagationStopped())t.type=o>1?f:p.bindType||v,h=($.get(u,"events")||{})[t.type]&&$.get(u,"handle"),h&&h.apply(u,n),h=l&&u[l],h&&h.apply&&X(u)&&(t.result=h.apply(u,n),t.result===!1&&t.preventDefault());return t.type=v,s||t.isDefaultPrevented()||p._default&&p._default.apply(d.pop(),n)!==!1||!X(i)||l&&g.isFunction(i[v])&&!g.isWindow(i)&&(a=i[l],a&&(i[l]=null),g.event.triggered=v,i[v](),g.event.triggered=void 0,a&&(i[l]=a)),t.result}},simulate:function(e,t,n){var r=g.extend(new g.Event,n,{type:e,isSimulated:!0});g.event.trigger(r,null,t)}}),g.fn.extend({trigger:function(e,t){return this.each(function(){g.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return g.event.trigger(e,t,n,!0)}}),g.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){g.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),g.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),d.focusin="onfocusin"in e,d.focusin||g.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){g.event.simulate(t,e.target,g.event.fix(e))};g.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=$.access(r,t);i||r.addEventListener(e,n,!0),$.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=$.access(r,t)-1;i?$.access(r,t,i):(r.removeEventListener(e,n,!0),$.remove(r,t))}}});var gn=e.location,yn=g.now(),bn=/\?/;g.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(r){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||g.error("Invalid XML: "+t),n};var wn=/\[\]$/,En=/\r?\n/g,Sn=/^(?:submit|button|image|reset|file)$/i,xn=/^(?:input|select|textarea|keygen)/i;g.param=function(e,t){var n,r=[],i=function(e,t){var n=g.isFunction(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(g.isArray(e)||e.jquery&&!g.isPlainObject(e))g.each(e,function(){i(this.name,this.value)});else for(n in e)Tn(n,e[n],t,i);return r.join("&")},g.fn.extend({serialize:function(){return g.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=g.prop(this,"elements");return e?g.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!g(this).is(":disabled")&&xn.test(this.nodeName)&&!Sn.test(e)&&(this.checked||!ut.test(e))}).map(function(e,t){var n=g(this).val();return null==n?null:g.isArray(n)?g.map(n,function(e){return{name:t.name,value:e.replace(En,"\r\n")}}):{name:t.name,value:n.replace(En,"\r\n")}}).get()}});var Nn=/%20/g,Cn=/#.*$/,kn=/([?&])_=[^&]*/,Ln=/^(.*?):[ \t]*([^\r\n]*)$/gm,An=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,On=/^(?:GET|HEAD)$/,Mn=/^\/\//,_n={},Dn={},Pn="*/".concat("*"),Hn=r.createElement("a");Hn.href=gn.href,g.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:gn.href,type:"GET",isLocal:An.test(gn.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Pn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":g.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Fn(Fn(e,g.ajaxSettings),t):Fn(g.ajaxSettings,e)},ajaxPrefilter:Bn(_n),ajaxTransport:Bn(Dn),ajax:function(t,n){function C(t,n,r,u){var f,h,p,E,S,x=n;l||(l=!0,a&&e.clearTimeout(a),i=void 0,o=u||"",T.readyState=t>0?4:0,f=t>=200&&t<300||304===t,r&&(E=In(d,T,r)),E=qn(d,E,T,f),f?(d.ifModified&&(S=T.getResponseHeader("Last-Modified"),S&&(g.lastModified[s]=S),S=T.getResponseHeader("etag"),S&&(g.etag[s]=S)),204===t||"HEAD"===d.type?x="nocontent":304===t?x="notmodified":(x=E.state,h=E.data,p=E.error,f=!p)):(p=x,!t&&x||(x="error",t<0&&(t=0))),T.status=t,T.statusText=(n||x)+"",f?y.resolveWith(v,[h,x,T]):y.rejectWith(v,[T,x,p]),T.statusCode(w),w=void 0,c&&m.trigger(f?"ajaxSuccess":"ajaxError",[T,d,f?h:p]),b.fireWith(v,[T,x]),c&&(m.trigger("ajaxComplete",[T,d]),--g.active||g.event.trigger("ajaxStop")))}"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,s,o,u,a,f,l,c,h,p,d=g.ajaxSetup({},n),v=d.context||d,m=d.context&&(v.nodeType||v.jquery)?g(v):g.event,y=g.Deferred(),b=g.Callbacks("once memory"),w=d.statusCode||{},E={},S={},x="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(l){if(!u){u={};while(t=Ln.exec(o))u[t[1].toLowerCase()]=t[2]}t=u[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return l?o:null},setRequestHeader:function(e,t){return null==l&&(e=S[e.toLowerCase()]=S[e.toLowerCase()]||e,E[e]=t),this},overrideMimeType:function(e){return null==l&&(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(l)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||x;return i&&i.abort(t),C(0,t),this}};if(y.promise(T),d.url=((t||d.url||gn.href)+"").replace(Mn,gn.protocol+"//"),d.type=n.method||n.type||d.method||d.type,d.dataTypes=(d.dataType||"*").toLowerCase().match(B)||[""],null==d.crossDomain){f=r.createElement("a");try{f.href=d.url,f.href=f.href,d.crossDomain=Hn.protocol+"//"+Hn.host!=f.protocol+"//"+f.host}catch(N){d.crossDomain=!0}}if(d.data&&d.processData&&"string"!=typeof d.data&&(d.data=g.param(d.data,d.traditional)),jn(_n,d,n,T),l)return T;c=g.event&&d.global,c&&0===g.active++&&g.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!On.test(d.type),s=d.url.replace(Cn,""),d.hasContent?d.data&&d.processData&&0===(d.contentType||"").indexOf("application/x-www-form-urlencoded")&&(d.data=d.data.replace(Nn,"+")):(p=d.url.slice(s.length),d.data&&(s+=(bn.test(s)?"&":"?")+d.data,delete d.data),d.cache===!1&&(s=s.replace(kn,""),p=(bn.test(s)?"&":"?")+"_="+yn++ +p),d.url=s+p),d.ifModified&&(g.lastModified[s]&&T.setRequestHeader("If-Modified-Since",g.lastModified[s]),g.etag[s]&&T.setRequestHeader("If-None-Match",g.etag[s])),(d.data&&d.hasContent&&d.contentType!==!1||n.contentType)&&T.setRequestHeader("Content-Type",d.contentType),T.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+Pn+"; q=0.01":""):d.accepts["*"]);for(h in d.headers)T.setRequestHeader(h,d.headers[h]);if(d.beforeSend&&(d.beforeSend.call(v,T,d)===!1||l))return T.abort();if(x="abort",b.add(d.complete),T.done(d.success),T.fail(d.error),i=jn(Dn,d,n,T)){if(T.readyState=1,c&&m.trigger("ajaxSend",[T,d]),l)return T;d.async&&d.timeout>0&&(a=e.setTimeout(function(){T.abort("timeout")},d.timeout));try{l=!1,i.send(E,C)}catch(N){if(l)throw N;C(-1,N)}}else C(-1,"No Transport");return T},getJSON:function(e,t,n){return g.get(e,t,n,"json")},getScript:function(e,t){return g.get(e,void 0,t,"script")}}),g.each(["get","post"],function(e,t){g[t]=function(e,n,r,i){return g.isFunction(n)&&(i=i||r,r=n,n=void 0),g.ajax(g.extend({url:e,type:t,dataType:i,data:n,success:r},g.isPlainObject(e)&&e))}}),g._evalUrl=function(e){return g.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},g.fn.extend({wrapAll:function(e){var t;return this[0]&&(g.isFunction(e)&&(e=e.call(this[0])),t=g(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return g.isFunction(e)?this.each(function(t){g(this).wrapInner(e.call(this,t))}):this.each(function(){var t=g(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=g.isFunction(e);return this.each(function(n){g(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){g(this).replaceWith(this.childNodes)}),this}}),g.expr.pseudos.hidden=function(e){return!g.expr.pseudos.visible(e)},g.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},g.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(t){}};var Rn={0:200,1223:204},Un=g.ajaxSettings.xhr();d.cors=!!Un&&"withCredentials"in Un,d.ajax=Un=!!Un,g.ajaxTransport(function(t){var n,r;if(d.cors||Un&&!t.crossDomain)return{send:function(i,s){var o,u=t.xhr();if(u.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(o in t.xhrFields)u[o]=t.xhrFields[o];t.mimeType&&u.overrideMimeType&&u.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(o in i)u.setRequestHeader(o,i[o]);n=function(e){return function(){n&&(n=r=u.onload=u.onerror=u.onabort=u.onreadystatechange=null,"abort"===e?u.abort():"error"===e?"number"!=typeof u.status?s(0,"error"):s(u.status,u.statusText):s(Rn[u.status]||u.status,u.statusText,"text"!==(u.responseType||"text")||"string"!=typeof u.responseText?{binary:u.response}:{text:u.responseText},u.getAllResponseHeaders()))}},u.onload=n(),r=u.onerror=n("error"),void 0!==u.onabort?u.onabort=r:u.onreadystatechange=function(){4===u.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{u.send(t.hasContent&&t.data||null)}catch(a){if(n)throw a}},abort:function(){n&&n()}}}),g.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),g.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return g.globalEval(e),e}}}),g.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),g.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(i,s){t=g("<script>").prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&s("error"===e.type?404:200,e.type)}),r.head.appendChild(t[0])},abort:function(){n&&n()}}}});var zn=[],Wn=/(=)\?(?=&|$)|\?\?/;g.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zn.pop()||g.expando+"_"+yn++;return this[e]=!0,e}}),g.ajaxPrefilter("json jsonp",function(t,n,r){var i,s,o,u=t.jsonp!==!1&&(Wn.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Wn.test(t.data)&&"data");if(u||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=g.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,u?t[u]=t[u].replace(Wn,"$1"+i):t.jsonp!==!1&&(t.url+=(bn.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return o||g.error(i+" was not called"),o[0]},t.dataTypes[0]="json",s=e[i],e[i]=function(){o=arguments},r.always(function(){void 0===s?g(e).removeProp(i):e[i]=s,t[i]&&(t.jsonpCallback=n.jsonpCallback,zn.push(i)),o&&g.isFunction(s)&&s(o[0]),o=s=void 0}),"script"}),d.createHTMLDocument=function(){var e=r.implementation.createHTMLDocument("").body;return e.innerHTML="<form></form><form></form>",2===e.childNodes.length}(),g.parseHTML=function(e,t,n){if("string"!=typeof e)return[];"boolean"==typeof t&&(n=t,t=!1);var i,s,o;return t||(d.createHTMLDocument?(t=r.implementation.createHTMLDocument(""),i=t.createElement("base"),i.href=r.location.href,t.head.appendChild(i)):t=r),s=k.exec(e),o=!n&&[],s?[t.createElement(s[1])]:(s=dt([e],t,o),o&&o.length&&g(o).remove(),g.merge([],s.childNodes))},g.fn.load=function(e,t,n){var r,i,s,o=this,u=e.indexOf(" ");return u>-1&&(r=g.trim(e.slice(u)),e=e.slice(0,u)),g.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),o.length>0&&g.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){s=arguments,o.html(r?g("<div>").append(g.parseHTML(e)).find(r):e)}).always(n&&function(e,t){o.each(function(){n.apply(this,s||[e.responseText,t,e])})}),this},g.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){g.fn[t]=function(e){return this.on(t,e)}}),g.expr.pseudos.animated=function(e){return g.grep(g.timers,function(t){return e===t.elem}).length},g.offset={setOffset:function(e,t,n){var r,i,s,o,u,a,f,l=g.css(e,"position"),c=g(e),h={};"static"===l&&(e.style.position="relative"),u=c.offset(),s=g.css(e,"top"),a=g.css(e,"left"),f=("absolute"===l||"fixed"===l)&&(s+a).indexOf("auto")>-1,f?(r=c.position(),o=r.top,i=r.left):(o=parseFloat(s)||0,i=parseFloat(a)||0),g.isFunction(t)&&(t=t.call(e,n,g.extend({},u))),null!=t.top&&(h.top=t.top-u.top+o),null!=t.left&&(h.left=t.left-u.left+i),"using"in t?t.using.call(e,h):c.css(h)}},g.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){g.offset.setOffset(this,e,t)});var t,n,r,i,s=this[0];if(s)return s.getClientRects().length?(r=s.getBoundingClientRect(),r.width||r.height?(i=s.ownerDocument,n=Xn(i),t=i.documentElement,{top:r.top+n.pageYOffset-t.clientTop,left:r.left+n.pageXOffset-t.clientLeft}):r):{top:0,left:0}},position:function(){if(this[0]){var e,t,n=this[0],r={top:0,left:0};return"fixed"===g.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),g.nodeName(e[0],"html")||(r=e.offset()),r={top:r.top+g.css(e[0],"borderTopWidth",!0),left:r.left+g.css(e[0],"borderLeftWidth",!0)}),{top:t.top-r.top-g.css(n,"marginTop",!0),left:t.left-r.left-g.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===g.css(e,"position"))e=e.offsetParent;return e||vt})}}),g.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;g.fn[e]=function(r){return W(this,function(e,r,i){var s=Xn(e);return void 0===i?s?s[t]:e[r]:void (s?s.scrollTo(n?s.pageXOffset:i,n?i:s.pageYOffset):e[r]=i)},e,r,arguments.length)}}),g.each(["top","left"],function(e,t){g.cssHooks[t]=It(d.pixelPosition,function(e,n){if(n)return n=Ft(e,t),Bt.test(n)?g(e).position()[t]+"px":n})}),g.each({Height:"height",Width:"width"},function(e,t){g.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){g.fn[r]=function(i,s){var o=arguments.length&&(n||"boolean"!=typeof i),u=n||(i===!0||s===!0?"margin":"border");return W(this,function(t,n,i){var s;return g.isWindow(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(s=t.documentElement,Math.max(t.body["scroll"+e],s["scroll"+e],t.body["offset"+e],s["offset"+e],s["client"+e])):void 0===i?g.css(t,n,u):g.style(t,n,i,u)},t,o?i:void 0,o)}})}),g.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),g.parseJSON=JSON.parse,"function"==typeof define&&define.amd&&define("jquery",[],function(){return g});var Vn=e.jQuery,$n=e.$;return g.noConflict=function(t){return e.$===g&&(e.$=$n),t&&e.jQuery===g&&(e.jQuery=Vn),g},t||(e.jQuery=e.$=g),g}),define("config",["jquery"],function(e){function r(){if(typeof Storage!="undefined"&&window.swish.config_hash){var e;if(e=localStorage.getItem(t)){value=JSON.parse(e);if(value.hash==window.swish.config_hash)return value.config}}}function i(e){typeof Storage!="undefined"&&window.swish.config_hash&&localStorage.setItem(t,JSON.stringify({hash:window.swish.config_hash,config:e}))}var t="SWISHCONFIG",n;return n||(n=r())||e.ajax("swish_config.json",{dataType:"json",async:!1,success:function(e){n=e,i(n)},error:function(){alert("Failed to fetch configuration from server")}}),n}),define("preferences",["jquery"],function(e){function i(){var e=localStorage.getItem("notagain")||"[]",t;try{data=JSON.parse(e),typeof data!="object"&&(data=[])}catch(n){data=[]}return data}var t=typeof Storage!="undefined",n={},r={persistent:function(){return t},setNotAgain:function(e){if(t){var n=i();n.indexOf(e)<0&&(n.push(e),localStorage.setItem("notagain",JSON.stringify(n)))}},notagain:function(e){if(t){var n=i();return n.indexOf(e)>=0}return!1},broadcast:function(t,n){e(".swish-event-receiver").trigger("preference",{name:t,value:n})},setVal:function(e,n){t&&localStorage.setItem(e,JSON.stringify(n)),this.broadcast(e,n)},setDefault:function(e,t){n[e]=t},getVal:function(e){if(t){var r;if(r=localStorage.getItem(e))return value=JSON.parse(r),value}return n[e]}};return r}),define("history",["jquery","preferences"],function(e,t){var n={push:function(e){var t=window.location.pathname;if(t!=e.url){var n={location:e.url};e.meta&&(n.meta=e.meta),window.history.pushState(n,"",e.url),document.title="SWISH -- "+(e.file?e.file:"SWI-Prolog for SHaring")}},pop:function(t){t.state&&(t.state.meta&&t.state.meta.name?e(".swish").swish("playFile",t.state.meta.name):t.state.location&&(window.location=t.state.location))},recentMaxLength:10,addRecent:function(e){function i(e,t){return e.type==t.type&&e.id==t.id}var r=t.getVal("recentDocuments")||[];for(var s=0;s<r.length;s++)if(i(e,r[s])){r.splice(s,1);break}while(r.length+1>n.recentMaxLength)r.pop();r.splice(0,0,e),t.setVal("recentDocuments",r)},openRecent:function(e,t){return n.openRecent[t.st_type](e,t)},updateRecentUL:function(){var n=e(this),r=t.getVal("recentDocuments")||[];n.html("");for(var i=0;i<r.length;i++){var s=r[i],o=e.el.a(s.label||s.id);e(o).data("document",s),n.append(e.el.li(o))}}};return n.openRecent.gitty=function(t,n){e(t.target).parents(".swish").swish("playFile",n.id)},window.onpopstate=n.pop,n}),define("links",["jquery","config","modal"],function(e,t,n){var r={PlDoc:function(t,n){function r(e){var t={},n;(n=e.indexOf(":"))>0&&(t.module=e.substring(0,n),e=e.slice(n+1));if((n=e.indexOf("/"))>0){t.name=e.substring(0,n),e.charAt(n+1)=="/"?t.arity=parseInt(e.slice(n+2))+2:t.arity=parseInt(e.slice(n+1));if(!isNaN(t.arity))return t}}if(t){var i=r(decodeURIComponent(t));if(i)return e(n.target).closest("#ajaxModal").modal("hide"),e(".swish-event-receiver").trigger("pldoc",i),n.preventDefault(),!0}return!1},runQueryLink:function(t,r){var i=t.closest(".notebook"),s=t.data("query"),o=i.find('.nb-cell[name="'+s+'"]');if(o){var u=e().prologEditor("variables",o.nbCell("text"),!0),a="",f={},l=[];function c(e){for(var t=0;t<u.length;t++)if(u[t].toLowerCase()==e.toLowerCase())return u[t];l.push(e)}e.each(t.data(),function(e,t){var n;e!=="query"&&(n=c(e))&&(a!=""&&(a+=", "),a+=n+" = ("+t+")")}),l.length>0&&n.feedback({owner:i,type:"warning",duration:3e3,html:"The variables <b>"+l.join(", ")+"</b> do not appear in "+"query <b>"+s+"</b>"}),a!=""&&(f.bindings=a),o.nbCell("run",f)}},followLink:function(n){function o(){s=!0,n.preventDefault(),e(n.target).closest("#ajaxModal").modal("hide")}var i=e(n.target).closest("a"),s=!1;if(i.attr("href")){var u=t.http.locations.swish+"p/",a=t.http.locations.swish+"example/",f=i.attr("href"),l;if(f.startsWith(u)&&!f.match(/#/))o(),file=f.slice(u.length),e(n.target).parents(".swish").swish("playFile",file);else if(i.hasClass("store"))o(),l.alert("File does not appear to come from gitty store?");else if(i.hasClass("file")||f.startsWith(a)&&!f.match(/#/))o(),e(n.target).parents(".swish").swish("playURL",{url:f});else if(i.hasClass("builtin")&&f.match(/predicate=/))s=r.PlDoc(f.split("predicate=").pop(),n);else if(f.match(/object=/))s=r.PlDoc(f.split("object=").pop(),n);else if((l=e(n.target).closest("#ajaxModal")).length==1&&f.match(/#/)){var c=f.split("#").pop(),h;(h=l.find("#"+c)).length==1&&(s=!0,n.preventDefault(),l.animate({scrollTop:h.position().top},2e3))}s||(n.preventDefault(),window.open(f,"_blank"))}else i.data("query")&&r.runQueryLink(i,n)}};return r}),function(e){function n(){var e=document.createElement(arguments[0]);for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r===null||r===undefined)continue;if(r.nodeType===1)e.appendChild(r);else if(!(r===""||r&&r.charCodeAt&&r.substr)&&!(r===0||r&&r.toExponential&&r.toFixed)){if(n===1&&typeof r=="object"){for(var i in r)if(r.hasOwnProperty(i)){var s=r[i];if(s!==null&&s!==undefined){i=i.toLowerCase(),i=t[i]||i;var o=i.charAt(0)==="o"&&i.charAt(1)==="n";o?(r.href===undefined&&i==="onclick"&&e.setAttribute("href","#"),e[i]=s):i==="style"&&e.style.setAttribute?e.style.setAttribute("cssText",s):i==="className"||i==="htmlFor"?e[i]=s:e.setAttribute(i,s)}}}else if(Object.prototype.toString.call(r)==="[object Array]")for(var u=0;u<r.length;u++){var a=r[u];a.nodeType===1&&e.appendChild(a)}}else e.appendChild(document.createTextNode(r))}return e.appendTo=function(e){return e.nodeType===1&&this.nodeType===1&&e.appendChild(this),this},e}var t={acceptcharset:"acceptCharset",accesskey:"accessKey",allowtransparency:"allowTransparency",bgcolor:"bgColor",cellpadding:"cellPadding",cellspacing:"cellSpacing","class":"className",classname:"className",colspan:"colSpan",csstext:"style",defaultchecked:"defaultChecked",defaultselected:"defaultSelected",defaultvalue:"defaultValue","for":"htmlFor",frameborder:"frameBorder",hspace:"hSpace",htmlfor:"htmlFor",longdesc:"longDesc",maxlength:"maxLength",marginwidth:"marginWidth",marginheight:"marginHeight",noresize:"noResize",noshade:"noShade",readonly:"readOnly",rowspan:"rowSpan",tabindex:"tabIndex",valign:"vAlign",vspace:"vSpace"};n.registerElement=function(e,t){n[e]||(n[e]=function(){var r=n("div",{"class":e});return t.apply(r,Array.prototype.slice.call(arguments)),r})};var r=["acronym","applet","basefont","big","center","dir","font","frame","frameset","noframes","strike","tt","u","xmp"],i=["a","abbr","address","area","article","aside","audio","b","base","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","command","datalist","dd","del","details","dfn","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","keygen","kbd","label","legend","li","link","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","picture","param","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","ul","var","video","wbr"].concat(r),s=function(e){return function(){return n.apply(this,[e].concat(Array.prototype.slice.call(arguments)))}};for(var o=0;o<i.length;o++)n[i[o]]=s(i[o]);if(typeof module!="undefined"&&module.exports)module.exports=n;else{var u=e.$||{};u.el=n,e.$=u}}(this),define("laconic",["jquery"],function(){});if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(e){var t=e.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||1==t[0]&&9==t[1]&&t[2]<1||t[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(jQuery),+function(e){function t(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in t)if(void 0!==e.style[n])return{end:t[n]};return!1}e.fn.emulateTransitionEnd=function(t){var n=!1,r=this;e(this).one("bsTransitionEnd",function(){n=!0});var i=function(){n||e(r).trigger(e.support.transition.end)};return setTimeout(i,t),this},e(function(){e.support.transition=t(),e.support.transition&&(e.event.special.bsTransitionEnd={bindType:e.support.transition.end,delegateType:e.support.transition.end,handle:function(t){if(e(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}})})}(jQuery),+function(e){function t(t){return this.each(function(){var n=e(this),i=n.data("bs.alert");i||n.data("bs.alert",i=new r(this)),"string"==typeof t&&i[t].call(n)})}var n='[data-dismiss="alert"]',r=function(t){e(t).on("click",n,this.close)};r.VERSION="3.3.7",r.TRANSITION_DURATION=150,r.prototype.close=function(t){function n(){o.detach().trigger("closed.bs.alert").remove()}var i=e(this),s=i.attr("data-target");s||(s=i.attr("href"),s=s&&s.replace(/.*(?=#[^\s]*$)/,""));var o=e("#"===s?[]:s);t&&t.preventDefault(),o.length||(o=i.closest(".alert")),o.trigger(t=e.Event("close.bs.alert")),t.isDefaultPrevented()||(o.removeClass("in"),e.support.transition&&o.hasClass("fade")?o.one("bsTransitionEnd",n).emulateTransitionEnd(r.TRANSITION_DURATION):n())};var i=e.fn.alert;e.fn.alert=t,e.fn.alert.Constructor=r,e.fn.alert.noConflict=function(){return e.fn.alert=i,this},e(document).on("click.bs.alert.data-api",n,r.prototype.close)}(jQuery),+function(e){function t(t){return this.each(function(){var r=e(this),i=r.data("bs.button"),s="object"==typeof t&&t;i||r.data("bs.button",i=new n(this,s)),"toggle"==t?i.toggle():t&&i.setState(t)})}var n=function(t,r){this.$element=e(t),this.options=e.extend({},n.DEFAULTS,r),this.isLoading=!1};n.VERSION="3.3.7",n.DEFAULTS={loadingText:"loading..."},n.prototype.setState=function(t){var n="disabled",r=this.$element,i=r.is("input")?"val":"html",s=r.data();t+="Text",null==s.resetText&&r.data("resetText",r[i]()),setTimeout(e.proxy(function(){r[i](null==s[t]?this.options[t]:s[t]),"loadingText"==t?(this.isLoading=!0,r.addClass(n).attr(n,n).prop(n,!0)):this.isLoading&&(this.isLoading=!1,r.removeClass(n).removeAttr(n).prop(n,!1))},this),0)},n.prototype.toggle=function(){var e=!0,t=this.$element.closest('[data-toggle="buttons"]');if(t.length){var n=this.$element.find("input");"radio"==n.prop("type")?(n.prop("checked")&&(e=!1),t.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==n.prop("type")&&(n.prop("checked")!==this.$element.hasClass("active")&&(e=!1),this.$element.toggleClass("active")),n.prop("checked",this.$element.hasClass("active")),e&&n.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var r=e.fn.button;e.fn.button=t,e.fn.button.Constructor=n,e.fn.button.noConflict=function(){return e.fn.button=r,this},e(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(n){var r=e(n.target).closest(".btn");t.call(r,"toggle"),e(n.target).is('input[type="radio"], input[type="checkbox"]')||(n.preventDefault(),r.is("input,button")?r.trigger("focus"):r.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(t){e(t.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(t.type))})}(jQuery),+function(e){function t(t){return this.each(function(){var r=e(this),i=r.data("bs.carousel"),s=e.extend({},n.DEFAULTS,r.data(),"object"==typeof t&&t),o="string"==typeof t?t:s.slide;i||r.data("bs.carousel",i=new n(this,s)),"number"==typeof t?i.to(t):o?i[o]():s.interval&&i.pause().cycle()})}var n=function(t,n){this.$element=e(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=n,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",e.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",e.proxy(this.pause,this)).on("mouseleave.bs.carousel",e.proxy(this.cycle,this))};n.VERSION="3.3.7",n.TRANSITION_DURATION=600,n.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},n.prototype.keydown=function(e){if(!/input|textarea/i.test(e.target.tagName)){switch(e.which){case 37:this.prev();break;case 39:this.next();break;default:return}e.preventDefault()}},n.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},n.prototype.getItemIndex=function(e){return this.$items=e.parent().children(".item"),this.$items.index(e||this.$active)},n.prototype.getItemForDirection=function(e,t){var n=this.getItemIndex(t),r="prev"==e&&0===n||"next"==e&&n==this.$items.length-1;if(r&&!this.options.wrap)return t;var i="prev"==e?-1:1,s=(n+i)%this.$items.length;return this.$items.eq(s)},n.prototype.to=function(e){var t=this,n=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(e>this.$items.length-1||e<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){t.to(e)}):n==e?this.pause().cycle():this.slide(e>n?"next":"prev",this.$items.eq(e))},n.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition&&(this.$element.trigger(e.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},n.prototype.next=function(){if(!this.sliding)return this.slide("next")},n.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},n.prototype.slide=function(t,r){var i=this.$element.find(".item.active"),s=r||this.getItemForDirection(t,i),o=this.interval,u="next"==t?"left":"right",f=this;if(s.hasClass("active"))return this.sliding=!1;var l=s[0],h=e.Event("slide.bs.carousel",{relatedTarget:l,direction:u});if(this.$element.trigger(h),!h.isDefaultPrevented()){if(this.sliding=!0,o&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var p=e(this.$indicators.children()[this.getItemIndex(s)]);p&&p.addClass("active")}var d=e.Event("slid.bs.carousel",{relatedTarget:l,direction:u});return e.support.transition&&this.$element.hasClass("slide")?(s.addClass(t),s[0].offsetWidth,i.addClass(u),s.addClass(u),i.one("bsTransitionEnd",function(){s.removeClass([t,u].join(" ")).addClass("active"),i.removeClass(["active",u].join(" ")),f.sliding=!1,setTimeout(function(){f.$element.trigger(d)},0)}).emulateTransitionEnd(n.TRANSITION_DURATION)):(i.removeClass("active"),s.addClass("active"),this.sliding=!1,this.$element.trigger(d)),o&&this.cycle(),this}};var r=e.fn.carousel;e.fn.carousel=t,e.fn.carousel.Constructor=n,e.fn.carousel.noConflict=function(){return e.fn.carousel=r,this};var i=function(n){var r,i=e(this),s=e(i.attr("data-target")||(r=i.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""));if(s.hasClass("carousel")){var o=e.extend({},s.data(),i.data()),u=i.attr("data-slide-to");u&&(o.interval=!1),t.call(s,o),u&&s.data("bs.carousel").to(u),n.preventDefault()}};e(document).on("click.bs.carousel.data-api","[data-slide]",i).on("click.bs.carousel.data-api","[data-slide-to]",i),e(window).on("load",function(){e('[data-ride="carousel"]').each(function(){var n=e(this);t.call(n,n.data())})})}(jQuery),+function(e){function t(t){var n,r=t.attr("data-target")||(n=t.attr("href"))&&n.replace(/.*(?=#[^\s]+$)/,"");return e(r)}function n(t){return this.each(function(){var n=e(this),i=n.data("bs.collapse"),s=e.extend({},r.DEFAULTS,n.data(),"object"==typeof t&&t);!i&&s.toggle&&/show|hide/.test(t)&&(s.toggle=!1),i||n.data("bs.collapse",i=new r(this,s)),"string"==typeof t&&i[t]()})}var r=function(t,n){this.$element=e(t),this.options=e.extend({},r.DEFAULTS,n),this.$trigger=e('[data-toggle="collapse"][href="#'+t.id+'"],[data-toggle="collapse"][data-target="#'+t.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};r.VERSION="3.3.7",r.TRANSITION_DURATION=350,r.DEFAULTS={toggle:!0},r.prototype.dimension=function(){var e=this.$element.hasClass("width");return e?"width":"height"},r.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var t,i=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(i&&i.length&&(t=i.data("bs.collapse"),t&&t.transitioning))){var s=e.Event("show.bs.collapse");if(this.$element.trigger(s),!s.isDefaultPrevented()){i&&i.length&&(n.call(i,"hide"),t||i.data("bs.collapse",null));var o=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[o](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var u=function(){this.$element.removeClass("collapsing").addClass("collapse in")[o](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!e.support.transition)return u.call(this);var f=e.camelCase(["scroll",o].join("-"));this.$element.one("bsTransitionEnd",e.proxy(u,this)).emulateTransitionEnd(r.TRANSITION_DURATION)[o](this.$element[0][f])}}}},r.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var t=e.Event("hide.bs.collapse");if(this.$element.trigger(t),!t.isDefaultPrevented()){var n=this.dimension();this.$element[n](this.$element[n]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var i=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return e.support.transition?void this.$element[n](0).one("bsTransitionEnd",e.proxy(i,this)).emulateTransitionEnd(r.TRANSITION_DURATION):i.call(this)}}},r.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},r.prototype.getParent=function(){return e(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(e.proxy(function(n,r){var i=e(r);this.addAriaAndCollapsedClass(t(i),i)},this)).end()},r.prototype.addAriaAndCollapsedClass=function(e,t){var n=e.hasClass("in");e.attr("aria-expanded",n),t.toggleClass("collapsed",!n).attr("aria-expanded",n)};var i=e.fn.collapse;e.fn.collapse=n,e.fn.collapse.Constructor=r,e.fn.collapse.noConflict=function(){return e.fn.collapse=i,this},e(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(r){var i=e(this);i.attr("data-target")||r.preventDefault();var s=t(i),o=s.data("bs.collapse"),u=o?"toggle":i.data();n.call(s,u)})}(jQuery),+function(e){function t(t){var n=t.attr("data-target");n||(n=t.attr("href"),n=n&&/#[A-Za-z]/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,""));var r=n&&e(n);return r&&r.length?r:t.parent()}function n(n){n&&3===n.which||(e(i).remove(),e(s).each(function(){var r=e(this),i=t(r),s={relatedTarget:this};i.hasClass("open")&&(n&&"click"==n.type&&/input|textarea/i.test(n.target.tagName)&&e.contains(i[0],n.target)||(i.trigger(n=e.Event("hide.bs.dropdown",s)),n.isDefaultPrevented()||(r.attr("aria-expanded","false"),i.removeClass("open").trigger(e.Event("hidden.bs.dropdown",s)))))}))}function r(t){return this.each(function(){var n=e(this),r=n.data("bs.dropdown");r||n.data("bs.dropdown",r=new o(this)),"string"==typeof t&&r[t].call(n)})}var i=".dropdown-backdrop",s='[data-toggle="dropdown"]',o=function(t){e(t).on("click.bs.dropdown",this.toggle)};o.VERSION="3.3.7",o.prototype.toggle=function(r){var i=e(this);if(!i.is(".disabled, :disabled")){var s=t(i),o=s.hasClass("open");if(n(),!o){"ontouchstart"in document.documentElement&&!s.closest(".navbar-nav").length&&e(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(e(this)).on("click",n);var u={relatedTarget:this};if(s.trigger(r=e.Event("show.bs.dropdown",u)),r.isDefaultPrevented())return;i.trigger("focus").attr("aria-expanded","true"),s.toggleClass("open").trigger(e.Event("shown.bs.dropdown",u))}return!1}},o.prototype.keydown=function(n){if(/(38|40|27|32)/.test(n.which)&&!/input|textarea/i.test(n.target.tagName)){var r=e(this);if(n.preventDefault(),n.stopPropagation(),!r.is(".disabled, :disabled")){var i=t(r),o=i.hasClass("open");if(!o&&27!=n.which||o&&27==n.which)return 27==n.which&&i.find(s).trigger("focus"),r.trigger("click");var u=" li:not(.disabled):visible a",l=i.find(".dropdown-menu"+u);if(l.length){var c=l.index(n.target);38==n.which&&c>0&&c--,40==n.which&&c<l.length-1&&c++,~c||(c=0),l.eq(c).trigger("focus")}}}};var u=e.fn.dropdown;e.fn.dropdown=r,e.fn.dropdown.Constructor=o,e.fn.dropdown.noConflict=function(){return e.fn.dropdown=u,this},e(document).on("click.bs.dropdown.data-api",n).on("click.bs.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on("click.bs.dropdown.data-api",s,o.prototype.toggle).on("keydown.bs.dropdown.data-api",s,o.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",o.prototype.keydown)}(jQuery),+function(e){function t(t,r){return this.each(function(){var i=e(this),s=i.data("bs.modal"),o=e.extend({},n.DEFAULTS,i.data(),"object"==typeof t&&t);s||i.data("bs.modal",s=new n(this,o)),"string"==typeof t?s[t](r):o.show&&s.show(r)})}var n=function(t,n){this.options=n,this.$body=e(document.body),this.$element=e(t),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,e.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};n.VERSION="3.3.7",n.TRANSITION_DURATION=300,n.BACKDROP_TRANSITION_DURATION=150,n.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},n.prototype.toggle=function(e){return this.isShown?this.hide():this.show(e)},n.prototype.show=function(t){var r=this,i=e.Event("show.bs.modal",{relatedTarget:t});this.$element.trigger(i),this.isShown||i.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',e.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){r.$element.one("mouseup.dismiss.bs.modal",function(t){e(t.target).is(r.$element)&&(r.ignoreBackdropClick=!0)})}),this.backdrop(function(){var i=e.support.transition&&r.$element.hasClass("fade");r.$element.parent().length||r.$element.appendTo(r.$body),r.$element.show().scrollTop(0),r.adjustDialog(),i&&r.$element[0].offsetWidth,r.$element.addClass("in"),r.enforceFocus();var s=e.Event("shown.bs.modal",{relatedTarget:t});i?r.$dialog.one("bsTransitionEnd",function(){r.$element.trigger("focus").trigger(s)}).emulateTransitionEnd(n.TRANSITION_DURATION):r.$element.trigger("focus").trigger(s)}))},n.prototype.hide=function(t){t&&t.preventDefault(),t=e.Event("hide.bs.modal"),this.$element.trigger(t),this.isShown&&!t.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),e(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),e.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",e.proxy(this.hideModal,this)).emulateTransitionEnd(n.TRANSITION_DURATION):this.hideModal())},n.prototype.enforceFocus=function(){e(document).off("focusin.bs.modal").on("focusin.bs.modal",e.proxy(function(e){document===e.target||this.$element[0]===e.target||this.$element.has(e.target).length||this.$element.trigger("focus")},this))},n.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",e.proxy(function(e){27==e.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},n.prototype.resize=function(){this.isShown?e(window).on("resize.bs.modal",e.proxy(this.handleUpdate,this)):e(window).off("resize.bs.modal")},n.prototype.hideModal=function(){var e=this;this.$element.hide(),this.backdrop(function(){e.$body.removeClass("modal-open"),e.resetAdjustments(),e.resetScrollbar(),e.$element.trigger("hidden.bs.modal")})},n.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},n.prototype.backdrop=function(t){var r=this,i=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var s=e.support.transition&&i;if(this.$backdrop=e(document.createElement("div")).addClass("modal-backdrop "+i).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",e.proxy(function(e){return this.ignoreBackdropClick?void (this.ignoreBackdropClick=!1):void (e.target===e.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),s&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!t)return;s?this.$backdrop.one("bsTransitionEnd",t).emulateTransitionEnd(n.BACKDROP_TRANSITION_DURATION):t()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var o=function(){r.removeBackdrop(),t&&t()};e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",o).emulateTransitionEnd(n.BACKDROP_TRANSITION_DURATION):o()}else t&&t()},n.prototype.handleUpdate=function(){this.adjustDialog()},n.prototype.adjustDialog=function(){var e=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&e?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!e?this.scrollbarWidth:""})},n.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},n.prototype.checkScrollbar=function(){var e=window.innerWidth;if(!e){var t=document.documentElement.getBoundingClientRect();e=t.right-Math.abs(t.left)}this.bodyIsOverflowing=document.body.clientWidth<e,this.scrollbarWidth=this.measureScrollbar()},n.prototype.setScrollbar=function(){var e=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",e+this.scrollbarWidth)},n.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},n.prototype.measureScrollbar=function(){var e=document.createElement("div");e.className="modal-scrollbar-measure",this.$body.append(e);var t=e.offsetWidth-e.clientWidth;return this.$body[0].removeChild(e),t};var r=e.fn.modal;e.fn.modal=t,e.fn.modal.Constructor=n,e.fn.modal.noConflict=function(){return e.fn.modal=r,this},e(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(n){var r=e(this),i=r.attr("href"),s=e(r.attr("data-target")||i&&i.replace(/.*(?=#[^\s]+$)/,"")),o=s.data("bs.modal")?"toggle":e.extend({remote:!/#/.test(i)&&i},s.data(),r.data());r.is("a")&&n.preventDefault(),s.one("show.bs.modal",function(e){e.isDefaultPrevented()||s.one("hidden.bs.modal",function(){r.is(":visible")&&r.trigger("focus")})}),t.call(s,o,this)})}(jQuery),+function(e){function t(t){return this.each(function(){var r=e(this),i=r.data("bs.tooltip"),s="object"==typeof t&&t;!i&&/destroy|hide/.test(t)||(i||r.data("bs.tooltip",i=new n(this,s)),"string"==typeof t&&i[t]())})}var n=function(e,t){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",e,t)};n.VERSION="3.3.7",n.TRANSITION_DURATION=150,n.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},n.prototype.init=function(t,n,r){if(this.enabled=!0,this.type=t,this.$element=e(n),this.options=this.getOptions(r),this.$viewport=this.options.viewport&&e(e.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var i=this.options.trigger.split(" "),s=i.length;s--;){var o=i[s];if("click"==o)this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this));else if("manual"!=o){var u="hover"==o?"mouseenter":"focusin",f="hover"==o?"mouseleave":"focusout";this.$element.on(u+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(f+"."+this.type,this.options.selector,e.proxy(this.leave,this))}}this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},n.prototype.getDefaults=function(){return n.DEFAULTS},n.prototype.getOptions=function(t){return t=e.extend({},this.getDefaults(),this.$element.data(),t),t.delay&&"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),t},n.prototype.getDelegateOptions=function(){var t={},n=this.getDefaults();return this._options&&e.each(this._options,function(e,r){n[e]!=r&&(t[e]=r)}),t},n.prototype.enter=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget).data("bs."+this.type);return n||(n=new this.constructor(t.currentTarget,this.getDelegateOptions()),e(t.currentTarget).data("bs."+this.type,n)),t instanceof e.Event&&(n.inState["focusin"==t.type?"focus":"hover"]=!0),n.tip().hasClass("in")||"in"==n.hoverState?void (n.hoverState="in"):(clearTimeout(n.timeout),n.hoverState="in",n.options.delay&&n.options.delay.show?void (n.timeout=setTimeout(function(){"in"==n.hoverState&&n.show()},n.options.delay.show)):n.show())},n.prototype.isInStateTrue=function(){for(var e in this.inState)if(this.inState[e])return!0;return!1},n.prototype.leave=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget).data("bs."+this.type);if(n||(n=new this.constructor(t.currentTarget,this.getDelegateOptions()),e(t.currentTarget).data("bs."+this.type,n)),t instanceof e.Event&&(n.inState["focusout"==t.type?"focus":"hover"]=!1),!n.isInStateTrue())return clearTimeout(n.timeout),n.hoverState="out",n.options.delay&&n.options.delay.hide?void (n.timeout=setTimeout(function(){"out"==n.hoverState&&n.hide()},n.options.delay.hide)):n.hide()},n.prototype.show=function(){var t=e.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(t);var r=e.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(t.isDefaultPrevented()||!r)return;var i=this,s=this.tip(),o=this.getUID(this.type);this.setContent(),s.attr("id",o),this.$element.attr("aria-describedby",o),this.options.animation&&s.addClass("fade");var u="function"==typeof this.options.placement?this.options.placement.call(this,s[0],this.$element[0]):this.options.placement,f=/\s?auto?\s?/i,l=f.test(u);l&&(u=u.replace(f,"")||"top"),s.detach().css({top:0,left:0,display:"block"}).addClass(u).data("bs."+this.type,this),this.options.container?s.appendTo(this.options.container):s.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var h=this.getPosition(),p=s[0].offsetWidth,d=s[0].offsetHeight;if(l){var v=u,m=this.getPosition(this.$viewport);u="bottom"==u&&h.bottom+d>m.bottom?"top":"top"==u&&h.top-d<m.top?"bottom":"right"==u&&h.right+p>m.width?"left":"left"==u&&h.left-p<m.left?"right":u,s.removeClass(v).addClass(u)}var g=this.getCalculatedOffset(u,h,p,d);this.applyPlacement(g,u);var y=function(){var e=i.hoverState;i.$element.trigger("shown.bs."+i.type),i.hoverState=null,"out"==e&&i.leave(i)};e.support.transition&&this.$tip.hasClass("fade")?s.one("bsTransitionEnd",y).emulateTransitionEnd(n.TRANSITION_DURATION):y()}},n.prototype.applyPlacement=function(t,n){var r=this.tip(),i=r[0].offsetWidth,s=r[0].offsetHeight,o=parseInt(r.css("margin-top"),10),u=parseInt(r.css("margin-left"),10);isNaN(o)&&(o=0),isNaN(u)&&(u=0),t.top+=o,t.left+=u,e.offset.setOffset(r[0],e.extend({using:function(e){r.css({top:Math.round(e.top),left:Math.round(e.left)})}},t),0),r.addClass("in");var f=r[0].offsetWidth,l=r[0].offsetHeight;"top"==n&&l!=s&&(t.top=t.top+s-l);var c=this.getViewportAdjustedDelta(n,t,f,l);c.left?t.left+=c.left:t.top+=c.top;var h=/top|bottom/.test(n),p=h?2*c.left-i+f:2*c.top-s+l,d=h?"offsetWidth":"offsetHeight";r.offset(t),this.replaceArrow(p,r[0][d],h)},n.prototype.replaceArrow=function(e,t,n){this.arrow().css(n?"left":"top",50*(1-e/t)+"%").css(n?"top":"left","")},n.prototype.setContent=function(){var e=this.tip(),t=this.getTitle();e.find(".tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("fade in top bottom left right")},n.prototype.hide=function(t){function r(){"in"!=i.hoverState&&s.detach(),i.$element&&i.$element.removeAttr("aria-describedby").trigger("hidden.bs."+i.type),t&&t()}var i=this,s=e(this.$tip),o=e.Event("hide.bs."+this.type);if(this.$element.trigger(o),!o.isDefaultPrevented())return s.removeClass("in"),e.support.transition&&s.hasClass("fade")?s.one("bsTransitionEnd",r).emulateTransitionEnd(n.TRANSITION_DURATION):r(),this.hoverState=null,this},n.prototype.fixTitle=function(){var e=this.$element;(e.attr("title")||"string"!=typeof e.attr("data-original-title"))&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},n.prototype.hasContent=function(){return this.getTitle()},n.prototype.getPosition=function(t){t=t||this.$element;var n=t[0],r="BODY"==n.tagName,i=n.getBoundingClientRect();null==i.width&&(i=e.extend({},i,{width:i.right-i.left,height:i.bottom-i.top}));var s=window.SVGElement&&n instanceof window.SVGElement,o=r?{top:0,left:0}:s?null:t.offset(),u={scroll:r?document.documentElement.scrollTop||document.body.scrollTop:t.scrollTop()},f=r?{width:e(window).width(),height:e(window).height()}:null;return e.extend({},i,u,f,o)},n.prototype.getCalculatedOffset=function(e,t,n,r){return"bottom"==e?{top:t.top+t.height,left:t.left+t.width/2-n/2}:"top"==e?{top:t.top-r,left:t.left+t.width/2-n/2}:"left"==e?{top:t.top+t.height/2-r/2,left:t.left-n}:{top:t.top+t.height/2-r/2,left:t.left+t.width}},n.prototype.getViewportAdjustedDelta=function(e,t,n,r){var i={top:0,left:0};if(!this.$viewport)return i;var s=this.options.viewport&&this.options.viewport.padding||0,o=this.getPosition(this.$viewport);if(/right|left/.test(e)){var u=t.top-s-o.scroll,a=t.top+s-o.scroll+r;u<o.top?i.top=o.top-u:a>o.top+o.height&&(i.top=o.top+o.height-a)}else{var f=t.left-s,l=t.left+s+n;f<o.left?i.left=o.left-f:l>o.right&&(i.left=o.left+o.width-l)}return i},n.prototype.getTitle=function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||("function"==typeof n.title?n.title.call(t[0]):n.title)},n.prototype.getUID=function(e){do e+=~~(1e6*Math.random());while(document.getElementById(e));return e},n.prototype.tip=function(){if(!this.$tip&&(this.$tip=e(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},n.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},n.prototype.enable=function(){this.enabled=!0},n.prototype.disable=function(){this.enabled=!1},n.prototype.toggleEnabled=function(){this.enabled=!this.enabled},n.prototype.toggle=function(t){var n=this;t&&(n=e(t.currentTarget).data("bs."+this.type),n||(n=new this.constructor(t.currentTarget,this.getDelegateOptions()),e(t.currentTarget).data("bs."+this.type,n))),t?(n.inState.click=!n.inState.click,n.isInStateTrue()?n.enter(n):n.leave(n)):n.tip().hasClass("in")?n.leave(n):n.enter(n)},n.prototype.destroy=function(){var e=this;clearTimeout(this.timeout),this.hide(function(){e.$element.off("."+e.type).removeData("bs."+e.type),e.$tip&&e.$tip.detach(),e.$tip=null,e.$arrow=null,e.$viewport=null,e.$element=null})};var r=e.fn.tooltip;e.fn.tooltip=t,e.fn.tooltip.Constructor=n,e.fn.tooltip.noConflict=function(){return e.fn.tooltip=r,this}}(jQuery),+function(e){function t(t){return this.each(function(){var r=e(this),i=r.data("bs.popover"),s="object"==typeof t&&t;!i&&/destroy|hide/.test(t)||(i||r.data("bs.popover",i=new n(this,s)),"string"==typeof t&&i[t]())})}var n=function(e,t){this.init("popover",e,t)};if(!e.fn.tooltip)throw new Error("Popover requires tooltip.js");n.VERSION="3.3.7",n.DEFAULTS=e.extend({},e.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),n.prototype=e.extend({},e.fn.tooltip.Constructor.prototype),n.prototype.constructor=n,n.prototype.getDefaults=function(){return n.DEFAULTS},n.prototype.setContent=function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".popover-title")[this.options.html?"html":"text"](t),e.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof n?"html":"append":"text"](n),e.removeClass("fade top bottom left right in"),e.find(".popover-title").html()||e.find(".popover-title").hide()},n.prototype.hasContent=function(){return this.getTitle()||this.getContent()},n.prototype.getContent=function(){var e=this.$element,t=this.options;return e.attr("data-content")||("function"==typeof t.content?t.content.call(e[0]):t.content)},n.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var r=e.fn.popover;e.fn.popover=t,e.fn.popover.Constructor=n,e.fn.popover.noConflict=function(){return e.fn.popover=r,this}}(jQuery),+function(e){function t(n,r){this.$body=e(document.body),this.$scrollElement=e(e(n).is(document.body)?window:n),this.options=e.extend({},t.DEFAULTS,r),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",e.proxy(this.process,this)),this.refresh(),this.process()}function n(n){return this.each(function(){var r=e(this),i=r.data("bs.scrollspy"),s="object"==typeof n&&n;i||r.data("bs.scrollspy",i=new t(this,s)),"string"==typeof n&&i[n]()})}t.VERSION="3.3.7",t.DEFAULTS={offset:10},t.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},t.prototype.refresh=function(){var t=this,n="offset",r=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),e.isWindow(this.$scrollElement[0])||(n="position",r=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var t=e(this),i=t.data("target")||t.attr("href"),s=/^#./.test(i)&&e(i);return s&&s.length&&s.is(":visible")&&[[s[n]().top+r,i]]||null}).sort(function(e,t){return e[0]-t[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},t.prototype.process=function(){var e,t=this.$scrollElement.scrollTop()+this.options.offset,n=this.getScrollHeight(),r=this.options.offset+n-this.$scrollElement.height(),i=this.offsets,s=this.targets,o=this.activeTarget;if(this.scrollHeight!=n&&this.refresh(),t>=r)return o!=(e=s[s.length-1])&&this.activate(e);if(o&&t<i[0])return this.activeTarget=null,this.clear();for(e=i.length;e--;)o!=s[e]&&t>=i[e]&&(void 0===i[e+1]||t<i[e+1])&&this.activate(s[e])},t.prototype.activate=function(t){this.activeTarget=t,this.clear();var n=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',r=e(n).parents("li").addClass("active");r.parent(".dropdown-menu").length&&(r=r.closest("li.dropdown").addClass("active")),r.trigger("activate.bs.scrollspy")},t.prototype.clear=function(){e(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var r=e.fn.scrollspy;e.fn.scrollspy=n,e.fn.scrollspy.Constructor=t,e.fn.scrollspy.noConflict=function(){return e.fn.scrollspy=r,this},e(window).on("load.bs.scrollspy.data-api",function(){e('[data-spy="scroll"]').each(function(){var t=e(this);n.call(t,t.data())})})}(jQuery),+function(e){function t(t){return this.each(function(){var r=e(this),i=r.data("bs.tab");i||r.data("bs.tab",i=new n(this)),"string"==typeof t&&i[t]()})}var n=function(t){this.element=e(t)};n.VERSION="3.3.7",n.TRANSITION_DURATION=150,n.prototype.show=function(){var t=this.element,n=t.closest("ul:not(.dropdown-menu)"),r=t.data("target");if(r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,"")),!t.parent("li").hasClass("active")){var i=n.find(".active:last a"),s=e.Event("hide.bs.tab",{relatedTarget:t[0]}),o=e.Event("show.bs.tab",{relatedTarget:i[0]});if(i.trigger(s),t.trigger(o),!o.isDefaultPrevented()&&!s.isDefaultPrevented()){var u=e(r);this.activate(t.closest("li"),n),this.activate(u,u.parent(),function(){i.trigger({type:"hidden.bs.tab",relatedTarget:t[0]}),t.trigger({type:"shown.bs.tab",relatedTarget:i[0]})})}}},n.prototype.activate=function(t,r,i){function s(){o.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),t.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),u?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu").length&&t.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),i&&i()}var o=r.find("> .active"),u=i&&e.support.transition&&(o.length&&o.hasClass("fade")||!!r.find("> .fade").length);o.length&&u?o.one("bsTransitionEnd",s).emulateTransitionEnd(n.TRANSITION_DURATION):s(),o.removeClass("in")};var r=e.fn.tab;e.fn.tab=t,e.fn.tab.Constructor=n,e.fn.tab.noConflict=function(){return e.fn.tab=r,this};var i=function(n){n.preventDefault(),t.call(e(this),"show")};e(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',i).on("click.bs.tab.data-api",'[data-toggle="pill"]',i)}(jQuery),+function(e){function t(t){return this.each(function(){var r=e(this),i=r.data("bs.affix"),s="object"==typeof t&&t;i||r.data("bs.affix",i=new n(this,s)),"string"==typeof t&&i[t]()})}var n=function(t,r){this.options=e.extend({},n.DEFAULTS,r),this.$target=e(this.options.target).on("scroll.bs.affix.data-api",e.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",e.proxy(this.checkPositionWithEventLoop,this)),this.$element=e(t),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};n.VERSION="3.3.7",n.RESET="affix affix-top affix-bottom",n.DEFAULTS={offset:0,target:window},n.prototype.getState=function(e,t,n,r){var i=this.$target.scrollTop(),s=this.$element.offset(),o=this.$target.height();if(null!=n&&"top"==this.affixed)return i<n&&"top";if("bottom"==this.affixed)return null!=n?!(i+this.unpin<=s.top)&&"bottom":!(i+o<=e-r)&&"bottom";var u=null==this.affixed,a=u?i:s.top,f=u?o:t;return null!=n&&i<=n?"top":null!=r&&a+f>=e-r&&"bottom"},n.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(n.RESET).addClass("affix");var e=this.$target.scrollTop(),t=this.$element.offset();return this.pinnedOffset=t.top-e},n.prototype.checkPositionWithEventLoop=function(){setTimeout(e.proxy(this.checkPosition,this),1)},n.prototype.checkPosition=function(){if(this.$element.is(":visible")){var t=this.$element.height(),r=this.options.offset,i=r.top,s=r.bottom,o=Math.max(e(document).height(),e(document.body).height());"object"!=typeof r&&(s=i=r),"function"==typeof i&&(i=r.top(this.$element)),"function"==typeof s&&(s=r.bottom(this.$element));var u=this.getState(o,t,i,s);if(this.affixed!=u){null!=this.unpin&&this.$element.css("top","");var f="affix"+(u?"-"+u:""),l=e.Event(f+".bs.affix");if(this.$element.trigger(l),l.isDefaultPrevented())return;this.affixed=u,this.unpin="bottom"==u?this.getPinnedOffset():null,this.$element.removeClass(n.RESET).addClass(f).trigger(f.replace("affix","affixed")+".bs.affix")}"bottom"==u&&this.$element.offset({top:o-t-s})}};var r=e.fn.affix;e.fn.affix=t,e.fn.affix.Constructor=n,e.fn.affix.noConflict=function(){return e.fn.affix=r,this},e(window).on("load",function(){e('[data-spy="affix"]').each(function(){var n=e(this),r=n.data();r.offset=r.offset||{},null!=r.offsetBottom&&(r.offset.bottom=r.offsetBottom),null!=r.offsetTop&&(r.offset.top=r.offsetTop),t.call(n,r)})})}(jQuery),define("bootstrap",["jquery"],function(){}),define("modal",["config","preferences","links","jquery","laconic","bootstrap"],function(e,t,n){return function(r){function o(){var e=r.el.button({type:"button","class":"close","data-dismiss":"modal"});return r(e).html("&times;").on("click",function(e){var n=r(this).parents(".modal"),i=n.find("[data-notagain]");e.preventDefault();if(i&&i.prop("checked")){var s=i.attr("data-notagain");t.setNotAgain(s)}}),e}function u(e){return e.notagain&&t.persistent()?r.el.label(r.el.input({type:"checkbox","data-notagain":e.notagain,name:"dismiss"})," Don't show again!"):""}function a(){var e=r(this).find(".tm-input");e.each(function(){var e=r(this),t=e.data("prefilled"),n={};t&&(n.prefilled=t),e.tagsManager(n)})}var i="swishModal",s={_init:function(e){return this.each(function(){var e=r(this);e.addClass("swish-event-receiver"),e.on("help",function(t,n){e.swishModal("showHelp",n)}),e.on("pldoc",function(t,n){e.swishModal("showPlDoc",n)}),e.on("form",function(t,n){e.swishModal("showForm",n)}),e.on("dialog",function(t,n){e.swishModal("show",n)}),e.on("error",function(t,n){e.swishModal("show",n)}),e.on("alert",function(t,n){var r="<span class='glyphicon glyphicon-warning-sign'></span>";e.swishModal("show",{title:r,body:n})}),e.on("ajaxError",function(t,n){e.swishModal("showAjaxError",n)}),e.on("feedback",function(t,n){e.swishModal("feedback",n)})})},showHelp:function(n){var i=this;if(n.notagain&&t.notagain(n.notagain))return;r.ajax({url:e.http.locations.help+"/"+n.file,dataType:"html",success:function(e){var t=r("<div>");t.html(e),i.swishModal("show",r.extend({title:t.find("title").text(),body:t},n))}})},showForm:function(t){var n=this;r.ajax({url:e.http.locations.form+"/"+t.file,dataType:"html",success:function(e){var i=r("<div>");i.html(e),n.swishModal("show",r.extend({title:i.find("legend").text(),body:i},t))}})},showPlDoc:function(t){function n(t){var n="("+t.name+")/"+t.arity;return t.module&&(n=t.module+":"+n),e.http.locations.pldoc_doc_for+"?header=false&object="+encodeURIComponent(n)}function r(e,t){return e.parents("div.modal-dialog").addClass("swish-embedded-manual"),"<iframe class='swish-embedded-manual' onload='javascript:resizeIframe(this);' src='"+t+"'>"+"</iframe>"}var i={title:"SWI-Prolog manual",body:function(){return r(this,n(t))}};return this.swishModal("show",i)},show:function(e){var i=r.el.div({"class":"modal-body"}),s=r.el.h2(),f=r.el.div({"class":"modal-content"},r.el.div({"class":"modal-header"},u(e),o(),s),i),l=r.el.div({"class":"modal fade",id:"ajaxModal",tabindex:-1,role:"dialog"},r.el.div({"class":"modal-dialog"},f));e.notagain&&t.persistent()&&r(f).append(r.el.div({"class":"modal-footer"},u(e))),i=r(i);if(typeof e.body=="function"){var c=e.body.call(i);c&&i.append(c)}else i.html(e.body);return r(s).html(e.title),r(l).modal({show:!0}).on("click","a",n.followLink).on("shown.bs.modal",a).on("hidden.bs.modal",function(){r(this).remove()}),this},showAjaxError:function(e){var t=r.el.div();r(t).html(e.responseText);var n=r(t).find("h1"),i=n.text()||"Server error";n.remove();var s={title:i,body:t};this.swishModal("show",s)},feedback:function(e){var t=r.el.div({"class":"feedback "+e.type||""});return r(t).html(e.html),r(e.owner||"body").append(t),setTimeout(function(){r(t).hide(400,function(){r(t).remove()})},e.duration||1500),this}};window.resizeIframe=function(e){e.style.height=0,e.style.height=e.contentWindow.document.body.scrollHeight+20+"px"},r.fn.swishModal=function(e){if(s[e])return s[e].apply(this,Array.prototype.slice.call(arguments,1));if(typeof e=="object"||!e)return s._init.apply(this,arguments);r.error("Method "+e+" does not exist on jQuery."+i)}}(jQuery),{ajaxError:function(e){$(".swish-event-receiver").trigger("ajaxError",e)},feedback:function(e){$(".swish-event-receiver").trigger("feedback",e)},alert:function(e){$(".swish-event-receiver").trigger("alert",e)}}}),function(e){"function"==typeof define&&define.amd?define("jquery-ui",["jquery"],e):e(jQuery)}(function(e){function t(e){for(var t=e.css("visibility");"inherit"===t;)e=e.parent(),t=e.css("visibility");return"hidden"!==t}function n(e){for(var t,n;e.length&&e[0]!==document;){if(t=e.css("position"),("absolute"===t||"relative"===t||"fixed"===t)&&(n=parseInt(e.css("zIndex"),10),!isNaN(n)&&0!==n))return n;e=e.parent()}return 0}function r(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[""]),this.regional.en=e.extend(!0,{},this.regional[""]),this.regional["en-US"]=e.extend(!0,{},this.regional.en),this.dpDiv=i(e("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function i(t){var n="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.on("mouseout",n,function(){e(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).on("mouseover",n,s)}function s(){e.datepicker._isDisabledDatepicker(m.inline?m.dpDiv.parent()[0]:m.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover"))}function o(t,n){e.extend(t,n);for(var r in n)null==n[r]&&(t[r]=n[r]);return t}function u(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}e.ui=e.ui||{},e.ui.version="1.12.0";var a=0,f=Array.prototype.slice;e.cleanData=function(t){return function(n){var r,i,s;for(s=0;null!=(i=n[s]);s++)try{r=e._data(i,"events"),r&&r.remove&&e(i).triggerHandler("remove")}catch(o){}t(n)}}(e.cleanData),e.widget=function(t,n,r){var i,s,o,u={},a=t.split(".")[0];t=t.split(".")[1];var f=a+"-"+t;return r||(r=n,n=e.Widget),e.isArray(r)&&(r=e.extend.apply(null,[{}].concat(r))),e.expr[":"][f.toLowerCase()]=function(t){return!!e.data(t,f)},e[a]=e[a]||{},i=e[a][t],s=e[a][t]=function(e,t){return this._createWidget?(arguments.length&&this._createWidget(e,t),void 0):new s(e,t)},e.extend(s,i,{version:r.version,_proto:e.extend({},r),_childConstructors:[]}),o=new n,o.options=e.widget.extend({},o.options),e.each(r,function(t,r){return e.isFunction(r)?(u[t]=function(){function e(){return n.prototype[t].apply(this,arguments)}function i(e){return n.prototype[t].apply(this,e)}return function(){var t,n=this._super,s=this._superApply;return this._super=e,this._superApply=i,t=r.apply(this,arguments),this._super=n,this._superApply=s,t}}(),void 0):(u[t]=r,void 0)}),s.prototype=e.widget.extend(o,{widgetEventPrefix:i?o.widgetEventPrefix||t:t},u,{constructor:s,namespace:a,widgetName:t,widgetFullName:f}),i?(e.each(i._childConstructors,function(t,n){var r=n.prototype;e.widget(r.namespace+"."+r.widgetName,s,n._proto)}),delete i._childConstructors):n._childConstructors.push(s),e.widget.bridge(t,s),s},e.widget.extend=function(t){for(var n,r,i=f.call(arguments,1),s=0,o=i.length;o>s;s++)for(n in i[s])r=i[s][n],i[s].hasOwnProperty(n)&&void 0!==r&&(t[n]=e.isPlainObject(r)?e.isPlainObject(t[n])?e.widget.extend({},t[n],r):e.widget.extend({},r):r);return t},e.widget.bridge=function(t,n){var r=n.prototype.widgetFullName||t;e.fn[t]=function(i){var s="string"==typeof i,o=f.call(arguments,1),u=this;return s?this.each(function(){var n,s=e.data(this,r);return"instance"===i?(u=s,!1):s?e.isFunction(s[i])&&"_"!==i.charAt(0)?(n=s[i].apply(s,o),n!==s&&void 0!==n?(u=n&&n.jquery?u.pushStack(n.get()):n,!1):void 0):e.error("no such method '"+i+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; "+"attempted to call method '"+i+"'")}):(o.length&&(i=e.widget.extend.apply(null,[i].concat(o))),this.each(function(){var t=e.data(this,r);t?(t.option(i||{}),t._init&&t._init()):e.data(this,r,new n(i,this))})),u}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,n){n=e(n||this.defaultElement||this)[0],this.element=e(n),this.uuid=a++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),this.classesElementLookup={},n!==this&&(e.data(n,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===n&&this.destroy()}}),this.document=e(n.style?n.ownerDocument:n.document||n),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){var t=this;this._destroy(),e.each(this.classesElementLookup,function(e,n){t._removeClass(n,e)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:e.noop,widget:function(){return this.element},option:function(t,n){var r,i,s,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},r=t.split("."),t=r.shift(),r.length){for(i=o[t]=e.widget.extend({},this.options[t]),s=0;r.length-1>s;s++)i[r[s]]=i[r[s]]||{},i=i[r[s]];if(t=r.pop(),1===arguments.length)return void 0===i[t]?null:i[t];i[t]=n}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=n}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return"classes"===e&&this._setOptionClasses(t),this.options[e]=t,"disabled"===e&&this._setOptionDisabled(t),this},_setOptionClasses:function(t){var n,r,i;for(n in t)i=this.classesElementLookup[n],t[n]!==this.options.classes[n]&&i&&i.length&&(r=e(i.get()),this._removeClass(i,n),r.addClass(this._classes({element:r,keys:n,classes:t,add:!0})))},_setOptionDisabled:function(e){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!e),e&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(t){function n(n,s){var o,u;for(u=0;n.length>u;u++)o=i.classesElementLookup[n[u]]||e(),o=t.add?e(e.unique(o.get().concat(t.element.get()))):e(o.not(t.element).get()),i.classesElementLookup[n[u]]=o,r.push(n[u]),s&&t.classes[n[u]]&&r.push(t.classes[n[u]])}var r=[],i=this;return t=e.extend({element:this.element,classes:this.options.classes||{}},t),t.keys&&n(t.keys.match(/\S+/g)||[],!0),t.extra&&n(t.extra.match(/\S+/g)||[]),r.join(" ")},_removeClass:function(e,t,n){return this._toggleClass(e,t,n,!1)},_addClass:function(e,t,n){return this._toggleClass(e,t,n,!0)},_toggleClass:function(e,t,n,r){r="boolean"==typeof r?r:n;var i="string"==typeof e||null===e,s={extra:i?t:n,keys:i?e:t,element:i?this.element:e,add:r};return s.element.toggleClass(this._classes(s),r),this},_on:function(t,n,r){var i,s=this;"boolean"!=typeof t&&(r=n,n=t,t=!1),r?(n=i=e(n),this.bindings=this.bindings.add(n)):(r=n,n=this.element,i=this.widget()),e.each(r,function(r,o){function u(){return t||s.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?s[o]:o).apply(s,arguments):void 0}"string"!=typeof o&&(u.guid=o.guid=o.guid||u.guid||e.guid++);var a=r.match(/^([\w:-]*)\s*(.*)$/),f=a[1]+s.eventNamespace,l=a[2];l?i.on(f,l,u):n.on(f,u)})},_off:function(t,n){n=(n||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(n).off(n),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function n(){return("string"==typeof e?r[e]:e).apply(r,arguments)}var r=this;return setTimeout(n,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(e(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(e(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(e(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(e(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,n,r){var i,s,o=this.options[t];if(r=r||{},n=e.Event(n),n.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),n.target=this.element[0],s=n.originalEvent)for(i in s)i in n||(n[i]=s[i]);return this.element.trigger(n,r),!(e.isFunction(o)&&o.apply(this.element[0],[n].concat(r))===!1||n.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,n){e.Widget.prototype["_"+t]=function(r,i,s){"string"==typeof i&&(i={effect:i});var o,u=i?i===!0||"number"==typeof i?n:i.effect||n:t;i=i||{},"number"==typeof i&&(i={duration:i}),o=!e.isEmptyObject(i),i.complete=s,i.delay&&r.delay(i.delay),o&&e.effects&&e.effects.effect[u]?r[t](i):u!==t&&r[u]?r[u](i.duration,i.easing,s):r.queue(function(n){e(this)[t](),s&&s.call(r[0]),n()})}}),e.widget,function(){function t(e,t,n){return[parseFloat(e[0])*(p.test(e[0])?t/100:1),parseFloat(e[1])*(p.test(e[1])?n/100:1)]}function n(t,n){return parseInt(e.css(t,n),10)||0}function r(t){var n=t[0];return 9===n.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(n)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:n.preventDefault?{width:0,height:0,offset:{top:n.pageY,left:n.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}var i,s,o=Math.max,u=Math.abs,a=Math.round,f=/left|center|right/,l=/top|center|bottom/,c=/[\+\-]\d+(\.[\d]+)?%?/,h=/^\w+/,p=/%$/,d=e.fn.position;s=function(){var t=e("<div>").css("position","absolute").appendTo("body").offset({top:1.5,left:1.5}),n=1.5===t.offset().top;return t.remove(),s=function(){return n},n},e.position={scrollbarWidth:function(){if(void 0!==i)return i;var t,n,r=e("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),s=r.children()[0];return e("body").append(r),t=s.offsetWidth,r.css("overflow","scroll"),n=s.offsetWidth,t===n&&(n=r[0].clientWidth),r.remove(),i=t-n},getScrollInfo:function(t){var n=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),r=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),i="scroll"===n||"auto"===n&&t.width<t.element[0].scrollWidth,s="scroll"===r||"auto"===r&&t.height<t.element[0].scrollHeight;return{width:s?e.position.scrollbarWidth():0,height:i?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var n=e(t||window),r=e.isWindow(n[0]),i=!!n[0]&&9===n[0].nodeType,s=!r&&!i;return{element:n,isWindow:r,isDocument:i,offset:s?e(t).offset():{left:0,top:0},scrollLeft:n.scrollLeft(),scrollTop:n.scrollTop(),width:n.outerWidth(),height:n.outerHeight()}}},e.fn.position=function(i){if(!i||!i.of)return d.apply(this,arguments);i=e.extend({},i);var p,v,m,g,y,b,w=e(i.of),E=e.position.getWithinInfo(i.within),S=e.position.getScrollInfo(E),x=(i.collision||"flip").split(" "),T={};return b=r(w),w[0].preventDefault&&(i.at="left top"),v=b.width,m=b.height,g=b.offset,y=e.extend({},g),e.each(["my","at"],function(){var e,t,n=(i[this]||"").split(" ");1===n.length&&(n=f.test(n[0])?n.concat(["center"]):l.test(n[0])?["center"].concat(n):["center","center"]),n[0]=f.test(n[0])?n[0]:"center",n[1]=l.test(n[1])?n[1]:"center",e=c.exec(n[0]),t=c.exec(n[1]),T[this]=[e?e[0]:0,t?t[0]:0],i[this]=[h.exec(n[0])[0],h.exec(n[1])[0]]}),1===x.length&&(x[1]=x[0]),"right"===i.at[0]?y.left+=v:"center"===i.at[0]&&(y.left+=v/2),"bottom"===i.at[1]?y.top+=m:"center"===i.at[1]&&(y.top+=m/2),p=t(T.at,v,m),y.left+=p[0],y.top+=p[1],this.each(function(){var r,f,l=e(this),c=l.outerWidth(),h=l.outerHeight(),d=n(this,"marginLeft"),b=n(this,"marginTop"),N=c+d+n(this,"marginRight")+S.width,L=h+b+n(this,"marginBottom")+S.height,A=e.extend({},y),O=t(T.my,l.outerWidth(),l.outerHeight());"right"===i.my[0]?A.left-=c:"center"===i.my[0]&&(A.left-=c/2),"bottom"===i.my[1]?A.top-=h:"center"===i.my[1]&&(A.top-=h/2),A.left+=O[0],A.top+=O[1],s()||(A.left=a(A.left),A.top=a(A.top)),r={marginLeft:d,marginTop:b},e.each(["left","top"],function(t,n){e.ui.position[x[t]]&&e.ui.position[x[t]][n](A,{targetWidth:v,targetHeight:m,elemWidth:c,elemHeight:h,collisionPosition:r,collisionWidth:N,collisionHeight:L,offset:[p[0]+O[0],p[1]+O[1]],my:i.my,at:i.at,within:E,elem:l})}),i.using&&(f=function(e){var t=g.left-A.left,n=t+v-c,r=g.top-A.top,s=r+m-h,a={target:{element:w,left:g.left,top:g.top,width:v,height:m},element:{element:l,left:A.left,top:A.top,width:c,height:h},horizontal:0>n?"left":t>0?"right":"center",vertical:0>s?"top":r>0?"bottom":"middle"};c>v&&v>u(t+n)&&(a.horizontal="center"),h>m&&m>u(r+s)&&(a.vertical="middle"),a.important=o(u(t),u(n))>o(u(r),u(s))?"horizontal":"vertical",i.using.call(this,e,a)}),l.offset(e.extend(A,{using:f}))})},e.ui.position={fit:{left:function(e,t){var n,r=t.within,i=r.isWindow?r.scrollLeft:r.offset.left,s=r.width,u=e.left-t.collisionPosition.marginLeft,a=i-u,f=u+t.collisionWidth-s-i;t.collisionWidth>s?a>0&&0>=f?(n=e.left+a+t.collisionWidth-s-i,e.left+=a-n):e.left=f>0&&0>=a?i:a>f?i+s-t.collisionWidth:i:a>0?e.left+=a:f>0?e.left-=f:e.left=o(e.left-u,e.left)},top:function(e,t){var n,r=t.within,i=r.isWindow?r.scrollTop:r.offset.top,s=t.within.height,u=e.top-t.collisionPosition.marginTop,a=i-u,f=u+t.collisionHeight-s-i;t.collisionHeight>s?a>0&&0>=f?(n=e.top+a+t.collisionHeight-s-i,e.top+=a-n):e.top=f>0&&0>=a?i:a>f?i+s-t.collisionHeight:i:a>0?e.top+=a:f>0?e.top-=f:e.top=o(e.top-u,e.top)}},flip:{left:function(e,t){var n,r,i=t.within,s=i.offset.left+i.scrollLeft,o=i.width,a=i.isWindow?i.scrollLeft:i.offset.left,f=e.left-t.collisionPosition.marginLeft,l=f-a,c=f+t.collisionWidth-o-a,h="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,p="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,d=-2*t.offset[0];0>l?(n=e.left+h+p+d+t.collisionWidth-o-s,(0>n||u(l)>n)&&(e.left+=h+p+d)):c>0&&(r=e.left-t.collisionPosition.marginLeft+h+p+d-a,(r>0||c>u(r))&&(e.left+=h+p+d))},top:function(e,t){var n,r,i=t.within,s=i.offset.top+i.scrollTop,o=i.height,a=i.isWindow?i.scrollTop:i.offset.top,f=e.top-t.collisionPosition.marginTop,l=f-a,c=f+t.collisionHeight-o-a,h="top"===t.my[1],p=h?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,d="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,v=-2*t.offset[1];0>l?(r=e.top+p+d+v+t.collisionHeight-o-s,(0>r||u(l)>r)&&(e.top+=p+d+v)):c>0&&(n=e.top-t.collisionPosition.marginTop+p+d+v-a,(n>0||c>u(n))&&(e.top+=p+d+v))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}}}(),e.ui.position,e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(n){return!!e.data(n,t)}}):function(t,n,r){return!!e.data(t,r[3])}}),e.fn.extend({disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}});var l="ui-effects-",c="ui-effects-style",h="ui-effects-animated",p=e;e.effects={effect:{}},function(e,t){function n(e,t,n){var r=c[t.type]||{};return null==e?n||!t.def?null:t.def:(e=r.floor?~~e:parseFloat(e),isNaN(e)?t.def:r.mod?(e+r.mod)%r.mod:0>e?0:e>r.max?r.max:e)}function r(n){var r=f(),i=r._rgba=[];return n=n.toLowerCase(),d(a,function(e,s){var o,u=s.re.exec(n),a=u&&s.parse(u),f=s.space||"rgba";return a?(o=r[f](a),r[l[f].cache]=o[l[f].cache],i=r._rgba=o._rgba,!1):t}),i.length?("0,0,0,0"===i.join()&&e.extend(i,s.transparent),r):s[n]}function i(e,t,n){return n=(n+1)%1,1>6*n?e+6*(t-e)*n:1>2*n?t:2>3*n?e+6*(t-e)*(2/3-n):e}var s,o="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",u=/^([\-+])=\s*(\d+\.?\d*)/,a=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[2.55*e[1],2.55*e[2],2.55*e[3],e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],f=e.Color=function(t,n,r,i){return new e.Color.fn.parse(t,n,r,i)},l={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},c={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},h=f.support={},p=e("<p>")[0],d=e.each;p.style.cssText="background-color:rgba(1,1,1,.5)",h.rgba=p.style.backgroundColor.indexOf("rgba")>-1,d(l,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),f.fn=e.extend(f.prototype,{parse:function(i,o,u,a){if(i===t)return this._rgba=[null,null,null,null],this;(i.jquery||i.nodeType)&&(i=e(i).css(o),o=t);var c=this,h=e.type(i),p=this._rgba=[];return o!==t&&(i=[i,o,u,a],h="array"),"string"===h?this.parse(r(i)||s._default):"array"===h?(d(l.rgba.props,function(e,t){p[t.idx]=n(i[t.idx],t)}),this):"object"===h?(i instanceof f?d(l,function(e,t){i[t.cache]&&(c[t.cache]=i[t.cache].slice())}):d(l,function(t,r){var s=r.cache;d(r.props,function(e,t){if(!c[s]&&r.to){if("alpha"===e||null==i[e])return;c[s]=r.to(c._rgba)}c[s][t.idx]=n(i[e],t,!0)}),c[s]&&0>e.inArray(null,c[s].slice(0,3))&&(c[s][3]=1,r.from&&(c._rgba=r.from(c[s])))}),this):t},is:function(e){var n=f(e),r=!0,i=this;return d(l,function(e,s){var o,u=n[s.cache];return u&&(o=i[s.cache]||s.to&&s.to(i._rgba)||[],d(s.props,function(e,n){return null!=u[n.idx]?r=u[n.idx]===o[n.idx]:t})),r}),r},_space:function(){var e=[],t=this;return d(l,function(n,r){t[r.cache]&&e.push(n)}),e.pop()},transition:function(e,t){var r=f(e),i=r._space(),s=l[i],o=0===this.alpha()?f("transparent"):this,u=o[s.cache]||s.to(o._rgba),a=u.slice();return r=r[s.cache],d(s.props,function(e,i){var s=i.idx,o=u[s],f=r[s],l=c[i.type]||{};null!==f&&(null===o?a[s]=f:(l.mod&&(f-o>l.mod/2?o+=l.mod:o-f>l.mod/2&&(o-=l.mod)),a[s]=n((f-o)*t+o,i)))}),this[i](a)},blend:function(t){if(1===this._rgba[3])return this;var n=this._rgba.slice(),r=n.pop(),i=f(t)._rgba;return f(e.map(n,function(e,t){return(1-r)*i[t]+r*e}))},toRgbaString:function(){var t="rgba(",n=e.map(this._rgba,function(e,t){return null==e?t>2?1:0:e});return 1===n[3]&&(n.pop(),t="rgb("),t+n.join()+")"},toHslaString:function(){var t="hsla(",n=e.map(this.hsla(),function(e,t){return null==e&&(e=t>2?1:0),t&&3>t&&(e=Math.round(100*e)+"%"),e});return 1===n[3]&&(n.pop(),t="hsl("),t+n.join()+")"},toHexString:function(t){var n=this._rgba.slice(),r=n.pop();return t&&n.push(~~(255*r)),"#"+e.map(n,function(e){return e=(e||0).toString(16),1===e.length?"0"+e:e}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),f.fn.parse.prototype=f.fn,l.hsla.to=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t,n,r=e[0]/255,i=e[1]/255,s=e[2]/255,o=e[3],u=Math.max(r,i,s),a=Math.min(r,i,s),f=u-a,l=u+a,c=.5*l;return t=a===u?0:r===u?60*(i-s)/f+360:i===u?60*(s-r)/f+120:60*(r-i)/f+240,n=0===f?0:.5>=c?f/l:f/(2-l),[Math.round(t)%360,n,c,null==o?1:o]},l.hsla.from=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t=e[0]/360,n=e[1],r=e[2],s=e[3],o=.5>=r?r*(1+n):r+n-r*n,u=2*r-o;return[Math.round(255*i(u,o,t+1/3)),Math.round(255*i(u,o,t)),Math.round(255*i(u,o,t-1/3)),s]},d(l,function(r,i){var s=i.props,o=i.cache,a=i.to,l=i.from;f.fn[r]=function(r){if(a&&!this[o]&&(this[o]=a(this._rgba)),r===t)return this[o].slice();var i,u=e.type(r),c="array"===u||"object"===u?r:arguments,h=this[o].slice();return d(s,function(e,t){var r=c["object"===u?e:t.idx];null==r&&(r=h[t.idx]),h[t.idx]=n(r,t)}),l?(i=f(l(h)),i[o]=h,i):f(h)},d(s,function(t,n){f.fn[t]||(f.fn[t]=function(i){var s,o=e.type(i),a="alpha"===t?this._hsla?"hsla":"rgba":r,f=this[a](),l=f[n.idx];return"undefined"===o?l:("function"===o&&(i=i.call(this,l),o=e.type(i)),null==i&&n.empty?this:("string"===o&&(s=u.exec(i),s&&(i=l+parseFloat(s[2])*("+"===s[1]?1:-1))),f[n.idx]=i,this[a](f)))})})}),f.hook=function(t){var n=t.split(" ");d(n,function(t,n){e.cssHooks[n]={set:function(t,i){var s,o,u="";if("transparent"!==i&&("string"!==e.type(i)||(s=r(i)))){if(i=f(s||i),!h.rgba&&1!==i._rgba[3]){for(o="backgroundColor"===n?t.parentNode:t;(""===u||"transparent"===u)&&o&&o.style;)try{u=e.css(o,"backgroundColor"),o=o.parentNode}catch(a){}i=i.blend(u&&"transparent"!==u?u:"_default")}i=i.toRgbaString()}try{t.style[n]=i}catch(a){}}},e.fx.step[n]=function(t){t.colorInit||(t.start=f(t.elem,n),t.end=f(t.end),t.colorInit=!0),e.cssHooks[n].set(t.elem,t.start.transition(t.end,t.pos))}})},f.hook(o),e.cssHooks.borderColor={expand:function(e){var t={};return d(["Top","Right","Bottom","Left"],function(n,r){t["border"+r+"Color"]=e}),t}},s=e.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(p),function(){function t(t){var n,r,i=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,s={};if(i&&i.length&&i[0]&&i[i[0]])for(r=i.length;r--;)n=i[r],"string"==typeof i[n]&&(s[e.camelCase(n)]=i[n]);else for(n in i)"string"==typeof i[n]&&(s[n]=i[n]);return s}function n(t,n){var r,s,o={};for(r in n)s=n[r],t[r]!==s&&(i[r]||(e.fx.step[r]||!isNaN(parseFloat(s)))&&(o[r]=s));return o}var r=["add","remove","toggle"],i={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,n){e.fx.step[n]=function(e){("none"!==e.end&&!e.setAttr||1===e.pos&&!e.setAttr)&&(p.style(e.elem,n,e.end),e.setAttr=!0)}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e.effects.animateClass=function(i,s,o,u){var a=e.speed(s,o,u);return this.queue(function(){var s,o=e(this),u=o.attr("class")||"",f=a.children?o.find("*").addBack():o;f=f.map(function(){var n=e(this);return{el:n,start:t(this)}}),s=function(){e.each(r,function(e,t){i[t]&&o[t+"Class"](i[t])})},s(),f=f.map(function(){return this.end=t(this.el[0]),this.diff=n(this.start,this.end),this}),o.attr("class",u),f=f.map(function(){var t=this,n=e.Deferred(),r=e.extend({},a,{queue:!1,complete:function(){n.resolve(t)}});return this.el.animate(this.diff,r),n.promise()}),e.when.apply(e,f.get()).done(function(){s(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),a.complete.call(o[0])})})},e.fn.extend({addClass:function(t){return function(n,r,i,s){return r?e.effects.animateClass.call(this,{add:n},r,i,s):t.apply(this,arguments)}}(e.fn.addClass),removeClass:function(t){return function(n,r,i,s){return arguments.length>1?e.effects.animateClass.call(this,{remove:n},r,i,s):t.apply(this,arguments)}}(e.fn.removeClass),toggleClass:function(t){return function(n,r,i,s,o){return"boolean"==typeof r||void 0===r?i?e.effects.animateClass.call(this,r?{add:n}:{remove:n},i,s,o):t.apply(this,arguments):e.effects.animateClass.call(this,{toggle:n},r,i,s)}}(e.fn.toggleClass),switchClass:function(t,n,r,i,s){return e.effects.animateClass.call(this,{add:n,remove:t},r,i,s)}})}(),function(){function t(t,n,r,i){return e.isPlainObject(t)&&(n=t,t=t.effect),t={effect:t},null==n&&(n={}),e.isFunction(n)&&(i=n,r=null,n={}),("number"==typeof n||e.fx.speeds[n])&&(i=r,r=n,n={}),e.isFunction(r)&&(i=r,r=null),n&&e.extend(t,n),r=r||n.duration,t.duration=e.fx.off?0:"number"==typeof r?r:r in e.fx.speeds?e.fx.speeds[r]:e.fx.speeds._default,t.complete=i||n.complete,t}function n(t){return!t||"number"==typeof t||e.fx.speeds[t]?!0:"string"!=typeof t||e.effects.effect[t]?e.isFunction(t)?!0:"object"!=typeof t||t.effect?!1:!0:!0}function r(e,t){var n=t.outerWidth(),r=t.outerHeight(),i=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/,s=i.exec(e)||["",0,n,r,0];return{top:parseFloat(s[1])||0,right:"auto"===s[2]?n:parseFloat(s[2]),bottom:"auto"===s[3]?r:parseFloat(s[3]),left:parseFloat(s[4])||0}}e.expr&&e.expr.filters&&e.expr.filters.animated&&(e.expr.filters.animated=function(t){return function(n){return!!e(n).data(h)||t(n)}}(e.expr.filters.animated)),e.uiBackCompat!==!1&&e.extend(e.effects,{save:function(e,t){for(var n=0,r=t.length;r>n;n++)null!==t[n]&&e.data(l+t[n],e[0].style[t[n]])},restore:function(e,t){for(var n,r=0,i=t.length;i>r;r++)null!==t[r]&&(n=e.data(l+t[r]),e.css(t[r],n))},setMode:function(e,t){return"toggle"===t&&(t=e.is(":hidden")?"show":"hide"),t},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var n={width:t.outerWidth(!0),height:t.outerHeight(!0),"float":t.css("float")},r=e("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),i={width:t.width(),height:t.height()},s=document.activeElement;try{s.id}catch(o){s=document.body}return t.wrap(r),(t[0]===s||e.contains(t[0],s))&&e(s).trigger("focus"),r=t.parent(),"static"===t.css("position")?(r.css({position:"relative"}),t.css({position:"relative"})):(e.extend(n,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,r){n[r]=t.css(r),isNaN(parseInt(n[r],10))&&(n[r]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(i),r.css(n).show()},removeWrapper:function(t){var n=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===n||e.contains(t[0],n))&&e(n).trigger("focus")),t}}),e.extend(e.effects,{version:"1.12.0",define:function(t,n,r){return r||(r=n,n="effect"),e.effects.effect[t]=r,e.effects.effect[t].mode=n,r},scaledDimensions:function(e,t,n){if(0===t)return{height:0,width:0,outerHeight:0,outerWidth:0};var r="horizontal"!==n?(t||100)/100:1,i="vertical"!==n?(t||100)/100:1;return{height:e.height()*i,width:e.width()*r,outerHeight:e.outerHeight()*i,outerWidth:e.outerWidth()*r}},clipToBox:function(e){return{width:e.clip.right-e.clip.left,height:e.clip.bottom-e.clip.top,left:e.clip.left,top:e.clip.top}},unshift:function(e,t,n){var r=e.queue();t>1&&r.splice.apply(r,[1,0].concat(r.splice(t,n))),e.dequeue()},saveStyle:function(e){e.data(c,e[0].style.cssText)},restoreStyle:function(e){e[0].style.cssText=e.data(c)||"",e.removeData(c)},mode:function(e,t){var n=e.is(":hidden");return"toggle"===t&&(t=n?"show":"hide"),(n?"hide"===t:"show"===t)&&(t="none"),t},getBaseline:function(e,t){var n,r;switch(e[0]){case"top":n=0;break;case"middle":n=.5;break;case"bottom":n=1;break;default:n=e[0]/t.height}switch(e[1]){case"left":r=0;break;case"center":r=.5;break;case"right":r=1;break;default:r=e[1]/t.width}return{x:r,y:n}},createPlaceholder:function(t){var n,r=t.css("position"),i=t.position();return t.css({marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()),/^(static|relative)/.test(r)&&(r="absolute",n=e("<"+t[0].nodeName+">").insertAfter(t).css({display:/^(inline|ruby)/.test(t.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight"),"float":t.css("float")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).addClass("ui-effects-placeholder"),t.data(l+"placeholder",n)),t.css({position:r,left:i.left,top:i.top}),n},removePlaceholder:function(e){var t=l+"placeholder",n=e.data(t);n&&(n.remove(),e.removeData(t))},cleanUp:function(t){e.effects.restoreStyle(t),e.effects.removePlaceholder(t)},setTransition:function(t,n,r,i){return i=i||{},e.each(n,function(e,n){var s=t.cssUnit(n);s[0]>0&&(i[n]=s[0]*r+s[1])}),i}}),e.fn.extend({effect:function(){function n(t){function n(){u.removeData(h),e.effects.cleanUp(u),"hide"===r.mode&&u.hide(),o()}function o(){e.isFunction(a)&&a.call(u[0]),e.isFunction(t)&&t()}var u=e(this);r.mode=l.shift(),e.uiBackCompat===!1||s?"none"===r.mode?(u[f](),o()):i.call(u[0],r,n):(u.is(":hidden")?"hide"===f:"show"===f)?(u[f](),o()):i.call(u[0],r,o)}var r=t.apply(this,arguments),i=e.effects.effect[r.effect],s=i.mode,o=r.queue,u=o||"fx",a=r.complete,f=r.mode,l=[],c=function(t){var n=e(this),r=e.effects.mode(n,f)||s;n.data(h,!0),l.push(r),s&&("show"===r||r===s&&"hide"===r)&&n.show(),s&&"none"===r||e.effects.saveStyle(n),e.isFunction(t)&&t()};return e.fx.off||!i?f?this[f](r.duration,a):this.each(function(){a&&a.call(this)}):o===!1?this.each(c).each(n):this.queue(u,c).queue(u,n)},show:function(e){return function(r){if(n(r))return e.apply(this,arguments);var i=t.apply(this,arguments);return i.mode="show",this.effect.call(this,i)}}(e.fn.show),hide:function(e){return function(r){if(n(r))return e.apply(this,arguments);var i=t.apply(this,arguments);return i.mode="hide",this.effect.call(this,i)}}(e.fn.hide),toggle:function(e){return function(r){if(n(r)||"boolean"==typeof r)return e.apply(this,arguments);var i=t.apply(this,arguments);return i.mode="toggle",this.effect.call(this,i)}}(e.fn.toggle),cssUnit:function(t){var n=this.css(t),r=[];return e.each(["em","px","%","pt"],function(e,t){n.indexOf(t)>0&&(r=[parseFloat(n),t])}),r},cssClip:function(e){return e?this.css("clip","rect("+e.top+"px "+e.right+"px "+e.bottom+"px "+e.left+"px)"):r(this.css("clip"),this)},transfer:function(t,n){var r=e(this),i=e(t.to),s="fixed"===i.css("position"),o=e("body"),u=s?o.scrollTop():0,a=s?o.scrollLeft():0,f=i.offset(),l={top:f.top-u,left:f.left-a,height:i.innerHeight(),width:i.innerWidth()},c=r.offset(),h=e("<div class='ui-effects-transfer'></div>").appendTo("body").addClass(t.className).css({top:c.top-u,left:c.left-a,height:r.innerHeight(),width:r.innerWidth(),position:s?"fixed":"absolute"}).animate(l,t.duration,t.easing,function(){h.remove(),e.isFunction(n)&&n()})}}),e.fx.step.clip=function(t){t.clipInit||(t.start=e(t.elem).cssClip(),"string"==typeof t.end&&(t.end=r(t.end,t.elem)),t.clipInit=!0),e(t.elem).cssClip({top:t.pos*(t.end.top-t.start.top)+t.start.top,right:t.pos*(t.end.right-t.start.right)+t.start.right,bottom:t.pos*(t.end.bottom-t.start.bottom)+t.start.bottom,left:t.pos*(t.end.left-t.start.left)+t.start.left})}}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,n){t[n]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return 0===e||1===e?e:-Math.pow(2,8*(e-1))*Math.sin((80*(e-1)-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){for(var t,n=4;((t=Math.pow(2,--n))-1)/11>e;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*t-2)/22-e,2)}}),e.each(t,function(t,n){e.easing["easeIn"+t]=n,e.easing["easeOut"+t]=function(e){return 1-n(1-e)},e.easing["easeInOut"+t]=function(e){return.5>e?n(2*e)/2:1-n(-2*e+2)/2}})}();var d=e.effects;e.effects.define("blind","hide",function(t,n){var r={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},i=e(this),s=t.direction||"up",o=i.cssClip(),u={clip:e.extend({},o)},a=e.effects.createPlaceholder(i);u.clip[r[s][0]]=u.clip[r[s][1]],"show"===t.mode&&(i.cssClip(u.clip),a&&a.css(e.effects.clipToBox(u)),u.clip=o),a&&a.animate(e.effects.clipToBox(u),t.duration,t.easing),i.animate(u,{queue:!1,duration:t.duration,easing:t.easing,complete:n})}),e.effects.define("bounce",function(t,n){var r,i,s,o=e(this),u=t.mode,a="hide"===u,f="show"===u,l=t.direction||"up",c=t.distance,h=t.times||5,p=2*h+(f||a?1:0),d=t.duration/p,v=t.easing,m="up"===l||"down"===l?"top":"left",g="up"===l||"left"===l,y=0,b=o.queue().length;for(e.effects.createPlaceholder(o),s=o.css(m),c||(c=o["top"===m?"outerHeight":"outerWidth"]()/3),f&&(i={opacity:1},i[m]=s,o.css("opacity",0).css(m,g?2*-c:2*c).animate(i,d,v)),a&&(c/=Math.pow(2,h-1)),i={},i[m]=s;h>y;y++)r={},r[m]=(g?"-=":"+=")+c,o.animate(r,d,v).animate(i,d,v),c=a?2*c:c/2;a&&(r={opacity:0},r[m]=(g?"-=":"+=")+c,o.animate(r,d,v)),o.queue(n),e.effects.unshift(o,b,p+1)}),e.effects.define("clip","hide",function(t,n){var r,i={},s=e(this),o=t.direction||"vertical",u="both"===o,a=u||"horizontal"===o,f=u||"vertical"===o;r=s.cssClip(),i.clip={top:f?(r.bottom-r.top)/2:r.top,right:a?(r.right-r.left)/2:r.right,bottom:f?(r.bottom-r.top)/2:r.bottom,left:a?(r.right-r.left)/2:r.left},e.effects.createPlaceholder(s),"show"===t.mode&&(s.cssClip(i.clip),i.clip=r),s.animate(i,{queue:!1,duration:t.duration,easing:t.easing,complete:n})}),e.effects.define("drop","hide",function(t,n){var r,i=e(this),s=t.mode,o="show"===s,u=t.direction||"left",a="up"===u||"down"===u?"top":"left",f="up"===u||"left"===u?"-=":"+=",l="+="===f?"-=":"+=",c={opacity:0};e.effects.createPlaceholder(i),r=t.distance||i["top"===a?"outerHeight":"outerWidth"](!0)/2,c[a]=f+r,o&&(i.css(c),c[a]=l+r,c.opacity=1),i.animate(c,{queue:!1,duration:t.duration,easing:t.easing,complete:n})}),e.effects.define("explode","hide",function(t,n){function r(){b.push(this),b.length===c*h&&i()}function i(){p.css({visibility:"visible"}),e(b).remove(),n()}var s,o,u,a,f,l,c=t.pieces?Math.round(Math.sqrt(t.pieces)):3,h=c,p=e(this),d=t.mode,v="show"===d,m=p.show().css("visibility","hidden").offset(),g=Math.ceil(p.outerWidth()/h),y=Math.ceil(p.outerHeight()/c),b=[];for(s=0;c>s;s++)for(a=m.top+s*y,l=s-(c-1)/2,o=0;h>o;o++)u=m.left+o*g,f=o-(h-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-o*g,top:-s*y}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g,height:y,left:u+(v?f*g:0),top:a+(v?l*y:0),opacity:v?0:1}).animate({left:u+(v?0:f*g),top:a+(v?0:l*y),opacity:v?1:0},t.duration||500,t.easing,r)}),e.effects.define("fade","toggle",function(t,n){var r="show"===t.mode;e(this).css("opacity",r?0:1).animate({opacity:r?1:0},{queue:!1,duration:t.duration,easing:t.easing,complete:n})}),e.effects.define("fold","hide",function(t,n){var r=e(this),i=t.mode,s="show"===i,o="hide"===i,u=t.size||15,a=/([0-9]+)%/.exec(u),f=!!t.horizFirst,l=f?["right","bottom"]:["bottom","right"],c=t.duration/2,h=e.effects.createPlaceholder(r),p=r.cssClip(),d={clip:e.extend({},p)},v={clip:e.extend({},p)},m=[p[l[0]],p[l[1]]],g=r.queue().length;a&&(u=parseInt(a[1],10)/100*m[o?0:1]),d.clip[l[0]]=u,v.clip[l[0]]=u,v.clip[l[1]]=0,s&&(r.cssClip(v.clip),h&&h.css(e.effects.clipToBox(v)),v.clip=p),r.queue(function(n){h&&h.animate(e.effects.clipToBox(d),c,t.easing).animate(e.effects.clipToBox(v),c,t.easing),n()}).animate(d,c,t.easing).animate(v,c,t.easing).queue(n),e.effects.unshift(r,g,4)}),e.effects.define("highlight","show",function(t,n){var r=e(this),i={backgroundColor:r.css("backgroundColor")};"hide"===t.mode&&(i.opacity=0),e.effects.saveStyle(r),r.css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(i,{queue:!1,duration:t.duration,easing:t.easing,complete:n})}),e.effects.define("size",function(t,n){var r,i,s,o=e(this),u=["fontSize"],a=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],f=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],l=t.mode,c="effect"!==l,h=t.scale||"both",p=t.origin||["middle","center"],d=o.css("position"),v=o.position(),m=e.effects.scaledDimensions(o),g=t.from||m,y=t.to||e.effects.scaledDimensions(o,0);e.effects.createPlaceholder(o),"show"===l&&(s=g,g=y,y=s),i={from:{y:g.height/m.height,x:g.width/m.width},to:{y:y.height/m.height,x:y.width/m.width}},("box"===h||"both"===h)&&(i.from.y!==i.to.y&&(g=e.effects.setTransition(o,a,i.from.y,g),y=e.effects.setTransition(o,a,i.to.y,y)),i.from.x!==i.to.x&&(g=e.effects.setTransition(o,f,i.from.x,g),y=e.effects.setTransition(o,f,i.to.x,y))),("content"===h||"both"===h)&&i.from.y!==i.to.y&&(g=e.effects.setTransition(o,u,i.from.y,g),y=e.effects.setTransition(o,u,i.to.y,y)),p&&(r=e.effects.getBaseline(p,m),g.top=(m.outerHeight-g.outerHeight)*r.y+v.top,g.left=(m.outerWidth-g.outerWidth)*r.x+v.left,y.top=(m.outerHeight-y.outerHeight)*r.y+v.top,y.left=(m.outerWidth-y.outerWidth)*r.x+v.left),o.css(g),("content"===h||"both"===h)&&(a=a.concat(["marginTop","marginBottom"]).concat(u),f=f.concat(["marginLeft","marginRight"]),o.find("*[width]").each(function(){var n=e(this),r=e.effects.scaledDimensions(n),s={height:r.height*i.from.y,width:r.width*i.from.x,outerHeight:r.outerHeight*i.from.y,outerWidth:r.outerWidth*i.from.x},o={height:r.height*i.to.y,width:r.width*i.to.x,outerHeight:r.height*i.to.y,outerWidth:r.width*i.to.x};i.from.y!==i.to.y&&(s=e.effects.setTransition(n,a,i.from.y,s),o=e.effects.setTransition(n,a,i.to.y,o)),i.from.x!==i.to.x&&(s=e.effects.setTransition(n,f,i.from.x,s),o=e.effects.setTransition(n,f,i.to.x,o)),c&&e.effects.saveStyle(n),n.css(s),n.animate(o,t.duration,t.easing,function(){c&&e.effects.restoreStyle(n)})})),o.animate(y,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){var t=o.offset();0===y.opacity&&o.css("opacity",g.opacity),c||(o.css("position","static"===d?"relative":d).offset(t),e.effects.saveStyle(o)),n()}})}),e.effects.define("scale",function(t,n){var r=e(this),i=t.mode,s=parseInt(t.percent,10)||(0===parseInt(t.percent,10)?0:"effect"!==i?0:100),o=e.extend(!0,{from:e.effects.scaledDimensions(r),to:e.effects.scaledDimensions(r,s,t.direction||"both"),origin:t.origin||["middle","center"]},t);t.fade&&(o.from.opacity=1,o.to.opacity=0),e.effects.effect.size.call(this,o,n)}),e.effects.define("puff","hide",function(t,n){var r=e.extend(!0,{},t,{fade:!0,percent:parseInt(t.percent,10)||150});e.effects.effect.scale.call(this,r,n)}),e.effects.define("pulsate","show",function(t,n){var r=e(this),i=t.mode,s="show"===i,o="hide"===i,u=s||o,a=2*(t.times||5)+(u?1:0),f=t.duration/a,l=0,c=1,h=r.queue().length;for((s||!r.is(":visible"))&&(r.css("opacity",0).show(),l=1);a>c;c++)r.animate({opacity:l},f,t.easing),l=1-l;r.animate({opacity:l},f,t.easing),r.queue(n),e.effects.unshift(r,h,a+1)}),e.effects.define("shake",function(t,n){var r=1,i=e(this),s=t.direction||"left",o=t.distance||20,u=t.times||3,a=2*u+1,f=Math.round(t.duration/a),l="up"===s||"down"===s?"top":"left",c="up"===s||"left"===s,h={},p={},d={},v=i.queue().length;for(e.effects.createPlaceholder(i),h[l]=(c?"-=":"+=")+o,p[l]=(c?"+=":"-=")+2*o,d[l]=(c?"-=":"+=")+2*o,i.animate(h,f,t.easing);u>r;r++)i.animate(p,f,t.easing).animate(d,f,t.easing);i.animate(p,f,t.easing).animate(h,f/2,t.easing).queue(n),e.effects.unshift(i,v,a+1)}),e.effects.define("slide","show",function(t,n){var r,i,s=e(this),o={up:["bottom","top"],down:["top","bottom"],left:["right","left"],right:["left","right"]},u=t.mode,a=t.direction||"left",f="up"===a||"down"===a?"top":"left",l="up"===a||"left"===a,c=t.distance||s["top"===f?"outerHeight":"outerWidth"](!0),h={};e.effects.createPlaceholder(s),r=s.cssClip(),i=s.position()[f],h[f]=(l?-1:1)*c+i,h.clip=s.cssClip(),h.clip[o[a][1]]=h.clip[o[a][0]],"show"===u&&(s.cssClip(h.clip),s.css(f,h[f]),h.clip=r,h[f]=i),s.animate(h,{queue:!1,duration:t.duration,easing:t.easing,complete:n})});var d;e.uiBackCompat!==!1&&(d=e.effects.define("transfer",function(t,n){e(this).transfer(t,n)})),e.ui.focusable=function(n,r){var i,s,o,u,a,f=n.nodeName.toLowerCase();return"area"===f?(i=n.parentNode,s=i.name,n.href&&s&&"map"===i.nodeName.toLowerCase()?(o=e("img[usemap='#"+s+"']"),o.length>0&&o.is(":visible")):!1):(/^(input|select|textarea|button|object)$/.test(f)?(u=!n.disabled,u&&(a=e(n).closest("fieldset")[0],a&&(u=!a.disabled))):u="a"===f?n.href||r:r,u&&e(n).is(":visible")&&t(e(n)))},e.extend(e.expr[":"],{focusable:function(t){return e.ui.focusable(t,null!=e.attr(t,"tabindex"))}}),e.ui.focusable,e.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):e(this[0].form)},e.ui.formResetMixin={_formResetHandler:function(){var t=e(this);setTimeout(function(){var n=t.data("ui-form-reset-instances");e.each(n,function(){this.refresh()})})},_bindFormResetHandler:function(){if(this.form=this.element.form(),this.form.length){var e=this.form.data("ui-form-reset-instances")||[];e.length||this.form.on("reset.ui-form-reset",this._formResetHandler),e.push(this),this.form.data("ui-form-reset-instances",e)}},_unbindFormResetHandler:function(){if(this.form.length){var t=this.form.data("ui-form-reset-instances");t.splice(e.inArray(this,t),1),t.length?this.form.data("ui-form-reset-instances",t):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}},"1.7"===e.fn.jquery.substring(0,3)&&(e.each(["Width","Height"],function(t,n){function r(t,n,r,s){return e.each(i,function(){n-=parseFloat(e.css(t,"padding"+this))||0,r&&(n-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(n-=parseFloat(e.css(t,"margin"+this))||0)}),n}var i="Width"===n?["Left","Right"]:["Top","Bottom"],s=n.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+n]=function(t){return void 0===t?o["inner"+n].call(this):this.each(function(){e(this).css(s,r(this,t)+"px")})},e.fn["outer"+n]=function(t,i){return"number"!=typeof t?o["outer"+n].call(this,t):this.each(function(){e(this).css(s,r(this,t,!0,i)+"px")})}}),e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},e.ui.escapeSelector=function(){var e=/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g;return function(t){return t.replace(e,"\\$1")}}(),e.fn.labels=function(){var t,n,r,i,s;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(i=this.eq(0).parents("label"),r=this.attr("id"),r&&(t=this.eq(0).parents().last(),s=t.add(t.length?t.siblings():this.siblings()),n="label[for='"+e.ui.escapeSelector(r)+"']",i=i.add(s.find(n).addBack(n))),this.pushStack(i))},e.fn.scrollParent=function(t){var n=this.css("position"),r="absolute"===n,i=t?/(auto|scroll|hidden)/:/(auto|scroll)/,s=this.parents().filter(function(){var t=e(this);return r&&"static"===t.css("position")?!1:i.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==n&&s.length?s:e(this[0].ownerDocument||document)},e.extend(e.expr[":"],{tabbable:function(t){var n=e.attr(t,"tabindex"),r=null!=n;return(!r||n>=0)&&e.ui.focusable(t,r)}}),e.fn.extend({uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.widget("ui.accordion",{version:"1.12.0",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:!1,event:"click",header:"> li > :first-child, > :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=e(),this._addClass("ui-accordion","ui-widget ui-helper-reset"),this.element.attr("role","tablist"),t.collapsible||t.active!==!1&&null!=t.active||(t.active=0),this._processPanels(),0>t.active&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():e()}},_createIcons:function(){var t,n,r=this.options.icons;r&&(t=e("<span>"),this._addClass(t,"ui-accordion-header-icon","ui-icon "+r.header),t.prependTo(this.headers),n=this.active.children(".ui-accordion-header-icon"),this._removeClass(n,r.header)._addClass(n,null,r.activeHeader)._addClass(this.headers,"ui-accordion-icons"))},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons"),this.headers.children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeAttr("role"),this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId(),this._destroyIcons(),e=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||this.options.active!==!1||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons()),void 0)},_setOptionDisabled:function(e){this._super(e),this.element.attr("aria-disabled",e),this._toggleClass(null,"ui-state-disabled",!!e),this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!e)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var n=e.ui.keyCode,r=this.headers.length,i=this.headers.index(t.target),s=!1;switch(t.keyCode){case n.RIGHT:case n.DOWN:s=this.headers[(i+1)%r];break;case n.LEFT:case n.UP:s=this.headers[(i-1+r)%r];break;case n.SPACE:case n.ENTER:this._eventHandler(t);break;case n.HOME:s=this.headers[0];break;case n.END:s=this.headers[r-1]}s&&(e(t.target).attr("tabIndex",-1),e(s).attr("tabIndex",0),e(s).trigger("focus"),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().trigger("focus")},refresh:function(){var t=this.options;this._processPanels(),t.active===!1&&t.collapsible===!0||!this.headers.length?(t.active=!1,this.active=e()):t.active===!1?this._activate(0):this.active.length&&!e.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=e()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var e=this.headers,t=this.panels;this.headers=this.element.find(this.options.header),this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default"),this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide(),this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content"),t&&(this._off(e.not(this.headers)),this._off(t.not(this.panels)))},_refresh:function(){var t,n=this.options,r=n.heightStyle,i=this.element.parent();this.active=this._findActive(n.active),this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed"),this._addClass(this.active.next(),"ui-accordion-content-active"),this.active.next().show(),this.headers.attr("role","tab").each(function(){var t=e(this),n=t.uniqueId().attr("id"),r=t.next(),i=r.uniqueId().attr("id");t.attr("aria-controls",i),r.attr("aria-labelledby",n)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(n.event),"fill"===r?(t=i.height(),this.element.siblings(":visible").each(function(){var n=e(this),r=n.css("position");"absolute"!==r&&"fixed"!==r&&(t-=n.outerHeight(!0))}),this.headers.each(function(){t-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,t-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===r&&(t=0,this.headers.next().each(function(){var n=e(this).is(":visible");n||e(this).show(),t=Math.max(t,e(this).css("height","").height()),n||e(this).hide()}).height(t))},_activate:function(t){var n=this._findActive(t)[0];n!==this.active[0]&&(n=n||this.active[0],this._eventHandler({target:n,currentTarget:n,preventDefault:e.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):e()},_setupEvents:function(t){var n={keydown:"_keydown"};t&&e.each(t.split(" "),function(e,t){n[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,n),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var n,r,i=this.options,s=this.active,o=e(t.currentTarget),u=o[0]===s[0],a=u&&i.collapsible,f=a?e():o.next(),l=s.next(),c={oldHeader:s,oldPanel:l,newHeader:a?e():o,newPanel:f};t.preventDefault(),u&&!i.collapsible||this._trigger("beforeActivate",t,c)===!1||(i.active=a?!1:this.headers.index(o),this.active=u?e():o,this._toggle(c),this._removeClass(s,"ui-accordion-header-active","ui-state-active"),i.icons&&(n=s.children(".ui-accordion-header-icon"),this._removeClass(n,null,i.icons.activeHeader)._addClass(n,null,i.icons.header)),u||(this._removeClass(o,"ui-accordion-header-collapsed")._addClass(o,"ui-accordion-header-active","ui-state-active"),i.icons&&(r=o.children(".ui-accordion-header-icon"),this._removeClass(r,null,i.icons.header)._addClass(r,null,i.icons.activeHeader)),this._addClass(o.next(),"ui-accordion-content-active")))},_toggle:function(t){var n=t.newPanel,r=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=n,this.prevHide=r,this.options.animate?this._animate(n,r,t):(r.hide(),n.show(),this._toggleComplete(t)),r.attr({"aria-hidden":"true"}),r.prev().attr({"aria-selected":"false","aria-expanded":"false"}),n.length&&r.length?r.prev().attr({tabIndex:-1,"aria-expanded":"false"}):n.length&&this.headers.filter(function(){return 0===parseInt(e(this).attr("tabIndex"),10)}).attr("tabIndex",-1),n.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(e,t,n){var r,i,s,o=this,u=0,a=e.css("box-sizing"),f=e.length&&(!t.length||e.index()<t.index()),l=this.options.animate||{},c=f&&l.down||l,h=function(){o._toggleComplete(n)};return"number"==typeof c&&(s=c),"string"==typeof c&&(i=c),i=i||c.easing||l.easing,s=s||c.duration||l.duration,t.length?e.length?(r=e.show().outerHeight(),t.animate(this.hideProps,{duration:s,easing:i,step:function(e,t){t.now=Math.round(e)}}),e.hide().animate(this.showProps,{duration:s,easing:i,complete:h,step:function(e,n){n.now=Math.round(e),"height"!==n.prop?"content-box"===a&&(u+=n.now):"content"!==o.options.heightStyle&&(n.now=Math.round(r-t.outerHeight()-u),u=0)}}),void 0):t.animate(this.hideProps,s,i,h):e.animate(this.showProps,s,i,h)},_toggleComplete:function(e){var t=e.oldPanel,n=t.prev();this._removeClass(t,"ui-accordion-content-active"),this._removeClass(n,"ui-accordion-header-active")._addClass(n,"ui-accordion-header-collapsed"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}}),e.ui.safeActiveElement=function(e){var t;try{t=e.activeElement}catch(n){t=e.body}return t||(t=e.body),t.nodeName||(t=e.body),t},e.widget("ui.menu",{version:"1.12.0",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(e){e.preventDefault()},"click .ui-menu-item":function(t){var n=e(t.target),r=e(e.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&n.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),n.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&r.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){if(!this.previousFilter){var n=e(t.target).closest(".ui-menu-item"),r=e(t.currentTarget);n[0]===r[0]&&(this._removeClass(r.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(t,r))}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var n=this.active||this.element.find(this.options.items).eq(0);t||this.focus(e,n)},blur:function(t){this._delay(function(){var n=!e.contains(this.element[0],e.ui.safeActiveElement(this.document[0]));n&&this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){this._closeOnDocumentClick(e)&&this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){var t=this.element.find(".ui-menu-item").removeAttr("role aria-disabled"),n=t.children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),n.children().each(function(){var t=e(this);t.data("ui-menu-submenu-caret")&&t.remove()})},_keydown:function(t){var n,r,i,s,o=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:o=!1,r=this.previousFilter||"",i=String.fromCharCode(t.keyCode),s=!1,clearTimeout(this.filterTimer),i===r?s=!0:i=r+i,n=this._filterMenuItems(i),n=s&&-1!==n.index(this.active.next())?this.active.nextAll(".ui-menu-item"):n,n.length||(i=String.fromCharCode(t.keyCode),n=this._filterMenuItems(i)),n.length?(this.focus(t,n),this.previousFilter=i,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}o&&t.preventDefault()},_activate:function(e){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(e):this.select(e))},refresh:function(){var t,n,r,i,s,o=this,u=this.options.icons.submenu,a=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),r=a.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),n=t.prev(),r=e("<span>").data("ui-menu-submenu-caret",!0);o._addClass(r,"ui-menu-icon","ui-icon "+u),n.attr("aria-haspopup","true").prepend(r),t.attr("aria-labelledby",n.attr("id"))}),this._addClass(r,"ui-menu","ui-widget ui-widget-content ui-front"),t=a.add(this.element),n=t.find(this.options.items),n.not(".ui-menu-item").each(function(){var t=e(this);o._isDivider(t)&&o._addClass(t,"ui-menu-divider","ui-widget-content")}),i=n.not(".ui-menu-item, .ui-menu-divider"),s=i.children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(i,"ui-menu-item")._addClass(s,"ui-menu-item-wrapper"),n.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(e,t){if("icons"===e){var n=this.element.find(".ui-menu-icon");this._removeClass(n,null,this.options.icons.submenu)._addClass(n,null,t.submenu)}this._super(e,t)},_setOptionDisabled:function(e){this._super(e),this.element.attr("aria-disabled",e+""),this._toggleClass(null,"ui-state-disabled",!!e)},focus:function(e,t){var n,r,i;this.blur(e,e&&"focus"===e.type),this._scrollIntoView(t),this.active=t.first(),r=this.active.children(".ui-menu-item-wrapper"),this._addClass(r,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",r.attr("id")),i=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),e&&"keydown"===e.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),n=t.children(".ui-menu"),n.length&&e&&/^mouse/.test(e.type)&&this._startOpening(n),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var n,r,i,s,o,u;this._hasScroll()&&(n=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,r=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,i=t.offset().top-this.activeMenu.offset().top-n-r,s=this.activeMenu.scrollTop(),o=this.activeMenu.height(),u=t.outerHeight(),0>i?this.activeMenu.scrollTop(s+i):i+u>o&&this.activeMenu.scrollTop(s+i-o+u))},blur:function(e,t){t||clearTimeout(this.timer),this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",e,{item:this.active}),this.active=null)},_startOpening:function(e){clearTimeout(this.timer),"true"===e.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(e)},this.delay))},_open:function(t){var n=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(n)},collapseAll:function(t,n){clearTimeout(this.timer),this.timer=this._delay(function(){var r=n?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));r.length||(r=this.element),this._close(r),this.blur(t),this._removeClass(r.find(".ui-state-active"),null,"ui-state-active"),this.activeMenu=r},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false")},_closeOnDocumentClick:function(t){return!e(t.target).closest(".ui-menu").length},_isDivider:function(e){return!/[^\-\u2014\u2013\s]/.test(e.text())},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,n){var r;this.active&&(r="first"===e||"last"===e?this.active["first"===e?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[e+"All"](".ui-menu-item").eq(0)),r&&r.length&&this.active||(r=this.activeMenu.find(this.options.items)[t]()),this.focus(n,r)},nextPage:function(t){var n,r,i;return this.active?(this.isLastItem()||(this._hasScroll()?(r=this.active.offset().top,i=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return n=e(this),0>n.offset().top-r-i}),this.focus(t,n)):this.focus(t,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())),void 0):(this.next(t),void 0)},previousPage:function(t){var n,r,i;return this.active?(this.isFirstItem()||(this._hasScroll()?(r=this.active.offset().top,i=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return n=e(this),n.offset().top-r+i>0}),this.focus(t,n)):this.focus(t,this.activeMenu.find(this.options.items).first())),void 0):(this.next(t),void 0)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||e(t.target).closest(".ui-menu-item");var n={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,n)},_filterMenuItems:function(t){var n=t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),r=RegExp("^"+n,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return r.test(e.trim(e(this).children(".ui-menu-item-wrapper").text()))})}}),e.widget("ui.autocomplete",{version:"1.12.0",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var t,n,r,i=this.element[0].nodeName.toLowerCase(),s="textarea"===i,o="input"===i;this.isMultiLine=s||!o&&this._isContentEditable(this.element),this.valueMethod=this.element[s||o?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(i){if(this.element.prop("readOnly"))return t=!0,r=!0,n=!0,void 0;t=!1,r=!1,n=!1;var s=e.ui.keyCode;switch(i.keyCode){case s.PAGE_UP:t=!0,this._move("previousPage",i);break;case s.PAGE_DOWN:t=!0,this._move("nextPage",i);break;case s.UP:t=!0,this._keyEvent("previous",i);break;case s.DOWN:t=!0,this._keyEvent("next",i);break;case s.ENTER:this.menu.active&&(t=!0,i.preventDefault(),this.menu.select(i));break;case s.TAB:this.menu.active&&this.menu.select(i);break;case s.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(i),i.preventDefault());break;default:n=!0,this._searchTimeout(i)}},keypress:function(r){if(t)return t=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&r.preventDefault(),void 0;if(!n){var i=e.ui.keyCode;switch(r.keyCode){case i.PAGE_UP:this._move("previousPage",r);break;case i.PAGE_DOWN:this._move("nextPage",r);break;case i.UP:this._keyEvent("previous",r);break;case i.DOWN:this._keyEvent("next",r)}}},input:function(e){return r?(r=!1,e.preventDefault(),void 0):(this._searchTimeout(e),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(e),this._change(e),void 0)}}),this._initSource(),this.menu=e("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,this.element[0]!==e.ui.safeActiveElement(this.document[0])&&this.element.trigger("focus")})},menufocus:function(t,n){var r,i;return this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type))?(this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)}),void 0):(i=n.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:i})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(i.value),r=n.item.attr("aria-label")||i.value,r&&e.trim(r).length&&(this.liveRegion.children().hide(),e("<div>").text(r).appendTo(this.liveRegion)),void 0)},menuselect:function(t,n){var r=n.item.data("ui-autocomplete-item"),i=this.previous;this.element[0]!==e.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=i,this._delay(function(){this.previous=i,this.selectedItem=r})),!1!==this._trigger("select",t,{item:r})&&this._value(r.value),this.term=this._value(),this.close(t),this.selectedItem=r}}),this.liveRegion=e("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(t){var n=this.menu.element[0];return t.target===this.element[0]||t.target===n||e.contains(n,t.target)},_closeOnClickOutside:function(e){this._isEventTargetInWidget(e)||this.close()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front, dialog")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,n,r=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(n,r){r(e.ui.autocomplete.filter(t,n.term))}):"string"==typeof this.options.source?(n=this.options.source,this.source=function(t,i){r.xhr&&r.xhr.abort(),r.xhr=e.ajax({url:n,data:t,dataType:"json",success:function(e){i(e)},error:function(){i([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),n=this.menu.element.is(":visible"),r=e.altKey||e.ctrlKey||e.metaKey||e.shiftKey;(!t||t&&!n&&!r)&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):this._trigger("search",t)!==!1?this._search(e):void 0},_search:function(e){this.pending++,this._addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var t=++this.requestIndex;return e.proxy(function(e){t===this.requestIndex&&this.__response(e),this.pending--,this.pending||this._removeClass("ui-autocomplete-loading")},this)},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this._off(this.document,"mousedown"),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return"string"==typeof t?{label:t,value:t}:e.extend({},t,{label:t.label||t.value,value:t.value||t.label})})},_suggest:function(t){var n=this.menu.element.empty();this._renderMenu(n,t),this.isNewMenu=!0,this.menu.refresh(),n.show(),this._resizeMenu(),n.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(),this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,n){var r=this;e.each(n,function(e,n){r._renderItemData(t,n)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,n){return e("<li>").append(e("<div>").text(n.label)).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this.isMultiLine||this._value(this.term),this.menu.blur(),void 0):(this.menu[e](t),void 0):(this.search(null,t),void 0)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())},_isContentEditable:function(e){if(!e.length)return!1;var t=e.prop("contentEditable");return"inherit"===t?this._isContentEditable(e.parent()):"true"===t}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,n){var r=RegExp(e.ui.autocomplete.escapeRegex(n),"i");return e.grep(t,function(e){return r.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var n;this._superApply(arguments),this.options.disabled||this.cancelSearch||(n=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.children().hide(),e("<div>").text(n).appendTo(this.liveRegion))}}),e.ui.autocomplete;var v=/ui-corner-([a-z]){2,6}/g;e.widget("ui.controlgroup",{version:"1.12.0",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var t=this,n=[];e.each(this.options.items,function(r,i){var s,o={};return i?"controlgroupLabel"===r?(s=t.element.find(i),s.each(function(){var t=e(this);t.children(".ui-controlgroup-label-contents").length||t.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")}),t._addClass(s,null,"ui-widget ui-widget-content ui-state-default"),n=n.concat(s.get()),void 0):(e.fn[r]&&(t["_"+r+"Options"]&&(o=t["_"+r+"Options"]("middle")),t.element.find(i).each(function(){var i=e(this),s=i[r]("instance"),u=e.widget.extend({},o);if("button"!==r||!i.parent(".ui-spinner").length){s||(s=i[r]()[r]("instance")),s&&(u.classes=t._resolveClassesValues(u.classes,s)),i[r](u);var a=i[r]("widget");e.data(a[0],"ui-controlgroup-data",s?s:i[r]("instance")),n.push(a[0])}})),void 0):void 0}),this.childWidgets=e(e.unique(n)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(t){this.childWidgets.each(function(){var n=e(this),r=n.data("ui-controlgroup-data");r&&r[t]&&r[t]()})},_updateCornerClass:function(e,t){var n="ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all",r=this._buildSimpleOptions(t,"label").classes.label;this._removeClass(e,null,n),this._addClass(e,null,r)},_buildSimpleOptions:function(e,t){var n="vertical"===this.options.direction,r={classes:{}};return r.classes[t]={middle:"",first:"ui-corner-"+(n?"top":"left"),last:"ui-corner-"+(n?"bottom":"right"),only:"ui-corner-all"}[e],r},_spinnerOptions:function(e){var t=this._buildSimpleOptions(e,"ui-spinner");return t.classes["ui-spinner-up"]="",t.classes["ui-spinner-down"]="",t},_buttonOptions:function(e){return this._buildSimpleOptions(e,"ui-button")},_checkboxradioOptions:function(e){return this._buildSimpleOptions(e,"ui-checkboxradio-label")},_selectmenuOptions:function(e){var t="vertical"===this.options.direction;return{width:t?"auto":!1,classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(t?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(t?"top":"left")},last:{"ui-selectmenu-button-open":t?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(t?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[e]}},_resolveClassesValues:function(t,n){var r={};return e.each(t,function(e){var i=n.options.classes[e]||"";i=i.replace(v,"").trim(),r[e]=(i+" "+t[e]).replace(/\s+/g," ")}),r},_setOption:function(e,t){return"direction"===e&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(e,t),"disabled"===e?(this._callChildMethod(t?"disable":"enable"),void 0):(this.refresh(),void 0)},refresh:function(){var t,n=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),t=this.childWidgets,this.options.onlyVisible&&(t=t.filter(":visible")),t.length&&(e.each(["first","last"],function(e,r){var i=t[r]().data("ui-controlgroup-data");if(i&&n["_"+i.widgetName+"Options"]){var s=n["_"+i.widgetName+"Options"](1===t.length?"only":r);s.classes=n._resolveClassesValues(s.classes,i),i.element[i.widgetName](s)}else n._updateCornerClass(t[r](),r)}),this._callChildMethod("refresh"))}}),e.widget("ui.checkboxradio",[e.ui.formResetMixin,{version:"1.12.0",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var t,n,r=this,i=this._super()||{};return this._readType(),n=this.element.labels(),this.label=e(n[n.length-1]),this.label.length||e.error("No label found for checkboxradio widget"),this.originalLabel="",this.label.contents().not(this.element).each(function(){r.originalLabel+=3===this.nodeType?e(this).text():this.outerHTML}),this.originalLabel&&(i.label=this.originalLabel),t=this.element[0].disabled,null!=t&&(i.disabled=t),i},_create:function(){var e=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),e&&(this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this.icon&&this._addClass(this.icon,null,"ui-state-hover")),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var t=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===t&&/radio|checkbox/.test(this.type)||e.error("Can't create checkboxradio on element.nodeName="+t+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var t,n=this.element[0].name,r="input[name='"+e.ui.escapeSelector(n)+"']";return n?(t=this.form.length?e(this.form[0].elements).filter(r):e(r).filter(function(){return 0===e(this).form().length}),t.not(this.element)):e([])},_toggleClasses:function(){var t=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",t)._toggleClass(this.icon,null,"ui-icon-blank",!t),"radio"===this.type&&this._getRadioGroup().each(function(){var t=e(this).checkboxradio("instance");t&&t._removeClass(t.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(e,t){return"label"!==e||t?(this._super(e,t),"disabled"===e?(this._toggleClass(this.label,null,"ui-state-disabled",t),this.element[0].disabled=t,void 0):(this.refresh(),void 0)):void 0},_updateIcon:function(t){var n="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=e("<span>"),this.iconSpace=e("<span> </span>"),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(n+=t?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,t?"ui-icon-blank":"ui-icon-check")):n+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",n),t||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){this.label.contents().not(this.element.add(this.icon).add(this.iconSpace)).remove(),this.label.append(this.options.label)},refresh:function(){var e=this.element[0].checked,t=this.element[0].disabled;this._updateIcon(e),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",e),null!==this.options.label&&this._updateLabel(),t!==this.options.disabled&&this._setOptions({disabled:t})}}]),e.ui.checkboxradio,e.widget("ui.button",{version:"1.12.0",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var e,t=this._super()||{};return this.isInput=this.element.is("input"),e=this.element[0].disabled,null!=e&&(t.disabled=e),this.originalLabel=this.isInput?this.element.val():this.element.html(),this.originalLabel&&(t.label=this.originalLabel),t},_create:function(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1),this.hasTitle=!!this.element.attr("title"),this.options.label&&this.options.label!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this.element.html(this.options.label)),this._addClass("ui-button","ui-widget"),this._setOption("disabled",this.options.disabled),this._enhance(),this.element.is("a")&&this._on({keyup:function(t){t.keyCode===e.ui.keyCode.SPACE&&(t.preventDefault(),this.element[0].click?this.element[0].click():this.element.trigger("click"))}})},_enhance:function(){this.element.is("button")||this.element.attr("role","button"),this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updateTooltip())},_updateTooltip:function(){this.title=this.element.attr("title"),this.options.showLabel||this.title||this.element.attr("title",this.options.label)},_updateIcon:function(t,n){var r="iconPosition"!==t,i=r?this.options.iconPosition:n,s="top"===i||"bottom"===i;this.icon?r&&this._removeClass(this.icon,null,this.options.icon):(this.icon=e("<span>"),this._addClass(this.icon,"ui-button-icon","ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only")),r&&this._addClass(this.icon,null,n),this._attachIcon(i),s?(this._addClass(this.icon,null,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconSpace||(this.iconSpace=e("<span> </span>"),this._addClass(this.iconSpace,"ui-button-icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._attachIconSpace(i))},_destroy:function(){this.element.removeAttr("role"),this.icon&&this.icon.remove(),this.iconSpace&&this.iconSpace.remove(),this.hasTitle||this.element.removeAttr("title")},_attachIconSpace:function(e){this.icon[/^(?:end|bottom)/.test(e)?"before":"after"](this.iconSpace)},_attachIcon:function(e){this.element[/^(?:end|bottom)/.test(e)?"append":"prepend"](this.icon)},_setOptions:function(e){var t=void 0===e.showLabel?this.options.showLabel:e.showLabel,n=void 0===e.icon?this.options.icon:e.icon;t||n||(e.showLabel=!0),this._super(e)},_setOption:function(e,t){"icon"===e&&(t?this._updateIcon(e,t):this.icon&&(this.icon.remove(),this.iconSpace&&this.iconSpace.remove())),"iconPosition"===e&&this._updateIcon(e,t),"showLabel"===e&&(this._toggleClass("ui-button-icon-only",null,!t),this._updateTooltip()),"label"===e&&(this.isInput?this.element.val(t):(this.element.html(t),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIconSpace(this.options.iconPosition)))),this._super(e,t),"disabled"===e&&(this._toggleClass(null,"ui-state-disabled",t),this.element[0].disabled=t,t&&this.element.blur())},refresh:function(){var e=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");e!==this.options.disabled&&this._setOptions({disabled:e}),this._updateTooltip()}}),e.uiBackCompat!==!1&&(e.widget("ui.button",e.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.options.showLabel=this.options.text),!this.options.showLabel&&this.options.text&&(this.options.text=this.options.showLabel),this.options.icon||!this.options.icons.primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.primary=this.options.icon):this.options.icons.primary?this.options.icon=this.options.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.iconPosition="end"),this._super()},_setOption:function(e,t){return"text"===e?(this._super("showLabel",t),void 0):("showLabel"===e&&(this.options.text=t),"icon"===e&&(this.options.icons.primary=t),"icons"===e&&(t.primary?(this._super("icon",t.primary),this._super("iconPosition","beginning")):t.secondary&&(this._super("icon",t.secondary),this._super("iconPosition","end"))),this._superApply(arguments),void 0)}}),e.fn.button=function(t){return function(){return!this.length||this.length&&"INPUT"!==this[0].tagName||this.length&&"INPUT"===this[0].tagName&&"checkbox"!==this.attr("type")&&"radio"!==this.attr("type")?t.apply(this,arguments):(e.ui.checkboxradio||e.error("Checkboxradio widget missing"),0===arguments.length?this.checkboxradio({icon:!1}):this.checkboxradio.apply(this,arguments))}}(e.fn.button),e.fn.buttonset=function(){return e.ui.controlgroup||e.error("Controlgroup widget missing"),"option"===arguments[0]&&"items"===arguments[1]&&arguments[2]?this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]):"option"===arguments[0]&&"items"===arguments[1]?this.controlgroup.apply(this,[arguments[0],"items.button"]):("object"==typeof arguments[0]&&arguments[0].items&&(arguments[0].items={button:arguments[0].items}),this.controlgroup.apply(this,arguments))}),e.ui.button,e.extend(e.ui,{datepicker:{version:"1.12.0"}});var m;e.extend(r.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return o(this._defaults,e||{}),this},_attachDatepicker:function(t,n){var r,i,s;r=t.nodeName.toLowerCase(),i="div"===r||"span"===r,t.id||(this.uuid+=1,t.id="dp"+this.uuid),s=this._newInst(e(t),i),s.settings=e.extend({},n||{}),"input"===r?this._connectDatepicker(t,s):i&&this._inlineDatepicker(t,s)},_newInst:function(t,n){var r=t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:r,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:n,dpDiv:n?i(e("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,n){var r=e(t);n.append=e([]),n.trigger=e([]),r.hasClass(this.markerClassName)||(this._attachments(r,n),r.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp),this._autoSize(n),e.data(t,"datepicker",n),n.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,n){var r,i,s,o=this._get(n,"appendText"),u=this._get(n,"isRTL");n.append&&n.append.remove(),o&&(n.append=e("<span class='"+this._appendClass+"'>"+o+"</span>"),t[u?"before":"after"](n.append)),t.off("focus",this._showDatepicker),n.trigger&&n.trigger.remove(),r=this._get(n,"showOn"),("focus"===r||"both"===r)&&t.on("focus",this._showDatepicker),("button"===r||"both"===r)&&(i=this._get(n,"buttonText"),s=this._get(n,"buttonImage"),n.trigger=e(this._get(n,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:s,alt:i,title:i}):e("<button type='button'></button>").addClass(this._triggerClass).html(s?e("<img/>").attr({src:s,alt:i,title:i}):i)),t[u?"before":"after"](n.trigger),n.trigger.on("click",function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,n,r,i,s=new Date(2009,11,20),o=this._get(e,"dateFormat");o.match(/[DM]/)&&(t=function(e){for(n=0,r=0,i=0;e.length>i;i++)e[i].length>n&&(n=e[i].length,r=i);return r},s.setMonth(t(this._get(e,o.match(/MM/)?"monthNames":"monthNamesShort"))),s.setDate(t(this._get(e,o.match(/DD/)?"dayNames":"dayNamesShort"))+20-s.getDay())),e.input.attr("size",this._formatDate(e,s).length)}},_inlineDatepicker:function(t,n){var r=e(t);r.hasClass(this.markerClassName)||(r.addClass(this.markerClassName).append(n.dpDiv),e.data(t,"datepicker",n),this._setDate(n,this._getDefaultDate(n),!0),this._updateDatepicker(n),this._updateAlternate(n),n.settings.disabled&&this._disableDatepicker(t),n.dpDiv.css("display","block"))},_dialogDatepicker:function(t,n,r,i,s){var u,a,f,l,c,h=this._dialogInst;return h||(this.uuid+=1,u="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+u+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.on("keydown",this._doKeyDown),e("body").append(this._dialogInput),h=this._dialogInst=this._newInst(this._dialogInput,!1),h.settings={},e.data(this._dialogInput[0],"datepicker",h)),o(h.settings,i||{}),n=n&&n.constructor===Date?this._formatDate(h,n):n,this._dialogInput.val(n),this._pos=s?s.length?s:[s.pageX,s.pageY]:null,this._pos||(a=document.documentElement.clientWidth,f=document.documentElement.clientHeight,l=document.documentElement.scrollLeft||document.body.scrollLeft,c=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[a/2-100+l,f/2-150+c]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),h.settings.onSelect=r,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],"datepicker",h),this},_destroyDatepicker:function(t){var n,r=e(t),i=e.data(t,"datepicker");r.hasClass(this.markerClassName)&&(n=t.nodeName.toLowerCase(),e.removeData(t,"datepicker"),"input"===n?(i.append.remove(),i.trigger.remove(),r.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):("div"===n||"span"===n)&&r.removeClass(this.markerClassName).empty(),m===i&&(m=null))},_enableDatepicker:function(t){var n,r,i=e(t),s=e.data(t,"datepicker");i.hasClass(this.markerClassName)&&(n=t.nodeName.toLowerCase(),"input"===n?(t.disabled=!1,s.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===n||"span"===n)&&(r=i.children("."+this._inlineClass),r.children().removeClass("ui-state-disabled"),r.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var n,r,i=e(t),s=e.data(t,"datepicker");i.hasClass(this.markerClassName)&&(n=t.nodeName.toLowerCase(),"input"===n?(t.disabled=!0,s.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===n||"span"===n)&&(r=i.children("."+this._inlineClass),r.children().addClass("ui-state-disabled"),r.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;this._disabledInputs.length>t;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,"datepicker")}catch(n){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,n,r){var i,s,u,a,f=this._getInst(t);return 2===arguments.length&&"string"==typeof n?"defaults"===n?e.extend({},e.datepicker._defaults):f?"all"===n?e.extend({},f.settings):this._get(f,n):null:(i=n||{},"string"==typeof n&&(i={},i[n]=r),f&&(this._curInst===f&&this._hideDatepicker(),s=this._getDateDatepicker(t,!0),u=this._getMinMaxDate(f,"min"),a=this._getMinMaxDate(f,"max"),o(f.settings,i),null!==u&&void 0!==i.dateFormat&&void 0===i.minDate&&(f.settings.minDate=this._formatDate(f,u)),null!==a&&void 0!==i.dateFormat&&void 0===i.maxDate&&(f.settings.maxDate=this._formatDate(f,a)),"disabled"in i&&(i.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(e(t),f),this._autoSize(f),this._setDate(f,s),this._updateAlternate(f),this._updateDatepicker(f)),void 0)},_changeDatepicker:function(e,t,n){this._optionDatepicker(e,t,n)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var n=this._getInst(e);n&&(this._setDate(n,t),this._updateDatepicker(n),this._updateAlternate(n))},_getDateDatepicker:function(e,t){var n=this._getInst(e);return n&&!n.inline&&this._setDateFromField(n,t),n?this._getDate(n):null},_doKeyDown:function(t){var n,r,i,s=e.datepicker._getInst(t.target),o=!0,u=s.dpDiv.is(".ui-datepicker-rtl");if(s._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),o=!1;break;case 13:return i=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",s.dpDiv),i[0]&&e.datepicker._selectDay(t.target,s.selectedMonth,s.selectedYear,i[0]),n=e.datepicker._get(s,"onSelect"),n?(r=e.datepicker._formatDate(s),n.apply(s.input?s.input[0]:null,[r,s])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(s,"stepBigMonths"):-e.datepicker._get(s,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(s,"stepBigMonths"):+e.datepicker._get(s,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),o=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),o=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,u?1:-1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(s,"stepBigMonths"):-e.datepicker._get(s,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),o=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,u?-1:1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(s,"stepBigMonths"):+e.datepicker._get(s,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),o=t.ctrlKey||t.metaKey;break;default:o=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):o=!1;o&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var n,r,i=e.datepicker._getInst(t.target);return e.datepicker._get(i,"constrainInput")?(n=e.datepicker._possibleChars(e.datepicker._get(i,"dateFormat")),r=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||" ">r||!n||n.indexOf(r)>-1):void 0},_doKeyUp:function(t){var n,r=e.datepicker._getInst(t.target);if(r.input.val()!==r.lastVal)try{n=e.datepicker.parseDate(e.datepicker._get(r,"dateFormat"),r.input?r.input.val():null,e.datepicker._getFormatConfig(r)),n&&(e.datepicker._setDateFromField(r),e.datepicker._updateAlternate(r),e.datepicker._updateDatepicker(r))}catch(i){}return!0},_showDatepicker:function(t){if(t=t.target||t,"input"!==t.nodeName.toLowerCase()&&(t=e("input",t.parentNode)[0]),!e.datepicker._isDisabledDatepicker(t)&&e.datepicker._lastInput!==t){var r,i,s,u,a,f,l;r=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==r&&(e.datepicker._curInst.dpDiv.stop(!0,!0),r&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),i=e.datepicker._get(r,"beforeShow"),s=i?i.apply(t,[t,r]):{},s!==!1&&(o(r.settings,s),r.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(r),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),u=!1,e(t).parents().each(function(){return u|="fixed"===e(this).css("position"),!u}),a={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,r.dpDiv.empty(),r.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(r),a=e.datepicker._checkOffset(r,a,u),r.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":u?"fixed":"absolute",display:"none",left:a.left+"px",top:a.top+"px"}),r.inline||(f=e.datepicker._get(r,"showAnim"),l=e.datepicker._get(r,"duration"),r.dpDiv.css("z-index",n(e(t))+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[f]?r.dpDiv.show(f,e.datepicker._get(r,"showOptions"),l):r.dpDiv[f||"show"](f?l:null),e.datepicker._shouldFocusInput(r)&&r.input.trigger("focus"),e.datepicker._curInst=r))}},_updateDatepicker:function(t){this.maxRows=4,m=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t);var n,r=this._getNumberOfMonths(t),i=r[1],o=17,u=t.dpDiv.find("."+this._dayOverClass+" a");u.length>0&&s.apply(u.get(0)),t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),i>1&&t.dpDiv.addClass("ui-datepicker-multi-"+i).css("width",o*i+"em"),t.dpDiv[(1!==r[0]||1!==r[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&e.datepicker._shouldFocusInput(t)&&t.input.trigger("focus"),t.yearshtml&&(n=t.yearshtml,setTimeout(function(){n===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),n=t.yearshtml=null},0))},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(t,n,r){var i=t.dpDiv.outerWidth(),s=t.dpDiv.outerHeight(),o=t.input?t.input.outerWidth():0,u=t.input?t.input.outerHeight():0,a=document.documentElement.clientWidth+(r?0:e(document).scrollLeft()),f=document.documentElement.clientHeight+(r?0:e(document).scrollTop());return n.left-=this._get(t,"isRTL")?i-o:0,n.left-=r&&n.left===t.input.offset().left?e(document).scrollLeft():0,n.top-=r&&n.top===t.input.offset().top+u?e(document).scrollTop():0,n.left-=Math.min(n.left,n.left+i>a&&a>i?Math.abs(n.left+i-a):0),n.top-=Math.min(n.top,n.top+s>f&&f>s?Math.abs(s+u):0),n},_findPos:function(t){for(var n,r=this._getInst(t),i=this._get(r,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.filters.hidden(t));)t=t[i?"previousSibling":"nextSibling"];return n=e(t).offset(),[n.left,n.top]},_hideDatepicker:function(t){var n,r,i,s,o=this._curInst;!o||t&&o!==e.data(t,"datepicker")||this._datepickerShowing&&(n=this._get(o,"showAnim"),r=this._get(o,"duration"),i=function(){e.datepicker._tidyDialog(o)},e.effects&&(e.effects.effect[n]||e.effects[n])?o.dpDiv.hide(n,e.datepicker._get(o,"showOptions"),r,i):o.dpDiv["slideDown"===n?"slideUp":"fadeIn"===n?"fadeOut":"hide"](n?r:null,i),n||i(),this._datepickerShowing=!1,s=this._get(o,"onClose"),s&&s.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(e.datepicker._curInst){var n=e(t.target),r=e.datepicker._getInst(n[0]);(n[0].id!==e.datepicker._mainDivId&&0===n.parents("#"+e.datepicker._mainDivId).length&&!n.hasClass(e.datepicker.markerClassName)&&!n.closest("."+e.datepicker._triggerClass).length&&e.datepicker._datepickerShowing&&(!e.datepicker._inDialog||!e.blockUI)||n.hasClass(e.datepicker.markerClassName)&&e.datepicker._curInst!==r)&&e.datepicker._hideDatepicker()}},_adjustDate:function(t,n,r){var i=e(t),s=this._getInst(i[0]);this._isDisabledDatepicker(i[0])||(this._adjustInstDate(s,n+("M"===r?this._get(s,"showCurrentAtPos"):0),r),this._updateDatepicker(s))},_gotoToday:function(t){var n,r=e(t),i=this._getInst(r[0]);this._get(i,"gotoCurrent")&&i.currentDay?(i.selectedDay=i.currentDay,i.drawMonth=i.selectedMonth=i.currentMonth,i.drawYear=i.selectedYear=i.currentYear):(n=new Date,i.selectedDay=n.getDate(),i.drawMonth=i.selectedMonth=n.getMonth(),i.drawYear=i.selectedYear=n.getFullYear()),this._notifyChange(i),this._adjustDate(r)},_selectMonthYear:function(t,n,r){var i=e(t),s=this._getInst(i[0]);s["selected"+("M"===r?"Month":"Year")]=s["draw"+("M"===r?"Month":"Year")]=parseInt(n.options[n.selectedIndex].value,10),this._notifyChange(s),this._adjustDate(i)},_selectDay:function(t,n,r,i){var s,o=e(t);e(i).hasClass(this._unselectableClass)||this._isDisabledDatepicker(o[0])||(s=this._getInst(o[0]),s.selectedDay=s.currentDay=e("a",i).html(),s.selectedMonth=s.currentMonth=n,s.selectedYear=s.currentYear=r,this._selectDate(t,this._formatDate(s,s.currentDay,s.currentMonth,s.currentYear)))},_clearDate:function(t){var n=e(t);this._selectDate(n,"")},_selectDate:function(t,n){var r,i=e(t),s=this._getInst(i[0]);n=null!=n?n:this._formatDate(s),s.input&&s.input.val(n),this._updateAlternate(s),r=this._get(s,"onSelect"),r?r.apply(s.input?s.input[0]:null,[n,s]):s.input&&s.input.trigger("change"),s.inline?this._updateDatepicker(s):(this._hideDatepicker(),this._lastInput=s.input[0],"object"!=typeof s.input[0]&&s.input.trigger("focus"),this._lastInput=null)},_updateAlternate:function(t){var n,r,i,s=this._get(t,"altField");s&&(n=this._get(t,"altFormat")||this._get(t,"dateFormat"),r=this._getDate(t),i=this.formatDate(n,r,this._getFormatConfig(t)),e(s).val(i))},noWeekends:function(e){var t=e.getDay();return[t>0&&6>t,""]},iso8601Week:function(e){var t,n=new Date(e.getTime());return n.setDate(n.getDate()+4-(n.getDay()||7)),t=n.getTime(),n.setMonth(0),n.setDate(1),Math.floor(Math.round((t-n)/864e5)/7)+1},parseDate:function(t,n,r){if(null==t||null==n)throw"Invalid arguments";if(n="object"==typeof n?""+n:n+"",""===n)return null;var i,s,o,u,a=0,f=(r?r.shortYearCutoff:null)||this._defaults.shortYearCutoff,l="string"!=typeof f?f:(new Date).getFullYear()%100+parseInt(f,10),c=(r?r.dayNamesShort:null)||this._defaults.dayNamesShort,h=(r?r.dayNames:null)||this._defaults.dayNames,p=(r?r.monthNamesShort:null)||this._defaults.monthNamesShort,d=(r?r.monthNames:null)||this._defaults.monthNames,v=-1,m=-1,g=-1,y=-1,b=!1,w=function(e){var n=t.length>i+1&&t.charAt(i+1)===e;return n&&i++,n},E=function(e){var t=w(e),r="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,i="y"===e?r:1,s=RegExp("^\\d{"+i+","+r+"}"),o=n.substring(a).match(s);if(!o)throw"Missing number at position "+a;return a+=o[0].length,parseInt(o[0],10)},S=function(t,r,i){var s=-1,o=e.map(w(t)?i:r,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(o,function(e,t){var r=t[1];return n.substr(a,r.length).toLowerCase()===r.toLowerCase()?(s=t[0],a+=r.length,!1):void 0}),-1!==s)return s+1;throw"Unknown name at position "+a},x=function(){if(n.charAt(a)!==t.charAt(i))throw"Unexpected literal at position "+a;a++};for(i=0;t.length>i;i++)if(b)"'"!==t.charAt(i)||w("'")?x():b=!1;else switch(t.charAt(i)){case"d":g=E("d");break;case"D":S("D",c,h);break;case"o":y=E("o");break;case"m":m=E("m");break;case"M":m=S("M",p,d);break;case"y":v=E("y");break;case"@":u=new Date(E("@")),v=u.getFullYear(),m=u.getMonth()+1,g=u.getDate();break;case"!":u=new Date((E("!")-this._ticksTo1970)/1e4),v=u.getFullYear(),m=u.getMonth()+1,g=u.getDate();break;case"'":w("'")?x():b=!0;break;default:x()}if(n.length>a&&(o=n.substr(a),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===v?v=(new Date).getFullYear():100>v&&(v+=(new Date).getFullYear()-(new Date).getFullYear()%100+(l>=v?0:-100)),y>-1)for(m=1,g=y;;){if(s=this._getDaysInMonth(v,m-1),s>=g)break;m++,g-=s}if(u=this._daylightSavingAdjust(new Date(v,m-1,g)),u.getFullYear()!==v||u.getMonth()+1!==m||u.getDate()!==g)throw"Invalid date";return u},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:864e9*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(e,t,n){if(!t)return"";var r,i=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,s=(n?n.dayNames:null)||this._defaults.dayNames,o=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,u=(n?n.monthNames:null)||this._defaults.monthNames,a=function(t){var n=e.length>r+1&&e.charAt(r+1)===t;return n&&r++,n},f=function(e,t,n){var r=""+t;if(a(e))for(;n>r.length;)r="0"+r;return r},l=function(e,t,n,r){return a(e)?r[t]:n[t]},c="",h=!1;if(t)for(r=0;e.length>r;r++)if(h)"'"!==e.charAt(r)||a("'")?c+=e.charAt(r):h=!1;else switch(e.charAt(r)){case"d":c+=f("d",t.getDate(),2);break;case"D":c+=l("D",t.getDay(),i,s);break;case"o":c+=f("o",Math.round(((new Date(t.getFullYear(),t.getMonth(),t.getDate())).getTime()-(new Date(t.getFullYear(),0,0)).getTime())/864e5),3);break;case"m":c+=f("m",t.getMonth()+1,2);break;case"M":c+=l("M",t.getMonth(),o,u);break;case"y":c+=a("y")?t.getFullYear():(10>t.getFullYear()%100?"0":"")+t.getFullYear()%100;break;case"@":c+=t.getTime();break;case"!":c+=1e4*t.getTime()+this._ticksTo1970;break;case"'":a("'")?c+="'":h=!0;break;default:c+=e.charAt(r)}return c},_possibleChars:function(e){var t,n="",r=!1,i=function(n){var r=e.length>t+1&&e.charAt(t+1)===n;return r&&t++,r};for(t=0;e.length>t;t++)if(r)"'"!==e.charAt(t)||i("'")?n+=e.charAt(t):r=!1;else switch(e.charAt(t)){case"d":case"m":case"y":case"@":n+="0123456789";break;case"D":case"M":return null;case"'":i("'")?n+="'":r=!0;break;default:n+=e.charAt(t)}return n},_get:function(e,t){return void 0!==e.settings[t]?e.settings[t]:this._defaults[t]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var n=this._get(e,"dateFormat"),r=e.lastVal=e.input?e.input.val():null,i=this._getDefaultDate(e),s=i,o=this._getFormatConfig(e);try{s=this.parseDate(n,r,o)||i}catch(u){r=t?"":r}e.selectedDay=s.getDate(),e.drawMonth=e.selectedMonth=s.getMonth(),e.drawYear=e.selectedYear=s.getFullYear(),e.currentDay=r?s.getDate():0,e.currentMonth=r?s.getMonth():0,e.currentYear=r?s.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,n,r){var i=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},s=function(n){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),n,e.datepicker._getFormatConfig(t))}catch(r){}for(var i=(n.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,s=i.getFullYear(),o=i.getMonth(),u=i.getDate(),a=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,f=a.exec(n);f;){switch(f[2]||"d"){case"d":case"D":u+=parseInt(f[1],10);break;case"w":case"W":u+=7*parseInt(f[1],10);break;case"m":case"M":o+=parseInt(f[1],10),u=Math.min(u,e.datepicker._getDaysInMonth(s,o));break;case"y":case"Y":s+=parseInt(f[1],10),u=Math.min(u,e.datepicker._getDaysInMonth(s,o))}f=a.exec(n)}return new Date(s,o,u)},o=null==n||""===n?r:"string"==typeof n?s(n):"number"==typeof n?isNaN(n)?r:i(n):new Date(n.getTime());return o=o&&"Invalid Date"==""+o?r:o,o&&(o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0)),this._daylightSavingAdjust(o)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,n){var r=!t,i=e.selectedMonth,s=e.selectedYear,o=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=o.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=o.getMonth(),e.drawYear=e.selectedYear=e.currentYear=o.getFullYear(),i===e.selectedMonth&&s===e.selectedYear||n||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(r?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(t){var n=this._get(t,"stepMonths"),r="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(r,-n,"M")},next:function(){e.datepicker._adjustDate(r,+n,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(r)},selectDay:function(){return e.datepicker._selectDay(r,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(r,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(r,this,"Y"),!1}};e(this).on(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N,C,k,L,A,O,M,_,D,P,H,B,j,F,I,q=new Date,R=this._daylightSavingAdjust(new Date(q.getFullYear(),q.getMonth(),q.getDate())),U=this._get(e,"isRTL"),z=this._get(e,"showButtonPanel"),W=this._get(e,"hideIfNoPrevNext"),X=this._get(e,"navigationAsDateFormat"),V=this._getNumberOfMonths(e),$=this._get(e,"showCurrentAtPos"),J=this._get(e,"stepMonths"),K=1!==V[0]||1!==V[1],Q=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),G=this._getMinMaxDate(e,"min"),Y=this._getMinMaxDate(e,"max"),Z=e.drawMonth-$,et=e.drawYear;if(0>Z&&(Z+=12,et--),Y)for(t=this._daylightSavingAdjust(new Date(Y.getFullYear(),Y.getMonth()-V[0]*V[1]+1,Y.getDate())),t=G&&G>t?G:t;this._daylightSavingAdjust(new Date(et,Z,1))>t;)Z--,0>Z&&(Z=11,et--);for(e.drawMonth=Z,e.drawYear=et,n=this._get(e,"prevText"),n=X?this.formatDate(n,this._daylightSavingAdjust(new Date(et,Z-J,1)),this._getFormatConfig(e)):n,r=this._canAdjustMonth(e,-1,et,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(U?"e":"w")+"'>"+n+"</span></a>":W?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(U?"e":"w")+"'>"+n+"</span></a>",i=this._get(e,"nextText"),i=X?this.formatDate(i,this._daylightSavingAdjust(new Date(et,Z+J,1)),this._getFormatConfig(e)):i,s=this._canAdjustMonth(e,1,et,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(U?"w":"e")+"'>"+i+"</span></a>":W?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(U?"w":"e")+"'>"+i+"</span></a>",o=this._get(e,"currentText"),u=this._get(e,"gotoCurrent")&&e.currentDay?Q:R,o=X?this.formatDate(o,u,this._getFormatConfig(e)):o,a=e.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(e,"closeText")+"</button>",f=z?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(U?a:"")+(this._isInRange(e,u)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+o+"</button>":"")+(U?"":a)+"</div>":"",l=parseInt(this._get(e,"firstDay"),10),l=isNaN(l)?0:l,c=this._get(e,"showWeek"),h=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),d=this._get(e,"monthNames"),v=this._get(e,"monthNamesShort"),m=this._get(e,"beforeShowDay"),g=this._get(e,"showOtherMonths"),y=this._get(e,"selectOtherMonths"),b=this._getDefaultDate(e),w="",S=0;V[0]>S;S++){for(x="",this.maxRows=4,T=0;V[1]>T;T++){if(N=this._daylightSavingAdjust(new Date(et,Z,e.selectedDay)),C=" ui-corner-all",k="",K){if(k+="<div class='ui-datepicker-group",V[1]>1)switch(T){case 0:k+=" ui-datepicker-group-first",C=" ui-corner-"+(U?"right":"left");break;case V[1]-1:k+=" ui-datepicker-group-last",C=" ui-corner-"+(U?"left":"right");break;default:k+=" ui-datepicker-group-middle",C=""}k+="'>"}for(k+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+C+"'>"+(/all|left/.test(C)&&0===S?U?s:r:"")+(/all|right/.test(C)&&0===S?U?r:s:"")+this._generateMonthYearHeader(e,Z,et,G,Y,S>0||T>0,d,v)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",L=c?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",E=0;7>E;E++)A=(E+l)%7,L+="<th scope='col'"+((E+l+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+h[A]+"'>"+p[A]+"</span></th>";for(k+=L+"</tr></thead><tbody>",O=this._getDaysInMonth(et,Z),et===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,O)),M=(this._getFirstDayOfMonth(et,Z)-l+7)%7,_=Math.ceil((M+O)/7),D=K?this.maxRows>_?this.maxRows:_:_,this.maxRows=D,P=this._daylightSavingAdjust(new Date(et,Z,1-M)),H=0;D>H;H++){for(k+="<tr>",B=c?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(P)+"</td>":"",E=0;7>E;E++)j=m?m.apply(e.input?e.input[0]:null,[P]):[!0,""],F=P.getMonth()!==Z,I=F&&!y||!j[0]||G&&G>P||Y&&P>Y,B+="<td class='"+((E+l+6)%7>=5?" ui-datepicker-week-end":"")+(F?" ui-datepicker-other-month":"")+(P.getTime()===N.getTime()&&Z===e.selectedMonth&&e._keyEvent||b.getTime()===P.getTime()&&b.getTime()===N.getTime()?" "+this._dayOverClass:"")+(I?" "+this._unselectableClass+" ui-state-disabled":"")+(F&&!g?"":" "+j[1]+(P.getTime()===Q.getTime()?" "+this._currentClass:"")+(P.getTime()===R.getTime()?" ui-datepicker-today":""))+"'"+(F&&!g||!j[2]?"":" title='"+j[2].replace(/'/g,"&#39;")+"'")+(I?"":" data-handler='selectDay' data-event='click' data-month='"+P.getMonth()+"' data-year='"+P.getFullYear()+"'")+">"+(F&&!g?"&#xa0;":I?"<span class='ui-state-default'>"+P.getDate()+"</span>":"<a class='ui-state-default"+(P.getTime()===R.getTime()?" ui-state-highlight":"")+(P.getTime()===Q.getTime()?" ui-state-active":"")+(F?" ui-priority-secondary":"")+"' href='#'>"+P.getDate()+"</a>")+"</td>",P.setDate(P.getDate()+1),P=this._daylightSavingAdjust(P);k+=B+"</tr>"}Z++,Z>11&&(Z=0,et++),k+="</tbody></table>"+(K?"</div>"+(V[0]>0&&T===V[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),x+=k}w+=x}return w+=f,e._keyEvent=!1,w},_generateMonthYearHeader:function(e,t,n,r,i,s,o,u){var a,f,l,c,h,p,d,v,m=this._get(e,"changeMonth"),g=this._get(e,"changeYear"),y=this._get(e,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",w="";if(s||!m)w+="<span class='ui-datepicker-month'>"+o[t]+"</span>";else{for(a=r&&r.getFullYear()===n,f=i&&i.getFullYear()===n,w+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",l=0;12>l;l++)(!a||l>=r.getMonth())&&(!f||i.getMonth()>=l)&&(w+="<option value='"+l+"'"+(l===t?" selected='selected'":"")+">"+u[l]+"</option>");w+="</select>"}if(y||(b+=w+(!s&&m&&g?"":"&#xa0;")),!e.yearshtml)if(e.yearshtml="",s||!g)b+="<span class='ui-datepicker-year'>"+n+"</span>";else{for(c=this._get(e,"yearRange").split(":"),h=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\-].*/)?n+parseInt(e.substring(1),10):e.match(/[+\-].*/)?h+parseInt(e,10):parseInt(e,10);return isNaN(t)?h:t},d=p(c[0]),v=Math.max(d,p(c[1]||"")),d=r?Math.max(d,r.getFullYear()):d,v=i?Math.min(v,i.getFullYear()):v,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";v>=d;d++)e.yearshtml+="<option value='"+d+"'"+(d===n?" selected='selected'":"")+">"+d+"</option>";e.yearshtml+="</select>",b+=e.yearshtml,e.yearshtml=null}return b+=this._get(e,"yearSuffix"),y&&(b+=(!s&&m&&g?"":"&#xa0;")+w),b+="</div>"},_adjustInstDate:function(e,t,n){var r=e.selectedYear+("Y"===n?t:0),i=e.selectedMonth+("M"===n?t:0),s=Math.min(e.selectedDay,this._getDaysInMonth(r,i))+("D"===n?t:0),o=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(r,i,s)));e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),("M"===n||"Y"===n)&&this._notifyChange(e)},_restrictMinMax:function(e,t){var n=this._getMinMaxDate(e,"min"),r=this._getMinMaxDate(e,"max"),i=n&&n>t?n:t;return r&&i>r?r:i},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return(new Date(e,t,1)).getDay()},_canAdjustMonth:function(e,t,n,r){var i=this._getNumberOfMonths(e),s=this._daylightSavingAdjust(new Date(n,r+(0>t?t:i[0]*i[1]),1));return 0>t&&s.setDate(this._getDaysInMonth(s.getFullYear(),s.getMonth())),this._isInRange(e,s)},_isInRange:function(e,t){var n,r,i=this._getMinMaxDate(e,"min"),s=this._getMinMaxDate(e,"max"),o=null,u=null,a=this._get(e,"yearRange");return a&&(n=a.split(":"),r=(new Date).getFullYear(),o=parseInt(n[0],10),u=parseInt(n[1],10),n[0].match(/[+\-].*/)&&(o+=r),n[1].match(/[+\-].*/)&&(u+=r)),(!i||t.getTime()>=i.getTime())&&(!s||t.getTime()<=s.getTime())&&(!o||t.getFullYear()>=o)&&(!u||u>=t.getFullYear())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,n,r){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var i=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(r,n,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),i,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).on("mousedown",e.datepicker._checkExternalClick),e.datepicker.initialized=!0),0===e("#"+e.datepicker._mainDivId).length&&e("body").append(e.datepicker.dpDiv);var n=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(n)):this.each(function(){"string"==typeof t?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(n)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(n))},e.datepicker=new r,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.12.0",e.datepicker,e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var g=!1;e(document).on("mouseup",function(){g=!1}),e.widget("ui.mouse",{version:"1.12.0",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.on("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).on("click."+this.widgetName,function(n){return!0===e.data(n.target,t.widgetName+".preventClickEvent")?(e.removeData(n.target,t.widgetName+".preventClickEvent"),n.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!g){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var n=this,r=1===t.which,i="string"==typeof this.options.cancel&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;return r&&!i&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){n.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(t)!==!1,!this._mouseStarted)?(t.preventDefault(),!0):(!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return n._mouseMove(e)},this._mouseUpDelegate=function(e){return n._mouseUp(e)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),g=!0,!0)):!0}},_mouseMove:function(t){if(this._mouseMoved){if(e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button)return this._mouseUp(t);if(!t.which)if(t.originalEvent.altKey||t.originalEvent.ctrlKey||t.originalEvent.metaKey||t.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,g=!1,t.preventDefault()},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),e.ui.plugin={add:function(t,n,r){var i,s=e.ui[t].prototype;for(i in r)s.plugins[i]=s.plugins[i]||[],s.plugins[i].push([n,r[i]])},call:function(e,t,n,r){var i,s=e.plugins[t];if(s&&(r||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(i=0;s.length>i;i++)e.options[s[i][0]]&&s[i][1].apply(e.element,n)}},e.ui.safeBlur=function(t){t&&"body"!==t.nodeName.toLowerCase()&&e(t).trigger("blur")},e.widget("ui.draggable",e.ui.mouse,{version:"1.12.0",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(e,t){this._super(e,t),"handle"===e&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(t){var n=this.options;return this._blurActiveElement(t),this.helper||n.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(this._blockFrames(n.iframeFix===!0?"iframe":n.iframeFix),!0):!1)},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=e(this);return e("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var n=e.ui.safeActiveElement(this.document[0]),r=e(t.target);this._getHandle(t)&&r.closest(n).length||e.ui.safeBlur(n)},_mouseStart:function(t){var n=this.options;return this.helper=this._createHelper(t),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===e(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,n.cursorAt&&this._adjustOffsetFromHelper(n.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(e){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:e.pageX-this.offset.left,top:e.pageY-this.offset.top}},_mouseDrag:function(t,n){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!n){var r=this._uiHash();if(this._trigger("drag",t,r)===!1)return this._mouseUp(new e.Event("mouseup",t)),!1;this.position=r.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var n=this,r=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(r=e.ui.ddmanager.drop(this,t)),this.dropped&&(r=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!r||"valid"===this.options.revert&&r||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,r)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){n._trigger("stop",t)!==!1&&n._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.trigger("focus"),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new e.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(t){var n=this.options,r=e.isFunction(n.helper),i=r?e(n.helper.apply(this.element[0],[t])):"clone"===n.helper?this.element.clone().removeAttr("id"):this.element;return i.parents("body").length||i.appendTo("parent"===n.appendTo?this.element[0].parentNode:n.appendTo),r&&i[0]===this.element[0]&&this._setPositionRelative(),i[0]===this.element[0]||/(fixed|absolute)/.test(i.css("position"))||i.css("position","absolute"),i},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(e){return/(html|body)/i.test(e.tagName)||e===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),n=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==n&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var e=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+(t?0:this.scrollParent.scrollTop()),left:e.left-(parseInt(this.helper.css("left"),10)||0)+(t?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,n,r,i=this.options,s=this.document[0];return this.relativeContainer=null,i.containment?"window"===i.containment?(this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||s.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===i.containment?(this.containment=[0,0,e(s).width()-this.helperProportions.width-this.margins.left,(e(s).height()||s.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):i.containment.constructor===Array?(this.containment=i.containment,void 0):("parent"===i.containment&&(i.containment=this.helper[0].parentNode),n=e(i.containment),r=n[0],r&&(t=/(scroll|auto)/.test(n.css("overflow")),this.containment=[(parseInt(n.css("borderLeftWidth"),10)||0)+(parseInt(n.css("paddingLeft"),10)||0),(parseInt(n.css("borderTopWidth"),10)||0)+(parseInt(n.css("paddingTop"),10)||0),(t?Math.max(r.scrollWidth,r.offsetWidth):r.offsetWidth)-(parseInt(n.css("borderRightWidth"),10)||0)-(parseInt(n.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(r.scrollHeight,r.offsetHeight):r.offsetHeight)-(parseInt(n.css("borderBottomWidth"),10)||0)-(parseInt(n.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=n),void 0):(this.containment=null,void 0)},_convertPositionTo:function(e,t){t||(t=this.position);var n="absolute"===e?1:-1,r=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*n+this.offset.parent.top*n-("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top)*n,left:t.left+this.offset.relative.left*n+this.offset.parent.left*n-("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)*n}},_generatePosition:function(e,t){var n,r,i,s,o=this.options,u=this._isRootNode(this.scrollParent[0]),a=e.pageX,f=e.pageY;return u&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),t&&(this.containment&&(this.relativeContainer?(r=this.relativeContainer.offset(),n=[this.containment[0]+r.left,this.containment[1]+r.top,this.containment[2]+r.left,this.containment[3]+r.top]):n=this.containment,e.pageX-this.offset.click.left<n[0]&&(a=n[0]+this.offset.click.left),e.pageY-this.offset.click.top<n[1]&&(f=n[1]+this.offset.click.top),e.pageX-this.offset.click.left>n[2]&&(a=n[2]+this.offset.click.left),e.pageY-this.offset.click.top>n[3]&&(f=n[3]+this.offset.click.top)),o.grid&&(i=o.grid[1]?this.originalPageY+Math.round((f-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,f=n?i-this.offset.click.top>=n[1]||i-this.offset.click.top>n[3]?i:i-this.offset.click.top>=n[1]?i-o.grid[1]:i+o.grid[1]:i,s=o.grid[0]?this.originalPageX+Math.round((a-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,a=n?s-this.offset.click.left>=n[0]||s-this.offset.click.left>n[2]?s:s-this.offset.click.left>=n[0]?s-o.grid[0]:s+o.grid[0]:s),"y"===o.axis&&(a=this.originalPageX),"x"===o.axis&&(f=this.originalPageY)),{top:f-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:u?0:this.offset.scroll.top),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:u?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(t,n,r){return r=r||this._uiHash(),e.ui.plugin.call(this,t,[n,r,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),r.offset=this.positionAbs),e.Widget.prototype._trigger.call(this,t,n,r)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,n,r){var i=e.extend({},n,{item:r.element});r.sortables=[],e(r.options.connectToSortable).each(function(){var n=e(this).sortable("instance");n&&!n.options.disabled&&(r.sortables.push(n),n.refreshPositions(),n._trigger("activate",t,i))})},stop:function(t,n,r){var i=e.extend({},n,{item:r.element});r.cancelHelperRemoval=!1,e.each(r.sortables,function(){var e=this;e.isOver?(e.isOver=0,r.cancelHelperRemoval=!0,e.cancelHelperRemoval=!1,e._storedCSS={position:e.placeholder.css("position"),top:e.placeholder.css("top"),left:e.placeholder.css("left")},e._mouseStop(t),e.options.helper=e.options._helper):(e.cancelHelperRemoval=!0,e._trigger("deactivate",t,i))})},drag:function(t,n,r){e.each(r.sortables,function(){var i=!1,s=this;s.positionAbs=r.positionAbs,s.helperProportions=r.helperProportions,s.offset.click=r.offset.click,s._intersectsWith(s.containerCache)&&(i=!0,e.each(r.sortables,function(){return this.positionAbs=r.positionAbs,this.helperProportions=r.helperProportions,this.offset.click=r.offset.click,this!==s&&this._intersectsWith(this.containerCache)&&e.contains(s.element[0],this.element[0])&&(i=!1),i})),i?(s.isOver||(s.isOver=1,r._parent=n.helper.parent(),s.currentItem=n.helper.appendTo(s.element).data("ui-sortable-item",!0),s.options._helper=s.options.helper,s.options.helper=function(){return n.helper[0]},t.target=s.currentItem[0],s._mouseCapture(t,!0),s._mouseStart(t,!0,!0),s.offset.click.top=r.offset.click.top,s.offset.click.left=r.offset.click.left,s.offset.parent.left-=r.offset.parent.left-s.offset.parent.left,s.offset.parent.top-=r.offset.parent.top-s.offset.parent.top,r._trigger("toSortable",t),r.dropped=s.element,e.each(r.sortables,function(){this.refreshPositions()}),r.currentItem=r.element,s.fromOutside=r),s.currentItem&&(s._mouseDrag(t),n.position=s.position)):s.isOver&&(s.isOver=0,s.cancelHelperRemoval=!0,s.options._revert=s.options.revert,s.options.revert=!1,s._trigger("out",t,s._uiHash(s)),s._mouseStop(t,!0),s.options.revert=s.options._revert,s.options.helper=s.options._helper,s.placeholder&&s.placeholder.remove(),n.helper.appendTo(r._parent),r._refreshOffsets(t),n.position=r._generatePosition(t,!0),r._trigger("fromSortable",t),r.dropped=!1,e.each(r.sortables,function(){this.refreshPositions()}))})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,n,r){var i=e("body"),s=r.options;i.css("cursor")&&(s._cursor=i.css("cursor")),i.css("cursor",s.cursor)},stop:function(t,n,r){var i=r.options;i._cursor&&e("body").css("cursor",i._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,n,r){var i=e(n.helper),s=r.options;i.css("opacity")&&(s._opacity=i.css("opacity")),i.css("opacity",s.opacity)},stop:function(t,n,r){var i=r.options;i._opacity&&e(n.helper).css("opacity",i._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(e,t,n){n.scrollParentNotHidden||(n.scrollParentNotHidden=n.helper.scrollParent(!1)),n.scrollParentNotHidden[0]!==n.document[0]&&"HTML"!==n.scrollParentNotHidden[0].tagName&&(n.overflowOffset=n.scrollParentNotHidden.offset())},drag:function(t,n,r){var i=r.options,s=!1,o=r.scrollParentNotHidden[0],u=r.document[0];o!==u&&"HTML"!==o.tagName?(i.axis&&"x"===i.axis||(r.overflowOffset.top+o.offsetHeight-t.pageY<i.scrollSensitivity?o.scrollTop=s=o.scrollTop+i.scrollSpeed:t.pageY-r.overflowOffset.top<i.scrollSensitivity&&(o.scrollTop=s=o.scrollTop-i.scrollSpeed)),i.axis&&"y"===i.axis||(r.overflowOffset.left+o.offsetWidth-t.pageX<i.scrollSensitivity?o.scrollLeft=s=o.scrollLeft+i.scrollSpeed:t.pageX-r.overflowOffset.left<i.scrollSensitivity&&(o.scrollLeft=s=o.scrollLeft-i.scrollSpeed))):(i.axis&&"x"===i.axis||(t.pageY-e(u).scrollTop()<i.scrollSensitivity?s=e(u).scrollTop(e(u).scrollTop()-i.scrollSpeed):e(window).height()-(t.pageY-e(u).scrollTop())<i.scrollSensitivity&&(s=e(u).scrollTop(e(u).scrollTop()+i.scrollSpeed))),i.axis&&"y"===i.axis||(t.pageX-e(u).scrollLeft()<i.scrollSensitivity?s=e(u).scrollLeft(e(u).scrollLeft()-i.scrollSpeed):e(window).width()-(t.pageX-e(u).scrollLeft())<i.scrollSensitivity&&(s=e(u).scrollLeft(e(u).scrollLeft()+i.scrollSpeed)))),s!==!1&&e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(r,t)}}),e.ui.plugin.add("draggable","snap",{start:function(t,n,r){var i=r.options;r.snapElements=[],e(i.snap.constructor!==String?i.snap.items||":data(ui-draggable)":i.snap).each(function(){var t=e(this),n=t.offset();this!==r.element[0]&&r.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:n.top,left:n.left})})},drag:function(t,n,r){var i,s,o,u,a,f,l,c,h,p,d=r.options,v=d.snapTolerance,m=n.offset.left,g=m+r.helperProportions.width,y=n.offset.top,b=y+r.helperProportions.height;for(h=r.snapElements.length-1;h>=0;h--)a=r.snapElements[h].left-r.margins.left,f=a+r.snapElements[h].width,l=r.snapElements[h].top-r.margins.top,c=l+r.snapElements[h].height,a-v>g||m>f+v||l-v>b||y>c+v||!e.contains(r.snapElements[h].item.ownerDocument,r.snapElements[h].item)?(r.snapElements[h].snapping&&r.options.snap.release&&r.options.snap.release.call(r.element,t,e.extend(r._uiHash(),{snapItem:r.snapElements[h].item})),r.snapElements[h].snapping=!1):("inner"!==d.snapMode&&(i=v>=Math.abs(l-b),s=v>=Math.abs(c-y),o=v>=Math.abs(a-g),u=v>=Math.abs(f-m),i&&(n.position.top=r._convertPositionTo("relative",{top:l-r.helperProportions.height,left:0}).top),s&&(n.position.top=r._convertPositionTo("relative",{top:c,left:0}).top),o&&(n.position.left=r._convertPositionTo("relative",{top:0,left:a-r.helperProportions.width}).left),u&&(n.position.left=r._convertPositionTo("relative",{top:0,left:f}).left)),p=i||s||o||u,"outer"!==d.snapMode&&(i=v>=Math.abs(l-y),s=v>=Math.abs(c-b),o=v>=Math.abs(a-m),u=v>=Math.abs(f-g),i&&(n.position.top=r._convertPositionTo("relative",{top:l,left:0}).top),s&&(n.position.top=r._convertPositionTo("relative",{top:c-r.helperProportions.height,left:0}).top),o&&(n.position.left=r._convertPositionTo("relative",{top:0,left:a}).left),u&&(n.position.left=r._convertPositionTo("relative",{top:0,left:f-r.helperProportions.width}).left)),!r.snapElements[h].snapping&&(i||s||o||u||p)&&r.options.snap.snap&&r.options.snap.snap.call(r.element,t,e.extend(r._uiHash(),{snapItem:r.snapElements[h].item})),r.snapElements[h].snapping=i||s||o||u||p)}}),e.ui.plugin.add("draggable","stack",{start:function(t,n,r){var i,s=r.options,o=e.makeArray(e(s.stack)).sort(function(t,n){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(n).css("zIndex"),10)||0)});o.length&&(i=parseInt(e(o[0]).css("zIndex"),10)||0,e(o).each(function(t){e(this).css("zIndex",i+t)}),this.css("zIndex",i+o.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,n,r){var i=e(n.helper),s=r.options;i.css("zIndex")&&(s._zIndex=i.css("zIndex")),i.css("zIndex",s.zIndex)},stop:function(t,n,r){var i=r.options;i._zIndex&&e(n.helper).css("zIndex",i._zIndex)}}),e.ui.draggable,e.widget("ui.resizable",e.ui.mouse,{version:"1.12.0",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(e){return parseFloat(e)||0},_isNumber:function(e){return!isNaN(parseFloat(e))},_hasScroll:function(t,n){if("hidden"===e(t).css("overflow"))return!1;var r=n&&"left"===n?"scrollLeft":"scrollTop",i=!1;return t[r]>0?!0:(t[r]=1,i=t[r]>0,t[r]=0,i)},_create:function(){var t,n=this.options,r=this;this._addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!n.aspectRatio,aspectRatio:n.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:n.helper||n.ghost||n.animate?n.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(e("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,t={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(t),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(t),this._proportionallyResize()),this._setupHandles(),n.autoHide&&e(this.element).on("mouseenter",function(){n.disabled||(r._removeClass("ui-resizable-autohide"),r._handles.show())}).on("mouseleave",function(){n.disabled||r.resizing||(r._addClass("ui-resizable-autohide"),r._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,n=function(t){e(t).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(n(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),n(this.originalElement),this},_setOption:function(e,t){switch(this._super(e,t),e){case"handles":this._removeHandles(),this._setupHandles();break;default:}},_setupHandles:function(){var t,n,r,i,s,o=this.options,u=this;if(this.handles=o.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=e(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),r=this.handles.split(","),this.handles={},n=0;r.length>n;n++)t=e.trim(r[n]),i="ui-resizable-"+t,s=e("<div>"),this._addClass(s,"ui-resizable-handle "+i),s.css({zIndex:o.zIndex}),this.handles[t]=".ui-resizable-"+t,this.element.append(s);this._renderAxis=function(t){var n,r,i,s;t=t||this.element;for(n in this.handles)this.handles[n].constructor===String?this.handles[n]=this.element.children(this.handles[n]).first().show():(this.handles[n].jquery||this.handles[n].nodeType)&&(this.handles[n]=e(this.handles[n]),this._on(this.handles[n],{mousedown:u._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(r=e(this.handles[n],this.element),s=/sw|ne|nw|se|n|s/.test(n)?r.outerHeight():r.outerWidth(),i=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join(""),t.css(i,s),this._proportionallyResize()),this._handles=this._handles.add(this.handles[n])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){u.resizing||(this.className&&(s=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),u.axis=s&&s[1]?s[1]:"se")}),o.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(t){var n,r,i=!1;for(n in this.handles)r=e(this.handles[n])[0],(r===t.target||e.contains(r,t.target))&&(i=!0);return!this.options.disabled&&i},_mouseStart:function(t){var n,r,i,s=this.options,o=this.element;return this.resizing=!0,this._renderProxy(),n=this._num(this.helper.css("left")),r=this._num(this.helper.css("top")),s.containment&&(n+=e(s.containment).scrollLeft()||0,r+=e(s.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:n,top:r},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:o.width(),height:o.height()},this.originalSize=this._helper?{width:o.outerWidth(),height:o.outerHeight()}:{width:o.width(),height:o.height()},this.sizeDiff={width:o.outerWidth()-o.width(),height:o.outerHeight()-o.height()},this.originalPosition={left:n,top:r},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof s.aspectRatio?s.aspectRatio:this.originalSize.width/this.originalSize.height||1,i=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor","auto"===i?this.axis+"-resize":i),this._addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var n,r,i=this.originalMousePosition,s=this.axis,o=t.pageX-i.left||0,u=t.pageY-i.top||0,a=this._change[s];return this._updatePrevProperties(),a?(n=a.apply(this,[t,o,u]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(n=this._updateRatio(n,t)),n=this._respectSize(n,t),this._updateCache(n),this._propagate("resize",t),r=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(r)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(t){this.resizing=!1;var n,r,i,s,o,u,a,f=this.options,l=this;return this._helper&&(n=this._proportionallyResizeElements,r=n.length&&/textarea/i.test(n[0].nodeName),i=r&&this._hasScroll(n[0],"left")?0:l.sizeDiff.height,s=r?0:l.sizeDiff.width,o={width:l.helper.width()-s,height:l.helper.height()-i},u=parseFloat(l.element.css("left"))+(l.position.left-l.originalPosition.left)||null,a=parseFloat(l.element.css("top"))+(l.position.top-l.originalPosition.top)||null,f.animate||this.element.css(e.extend(o,{top:a,left:u})),l.helper.height(l.size.height),l.helper.width(l.size.width),this._helper&&!f.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var e={};return this.position.top!==this.prevPosition.top&&(e.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(e.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(e.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(e.height=this.size.height+"px"),this.helper.css(e),e},_updateVirtualBoundaries:function(e){var t,n,r,i,s,o=this.options;s={minWidth:this._isNumber(o.minWidth)?o.minWidth:0,maxWidth:this._isNumber(o.maxWidth)?o.maxWidth:1/0,minHeight:this._isNumber(o.minHeight)?o.minHeight:0,maxHeight:this._isNumber(o.maxHeight)?o.maxHeight:1/0},(this._aspectRatio||e)&&(t=s.minHeight*this.aspectRatio,r=s.minWidth/this.aspectRatio,n=s.maxHeight*this.aspectRatio,i=s.maxWidth/this.aspectRatio,t>s.minWidth&&(s.minWidth=t),r>s.minHeight&&(s.minHeight=r),s.maxWidth>n&&(s.maxWidth=n),s.maxHeight>i&&(s.maxHeight=i)),this._vBoundaries=s},_updateCache:function(e){this.offset=this.helper.offset(),this._isNumber(e.left)&&(this.position.left=e.left),this._isNumber(e.top)&&(this.position.top=e.top),this._isNumber(e.height)&&(this.size.height=e.height),this._isNumber(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,n=this.size,r=this.axis;return this._isNumber(e.height)?e.width=e.height*this.aspectRatio:this._isNumber(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===r&&(e.left=t.left+(n.width-e.width),e.top=null),"nw"===r&&(e.top=t.top+(n.height-e.height),e.left=t.left+(n.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,n=this.axis,r=this._isNumber(e.width)&&t.maxWidth&&t.maxWidth<e.width,i=this._isNumber(e.height)&&t.maxHeight&&t.maxHeight<e.height,s=this._isNumber(e.width)&&t.minWidth&&t.minWidth>e.width,o=this._isNumber(e.height)&&t.minHeight&&t.minHeight>e.height,u=this.originalPosition.left+this.originalSize.width,a=this.originalPosition.top+this.originalSize.height,f=/sw|nw|w/.test(n),l=/nw|ne|n/.test(n);return s&&(e.width=t.minWidth),o&&(e.height=t.minHeight),r&&(e.width=t.maxWidth),i&&(e.height=t.maxHeight),s&&f&&(e.left=u-t.minWidth),r&&f&&(e.left=u-t.maxWidth),o&&l&&(e.top=a-t.minHeight),i&&l&&(e.top=a-t.maxHeight),e.width||e.height||e.left||!e.top?e.width||e.height||e.top||!e.left||(e.left=null):e.top=null,e},_getPaddingPlusBorderDimensions:function(e){for(var t=0,n=[],r=[e.css("borderTopWidth"),e.css("borderRightWidth"),e.css("borderBottomWidth"),e.css("borderLeftWidth")],i=[e.css("paddingTop"),e.css("paddingRight"),e.css("paddingBottom"),e.css("paddingLeft")];4>t;t++)n[t]=parseFloat(r[t])||0,n[t]+=parseFloat(i[t])||0;return{height:n[0]+n[2],width:n[1]+n[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var e,t=0,n=this.helper||this.element;this._proportionallyResizeElements.length>t;t++)e=this._proportionallyResizeElements[t],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(e)),e.css({height:n.height()-this.outerDimensions.height||0,width:n.width()-this.outerDimensions.width||0})},_renderProxy:function(){var t=this.element,n=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("<div style='overflow:hidden;'></div>"),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++n.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var n=this.originalSize,r=this.originalPosition;return{left:r.left+t,width:n.width-t}},n:function(e,t,n){var r=this.originalSize,i=this.originalPosition;return{top:i.top+n,height:r.height-n}},s:function(e,t,n){return{height:this.originalSize.height+n}},se:function(t,n,r){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,n,r]))},sw:function(t,n,r){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,n,r]))},ne:function(t,n,r){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,n,r]))},nw:function(t,n,r){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,n,r]))}},_propagate:function(t,n){e.ui.plugin.call(this,t,[n,this.ui()]),"resize"!==t&&this._trigger(t,n,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var n=e(this).resizable("instance"),r=n.options,i=n._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),o=s&&n._hasScroll(i[0],"left")?0:n.sizeDiff.height,u=s?0:n.sizeDiff.width,a={width:n.size.width-u,height:n.size.height-o},f=parseFloat(n.element.css("left"))+(n.position.left-n.originalPosition.left)||null,l=parseFloat(n.element.css("top"))+(n.position.top-n.originalPosition.top)||null;n.element.animate(e.extend(a,l&&f?{top:l,left:f}:{}),{duration:r.animateDuration,easing:r.animateEasing,step:function(){var r={width:parseFloat(n.element.css("width")),height:parseFloat(n.element.css("height")),top:parseFloat(n.element.css("top")),left:parseFloat(n.element.css("left"))};i&&i.length&&e(i[0]).css({width:r.width,height:r.height}),n._updateCache(r),n._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var t,n,r,i,s,o,u,a=e(this).resizable("instance"),f=a.options,l=a.element,c=f.containment,h=c instanceof e?c.get(0):/parent/.test(c)?l.parent().get(0):c;h&&(a.containerElement=e(h),/document/.test(c)||c===document?(a.containerOffset={left:0,top:0},a.containerPosition={left:0,top:0},a.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(t=e(h),n=[],e(["Top","Right","Left","Bottom"]).each(function(e,r){n[e]=a._num(t.css("padding"+r))}),a.containerOffset=t.offset(),a.containerPosition=t.position(),a.containerSize={height:t.innerHeight()-n[3],width:t.innerWidth()-n[1]},r=a.containerOffset,i=a.containerSize.height,s=a.containerSize.width,o=a._hasScroll(h,"left")?h.scrollWidth:s,u=a._hasScroll(h)?h.scrollHeight:i,a.parentData={element:h,left:r.left,top:r.top,width:o,height:u}))},resize:function(t){var n,r,i,s,o=e(this).resizable("instance"),u=o.options,a=o.containerOffset,f=o.position,l=o._aspectRatio||t.shiftKey,c={top:0,left:0},h=o.containerElement,p=!0;h[0]!==document&&/static/.test(h.css("position"))&&(c=a),f.left<(o._helper?a.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-a.left:o.position.left-c.left),l&&(o.size.height=o.size.width/o.aspectRatio,p=!1),o.position.left=u.helper?a.left:0),f.top<(o._helper?a.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-a.top:o.position.top),l&&(o.size.width=o.size.height*o.aspectRatio,p=!1),o.position.top=o._helper?a.top:0),i=o.containerElement.get(0)===o.element.parent().get(0),s=/relative|absolute/.test(o.containerElement.css("position")),i&&s?(o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top):(o.offset.left=o.element.offset().left,o.offset.top=o.element.offset().top),n=Math.abs(o.sizeDiff.width+(o._helper?o.offset.left-c.left:o.offset.left-a.left)),r=Math.abs(o.sizeDiff.height+(o._helper?o.offset.top-c.top:o.offset.top-a.top)),n+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-n,l&&(o.size.height=o.size.width/o.aspectRatio,p=!1)),r+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-r,l&&(o.size.width=o.size.height*o.aspectRatio,p=!1)),p||(o.position.left=o.prevPosition.left,o.position.top=o.prevPosition.top,o.size.width=o.prevSize.width,o.size.height=o.prevSize.height)},stop:function(){var t=e(this).resizable("instance"),n=t.options,r=t.containerOffset,i=t.containerPosition,s=t.containerElement,o=e(t.helper),u=o.offset(),a=o.outerWidth()-t.sizeDiff.width,f=o.outerHeight()-t.sizeDiff.height;t._helper&&!n.animate&&/relative/.test(s.css("position"))&&e(this).css({left:u.left-i.left-r.left,width:a,height:f}),t._helper&&!n.animate&&/static/.test(s.css("position"))&&e(this).css({left:u.left-i.left-r.left,width:a,height:f})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).resizable("instance"),n=t.options;e(n.alsoResize).each(function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseFloat(t.width()),height:parseFloat(t.height()),left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})})},resize:function(t,n){var r=e(this).resizable("instance"),i=r.options,s=r.originalSize,o=r.originalPosition,u={height:r.size.height-s.height||0,width:r.size.width-s.width||0,top:r.position.top-o.top||0,left:r.position.left-o.left||0};e(i.alsoResize).each(function(){var t=e(this),r=e(this).data("ui-resizable-alsoresize"),i={},s=t.parents(n.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(s,function(e,t){var n=(r[t]||0)+(u[t]||0);n&&n>=0&&(i[t]=n||null)}),t.css(i)})},stop:function(){e(this).removeData("ui-resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).resizable("instance"),n=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:n.height,width:n.width,margin:0,left:0,top:0}),t._addClass(t.ghost,"ui-resizable-ghost"),e.uiBackCompat!==!1&&"string"==typeof t.options.ghost&&t.ghost.addClass(this.options.ghost),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t,n=e(this).resizable("instance"),r=n.options,i=n.size,s=n.originalSize,o=n.originalPosition,u=n.axis,a="number"==typeof r.grid?[r.grid,r.grid]:r.grid,f=a[0]||1,l=a[1]||1,c=Math.round((i.width-s.width)/f)*f,h=Math.round((i.height-s.height)/l)*l,p=s.width+c,d=s.height+h,v=r.maxWidth&&p>r.maxWidth,m=r.maxHeight&&d>r.maxHeight,g=r.minWidth&&r.minWidth>p,y=r.minHeight&&r.minHeight>d;r.grid=a,g&&(p+=f),y&&(d+=l),v&&(p-=f),m&&(d-=l),/^(se|s|e)$/.test(u)?(n.size.width=p,n.size.height=d):/^(ne)$/.test(u)?(n.size.width=p,n.size.height=d,n.position.top=o.top-h):/^(sw)$/.test(u)?(n.size.width=p,n.size.height=d,n.position.left=o.left-c):((0>=d-l||0>=p-f)&&(t=n._getPaddingPlusBorderDimensions(this)),d-l>0?(n.size.height=d,n.position.top=o.top-h):(d=l-t.height,n.size.height=d,n.position.top=o.top+s.height-d),p-f>0?(n.size.width=p,n.position.left=o.left-c):(p=f-t.width,n.size.width=p,n.position.left=o.left+s.width-p))}}),e.ui.resizable,e.widget("ui.dialog",{version:"1.12.0",options:{appendTo:"body",autoOpen:!0,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:!0,closeText:"Close",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var n=e(this).css(t).offset().top;0>n&&e(this).css("top",t.top-n)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),null==this.options.title&&null!=this.originalTitle&&(this.options.title=this.originalTitle),this.options.disabled&&(this.options.disabled=!1),this._createWrapper(),this.element.show().removeAttr("title").appendTo(this.uiDialog),this._addClass("ui-dialog-content","ui-widget-content"),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&e.fn.draggable&&this._makeDraggable(),this.options.resizable&&e.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?e(t):this.document.find(t||"body").eq(0)},_destroy:function(){var e,t=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().css(this.originalCss).detach(),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:e.noop,enable:e.noop,close:function(t){var n=this;this._isOpen&&this._trigger("beforeClose",t)!==!1&&(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),this.opener.filter(":focusable").trigger("focus").length||e.ui.safeBlur(e.ui.safeActiveElement(this.document[0])),this._hide(this.uiDialog,this.options.hide,function(){n._trigger("close",t)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,n){var r=!1,i=this.uiDialog.siblings(".ui-front:visible").map(function(){return+e(this).css("z-index")}).get(),s=Math.max.apply(null,i);return s>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",s+1),r=!0),r&&!n&&this._trigger("focus",t),r},open:function(){var t=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),void 0):(this._isOpen=!0,this.opener=e(e.ui.safeActiveElement(this.document[0])),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"),void 0)},_focusTabbable:function(){var e=this._focusedElement;e||(e=this.element.find("[autofocus]")),e.length||(e=this.element.find(":tabbable")),e.length||(e=this.uiDialogButtonPane.find(":tabbable")),e.length||(e=this.uiDialogTitlebarClose.filter(":tabbable")),e.length||(e=this.uiDialog),e.eq(0).trigger("focus")},_keepFocus:function(t){function n(){var t=e.ui.safeActiveElement(this.document[0]),n=this.uiDialog[0]===t||e.contains(this.uiDialog[0],t);n||this._focusTabbable()}t.preventDefault(),n.call(this),this._delay(n)},_createWrapper:function(){this.uiDialog=e("<div>").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front"),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===e.ui.keyCode.ESCAPE)return t.preventDefault(),this.close(t),void 0;if(t.keyCode===e.ui.keyCode.TAB&&!t.isDefaultPrevented()){var n=this.uiDialog.find(":tabbable"),r=n.filter(":first"),i=n.filter(":last");t.target!==i[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==r[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(this._delay(function(){i.trigger("focus")}),t.preventDefault()):(this._delay(function(){r.trigger("focus")}),t.preventDefault())}},mousedown:function(e){this._moveToTop(e)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=e("<div>"),this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix"),this._on(this.uiDialogTitlebar,{mousedown:function(t){e(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.trigger("focus")}}),this.uiDialogTitlebarClose=e("<button type='button'></button>").button({label:e("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar),this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close"),this._on(this.uiDialogTitlebarClose,{click:function(e){e.preventDefault(),this.close(e)}}),t=e("<span>").uniqueId().prependTo(this.uiDialogTitlebar),this._addClass(t,"ui-dialog-title"),this._title(t),this.uiDialogTitlebar.prependTo(this.uiDialog),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(e){this.options.title?e.text(this.options.title):e.html("&#160;")},_createButtonPane:function(){this.uiDialogButtonPane=e("<div>"),this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix"),this.uiButtonSet=e("<div>").appendTo(this.uiDialogButtonPane),this._addClass(this.uiButtonSet,"ui-dialog-buttonset"),this._createButtons()},_createButtons:function(){var t=this,n=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),e.isEmptyObject(n)||e.isArray(n)&&!n.length?(this._removeClass(this.uiDialog,"ui-dialog-buttons"),void 0):(e.each(n,function(n,r){var i,s;r=e.isFunction(r)?{click:r,text:n}:r,r=e.extend({type:"button"},r),i=r.click,s={icon:r.icon,iconPosition:r.iconPosition,showLabel:r.showLabel},delete r.click,delete r.icon,delete r.iconPosition,delete r.showLabel,e("<button></button>",r).button(s).appendTo(t.uiButtonSet).on("click",function(){i.apply(t.element[0],arguments)})}),this._addClass(this.uiDialog,"ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),void 0)},_makeDraggable:function(){function t(e){return{position:e.position,offset:e.offset}}var n=this,r=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(r,i){n._addClass(e(this),"ui-dialog-dragging"),n._blockFrames(),n._trigger("dragStart",r,t(i))},drag:function(e,r){n._trigger("drag",e,t(r))},stop:function(i,s){var o=s.offset.left-n.document.scrollLeft(),u=s.offset.top-n.document.scrollTop();r.position={my:"left top",at:"left"+(o>=0?"+":"")+o+" "+"top"+(u>=0?"+":"")+u,of:n.window},n._removeClass(e(this),"ui-dialog-dragging"),n._unblockFrames(),n._trigger("dragStop",i,t(s))}})},_makeResizable:function(){function t(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}var n=this,r=this.options,i=r.resizable,s=this.uiDialog.css("position"),o="string"==typeof i?i:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:r.maxWidth,maxHeight:r.maxHeight,minWidth:r.minWidth,minHeight:this._minHeight(),handles:o,start:function(r,i){n._addClass(e(this),"ui-dialog-resizing"),n._blockFrames(),n._trigger("resizeStart",r,t(i))},resize:function(e,r){n._trigger("resize",e,t(r))},stop:function(i,s){var o=n.uiDialog.offset(),u=o.left-n.document.scrollLeft(),a=o.top-n.document.scrollTop();r.height=n.uiDialog.height(),r.width=n.uiDialog.width(),r.position={my:"left top",at:"left"+(u>=0?"+":"")+u+" "+"top"+(a>=0?"+":"")+a,of:n.window},n._removeClass(e(this),"ui-dialog-resizing"),n._unblockFrames(),n._trigger("resizeStop",i,t(s))}}).css("position",s)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._makeFocusTarget(),this._focusedElement=e(t.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var t=this._trackingInstances(),n=e.inArray(this,t);-1!==n&&t.splice(n,1)},_trackingInstances:function(){var e=this.document.data("ui-dialog-instances");return e||(e=[],this.document.data("ui-dialog-instances",e)),e},_minHeight:function(){var e=this.options;return"auto"===e.height?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");e||this.uiDialog.show(),this.uiDialog.position(this.options.position),e||this.uiDialog.hide()},_setOptions:function(t){var n=this,r=!1,i={};e.each(t,function(e,t){n._setOption(e,t),e in n.sizeRelatedOptions&&(r=!0),e in n.resizableRelatedOptions&&(i[e]=t)}),r&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",i)},_setOption:function(t,n){var r,i,s=this.uiDialog;"disabled"!==t&&(this._super(t,n),"appendTo"===t&&this.uiDialog.appendTo(this._appendTo()),"buttons"===t&&this._createButtons(),"closeText"===t&&this.uiDialogTitlebarClose.button({label:e("<a>").text(""+this.options.closeText).html()}),"draggable"===t&&(r=s.is(":data(ui-draggable)"),r&&!n&&s.draggable("destroy"),!r&&n&&this._makeDraggable()),"position"===t&&this._position(),"resizable"===t&&(i=s.is(":data(ui-resizable)"),i&&!n&&s.resizable("destroy"),i&&"string"==typeof n&&s.resizable("option","handles",n),i||n===!1||this._makeResizable()),"title"===t&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var e,t,n,r=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),r.minWidth>r.width&&(r.width=r.minWidth),e=this.uiDialog.css({height:"auto",width:r.width}).outerHeight(),t=Math.max(0,r.minHeight-e),n="number"==typeof r.maxHeight?Math.max(0,r.maxHeight-e):"none","auto"===r.height?this.element.css({minHeight:t,maxHeight:n,height:"auto"}):this.element.height(Math.max(0,r.height-e)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=e(this);return e("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return e(t.target).closest(".ui-dialog").length?!0:!!e(t.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var t=!0;this._delay(function(){t=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(e){t||this._allowInteraction(e)||(e.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=e("<div>").appendTo(this._appendTo()),this._addClass(this.overlay,null,"ui-widget-overlay ui-front"),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var e=this.document.data("ui-dialog-overlays")-1;e?this.document.data("ui-dialog-overlays",e):(this._off(this.document,"focusin"),this.document.removeData("ui-dialog-overlays")),this.overlay.remove(),this.overlay=null}}}),e.uiBackCompat!==!1&&e.widget("ui.dialog",e.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super(),this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(e,t){"dialogClass"===e&&this.uiDialog.removeClass(this.options.dialogClass).addClass(t),this._superApply(arguments)}}),e.ui.dialog,e.widget("ui.droppable",{version:"1.12.0",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,n=this.options,r=n.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(r)?r:function(e){return e.is(r)},this.proportions=function(){return arguments.length?(t=arguments[0],void 0):t?t:t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},this._addToManager(n.scope),n.addClasses&&this._addClass("ui-droppable")},_addToManager:function(t){e.ui.ddmanager.droppables[t]=e.ui.ddmanager.droppables[t]||[],e.ui.ddmanager.droppables[t].push(this)},_splice:function(e){for(var t=0;e.length>t;t++)e[t]===this&&e.splice(t,1)},_destroy:function(){var t=e.ui.ddmanager.droppables[this.options.scope];this._splice(t)},_setOption:function(t,n){if("accept"===t)this.accept=e.isFunction(n)?n:function(e){return e.is(n)};else if("scope"===t){var r=e.ui.ddmanager.droppables[this.options.scope];this._splice(r),this._addToManager(n)}this._super(t,n)},_activate:function(t){var n=e.ui.ddmanager.current;this._addActiveClass(),n&&this._trigger("activate",t,this.ui(n))},_deactivate:function(t){var n=e.ui.ddmanager.current;this._removeActiveClass(),n&&this._trigger("deactivate",t,this.ui(n))},_over:function(t){var n=e.ui.ddmanager.current;n&&(n.currentItem||n.element)[0]!==this.element[0]&&this.accept.call(this.element[0],n.currentItem||n.element)&&(this._addHoverClass(),this._trigger("over",t,this.ui(n)))},_out:function(t){var n=e.ui.ddmanager.current;n&&(n.currentItem||n.element)[0]!==this.element[0]&&this.accept.call(this.element[0],n.currentItem||n.element)&&(this._removeHoverClass(),this._trigger("out",t,this.ui(n)))},_drop:function(t,n){var r=n||e.ui.ddmanager.current,i=!1;return r&&(r.currentItem||r.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var n=e(this).droppable("instance");return n.options.greedy&&!n.options.disabled&&n.options.scope===r.options.scope&&n.accept.call(n.element[0],r.currentItem||r.element)&&y(r,e.extend(n,{offset:n.element.offset()}),n.options.tolerance,t)?(i=!0,!1):void 0}),i?!1:this.accept.call(this.element[0],r.currentItem||r.element)?(this._removeActiveClass(),this._removeHoverClass(),this._trigger("drop",t,this.ui(r)),this.element):!1):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}});var y=e.ui.intersect=function(){function e(e,t,n){return e>=t&&t+n>e}return function(t,n,r,i){if(!n.offset)return!1;var s=(t.positionAbs||t.position.absolute).left+t.margins.left,o=(t.positionAbs||t.position.absolute).top+t.margins.top,u=s+t.helperProportions.width,a=o+t.helperProportions.height,f=n.offset.left,l=n.offset.top,c=f+n.proportions().width,h=l+n.proportions().height;switch(r){case"fit":return s>=f&&c>=u&&o>=l&&h>=a;case"intersect":return s+t.helperProportions.width/2>f&&c>u-t.helperProportions.width/2&&o+t.helperProportions.height/2>l&&h>a-t.helperProportions.height/2;case"pointer":return e(i.pageY,l,n.proportions().height)&&e(i.pageX,f,n.proportions().width);case"touch":return(o>=l&&h>=o||a>=l&&h>=a||l>o&&a>h)&&(s>=f&&c>=s||u>=f&&c>=u||f>s&&u>c);default:return!1}}}();e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,n){var r,i,s=e.ui.ddmanager.droppables[t.options.scope]||[],o=n?n.type:null,u=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(r=0;s.length>r;r++)if(!(s[r].options.disabled||t&&!s[r].accept.call(s[r].element[0],t.currentItem||t.element))){for(i=0;u.length>i;i++)if(u[i]===s[r].element[0]){s[r].proportions().height=0;continue e}s[r].visible="none"!==s[r].element.css("display"),s[r].visible&&("mousedown"===o&&s[r]._activate.call(s[r],n),s[r].offset=s[r].element.offset(),s[r].proportions({width:s[r].element[0].offsetWidth,height:s[r].element[0].offsetHeight}))}},drop:function(t,n){var r=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&y(t,this,this.options.tolerance,n)&&(r=this._drop.call(this,n)||r),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,n)))}),r},dragStart:function(t,n){t.element.parentsUntil("body").on("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)})},drag:function(t,n){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,n),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var r,i,s,o=y(t,this,this.options.tolerance,n),u=!o&&this.isover?"isout":o&&!this.isover?"isover":null;u&&(this.options.greedy&&(i=this.options.scope,s=this.element.parents(":data(ui-droppable)").filter(function(){return e(this).droppable("instance").options.scope===i}),s.length&&(r=e(s[0]).droppable("instance"),r.greedyChild="isover"===u)),r&&"isover"===u&&(r.isover=!1,r.isout=!0,r._out.call(r,n)),this[u]=!0,this["isout"===u?"isover":"isout"]=!1,this["isover"===u?"_over":"_out"].call(this,n),r&&"isout"===u&&(r.isout=!1,r.isover=!0,r._over.call(r,n)))}})},dragStop:function(t,n){t.element.parentsUntil("body").off("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)}},e.uiBackCompat!==!1&&e.widget("ui.droppable",e.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super(),this.options.activeClass&&this.element.addClass(this.options.activeClass)},_removeActiveClass:function(){this._super(),this.options.activeClass&&this.element.removeClass(this.options.activeClass)},_addHoverClass:function(){this._super(),this.options.hoverClass&&this.element.addClass(this.options.hoverClass)},_removeHoverClass:function(){this._super(),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass)}}),e.ui.droppable,e.widget("ui.progressbar",{version:"1.12.0",options:{classes:{"ui-progressbar":"ui-corner-all","ui-progressbar-value":"ui-corner-left","ui-progressbar-complete":"ui-corner-right"},max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.attr({role:"progressbar","aria-valuemin":this.min}),this._addClass("ui-progressbar","ui-widget ui-widget-content"),this.valueDiv=e("<div>").appendTo(this.element),this._addClass(this.valueDiv,"ui-progressbar-value","ui-widget-header"),this._refreshValue()},_destroy:function(){this.element.removeAttr("role aria-valuemin aria-valuemax aria-valuenow"),this.valueDiv.remove()},value:function(e){return void 0===e?this.options.value:(this.options.value=this._constrainedValue(e),this._refreshValue(),void 0)},_constrainedValue:function(e){return void 0===e&&(e=this.options.value),this.indeterminate=e===!1,"number"!=typeof e&&(e=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,e))},_setOptions:function(e){var t=e.value;delete e.value,this._super(e),this.options.value=this._constrainedValue(t),this._refreshValue()},_setOption:function(e,t){"max"===e&&(t=Math.max(this.min,t)),this._super(e,t)},_setOptionDisabled:function(e){this._super(e),this.element.attr("aria-disabled",e),this._toggleClass(null,"ui-state-disabled",!!e)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,n=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).width(n.toFixed(0)+"%"),this._toggleClass(this.valueDiv,"ui-progressbar-complete",null,t===this.options.max)._toggleClass("ui-progressbar-indeterminate",null,this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=e("<div>").appendTo(this.valueDiv),this._addClass(this.overlayDiv,"ui-progressbar-overlay"))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}}),e.widget("ui.selectable",e.ui.mouse,{version:"1.12.0",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var t=this;this._addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){t.elementPos=e(t.element[0]).offset(),t.selectees=e(t.options.filter,t.element[0]),t._addClass(t.selectees,"ui-selectee"),t.selectees.each(function(){var n=e(this),r=n.offset(),i={left:r.left-t.elementPos.left,top:r.top-t.elementPos.top};e.data(this,"selectable-item",{element:this,$element:n,left:i.left,top:i.top,right:i.left+n.outerWidth(),bottom:i.top+n.outerHeight(),startselected:!1,selected:n.hasClass("ui-selected"),selecting:n.hasClass("ui-selecting"),unselecting:n.hasClass("ui-unselecting")})})},this.refresh(),this._mouseInit(),this.helper=e("<div>"),this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){this.selectees.removeData("selectable-item"),this._mouseDestroy()},_mouseStart:function(t){var n=this,r=this.options;this.opos=[t.pageX,t.pageY],this.elementPos=e(this.element[0]).offset(),this.options.disabled||(this.selectees=e(r.filter,this.element[0]),this._trigger("start",t),e(r.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),r.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var r=e.data(this,"selectable-item");r.startselected=!0,t.metaKey||t.ctrlKey||(n._removeClass(r.$element,"ui-selected"),r.selected=!1,n._addClass(r.$element,"ui-unselecting"),r.unselecting=!0,n._trigger("unselecting",t,{unselecting:r.element}))}),e(t.target).parents().addBack().each(function(){var r,i=e.data(this,"selectable-item");return i?(r=!t.metaKey&&!t.ctrlKey||!i.$element.hasClass("ui-selected"),n._removeClass(i.$element,r?"ui-unselecting":"ui-selected")._addClass(i.$element,r?"ui-selecting":"ui-unselecting"),i.unselecting=!r,i.selecting=r,i.selected=r,r?n._trigger("selecting",t,{selecting:i.element}):n._trigger("unselecting",t,{unselecting:i.element}),!1):void 0}))},_mouseDrag:function(t){if(this.dragged=!0,!this.options.disabled){var n,r=this,i=this.options,s=this.opos[0],o=this.opos[1],u=t.pageX,a=t.pageY;return s>u&&(n=u,u=s,s=n),o>a&&(n=a,a=o,o=n),this.helper.css({left:s,top:o,width:u-s,height:a-o}),this.selectees.each(function(){var n=e.data(this,"selectable-item"),f=!1,l={};n&&n.element!==r.element[0]&&(l.left=n.left+r.elementPos.left,l.right=n.right+r.elementPos.left,l.top=n.top+r.elementPos.top,l.bottom=n.bottom+r.elementPos.top,"touch"===i.tolerance?f=!(l.left>u||s>l.right||l.top>a||o>l.bottom):"fit"===i.tolerance&&(f=l.left>s&&u>l.right&&l.top>o&&a>l.bottom),f?(n.selected&&(r._removeClass(n.$element,"ui-selected"),n.selected=!1),n.unselecting&&(r._removeClass(n.$element,"ui-unselecting"),n.unselecting=!1),n.selecting||(r._addClass(n.$element,"ui-selecting"),n.selecting=!0,r._trigger("selecting",t,{selecting:n.element}))):(n.selecting&&((t.metaKey||t.ctrlKey)&&n.startselected?(r._removeClass(n.$element,"ui-selecting"),n.selecting=!1,r._addClass(n.$element,"ui-selected"),n.selected=!0):(r._removeClass(n.$element,"ui-selecting"),n.selecting=!1,n.startselected&&(r._addClass(n.$element,"ui-unselecting"),n.unselecting=!0),r._trigger("unselecting",t,{unselecting:n.element}))),n.selected&&(t.metaKey||t.ctrlKey||n.startselected||(r._removeClass(n.$element,"ui-selected"),n.selected=!1,r._addClass(n.$element,"ui-unselecting"),n.unselecting=!0,r._trigger("unselecting",t,{unselecting:n.element})))))}),!1}},_mouseStop:function(t){var n=this;return this.dragged=!1,e(".ui-unselecting",this.element[0]).each(function(){var r=e.data(this,"selectable-item");n._removeClass(r.$element,"ui-unselecting"),r.unselecting=!1,r.startselected=!1,n._trigger("unselected",t,{unselected:r.element})}),e(".ui-selecting",this.element[0]).each(function(){var r=e.data(this,"selectable-item");n._removeClass(r.$element,"ui-selecting")._addClass(r.$element,"ui-selected"),r.selecting=!1,r.selected=!0,r.startselected=!0,n._trigger("selected",t,{selected:r.element})}),this._trigger("stop",t),this.helper.remove(),!1}}),e.widget("ui.selectmenu",[e.ui.formResetMixin,{version:"1.12.0",defaultElement:"<select>",options:{appendTo:null,classes:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"},disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:!1,change:null,close:null,focus:null,open:null,select:null},_create:function(){var t=this.element.uniqueId().attr("id");this.ids={element:t,button:t+"-button",menu:t+"-menu"},this._drawButton(),this._drawMenu(),this._bindFormResetHandler(),this._rendered=!1,this.menuItems=e()},_drawButton:function(){var t,n=this,r=this._parseOption(this.element.find("option:selected"),this.element[0].selectedIndex);this.labels=this.element.labels().attr("for",this.ids.button),this._on(this.labels,{click:function(e){this.button.focus(),e.preventDefault()}}),this.element.hide(),this.button=e("<span>",{tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true",title:this.element.attr("title")}).insertAfter(this.element),this._addClass(this.button,"ui-selectmenu-button ui-selectmenu-button-closed","ui-button ui-widget"),t=e("<span>").appendTo(this.button),this._addClass(t,"ui-selectmenu-icon","ui-icon "+this.options.icons.button),this.buttonItem=this._renderButtonItem(r).appendTo(this.button),this.options.width!==!1&&this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){n._rendered||n._refreshMenu()})},_drawMenu:function(){var t=this;this.menu=e("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=e("<div>").append(this.menu),this._addClass(this.menuWrap,"ui-selectmenu-menu","ui-front"),this.menuWrap.appendTo(this._appendTo()),this.menuInstance=this.menu.menu({classes:{"ui-menu":"ui-corner-bottom"},role:"listbox",select:function(e,n){e.preventDefault(),t._setSelection(),t._select(n.item.data("ui-selectmenu-item"),e)},focus:function(e,n){var r=n.item.data("ui-selectmenu-item");null!=t.focusIndex&&r.index!==t.focusIndex&&(t._trigger("focus",e,{item:r}),t.isOpen||t._select(r,e)),t.focusIndex=r.index,t.button.attr("aria-activedescendant",t.menuItems.eq(r.index).attr("id"))}}).menu("instance"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(this._getSelectedItem().data("ui-selectmenu-item")||{})),null===this.options.width&&this._resizeButton()},_refreshMenu:function(){var e,t=this.element.find("option");this.menu.empty(),this._parseOptions(t),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup").find(".ui-menu-item-wrapper"),this._rendered=!0,t.length&&(e=this._getSelectedItem(),this.menuInstance.focus(null,e),this._setAria(e.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(e){this.options.disabled||(this._rendered?(this._removeClass(this.menu.find(".ui-state-active"),null,"ui-state-active"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.menuItems.length&&(this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",e)))},_position:function(){this.menuWrap.position(e.extend({of:this.button},this.options.position))},close:function(e){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",e))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderButtonItem:function(t){var n=e("<span>");return this._setText(n,t.label),this._addClass(n,"ui-selectmenu-text"),n},_renderMenu:function(t,n){var r=this,i="";e.each(n,function(n,s){var o;s.optgroup!==i&&(o=e("<li>",{text:s.optgroup}),r._addClass(o,"ui-selectmenu-optgroup","ui-menu-divider"+(s.element.parent("optgroup").prop("disabled")?" ui-state-disabled":"")),o.appendTo(t),i=s.optgroup),r._renderItemData(t,s)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-selectmenu-item",t)},_renderItem:function(t,n){var r=e("<li>"),i=e("<div>",{title:n.element.attr("title")});return n.disabled&&this._addClass(r,null,"ui-state-disabled"),this._setText(i,n.label),r.append(i).appendTo(t)},_setText:function(e,t){t?e.text(t):e.html("&#160;")},_move:function(e,t){var n,r,i=".ui-menu-item";this.isOpen?n=this.menuItems.eq(this.focusIndex).parent("li"):(n=this.menuItems.eq(this.element[0].selectedIndex).parent("li"),i+=":not(.ui-state-disabled)"),r="first"===e||"last"===e?n["first"===e?"prevAll":"nextAll"](i).eq(-1):n[e+"All"](i).eq(0),r.length&&this.menuInstance.focus(t,r)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex).parent("li")},_toggle:function(e){this[this.isOpen?"close":"open"](e)},_setSelection:function(){var e;this.range&&(window.getSelection?(e=window.getSelection(),e.removeAllRanges(),e.addRange(this.range)):this.range.select(),this.button.focus())},_documentClick:{mousedown:function(t){this.isOpen&&(e(t.target).closest(".ui-selectmenu-menu, #"+e.ui.escapeSelector(this.ids.button)).length||this.close(t))}},_buttonEvents:{mousedown:function(){var e;window.getSelection?(e=window.getSelection(),e.rangeCount&&(this.range=e.getRangeAt(0))):this.range=document.selection.createRange()},click:function(e){this._setSelection(),this._toggle(e)},keydown:function(t){var n=!0;switch(t.keyCode){case e.ui.keyCode.TAB:case e.ui.keyCode.ESCAPE:this.close(t),n=!1;break;case e.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(t);break;case e.ui.keyCode.UP:t.altKey?this._toggle(t):this._move("prev",t);break;case e.ui.keyCode.DOWN:t.altKey?this._toggle(t):this._move("next",t);break;case e.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(t):this._toggle(t);break;case e.ui.keyCode.LEFT:this._move("prev",t);break;case e.ui.keyCode.RIGHT:this._move("next",t);break;case e.ui.keyCode.HOME:case e.ui.keyCode.PAGE_UP:this._move("first",t);break;case e.ui.keyCode.END:case e.ui.keyCode.PAGE_DOWN:this._move("last",t);break;default:this.menu.trigger(t),n=!1}n&&t.preventDefault()}},_selectFocusedItem:function(e){var t=this.menuItems.eq(this.focusIndex).parent("li");t.hasClass("ui-state-disabled")||this._select(t.data("ui-selectmenu-item"),e)},_select:function(e,t){var n=this.element[0].selectedIndex;this.element[0].selectedIndex=e.index,this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(e)),this._setAria(e),this._trigger("select",t,{item:e}),e.index!==n&&this._trigger("change",t,{item:e}),this.close(t)},_setAria:function(e){var t=this.menuItems.eq(e.index).attr("id");this.button.attr({"aria-labelledby":t,"aria-activedescendant":t}),this.menu.attr("aria-activedescendant",t)},_setOption:function(e,t){if("icons"===e){var n=this.button.find("span.ui-icon");this._removeClass(n,null,this.options.icons.button)._addClass(n,null,t.button)}this._super(e,t),"appendTo"===e&&this.menuWrap.appendTo(this._appendTo()),"width"===e&&this._resizeButton()},_setOptionDisabled:function(e){this._super(e),this.menuInstance.option("disabled",e),this.button.attr("aria-disabled",e),this._toggleClass(this.button,null,"ui-state-disabled",e),this.element.prop("disabled",e),e?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front, dialog")),t.length||(t=this.document[0].body),t},_toggleAttr:function(){this.button.attr("aria-expanded",this.isOpen),this._removeClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"closed":"open"))._addClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"open":"closed"))._toggleClass(this.menuWrap,"ui-selectmenu-open",null,this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var e=this.options.width;return e===!1?(this.button.css("width",""),void 0):(null===e&&(e=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(e),void 0)},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){var e=this._super();return e.disabled=this.element.prop("disabled"),e},_parseOptions:function(t){var n=this,r=[];t.each(function(t,i){r.push(n._parseOption(e(i),t))}),this.items=r},_parseOption:function(e,t){var n=e.parent("optgroup");return{element:e,index:t,value:e.val(),label:e.text(),optgroup:n.attr("label")||"",disabled:n.prop("disabled")||e.prop("disabled")}},_destroy:function(){this._unbindFormResetHandler(),this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.labels.attr("for",this.ids.element)}}]),e.widget("ui.slider",e.ui.mouse,{version:"1.12.0",widgetEventPrefix:"slide",options:{animate:!1,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all","ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this._addClass("ui-slider ui-slider-"+this.orientation,"ui-widget ui-widget-content"),this._refresh(),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var t,n,r=this.options,i=this.element.find(".ui-slider-handle"),s="<span tabindex='0'></span>",o=[];for(n=r.values&&r.values.length||1,i.length>n&&(i.slice(n).remove(),i=i.slice(0,n)),t=i.length;n>t;t++)o.push(s);this.handles=i.add(e(o.join("")).appendTo(this.element)),this._addClass(this.handles,"ui-slider-handle","ui-state-default"),this.handle=this.handles.eq(0),this.handles.each(function(t){e(this).data("ui-slider-handle-index",t)})},_createRange:function(){var t=this.options;t.range?(t.range===!0&&(t.values?t.values.length&&2!==t.values.length?t.values=[t.values[0],t.values[0]]:e.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?(this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max"),this.range.css({left:"",bottom:""})):(this.range=e("<div>").appendTo(this.element),this._addClass(this.range,"ui-slider-range")),("min"===t.range||"max"===t.range)&&this._addClass(this.range,"ui-slider-range-"+t.range)):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this._mouseDestroy()},_mouseCapture:function(t){var n,r,i,s,o,u,a,f,l=this,c=this.options;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),n={x:t.pageX,y:t.pageY},r=this._normValueFromMouse(n),i=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var n=Math.abs(r-l.values(t));(i>n||i===n&&(t===l._lastChangedValue||l.values(t)===c.min))&&(i=n,s=e(this),o=t)}),u=this._start(t,o),u===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,this._addClass(s,null,"ui-state-active"),s.trigger("focus"),a=s.offset(),f=!e(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=f?{left:0,top:0}:{left:t.pageX-a.left-s.width()/2,top:t.pageY-a.top-s.height()/2-(parseInt(s.css("borderTopWidth"),10)||0)-(parseInt(s.css("borderBottomWidth"),10)||0)+(parseInt(s.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,r),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},n=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,n),!1},_mouseStop:function(e){return this._removeClass(this.handles,null,"ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,n,r,i,s;return"horizontal"===this.orientation?(t=this.elementSize.width,n=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,n=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),r=n/t,r>1&&(r=1),0>r&&(r=0),"vertical"===this.orientation&&(r=1-r),i=this._valueMax()-this._valueMin(),s=this._valueMin()+r*i,this._trimAlignValue(s)},_uiHash:function(e,t,n){var r={handle:this.handles[e],handleIndex:e,value:void 0!==t?t:this.value()};return this._hasMultipleValues()&&(r.value=void 0!==t?t:this.values(e),r.values=n||this.values()),r},_hasMultipleValues:function(){return this.options.values&&this.options.values.length},_start:function(e,t){return this._trigger("start",e,this._uiHash(t))},_slide:function(e,t,n){var r,i,s=this.value(),o=this.values();this._hasMultipleValues()&&(i=this.values(t?0:1),s=this.values(t),2===this.options.values.length&&this.options.range===!0&&(n=0===t?Math.min(i,n):Math.max(i,n)),o[t]=n),n!==s&&(r=this._trigger("slide",e,this._uiHash(t,n,o)),r!==!1&&(this._hasMultipleValues()?this.values(t,n):this.value(n)))},_stop:function(e,t){this._trigger("stop",e,this._uiHash(t))},_change:function(e,t){this._keySliding||this._mouseSliding||(this._lastChangedValue=t,this._trigger("change",e,this._uiHash(t)))},value:function(e){return arguments.length?(this.options.value=this._trimAlignValue(e),this._refreshValue(),this._change(null,0),void 0):this._value()},values:function(t,n){var r,i,s;if(arguments.length>1)return this.options.values[t]=this._trimAlignValue(n),this._refreshValue(),this._change(null,t),void 0;if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this._hasMultipleValues()?this._values(t):this.value();for(r=this.options.values,i=arguments[0],s=0;r.length>s;s+=1)r[s]=this._trimAlignValue(i[s]),this._change(null,s);this._refreshValue()},_setOption:function(t,n){var r,i=0;switch("range"===t&&this.options.range===!0&&("min"===n?(this.options.value=this._values(0),this.options.values=null):"max"===n&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),e.isArray(this.options.values)&&(i=this.options.values.length),this._super(t,n),t){case"orientation":this._detectOrientation(),this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-"+this.orientation),this._refreshValue(),this.options.range&&this._refreshRange(n),this.handles.css("horizontal"===n?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),r=i-1;r>=0;r--)this._change(null,r);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_setOptionDisabled:function(e){this._super(e),this._toggleClass(null,"ui-state-disabled",!!e)},_value:function(){var e=this.options.value;return e=this._trimAlignValue(e)},_values:function(e){var t,n,r;if(arguments.length)return t=this.options.values[e],t=this._trimAlignValue(t);if(this._hasMultipleValues()){for(n=this.options.values.slice(),r=0;n.length>r;r+=1)n[r]=this._trimAlignValue(n[r]);return n}return[]},_trimAlignValue:function(e){if(this._valueMin()>=e)return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,n=(e-this._valueMin())%t,r=e-n;return 2*Math.abs(n)>=t&&(r+=n>0?t:-t),parseFloat(r.toFixed(5))},_calculateNewMax:function(){var e=this.options.max,t=this._valueMin(),n=this.options.step,r=Math.round((e-t)/n)*n;e=r+t,e>this.options.max&&(e-=n),this.max=parseFloat(e.toFixed(this._precision()))},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=""+e,n=t.indexOf(".");return-1===n?0:t.length-n-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(e){"vertical"===e&&this.range.css({width:"",left:""}),"horizontal"===e&&this.range.css({height:"",bottom:""})},_refreshValue:function(){var t,n,r,i,s,o=this.options.range,u=this.options,a=this,f=this._animateOff?!1:u.animate,l={};this._hasMultipleValues()?this.handles.each(function(r){n=100*((a.values(r)-a._valueMin())/(a._valueMax()-a._valueMin())),l["horizontal"===a.orientation?"left":"bottom"]=n+"%",e(this).stop(1,1)[f?"animate":"css"](l,u.animate),a.options.range===!0&&("horizontal"===a.orientation?(0===r&&a.range.stop(1,1)[f?"animate":"css"]({left:n+"%"},u.animate),1===r&&a.range[f?"animate":"css"]({width:n-t+"%"},{queue:!1,duration:u.animate})):(0===r&&a.range.stop(1,1)[f?"animate":"css"]({bottom:n+"%"},u.animate),1===r&&a.range[f?"animate":"css"]({height:n-t+"%"},{queue:!1,duration:u.animate}))),t=n}):(r=this.value(),i=this._valueMin(),s=this._valueMax(),n=s!==i?100*((r-i)/(s-i)):0,l["horizontal"===this.orientation?"left":"bottom"]=n+"%",this.handle.stop(1,1)[f?"animate":"css"](l,u.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[f?"animate":"css"]({width:n+"%"},u.animate),"max"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[f?"animate":"css"]({width:100-n+"%"},u.animate),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[f?"animate":"css"]({height:n+"%"},u.animate),"max"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[f?"animate":"css"]({height:100-n+"%"},u.animate))},_handleEvents:{keydown:function(t){var n,r,i,s,o=e(t.target).data("ui-slider-handle-index");switch(t.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(t.preventDefault(),!this._keySliding&&(this._keySliding=!0,this._addClass(e(t.target),null,"ui-state-active"),n=this._start(t,o),n===!1))return}switch(s=this.options.step,r=i=this._hasMultipleValues()?this.values(o):this.value(),t.keyCode){case e.ui.keyCode.HOME:i=this._valueMin();break;case e.ui.keyCode.END:i=this._valueMax();break;case e.ui.keyCode.PAGE_UP:i=this._trimAlignValue(r+(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.PAGE_DOWN:i=this._trimAlignValue(r-(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(r===this._valueMax())return;i=this._trimAlignValue(r+s);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(r===this._valueMin())return;i=this._trimAlignValue(r-s)}this._slide(t,o,i)},keyup:function(t){var n=e(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,n),this._change(t,n),this._removeClass(e(t.target),null,"ui-state-active"))}}}),e.widget("ui.sortable",e.ui.mouse,{version:"1.12.0",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(e,t,n){return e>=t&&t+n>e},_isFloating:function(e){return/left|right/.test(e.css("float"))||/inline|table-cell/.test(e.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(e,t){this._super(e,t),"handle"===e&&this._setHandleClassName()},_setHandleClassName:function(){var t=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),e.each(this.items,function(){t._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,n){var r=null,i=!1,s=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(t),e(t.target).parents().each(function(){return e.data(this,s.widgetName+"-item")===s?(r=e(this),!1):void 0}),e.data(t.target,s.widgetName+"-item")===s&&(r=e(t.target)),r?!this.options.handle||n||(e(this.options.handle,r).find("*").addBack().each(function(){this===t.target&&(i=!0)}),i)?(this.currentItem=r,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(t,n,r){var i,s,o=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(s=this.document.find("body"),this.storedCursor=s.css("cursor"),s.css("cursor",o.cursor),this.storedStylesheet=e("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(s)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!r)for(i=this.containers.length-1;i>=0;i--)this.containers[i]._trigger("activate",t,this._uiHash(this));return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var n,r,i,s,o=this.options,u=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<o.scrollSensitivity?this.scrollParent[0].scrollTop=u=this.scrollParent[0].scrollTop+o.scrollSpeed:t.pageY-this.overflowOffset.top<o.scrollSensitivity&&(this.scrollParent[0].scrollTop=u=this.scrollParent[0].scrollTop-o.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<o.scrollSensitivity?this.scrollParent[0].scrollLeft=u=this.scrollParent[0].scrollLeft+o.scrollSpeed:t.pageX-this.overflowOffset.left<o.scrollSensitivity&&(this.scrollParent[0].scrollLeft=u=this.scrollParent[0].scrollLeft-o.scrollSpeed)):(t.pageY-this.document.scrollTop()<o.scrollSensitivity?u=this.document.scrollTop(this.document.scrollTop()-o.scrollSpeed):this.window.height()-(t.pageY-this.document.scrollTop())<o.scrollSensitivity&&(u=this.document.scrollTop(this.document.scrollTop()+o.scrollSpeed)),t.pageX-this.document.scrollLeft()<o.scrollSensitivity?u=this.document.scrollLeft(this.document.scrollLeft()-o.scrollSpeed):this.window.width()-(t.pageX-this.document.scrollLeft())<o.scrollSensitivity&&(u=this.document.scrollLeft(this.document.scrollLeft()+o.scrollSpeed))),u!==!1&&e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),n=this.items.length-1;n>=0;n--)if(r=this.items[n],i=r.item[0],s=this._intersectsWithPointer(r),s&&r.instance===this.currentContainer&&i!==this.currentItem[0]&&this.placeholder[1===s?"next":"prev"]()[0]!==i&&!e.contains(this.placeholder[0],i)&&("semi-dynamic"===this.options.type?!e.contains(this.element[0],i):!0)){if(this.direction=1===s?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(r))break;this._rearrange(t,r),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,n){if(t){if(e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t),this.options.revert){var r=this,i=this.placeholder.offset(),s=this.options.axis,o={};s&&"x"!==s||(o.left=i.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),s&&"y"!==s||(o.top=i.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,e(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){r._clear(t)})}else this._clear(t,n);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var n=this._getItemsAsjQuery(t&&t.connected),r=[];return t=t||{},e(n).each(function(){var n=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);n&&r.push((t.key||n[1]+"[]")+"="+(t.key&&t.expression?n[1]:n[2]))}),!r.length&&t.key&&r.push(t.key+"="),r.join("&")},toArray:function(t){var n=this._getItemsAsjQuery(t&&t.connected),r=[];return t=t||{},n.each(function(){r.push(e(t.item||this).attr(t.attribute||"id")||"")}),r},_intersectsWith:function(e){var t=this.positionAbs.left,n=t+this.helperProportions.width,r=this.positionAbs.top,i=r+this.helperProportions.height,s=e.left,o=s+e.width,u=e.top,a=u+e.height,f=this.offset.click.top,l=this.offset.click.left,c="x"===this.options.axis||r+f>u&&a>r+f,h="y"===this.options.axis||t+l>s&&o>t+l,p=c&&h;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?p:t+this.helperProportions.width/2>s&&o>n-this.helperProportions.width/2&&r+this.helperProportions.height/2>u&&a>i-this.helperProportions.height/2},_intersectsWithPointer:function(e){var t,n,r="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top,e.height),i="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left,e.width),s=r&&i;return s?(t=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection(),this.floating?"right"===n||"down"===t?2:1:t&&("down"===t?2:1)):!1},_intersectsWithSides:function(e){var t=this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),n=this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),r=this._getDragVerticalDirection(),i=this._getDragHorizontalDirection();return this.floating&&i?"right"===i&&n||"left"===i&&!n:r&&("down"===r&&t||"up"===r&&!t)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return 0!==e&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return 0!==e&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){function n(){u.push(this)}var r,i,s,o,u=[],a=[],f=this._connectWith();if(f&&t)for(r=f.length-1;r>=0;r--)for(s=e(f[r],this.document[0]),i=s.length-1;i>=0;i--)o=e.data(s[i],this.widgetFullName),o&&o!==this&&!o.options.disabled&&a.push([e.isFunction(o.options.items)?o.options.items.call(o.element):e(o.options.items,o.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),o]);for(a.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),r=a.length-1;r>=0;r--)a[r][0].each(n);return e(u)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var n=0;t.length>n;n++)if(t[n]===e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var n,r,i,s,o,u,a,f,l=this.items,c=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],h=this._connectWith();if(h&&this.ready)for(n=h.length-1;n>=0;n--)for(i=e(h[n],this.document[0]),r=i.length-1;r>=0;r--)s=e.data(i[r],this.widgetFullName),s&&s!==this&&!s.options.disabled&&(c.push([e.isFunction(s.options.items)?s.options.items.call(s.element[0],t,{item:this.currentItem}):e(s.options.items,s.element),s]),this.containers.push(s));for(n=c.length-1;n>=0;n--)for(o=c[n][1],u=c[n][0],r=0,f=u.length;f>r;r++)a=e(u[r]),a.data(this.widgetName+"-item",o),l.push({item:a,instance:o,width:0,height:0,left:0,top:0})},refreshPositions:function(t){this.floating=this.items.length?"x"===this.options.axis||this._isFloating(this.items[0].item):!1,this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var n,r,i,s;for(n=this.items.length-1;n>=0;n--)r=this.items[n],r.instance!==this.currentContainer&&this.currentContainer&&r.item[0]!==this.currentItem[0]||(i=this.options.toleranceElement?e(this.options.toleranceElement,r.item):r.item,t||(r.width=i.outerWidth(),r.height=i.outerHeight()),s=i.offset(),r.left=s.left,r.top=s.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(n=this.containers.length-1;n>=0;n--)s=this.containers[n].element.offset(),this.containers[n].containerCache.left=s.left,this.containers[n].containerCache.top=s.top,this.containers[n].containerCache.width=this.containers[n].element.outerWidth(),this.containers[n].containerCache.height=this.containers[n].element.outerHeight();return this},_createPlaceholder:function(t){t=t||this;var n,r=t.options;r.placeholder&&r.placeholder.constructor!==String||(n=r.placeholder,r.placeholder={element:function(){var r=t.currentItem[0].nodeName.toLowerCase(),i=e("<"+r+">",t.document[0]);return t._addClass(i,"ui-sortable-placeholder",n||t.currentItem[0].className)._removeClass(i,"ui-sortable-helper"),"tbody"===r?t._createTrPlaceholder(t.currentItem.find("tr").eq(0),e("<tr>",t.document[0]).appendTo(i)):"tr"===r?t._createTrPlaceholder(t.currentItem,i):"img"===r&&i.attr("src",t.currentItem.attr("src")),n||i.css("visibility","hidden"),i},update:function(e,i){(!n||r.forcePlaceholderSize)&&(i.height()||i.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),i.width()||i.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}}),t.placeholder=e(r.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),r.placeholder.update(t,t.placeholder)},_createTrPlaceholder:function(t,n){var r=this;t.children().each(function(){e("<td>&#160;</td>",r.document[0]).attr("colspan",e(this).attr("colspan")||1).appendTo(n)})},_contactContainers:function(t){var n,r,i,s,o,u,a,f,l,c,h=null,p=null;for(n=this.containers.length-1;n>=0;n--)if(!e.contains(this.currentItem[0],this.containers[n].element[0]))if(this._intersectsWith(this.containers[n].containerCache)){if(h&&e.contains(this.containers[n].element[0],h.element[0]))continue;h=this.containers[n],p=n}else this.containers[n].containerCache.over&&(this.containers[n]._trigger("out",t,this._uiHash(this)),this.containers[n].containerCache.over=0);if(h)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(i=1e4,s=null,l=h.floating||this._isFloating(this.currentItem),o=l?"left":"top",u=l?"width":"height",c=l?"pageX":"pageY",r=this.items.length-1;r>=0;r--)e.contains(this.containers[p].element[0],this.items[r].item[0])&&this.items[r].item[0]!==this.currentItem[0]&&(a=this.items[r].item.offset()[o],f=!1,t[c]-a>this.items[r][u]/2&&(f=!0),i>Math.abs(t[c]-a)&&(i=Math.abs(t[c]-a),s=this.items[r],this.direction=f?"up":"down"));if(!s&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash()),this.currentContainer.containerCache.over=1),void 0;s?this._rearrange(t,s,null,!0):this._rearrange(t,null,this.containers[p].element,!0),this._trigger("change",t,this._uiHash()),this.containers[p]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(t){var n=this.options,r=e.isFunction(n.helper)?e(n.helper.apply(this.element[0],[t,this.currentItem])):"clone"===n.helper?this.currentItem.clone():this.currentItem;return r.parents("body").length||e("parent"!==n.appendTo?n.appendTo:this.currentItem[0].parentNode)[0].appendChild(r[0]),r[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!r[0].style.width||n.forceHelperSize)&&r.width(this.currentItem.width()),(!r[0].style.height||n.forceHelperSize)&&r.height(this.currentItem.height()),r},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,n,r,i=this.options;"parent"===i.containment&&(i.containment=this.helper[0].parentNode),("document"===i.containment||"window"===i.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===i.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===i.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(i.containment)||(t=e(i.containment)[0],n=e(i.containment).offset(),r="hidden"!==e(t).css("overflow"),this.containment=[n.left+(parseInt(e(t).css("borderLeftWidth"),10)||0)+(parseInt(e(t).css("paddingLeft"),10)||0)-this.margins.left,n.top+(parseInt(e(t).css("borderTopWidth"),10)||0)+(parseInt(e(t).css("paddingTop"),10)||0)-this.margins.top,n.left+(r?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(e(t).css("borderLeftWidth"),10)||0)-(parseInt(e(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,n.top+(r?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(e(t).css("borderTopWidth"),10)||0)-(parseInt(e(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,n){n||(n=this.position);var r="absolute"===t?1:-1,i="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,s=/(html|body)/i.test(i[0].tagName);return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():s?0:i.scrollTop())*r,left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():s?0:i.scrollLeft())*r}},_generatePosition:function(t){var n,r,i=this.options,s=t.pageX,o=t.pageY,u="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(u[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(s=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(s=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),i.grid&&(n=this.originalPageY+Math.round((o-this.originalPageY)/i.grid[1])*i.grid[1],o=this.containment?n-this.offset.click.top>=this.containment[1]&&n-this.offset.click.top<=this.containment[3]?n:n-this.offset.click.top>=this.containment[1]?n-i.grid[1]:n+i.grid[1]:n,r=this.originalPageX+Math.round((s-this.originalPageX)/i.grid[0])*i.grid[0],s=this.containment?r-this.offset.click.left>=this.containment[0]&&r-this.offset.click.left<=this.containment[2]?r:r-this.offset.click.left>=this.containment[0]?r-i.grid[0]:r+i.grid[0]:r)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:u.scrollTop()),left:s-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:u.scrollLeft())}},_rearrange:function(e,t,n,r){n?n[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var i=this.counter;this._delay(function(){i===this.counter&&this.refreshPositions(!r)})},_clear:function(e,t){function n(e,t,n){return function(r){n._trigger(e,r,t._uiHash(t))}}this.reverting=!1;var r,i=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(r in this._storedCSS)("auto"===this._storedCSS[r]||"static"===this._storedCSS[r])&&(this._storedCSS[r]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!t&&i.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||t||i.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(t||(i.push(function(e){this._trigger("remove",e,this._uiHash())}),i.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),i.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),r=this.containers.length-1;r>=0;r--)t||i.push(n("deactivate",this,this.containers[r])),this.containers[r].containerCache.over&&(i.push(n("out",this,this.containers[r])),this.containers[r].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,t||this._trigger("beforeStop",e,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!t){for(r=0;i.length>r;r++)i[r].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){e.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var n=t||this;return{helper:n.helper,placeholder:n.placeholder||e([]),position:n.position,originalPosition:n.originalPosition,offset:n.positionAbs,item:n.currentItem,sender:t?t.element:null}}}),e.widget("ui.spinner",{version:"1.12.0",defaultElement:"<input>",widgetEventPrefix:"spin",options:{classes:{"ui-spinner":"ui-corner-all","ui-spinner-down":"ui-corner-br","ui-spinner-up":"ui-corner-tr"},culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t=this._super(),n=this.element;return e.each(["min","max","step"],function(e,r){var i=n.attr(r);null!=i&&i.length&&(t[r]=i)}),t},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e),void 0)},mousewheel:function(e,t){if(t){if(!this.spinning&&!this._start(e))return!1;this._spin((t>0?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()}},"mousedown .ui-spinner-button":function(t){function n(){var t=this.element[0]===e.ui.safeActiveElement(this.document[0]);t||(this.element.trigger("focus"),this.previous=r,this._delay(function(){this.previous=r}))}var r;r=this.element[0]===e.ui.safeActiveElement(this.document[0])?this.previous:this.element.val(),t.preventDefault(),n.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,n.call(this)}),this._start(t)!==!1&&this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){return e(t.currentTarget).hasClass("ui-state-active")?this._start(t)===!1?!1:(this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap("<span>").parent().append("<a></a><a></a>")},_draw:function(){this._enhance(),this._addClass(this.uiSpinner,"ui-spinner","ui-widget ui-widget-content"),this._addClass("ui-spinner-input"),this.element.attr("role","spinbutton"),this.buttons=this.uiSpinner.children("a").attr("tabIndex",-1).attr("aria-hidden",!0).button({classes:{"ui-button":""}}),this._removeClass(this.buttons,"ui-corner-all"),this._addClass(this.buttons.first(),"ui-spinner-button ui-spinner-up"),this._addClass(this.buttons.last(),"ui-spinner-button ui-spinner-down"),this.buttons.first().button({icon:this.options.icons.up,showLabel:!1}),this.buttons.last().button({icon:this.options.icons.down,showLabel:!1}),this.buttons.height()>Math.ceil(.5*this.uiSpinner.height())&&this.uiSpinner.height()>0&&this.uiSpinner.height(this.uiSpinner.height())},_keydown:function(t){var n=this.options,r=e.ui.keyCode;switch(t.keyCode){case r.UP:return this._repeat(null,1,t),!0;case r.DOWN:return this._repeat(null,-1,t),!0;case r.PAGE_UP:return this._repeat(null,n.page,t),!0;case r.PAGE_DOWN:return this._repeat(null,-n.page,t),!0}return!1},_start:function(e){return this.spinning||this._trigger("start",e)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(e,t,n){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,n)},e),this._spin(t*this.options.step,n)},_spin:function(e,t){var n=this.value()||0;this.counter||(this.counter=1),n=this._adjustValue(n+e*this._increment(this.counter)),this.spinning&&this._trigger("spin",t,{value:n})===!1||(this._value(n),this.counter++)},_increment:function(t){var n=this.options.incremental;return n?e.isFunction(n)?n(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=""+e,n=t.indexOf(".");return-1===n?0:t.length-n-1},_adjustValue:function(e){var t,n,r=this.options;return t=null!==r.min?r.min:0,n=e-t,n=Math.round(n/r.step)*r.step,e=t+n,e=parseFloat(e.toFixed(this._precision())),null!==r.max&&e>r.max?r.max:null!==r.min&&r.min>e?r.min:e},_stop:function(e){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",e))},_setOption:function(e,t){var n,r,i;return"culture"===e||"numberFormat"===e?(n=this._parse(this.element.val()),this.options[e]=t,this.element.val(this._format(n)),void 0):(("max"===e||"min"===e||"step"===e)&&"string"==typeof t&&(t=this._parse(t)),"icons"===e&&(r=this.buttons.first().find(".ui-icon"),this._removeClass(r,null,this.options.icons.up),this._addClass(r,null,t.up),i=this.buttons.last().find(".ui-icon"),this._removeClass(i,null,this.options.icons.down),this._addClass(i,null,t.down)),this._super(e,t),void 0)},_setOptionDisabled:function(e){this._super(e),this._toggleClass(this.uiSpinner,null,"ui-state-disabled",!!e),this.element.prop("disabled",!!e),this.buttons.button(e?"disable":"enable")},_setOptions:u(function(e){this._super(e)}),_parse:function(e){return"string"==typeof e&&""!==e&&(e=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(e,10,this.options.culture):+e),""===e||isNaN(e)?null:e},_format:function(e){return""===e?"":window.Globalize&&this.options.numberFormat?Globalize.format(e,this.options.numberFormat,this.options.culture):e},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var e=this.value();return null===e?!1:e===this._adjustValue(e)},_value:function(e,t){var n;""!==e&&(n=this._parse(e),null!==n&&(t||(n=this._adjustValue(n)),e=this._format(n))),this.element.val(e),this._refresh()},_destroy:function(){this.element.prop("disabled",!1).removeAttr("autocomplete role aria-valuemin aria-valuemax aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:u(function(e){this._stepUp(e)}),_stepUp:function(e){this._start()&&(this._spin((e||1)*this.options.step),this._stop())},stepDown:u(function(e){this._stepDown(e)}),_stepDown:function(e){this._start()&&(this._spin((e||1)*-this.options.step),this._stop())},pageUp:u(function(e){this._stepUp((e||1)*this.options.page)}),pageDown:u(function(e){this._stepDown((e||1)*this.options.page)}),value:function(e){return arguments.length?(u(this._value).call(this,e),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}}),e.uiBackCompat!==!1&&e.widget("ui.spinner",e.ui.spinner,{_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml())},_uiSpinnerHtml:function(){return"<span>"},_buttonHtml:function(){return"<a></a><a></a>"}}),e.ui.spinner,e.widget("ui.tabs",{version:"1.12.0",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var e=/#.*$/;return function(t){var n,r;n=t.href.replace(e,""),r=location.href.replace(e,"");try{n=decodeURIComponent(n)}catch(i){}try{r=decodeURIComponent(r)}catch(i){}return t.hash.length>1&&n===r}}(),_create:function(){var t=this,n=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-widget-content"),this._toggleClass("ui-tabs-collapsible",null,n.collapsible),this._processTabs(),n.active=this._initialActive(),e.isArray(n.disabled)&&(n.disabled=e.unique(n.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(n.active):e(),this._refresh(),this.active.length&&this.load(n.active)},_initialActive:function(){var t=this.options.active,n=this.options.collapsible,r=location.hash.substring(1);return null===t&&(r&&this.tabs.each(function(n,i){return e(i).attr("aria-controls")===r?(t=n,!1):void 0}),null===t&&(t=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===t||-1===t)&&(t=this.tabs.length?0:!1)),t!==!1&&(t=this.tabs.index(this.tabs.eq(t)),-1===t&&(t=n?!1:0)),!n&&t===!1&&this.anchors.length&&(t=0),t},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var n=e(e.ui.safeActiveElement(this.document[0])).closest("li"),r=this.tabs.index(n),i=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:r++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:i=!1,r--;break;case e.ui.keyCode.END:r=this.anchors.length-1;break;case e.ui.keyCode.HOME:r=0;break;case e.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),this._activate(r),void 0;case e.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),this._activate(r===this.options.active?!1:r),void 0;default:return}t.preventDefault(),clearTimeout(this.activating),r=this._focusNextTab(r,i),t.ctrlKey||t.metaKey||(n.attr("aria-selected","false"),this.tabs.eq(r).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",r)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.trigger("focus"))},_handlePageNav:function(t){return t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,n){function r(){return t>i&&(t=0),0>t&&(t=i),t}for(var i=this.tabs.length-1;-1!==e.inArray(r(),this.options.disabled);)t=n?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).trigger("focus"),e},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):(this._super(e,t),"collapsible"===e&&(this._toggleClass("ui-tabs-collapsible",null,t),t||this.options.active!==!1||this._activate(0)),"event"===e&&this._setupEvents(t),"heightStyle"===e&&this._setupHeightStyle(t),void 0)},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,n=this.tablist.children(":has(a[href])");t.disabled=e.map(n.filter(".ui-state-disabled"),function(e){return n.index(e)}),this._processTabs(),t.active!==!1&&this.anchors.length?this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=e()),this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass(this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this,n=this.tabs,r=this.anchors,i=this.panels;this.tablist=this._getList().attr("role","tablist"),this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("mousedown"+this.eventNamespace,"> li",function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass(this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map(function(){return e("a",this)[0]}).attr({role:"presentation",tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=e(),this.anchors.each(function(n,r){var i,s,o,u=e(r).uniqueId().attr("id"),a=e(r).closest("li"),f=a.attr("aria-controls");t._isLocal(r)?(i=r.hash,o=i.substring(1),s=t.element.find(t._sanitizeSelector(i))):(o=a.attr("aria-controls")||e({}).uniqueId()[0].id,i="#"+o,s=t.element.find(i),s.length||(s=t._createPanel(o),s.insertAfter(t.panels[n-1]||t.tablist)),s.attr("aria-live","polite")),s.length&&(t.panels=t.panels.add(s)),f&&a.data("ui-tabs-aria-controls",f),a.attr({"aria-controls":o,"aria-labelledby":u}),s.attr("aria-labelledby",u)}),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),n&&(this._off(n.not(this.tabs)),this._off(r.not(this.anchors)),this._off(i.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(t){return e("<div>").attr("id",t).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(t){var n,r,i;for(e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1),i=0;r=this.tabs[i];i++)n=e(r),t===!0||-1!==e.inArray(i,t)?(n.attr("aria-disabled","true"),this._addClass(n,null,"ui-state-disabled")):(n.removeAttr("aria-disabled"),this._removeClass(n,null,"ui-state-disabled"));this.options.disabled=t,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,t===!0)},_setupEvents:function(t){var n={};t&&e.each(t.split(" "),function(e,t){n[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(e){e.preventDefault()}}),this._on(this.anchors,n),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var n,r=this.element.parent();"fill"===t?(n=r.height(),n-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=e(this),r=t.css("position");"absolute"!==r&&"fixed"!==r&&(n-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){n-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,n-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===t&&(n=0,this.panels.each(function(){n=Math.max(n,e(this).height("").height())}).height(n))},_eventHandler:function(t){var n=this.options,r=this.active,i=e(t.currentTarget),s=i.closest("li"),o=s[0]===r[0],u=o&&n.collapsible,a=u?e():this._getPanelForTab(s),f=r.length?this._getPanelForTab(r):e(),l={oldTab:r,oldPanel:f,newTab:u?e():s,newPanel:a};t.preventDefault(),s.hasClass("ui-state-disabled")||s.hasClass("ui-tabs-loading")||this.running||o&&!n.collapsible||this._trigger("beforeActivate",t,l)===!1||(n.active=u?!1:this.tabs.index(s),this.active=o?e():s,this.xhr&&this.xhr.abort(),f.length||a.length||e.error("jQuery UI Tabs: Mismatching fragment identifier."),a.length&&this.load(this.tabs.index(s),t),this._toggle(t,l))},_toggle:function(t,n){function r(){s.running=!1,s._trigger("activate",t,n)}function i(){s._addClass(n.newTab.closest("li"),"ui-tabs-active","ui-state-active"),o.length&&s.options.show?s._show(o,s.options.show,r):(o.show(),r())}var s=this,o=n.newPanel,u=n.oldPanel;this.running=!0,u.length&&this.options.hide?this._hide(u,this.options.hide,function(){s._removeClass(n.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),i()}):(this._removeClass(n.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),u.hide(),i()),u.attr("aria-hidden","true"),n.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),o.length&&u.length?n.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr("aria-hidden","false"),n.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var n,r=this._findActive(t);r[0]!==this.active[0]&&(r.length||(r=this.active),n=r.find(".ui-tabs-anchor")[0],this._eventHandler({target:n,currentTarget:n,preventDefault:e.noop}))},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(t){return"string"==typeof t&&(t=this.anchors.index(this.anchors.filter("[href$='"+e.ui.escapeSelector(t)+"']"))),t},_destroy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}),this.tabs.each(function(){var t=e(this),n=t.data("ui-tabs-aria-controls");n?t.attr("aria-controls",n).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(t){var n=this.options.disabled;n!==!1&&(void 0===t?n=!1:(t=this._getIndex(t),n=e.isArray(n)?e.map(n,function(e){return e!==t?e:null}):e.map(this.tabs,function(e,n){return n!==t?n:null})),this._setOptionDisabled(n))},disable:function(t){var n=this.options.disabled;if(n!==!0){if(void 0===t)n=!0;else{if(t=this._getIndex(t),-1!==e.inArray(t,n))return;n=e.isArray(n)?e.merge([t],n).sort():[t]}this._setOptionDisabled(n)}},load:function(t,n){t=this._getIndex(t);var r=this,i=this.tabs.eq(t),s=i.find(".ui-tabs-anchor"),o=this._getPanelForTab(i),u={tab:i,panel:o},a=function(e,t){"abort"===t&&r.panels.stop(!1,!0),r._removeClass(i,"ui-tabs-loading"),o.removeAttr("aria-busy"),e===r.xhr&&delete r.xhr};this._isLocal(s[0])||(this.xhr=e.ajax(this._ajaxSettings(s,n,u)),this.xhr&&"canceled"!==this.xhr.statusText&&(this._addClass(i,"ui-tabs-loading"),o.attr("aria-busy","true"),this.xhr.done(function(e,t,i){setTimeout(function(){o.html(e),r._trigger("load",n,u),a(i,t)},1)}).fail(function(e,t){setTimeout(function(){a(e,t)},1)})))},_ajaxSettings:function(t,n,r){var i=this;return{url:t.attr("href"),beforeSend:function(t,s){return i._trigger("beforeLoad",n,e.extend({jqXHR:t,ajaxSettings:s},r))}}},_getPanelForTab:function(t){var n=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+n))}}),e.uiBackCompat!==!1&&e.widget("ui.tabs",e.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}}),e.ui.tabs,e.widget("ui.tooltip",{version:"1.12.0",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var t=e(this).attr("title")||"";return e("<a>").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,track:!1,close:null,open:null},_addDescribedBy:function(t,n){var r=(t.attr("aria-describedby")||"").split(/\s+/);r.push(n),t.data("ui-tooltip-id",n).attr("aria-describedby",e.trim(r.join(" ")))},_removeDescribedBy:function(t){var n=t.data("ui-tooltip-id"),r=(t.attr("aria-describedby")||"").split(/\s+/),i=e.inArray(n,r);-1!==i&&r.splice(i,1),t.removeData("ui-tooltip-id"),r=e.trim(r.join(" ")),r?t.attr("aria-describedby",r):t.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.liveRegion=e("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this.disabledTitles=e([])},_setOption:function(t,n){var r=this;this._super(t,n),"content"===t&&e.each(this.tooltips,function(e,t){r._updateContent(t.element)})},_setOptionDisabled:function(e){this[e?"_disable":"_enable"]()},_disable:function(){var t=this;e.each(this.tooltips,function(n,r){var i=e.Event("blur");i.target=i.currentTarget=r.element[0],t.close(i,!0)}),this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var t=e(this);return t.is("[title]")?t.data("ui-tooltip-title",t.attr("title")).removeAttr("title"):void 0}))},_enable:function(){this.disabledTitles.each(function(){var t=e(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))}),this.disabledTitles=e([])},open:function(t){var n=this,r=e(t?t.target:this.element).closest(this.options.items);r.length&&!r.data("ui-tooltip-id")&&(r.attr("title")&&r.data("ui-tooltip-title",r.attr("title")),r.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&r.parents().each(function(){var t,r=e(this);r.data("ui-tooltip-open")&&(t=e.Event("blur"),t.target=t.currentTarget=this,n.close(t,!0)),r.attr("title")&&(r.uniqueId(),n.parents[this.id]={element:this,title:r.attr("title")},r.attr("title",""))}),this._registerCloseHandlers(t,r),this._updateContent(r,t))},_updateContent:function(e,t){var n,r=this.options.content,i=this,s=t?t.type:null;return"string"==typeof r||r.nodeType||r.jquery?this._open(t,e,r):(n=r.call(e[0],function(n){i._delay(function(){e.data("ui-tooltip-open")&&(t&&(t.type=s),this._open(t,e,n))})}),n&&this._open(t,e,n),void 0)},_open:function(t,n,r){function i(e){f.of=e,o.is(":hidden")||o.position(f)}var s,o,u,a,f=e.extend({},this.options.position);if(r){if(s=this._find(n))return s.tooltip.find(".ui-tooltip-content").html(r),void 0;n.is("[title]")&&(t&&"mouseover"===t.type?n.attr("title",""):n.removeAttr("title")),s=this._tooltip(n),o=s.tooltip,this._addDescribedBy(n,o.attr("id")),o.find(".ui-tooltip-content").html(r),this.liveRegion.children().hide(),a=e("<div>").html(o.find(".ui-tooltip-content").html()),a.removeAttr("name").find("[name]").removeAttr("name"),a.removeAttr("id").find("[id]").removeAttr("id"),a.appendTo(this.liveRegion),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:i}),i(t)):o.position(e.extend({of:n},this.options.position)),o.hide(),this._show(o,this.options.show),this.options.track&&this.options.show&&this.options.show.delay&&(u=this.delayedShow=setInterval(function(){o.is(":visible")&&(i(f.of),clearInterval(u))},e.fx.interval)),this._trigger("open",t,{tooltip:o})}},_registerCloseHandlers:function(t,n){var r={keyup:function(t){if(t.keyCode===e.ui.keyCode.ESCAPE){var r=e.Event(t);r.currentTarget=n[0],this.close(r,!0)}}};n[0]!==this.element[0]&&(r.remove=function(){this._removeTooltip(this._find(n).tooltip)}),t&&"mouseover"!==t.type||(r.mouseleave="close"),t&&"focusin"!==t.type||(r.focusout="close"),this._on(!0,n,r)},close:function(t){var n,r=this,i=e(t?t.currentTarget:this.element),s=this._find(i);return s?(n=s.tooltip,s.closing||(clearInterval(this.delayedShow),i.data("ui-tooltip-title")&&!i.attr("title")&&i.attr("title",i.data("ui-tooltip-title")),this._removeDescribedBy(i),s.hiding=!0,n.stop(!0),this._hide(n,this.options.hide,function(){r._removeTooltip(e(this))}),i.removeData("ui-tooltip-open"),this._off(i,"mouseleave focusout keyup"),i[0]!==this.element[0]&&this._off(i,"remove"),this._off(this.document,"mousemove"),t&&"mouseleave"===t.type&&e.each(this.parents,function(t,n){e(n.element).attr("title",n.title),delete r.parents[t]}),s.closing=!0,this._trigger("close",t,{tooltip:n}),s.hiding||(s.closing=!1)),void 0):(i.removeData("ui-tooltip-open"),void 0)},_tooltip:function(t){var n=e("<div>").attr("role","tooltip"),r=e("<div>").appendTo(n),i=n.uniqueId().attr("id");return this._addClass(r,"ui-tooltip-content"),this._addClass(n,"ui-tooltip","ui-widget ui-widget-content"),n.appendTo(this._appendTo(t)),this.tooltips[i]={element:t,tooltip:n}},_find:function(e){var t=e.data("ui-tooltip-id");return t?this.tooltips[t]:null},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_appendTo:function(e){var t=e.closest(".ui-front, dialog");return t.length||(t=this.document[0].body),t},_destroy:function(){var t=this;e.each(this.tooltips,function(n,r){var i=e.Event("blur"),s=r.element;i.target=i.currentTarget=s[0],t.close(i,!0),e("#"+n).remove(),s.data("ui-tooltip-title")&&(s.attr("title")||s.attr("title",s.data("ui-tooltip-title")),s.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}}),e.uiBackCompat!==!1&&e.widget("ui.tooltip",e.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var e=this._superApply(arguments);return this.options.tooltipClass&&e.tooltip.addClass(this.options.tooltipClass),e}}),e.ui.tooltip}),function(e,t){var n=0,r=null,i=[],s=null;e.fn.split=function(o){function y(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=e.match(/^([0-9\.]+)(px|%)$/);if(t){if(t[2]=="px")return+t[1];if(l.orientation=="vertical")return p*+t[1]/100;if(l.orientation=="horizontal")return d*+t[1]/100}}}var u=this.data("splitter");if(u)return u;var a,f,l=e.extend({limit:100,orientation:"horizontal",position:"50%",invisible:!1,onDragStart:e.noop,onDragEnd:e.noop,onDrag:e.noop},o||{});this.settings=l;var c,h=this.children();l.orientation=="vertical"?(a=h.first().addClass("left_panel"),f=a.next().addClass("right_panel"),c="vsplitter"):l.orientation=="horizontal"&&(a=h.first().addClass("top_panel"),f=a.next().addClass("bottom_panel"),c="hsplitter"),l.invisible&&(c+=" splitter-invisible");var p=this.width(),d=this.height(),v=n++;this.addClass("splitter_panel");var m=e("<div/>").addClass(c).bind("mouseenter touchstart",function(){r=v}).bind("mouseleave touchend",function(){r=null}).insertAfter(a),g,b=e.extend(this,{refresh:function(){var e=this.width(),t=this.height();if(p!=e||d!=t)p=this.width(),d=this.height(),b.position(g)},position:function(){return l.orientation=="vertical"?function(e,n){if(e===t)return g;g=y(e);var r=m.width(),i=r/2;if(l.invisible){var s=a.width(g).outerWidth();f.width(b.width()-s),m.css("left",s-i)}else{var s=a.width(g-i).outerWidth();f.width(b.width()-s-r),m.css("left",s)}return n||b.find(".splitter_panel").trigger("splitter.resize"),b}:l.orientation=="horizontal"?function(e,n){if(e===t)return g;g=y(e);var r=m.height(),i=r/2;if(l.invisible){var s=a.height(g).outerHeight();f.height(b.height()-s),m.css("top",s-i)}else{var s=a.height(g-i).outerHeight();f.height(b.height()-s-r),m.css("top",s)}return n||b.find(".splitter_panel").trigger("splitter.resize"),b}:e.noop}(),orientation:l.orientation,limit:l.limit,isActive:function(){return r===v},destroy:function(){b.removeClass("splitter_panel"),m.unbind("mouseenter"),m.unbind("mouseleave"),m.unbind("touchstart"),m.unbind("touchmove"),m.unbind("touchend"),m.unbind("touchleave"),m.unbind("touchcancel"),l.orientation=="vertical"?(a.removeClass("left_panel"),f.removeClass("right_panel")):l.orientation=="horizontal"&&(a.removeClass("top_panel"),f.removeClass("bottom_panel")),b.unbind("splitter.resize"),b.find(".splitter_panel").trigger("splitter.resize"),i[v]=null,m.remove();var t=!1;for(var r=i.length;r--;)if(i[r]!==null){t=!0;break}t||(e(document.documentElement).unbind(".splitter"),e(window).unbind("resize.splitter"),b.data("splitter",null),i=[],n=0)}});b.bind("splitter.resize",function(e){var t=b.position();b.orientation=="vertical"&&t>b.width()?t=b.width()-b.limit-1:b.orientation=="horizontal"&&t>b.height()&&(t=b.height()-b.limit-1),t<b.limit&&(t=b.limit+1),b.position(t,!0)});var w;return l.orientation=="vertical"?w>p-l.limit?w=p-l.limit:w=y(l.position):l.orientation=="horizontal"&&(w>d-l.limit?w=d-l.limit:w=y(l.position)),w<l.limit&&(w=l.limit),b.position(w,!0),i.length==0&&(e(window).bind("resize.splitter",function(){e.each(i,function(e,t){t.refresh()})}),e(document.documentElement).bind("mousedown.splitter touchstart.splitter",function(t){if(r!==null)return s=i[r],e('<div class="splitterMask"></div>').css("cursor",s.children().eq(1).css("cursor")).insertAfter(s),s.settings.onDragStart(t),!1}).bind("mouseup.splitter touchend.splitter touchleave.splitter touchcancel.splitter",function(t){s&&(e(".splitterMask").remove(),s.settings.onDragEnd(t),s=null)}).bind("mousemove.splitter touchmove.splitter",function(e){if(s!==null){var t=s.limit,n=s.offset();if(s.orientation=="vertical"){var r=e.pageX;e.originalEvent&&e.originalEvent.changedTouches&&(r=e.originalEvent.changedTouches[0].pageX);var i=r-n.left;i<=s.limit?i=s.limit+1:i>=s.width()-t&&(i=s.width()-t-1),i>s.limit&&i<s.width()-t&&(s.position(i,!0),s.find(".splitter_panel").trigger("splitter.resize"),e.preventDefault())}else if(s.orientation=="horizontal"){var o=e.pageY;e.originalEvent&&e.originalEvent.changedTouches&&(o=e.originalEvent.changedTouches[0].pageY);var u=o-n.top;u<=s.limit?u=s.limit+1:u>=s.height()-t&&(u=s.height()-t-1),u>s.limit&&u<s.height()-t&&(s.position(u,!0),s.find(".splitter_panel").trigger("splitter.resize"),e.preventDefault())}s.settings.onDrag(e)}})),i.push(b),b.data("splitter",b),b}}(jQuery),define("splitter",["jquery"],function(){}),define("pane",["jquery","splitter"],function(){function e(e,t,n){var r=e.wrap('<div class="pane-container"></div>').parent();n=="above"||n=="left"?r.prepend(t):r.append(t),e.wrap('<div class="pane-wrapper"></div>'),t.wrap('<div class="pane-wrapper"></div>'),n=="above"||n=="below"?dir="horizontal":dir="vertical",r.split({orientation:dir,limit:10})}function t(e){var t=e.parents(".pane-container").first();t.split().destroy(),e.parent().remove(),t.children().first().children().first().unwrap().unwrap()}(function(e){function r(t){var n=t.children();return{splitter:t.split(),first:e(n[0]).children()[0],second:e(n[2]).children()[0]}}var t="tile",n={_init:function(t){return this.each(function(){var t=e(this),n=t.hasClass("horizontal")?"vertical":"horizontal",r=t.attr("data-split"),i=t.children();r||(r="50%"),i.each(function(){e(this).wrap('<div class="pane-wrapper"></div>')}),t.addClass("pane-container"),t.split({orientation:n,position:r,limit:10,onDragStart:function(){t.tile("resize_start")},onDrag:function(e){i.trigger("pane.resize")},onDragEnd:function(){t.tile("resize_save")}}),t.tile("resize_save")})},resize_start:function(){return this.each(function(){var t=e(this),n=r(t);t.find(".reactive-size").trigger("reactive-resize-start",n.splitter.orientation)})},resize_save:function(){return this.each(function(){var t=e(this),n=r(t),i,s;n.splitter.orientation=="horizontal"?(i=t.height(),s=e(n.first).height()):(i=t.width(),s=e(n.first).width());var o=Math.round(100*s/i)+"%";n.splitter.resizestart=o}),this.find(".reactive-size").trigger("reactive-resize"),this},resize:function(){return this.each(function(){var t=e(this),n=t.split();n.resizestart&&(n.position(n.resizestart),n.settings.onDrag(t))})}};e.fn.tile=function(r){if(n[r])return n[r].apply(this,Array.prototype.slice.call(arguments,1));if(typeof r=="object"||!r)return n._init.apply(this,arguments);e.error("Method "+r+" does not exist on jQuery."+t)}})(jQuery)}),function(e){var t={prefilled:null,CapitalizeFirstLetter:!1,preventSubmitOnEnter:!0,isClearInputOnEsc:!0,externalTagId:!1,prefillIdFieldName:"Id",prefillValueFieldName:"Value",AjaxPush:null,AjaxPushAllTags:null,AjaxPushParameters:null,delimiters:[9,13,44],backspace:[8],maxTags:0,hiddenTagListName:null,hiddenTagListId:null,replace:!0,output:null,deleteTagsOnBackspace:!0,tagsContainer:null,tagCloseIcon:"x",tagClass:"",validator:null,onlyTagList:!1,tagList:null,fillInputOnTagRemove:!1},n={pushTag:function(t,n,i){var s=e(this),o=s.data("opts"),u,a,f,l,c=s.data("tlis"),h=s.data("tlid"),p,d,v,m,g,y,b,w;t=r.trimTag(t,o.delimiterChars);if(!t||t.length<=0)return;if(o.onlyTagList&&undefined!==o.tagList&&o.tagList){var E=o.tagList;e.each(E,function(e,t){E[e]=t.toLowerCase()});var S=e.inArray(t.toLowerCase(),E);if(-1===S)return}o.CapitalizeFirstLetter&&t.length>1&&(t=t.charAt(0).toUpperCase()+t.slice(1).toLowerCase());if(o.validator&&!o.validator(t)){s.trigger("tm:invalid",t);return}if(o.maxTags>0&&c.length>=o.maxTags)return;u=!1,a=jQuery.map(c,function(e){return e.toLowerCase()}),p=e.inArray(t.toLowerCase(),a),-1!==p&&(u=!0);if(u){s.trigger("tm:duplicated",t);if(o.blinkClass)for(var x=0;x<6;++x)e("#"+s.data("tm_rndid")+"_"+h[p]).queue(function(t){e(this).toggleClass(o.blinkClass),t()}).delay(100);else e("#"+s.data("tm_rndid")+"_"+h[p]).stop().animate({backgroundColor:o.blinkBGColor_1},100).animate({backgroundColor:o.blinkBGColor_2},100).animate({backgroundColor:o.blinkBGColor_1},100).animate({backgroundColor:o.blinkBGColor_2},100).animate({backgroundColor:o.blinkBGColor_1},100).animate({backgroundColor:o.blinkBGColor_2},100)}else o.externalTagId===!0?(i===undefined&&e.error("externalTagId is not passed for tag -"+t),l=i):(f=Math.max.apply(null,h),f=f===-Infinity?0:f,l=++f),n||s.trigger("tm:pushing",[t,l]),c.push(t),h.push(l),n||o.AjaxPush!==null&&o.AjaxPushAllTags==null&&e.inArray(t,o.prefilled)===-1&&e.post(o.AjaxPush,e.extend({tag:t},o.AjaxPushParameters)),d=s.data("tm_rndid")+"_"+l,v=s.data("tm_rndid")+"_Remover_"+l,m=e("<span/>").text(t).html(),g='<span class="'+r.tagClasses.call(s)+'" id="'+d+'">',g+="<span>"+m+"</span>",g+='<a href="#" class="tm-tag-remove" id="'+v+'" TagIdToRemove="'+l+'">',g+=o.tagCloseIcon+"</a></span> ",y=e(g),o.tagsContainer!==null?e(o.tagsContainer).append(y):h.length>1?(w=s.siblings("#"+s.data("tm_rndid")+"_"+h[h.length-2]),w.after(y)):s.before(y),y.find("#"+v).on("click",s,function(t){t.preventDefault();var n=parseInt(e(this).attr("TagIdToRemove"));r.spliceTag.call(s,n,t.data)}),r.refreshHiddenTagList.call(s),n||s.trigger("tm:pushed",[t,l]),r.showOrHide.call(s);s.val("")},popTag:function(){var t=e(this),n,i,s=t.data("tlis"),o=t.data("tlid");o.length>0&&(n=o.pop(),i=s[s.length-1],t.trigger("tm:popping",[i,n]),s.pop(),e("#"+t.data("tm_rndid")+"_"+n).remove(),r.refreshHiddenTagList.call(t),t.trigger("tm:popped",[i,n]))},empty:function(){var t=e(this),n=t.data("tlis"),i=t.data("tlid"),s;while(i.length>0)s=i.pop(),n.pop(),e("#"+t.data("tm_rndid")+"_"+s).remove(),r.refreshHiddenTagList.call(t);t.trigger("tm:emptied",null),r.showOrHide.call(t)},tags:function(){var e=this,t=e.data("tlis");return t}},r={showOrHide:function(){var e=this,t=e.data("opts"),n=e.data("tlis");t.maxTags>0&&n.length<t.maxTags&&(e.show(),e.trigger("tm:show")),t.maxTags>0&&n.length>=t.maxTags&&(e.hide(),e.trigger("tm:hide"))},tagClasses:function(){var t=e(this),n=t.data("opts"),r=n.tagBaseClass,i=n.inputBaseClass,s;return s=r,t.attr("class")&&e.each(t.attr("class").split(" "),function(e,t){t.indexOf(i+"-")!==-1&&(s+=" "+r+t.substring(i.length))}),s+=n.tagClass?" "+n.tagClass:"",s},trimTag:function(t,n){var r;t=e.trim(t),r=0;for(r;r<t.length;r++)if(e.inArray(t.charCodeAt(r),n)!==-1)break;return t.substring(0,r)},refreshHiddenTagList:function(){var t=e(this),n=t.data("tlis"),r=t.data("lhiddenTagList");r&&e(r).val(n.join(t.data("opts").baseDelimiter)).change(),t.trigger("tm:refresh",n.join(t.data("opts").baseDelimiter))},killEvent:function(e){e.cancelBubble=!0,e.returnValue=!1,e.stopPropagation(),e.preventDefault()},keyInArray:function(t,n){return e.inArray(t.which,n)!==-1},applyDelimiter:function(t){var r=e(this);n.pushTag.call(r,e(this).val()),t.preventDefault()},prefill:function(t){var r=e(this),i=r.data("opts");e.each(t,function(e,t){i.externalTagId===!0?n.pushTag.call(r,t[i.prefillValueFieldName],!0,t[i.prefillIdFieldName]):n.pushTag.call(r,t,!0)})},pushAllTags:function(t,n){var r=e(this),i=r.data("opts"),s=r.data("tlis");i.AjaxPushAllTags&&(t.type!=="tm:pushed"||e.inArray(n,i.prefilled)===-1)&&e.post(i.AjaxPush,e.extend({tags:s.join(i.baseDelimiter)},i.AjaxPushParameters))},spliceTag:function(t){var n=this,i=n.data("tlis"),s=n.data("tlid"),o=e.inArray(t,s),u;-1!==o&&(u=i[o],n.trigger("tm:splicing",[u,t]),e("#"+n.data("tm_rndid")+"_"+t).remove(),i.splice(o,1),s.splice(o,1),r.refreshHiddenTagList.call(n),n.trigger("tm:spliced",[u,t])),r.showOrHide.call(n)},init:function(i){var s=e.extend({},t,i),o,u;return s.hiddenTagListName=s.hiddenTagListName===null?"hidden-"+this.attr("name"):s.hiddenTagListName,o=s.delimeters||s.delimiters,u=[9,13,17,18,19,37,38,39,40],s.delimiterChars=[],s.delimiterKeys=[],e.each(o,function(t,n){e.inArray(n,u)!==-1?s.delimiterKeys.push(n):s.delimiterChars.push(n)}),s.baseDelimiter=String.fromCharCode(s.delimiterChars[0]||44),s.tagBaseClass="tm-tag",s.inputBaseClass="tm-input",e.isFunction(s.validator)||(s.validator=null),this.each(function(){var t=e(this),i="",o="",u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";if(t.data("tagManager"))return!1;t.data("tagManager",!0);for(var a=0;a<5;a++)o+=u.charAt(Math.floor(Math.random()*u.length));t.data("tm_rndid",o),t.data("opts",s).data("tlis",[]).data("tlid",[]),s.output===null?(i=e("<input/>",{type:"hidden",name:s.hiddenTagListName}),t.after(i),t.data("lhiddenTagList",i)):t.data("lhiddenTagList",e(s.output)),s.AjaxPushAllTags&&(t.on("tm:spliced",r.pushAllTags),t.on("tm:popped",r.pushAllTags),t.on("tm:pushed",r.pushAllTags)),t.on("focus keypress",function(t){e(this).popover&&e(this).popover("hide")}),s.isClearInputOnEsc&&t.on("keyup",function(t){t.which===27&&(e(this).val(""),r.killEvent(t))}),t.on("keypress",function(e){r.keyInArray(e,s.delimiterChars)&&r.applyDelimiter.call(t,e)}),t.on("keydown",function(e){e.which===13&&s.preventSubmitOnEnter&&r.killEvent(e),r.keyInArray(e,s.delimiterKeys)&&r.applyDelimiter.call(t,e)}),s.deleteTagsOnBackspace&&t.on("keydown",function(i){r.keyInArray(i,s.backspace)&&e(this).val().length<=0&&(n.popTag.call(t),r.killEvent(i))}),s.fillInputOnTagRemove&&t.on("tm:popped",function(t,n){e(this).val(n)}),t.change(function(e){/webkit/.test(navigator.userAgent.toLowerCase())||t.focus(),r.killEvent(e)});if(s.prefilled!==null)typeof s.prefilled=="object"?r.prefill.call(t,s.prefilled):typeof s.prefilled=="string"?r.prefill.call(t,s.prefilled.split(s.baseDelimiter)):typeof s.prefilled=="function"&&r.prefill.call(t,s.prefilled());else if(s.output!==null){if(e(s.output)&&e(s.output).val())var f=e(s.output);r.prefill.call(t,e(s.output).val().split(s.baseDelimiter))}}),this}};e.fn.tagsManager=function(t){var i=e(this);return 0 in this?n[t]?n[t].apply(i,Array.prototype.slice.call(arguments,1)):typeof t=="object"||!t?r.init.apply(this,arguments):(e.error("Method "+t+" does not exist."),!1):this}}(jQuery),define("tagmanager",["jquery"],function(){}),define("form",["jquery","config","modal","laconic","tagmanager"],function(e,t,n){function i(t,n,r){return r=r||2,e.el.label({"class":"control-label col-xs-"+r+"","for":t},n)}function s(t,n){var r={name:t,type:"checkbox"};return n=n||{},n.checked&&(r.checked="checked"),n.title&&(r.title=n.title),e.el.input(r)}function o(t,n){var r={name:t,type:"text","class":"form-control"};return n=n||{},n.placeholder&&(r.placeholder=n.placeholder),n.title&&(r.title=n.title),n.value&&(r.value=n.value),n.disabled&&(r.disabled=n.disabled),n.type&&(r.type=n.type),e.el.input(r)}function u(t,n,r){var i={name:t,type:"text","class":"tm-input tag-list"};n&&(i.placeholder=n);var s=e.el.input(i);return r&&e(s).data("prefilled",r),s}function a(t){return e.el.p({"class":"help-block"},"Make saved file public and give it a meaningful name")}function f(t,n){var r={name:t,"class":"form-control"};return n=n||{},n.placeholder&&(r.placeholder=n.placeholder),e.el.textarea(r,n.value||"")}function l(t,n,r){function s(t){if(typeof t=="string")t==r.value?i.append(e.el.option({selected:"selected"},t)):i.append(e.el.option(t));else{var n={value:t.value};t.value==r.value&&(n.selected="selected"),i.append(e.el.option(n,t.label))}}var i=e(e.el.select({"class":"form-control",name:t}));r=r||{};for(var o=0;o<n.length;o++)s(n[o]);return i[0]}var r={serializeAsObject:function(t){var n=t.serializeArray(0),r={};for(var i=0;i<n.length;i++){var s=n[i].name,o=n[i].value,u=t.find('[name="'+s+'"]'),a=u.prop("type");o!=""&&(a=="hidden"&&s.indexOf("hidden-")==0?(s=s.slice("hidden-".length),r[s]==undefined?r[s]=o.split(","):r[s]=o.split(",").concat(r[s])):a=="text"&&u.hasClass("tag-list")?o!=""&&(r[s]!==undefined?r[s].push(o):r[s]=[o]):a=="number"?r[s]=parseInt(o):a=="checkbox"?r[s]=o=="on"?!0:!1:r[s]=o)}return t.find("[type=checkbox]").each(function(){var t=e(this),n=t.prop("name");r[n]===undefined&&(r[n]=!1)}),r},formError:function(e,t){e.find(".has-error").removeClass("has-error"),e.find(".help-block.with-errors").remove();if(t)if(t.code=="form_error"||t.code=="input_error"){errors=t.data.split("\n");for(var i=0;i<errors.length;i++){var s=errors[i].split(/:\s*(.*)?/);r.fieldError(e,s[0],s[1])}}else n.alert(t.data)},fieldError:function(t,n,r){var i=t.find("input[name="+n+"]");if(i.length>0){var s=i.closest(".form-group");i.parent().hasClass("input-group")&&(i=i.parent()),s.addClass("has-error"),i.after(e.el.p({"class":"help-block with-errors"},r))}else alert("Missing value for "+n)},showDialog:function(t){e(".swish-event-receiver").trigger("dialog",t)},formBroadcast:function(t,n){e(".swish-event-receiver").trigger(t,n)},fields:{fileName:function(n,r,u,f){var l=t.swish.community_examples?"Public | Example | name":"Public | name",c=e.el.div({"class":"form-group"},i("name",l),e.el.div({"class":"col-xs-10"},e.el.div({"class":"input-group"},e.el.span({"class":"input-group-addon",title:"If checked, other users can find this program"},s("public",{checked:r})),t.swish.community_examples?e.el.span({"class":"input-group-addon",title:"If checked, add to examples menu"},s("example",{checked:u})):undefined,o("name",{placeholder:"Name (leave empty for generated random name)",title:"Public name of your program",value:n,disabled:f})),a("Make saved file public or give it a meaningful name")));return c},title:function(t){var n=e.el.div({"class":"form-group"},i("title","Title"),e.el.div({"class":"col-xs-10"},o("title",{placeholder:"Descriptive title",value:t})));return n},author:function(t){var n=e.el.div({"class":"form-group"},i("author","Author"),e.el.div({"class":"col-xs-10"},o("author",{placeholder:"Your name",value:t})));return n},date:function(t,n,r){r=r||i;var s=e.el.div({"class":"form-group"},i(r,n),e.el.div({"class":"col-xs-10"},o(r,{disabled:!0,value:(new Date(t*1e3)).toLocaleString()})));return s},description:function(t){var n=e.el.div({"class":"form-group"},i("description","Description"),e.el.div({"class":"col-xs-10"},f("description",{value:t})));return n},commit_message:function(t){var n=e.el.div({"class":"form-group"},i("commit_message","Changes"),e.el.div({"class":"col-xs-10"},f("commit_message",{value:t,placeholder:"Describe your changes here"})));return n},tags:function(t){var n=e.el.div({"class":"form-group"},i("tags","Tags"),e.el.div({"class":"col-xs-10"},u("tags","Tags help finding this code",t)));return n},projection:function(t){var n=e.el.div({"class":"form-group"},i("projection","Projection"),e.el.div({"class":"col-xs-10"},o("projection",{placeholder:"Columns",value:t})));return n},csvFormat:function(t,n){var r;return t=t||["prolog"],n=n||t[0],t.length==1?r=e.el.input({type:"hidden",name:"format",value:t[0]}):r=e.el.div({"class":"form-group"},i("format","Format"),e.el.div({"class":"col-xs-10"},l("format",t,{value:n}))),r},limit:function(t,n){var r=e.el.div({"class":"form-group"},i("name","Distinct | limit"),e.el.div({"class":"col-xs-10"},e.el.div({"class":"input-group"},e.el.span({"class":"input-group-addon",title:"If checked only return distinct results"},s("distinct",{checked:n})),o("limit",{placeholder:"Maximum result count (blank for unlimited)",title:"Limit results",value:t}))));return r},checkboxes:function(t){var n,r=e.el.div({"class":"form-group"},i("options","Options",3),n=e.el.div({"class":"col-xs-9"}));for(var s=0;s<t.length;s++){var o=t[s],u={type:"checkbox",name:o.name,autocomplete:"false"};o.value&&(u.checked="checked"),e(n).append(e.el.label({"class":"checkbox-inline"},e.el.input(u),o.label))}return r},chunk:function(t){var n=e.el.div({"class":"form-group"},i("count","Initial solutions",3),e.el.div({"class":"col-xs-9"},e.el.div({"class":"input-group"},o("chunk",{title:"Initial number of solutions",type:"number",value:t}))));return n},name:function(t,n){n=n||3;var r=e.el.div({"class":"form-group"},i("name","Name",n),e.el.div({"class":"col-xs-"+(12-n)},o("name",{placeholder:"Name",value:t})));return r},filename:function(t,n){n=n||3;var r=e.el.div({"class":"form-group"},i("filename","File name",n),e.el.div({"class":"col-xs-"+(12-n)},o("filename",{placeholder:"File name",value:t})));return r},buttons:function(t){t=t||{};var n=t.label||"Save program",i=t.offset||2,s=e.el.button({name:"save","class":"btn btn-primary"},n);e(s).on("click",function(n){var i=e(n.target).parents("form")[0],s=r.serializeAsObject(e(i));return t.action(n,s),e(n.target).parents(".modal").modal("hide"),n.preventDefault(),!1});var o=e.el.div({"class":"form-group"},e.el.div({"class":"col-xs-offset-"+i+" col-xs-"+(12-i)},s,e.el.button({name:"cancel","class":"btn btn-danger","data-dismiss":"modal"},"Cancel")));return o},radio:function(t,n){var r=e.el.div({"class":"btn-group","data-toggle":"buttons"});for(var i=0;i<n.length;i++){var s="btn btn-default btn-xs";n[i].active&&(s+=" active");var o={type:"radio",name:t,autocomplete:"off",value:n[i].value},u={"class":s};n[i].title&&(u.title=n[i].title),e(r).append(e.el.label(u,e.el.input(o),n[i].label))}return r}},widgets:{glyphIconButton:function(t,n){var r={"class":"btn btn-info",type:"button"};return n.action&&(r["data-action"]=n.action),n.title&&(r.title=n.title),elem=e.el.button(r,e.el.span({"class":"glyphicon "+t})),elem},dropdownButton:function(t,n){n||(n={});var i=n.divClass,s=n.ulClass,o=e.el.div({"class":"btn-group dropdown"+(i?" "+i:"")},e.el.button({"class":"dropdown-toggle","data-toggle":"dropdown"},t),e.el.ul({"class":"dropdown-menu"+(s?" "+s:"")}));return n.actions&&r.widgets.populateMenu(e(o),n.client,n.actions),o},populateMenu:function(t,n,r){function s(t){var r=e(t).data("action");return r&&r.call(n,t),!1}function o(t,n){if(t.indexOf("--")==0)i.append(e.el.li({"class":"divider"}));else{var r=e.el.a(t);e(r).data("action",n),i.append(e.el.li(r))}}var i=t.find(".dropdown-menu");for(var u in r)r.hasOwnProperty(u)&&o(u,r[u]);return i.on("click","a",function(){s(this)}),t}}};return r}),!function(e){var t=function(){return{isMsie:function(){return/(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]:!1},isBlankString:function(e){return!e||/^\s*$/.test(e)},escapeRegExChars:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isArray:e.isArray,isFunction:e.isFunction,isObject:e.isPlainObject,isUndefined:function(e){return"undefined"==typeof e},toStr:function(e){return t.isUndefined(e)||null===e?"":e+""},bind:e.proxy,each:function(t,n){function r(e,t){return n(t,e)}e.each(t,r)},map:e.map,filter:e.grep,every:function(t,n){var r=!0;return t?(e.each(t,function(e,i){return(r=n.call(null,i,e,t))?void 0:!1}),!!r):r},some:function(t,n){var r=!1;return t?(e.each(t,function(e,i){return(r=n.call(null,i,e,t))?!1:void 0}),!!r):r},mixin:e.extend,getUniqueId:function(){var e=0;return function(){return e++}}(),templatify:function(t){function n(){return String(t)}return e.isFunction(t)?t:n},defer:function(e){setTimeout(e,0)},debounce:function(e,t,n){var r,i;return function(){var s,o,u=this,a=arguments;return s=function(){r=null,n||(i=e.apply(u,a))},o=n&&!r,clearTimeout(r),r=setTimeout(s,t),o&&(i=e.apply(u,a)),i}},throttle:function(e,t){var n,r,i,s,o,u;return o=0,u=function(){o=new Date,i=null,s=e.apply(n,r)},function(){var a=new Date,f=t-(a-o);return n=this,r=arguments,0>=f?(clearTimeout(i),i=null,o=a,s=e.apply(n,r)):i||(i=setTimeout(u,f)),s}},noop:function(){}}}(),n="0.10.5",r=function(){function e(e){return e=t.toStr(e),e?e.split(/\s+/):[]}function n(e){return e=t.toStr(e),e?e.split(/\W+/):[]}function r(e){return function(){var n=[].slice.call(arguments,0);return function(r){var i=[];return t.each(n,function(n){i=i.concat(e(t.toStr(r[n])))}),i}}}return{nonword:n,whitespace:e,obj:{nonword:r(n),whitespace:r(e)}}}(),i=function(){function n(n){this.maxSize=t.isNumber(n)?n:100,this.reset(),this.maxSize<=0&&(this.set=this.get=e.noop)}function r(){this.head=this.tail=null}function i(e,t){this.key=e,this.val=t,this.prev=this.next=null}return t.mixin(n.prototype,{set:function(e,t){var n,r=this.list.tail;this.size>=this.maxSize&&(this.list.remove(r),delete this.hash[r.key]),(n=this.hash[e])?(n.val=t,this.list.moveToFront(n)):(n=new i(e,t),this.list.add(n),this.hash[e]=n,this.size++)},get:function(e){var t=this.hash[e];return t?(this.list.moveToFront(t),t.val):void 0},reset:function(){this.size=0,this.hash={},this.list=new r}}),t.mixin(r.prototype,{add:function(e){this.head&&(e.next=this.head,this.head.prev=e),this.head=e,this.tail=this.tail||e},remove:function(e){e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev},moveToFront:function(e){this.remove(e),this.add(e)}}),n}(),s=function(){function e(e){this.prefix=["__",e,"__"].join(""),this.ttlKey="__ttl__",this.keyMatcher=new RegExp("^"+t.escapeRegExChars(this.prefix))}function n(){return(new Date).getTime()}function r(e){return JSON.stringify(t.isUndefined(e)?null:e)}function i(e){return JSON.parse(e)}var s,o;try{s=window.localStorage,s.setItem("~~~","!"),s.removeItem("~~~")}catch(u){s=null}return o=s&&window.JSON?{_prefix:function(e){return this.prefix+e},_ttlKey:function(e){return this._prefix(e)+this.ttlKey},get:function(e){return this.isExpired(e)&&this.remove(e),i(s.getItem(this._prefix(e)))},set:function(e,i,o){return t.isNumber(o)?s.setItem(this._ttlKey(e),r(n()+o)):s.removeItem(this._ttlKey(e)),s.setItem(this._prefix(e),r(i))},remove:function(e){return s.removeItem(this._ttlKey(e)),s.removeItem(this._prefix(e)),this},clear:function(){var e,t,n=[],r=s.length;for(e=0;r>e;e++)(t=s.key(e)).match(this.keyMatcher)&&n.push(t.replace(this.keyMatcher,""));for(e=n.length;e--;)this.remove(n[e]);return this},isExpired:function(e){var r=i(s.getItem(this._ttlKey(e)));return t.isNumber(r)&&n()>r?!0:!1}}:{get:t.noop,set:t.noop,remove:t.noop,clear:t.noop,isExpired:t.noop},t.mixin(e.prototype,o),e}(),o=function(){function n(t){t=t||{},this.cancelled=!1,this.lastUrl=null,this._send=t.transport?r(t.transport):e.ajax,this._get=t.rateLimiter?t.rateLimiter(this._get):this._get,this._cache=t.cache===!1?new i(0):a}function r(n){return function(r,i){function s(e){t.defer(function(){u.resolve(e)})}function o(e){t.defer(function(){u.reject(e)})}var u=e.Deferred();return n(r,i,s,o),u}}var s=0,o={},u=6,a=new i(10);return n.setMaxPendingRequests=function(e){u=e},n.resetCache=function(){a.reset()},t.mixin(n.prototype,{_get:function(e,t,n){function r(t){n&&n(null,t),l._cache.set(e,t)}function i(){n&&n(!0)}function a(){s--,delete o[e],l.onDeckRequestArgs&&(l._get.apply(l,l.onDeckRequestArgs),l.onDeckRequestArgs=null)}var f,l=this;this.cancelled||e!==this.lastUrl||((f=o[e])?f.done(r).fail(i):u>s?(s++,o[e]=this._send(e,t).done(r).fail(i).always(a)):this.onDeckRequestArgs=[].slice.call(arguments,0))},get:function(e,n,r){var i;return t.isFunction(n)&&(r=n,n={}),this.cancelled=!1,this.lastUrl=e,(i=this._cache.get(e))?t.defer(function(){r&&r(null,i)}):this._get(e,n,r),!!i},cancel:function(){this.cancelled=!0}}),n}(),u=function(){function n(t){t=t||{},t.datumTokenizer&&t.queryTokenizer||e.error("datumTokenizer and queryTokenizer are both required"),this.datumTokenizer=t.datumTokenizer,this.queryTokenizer=t.queryTokenizer,this.reset()}function r(e){return e=t.filter(e,function(e){return!!e}),e=t.map(e,function(e){return e.toLowerCase()})}function i(){return{ids:[],children:{}}}function s(e){for(var t={},n=[],r=0,i=e.length;i>r;r++)t[e[r]]||(t[e[r]]=!0,n.push(e[r]));return n}function o(e,t){function n(e,t){return e-t}var r=0,i=0,s=[];e=e.sort(n),t=t.sort(n);for(var o=e.length,u=t.length;o>r&&u>i;)e[r]<t[i]?r++:e[r]>t[i]?i++:(s.push(e[r]),r++,i++);return s}return t.mixin(n.prototype,{bootstrap:function(e){this.datums=e.datums,this.trie=e.trie},add:function(e){var n=this;e=t.isArray(e)?e:[e],t.each(e,function(e){var s,o;s=n.datums.push(e)-1,o=r(n.datumTokenizer(e)),t.each(o,function(e){var t,r,o;for(t=n.trie,r=e.split("");o=r.shift();)t=t.children[o]||(t.children[o]=i()),t.ids.push(s)})})},get:function(e){var n,i,u=this;return n=r(this.queryTokenizer(e)),t.each(n,function(e){var t,n,r,s;if(i&&0===i.length)return!1;for(t=u.trie,n=e.split("");t&&(r=n.shift());)t=t.children[r];return t&&0===n.length?(s=t.ids.slice(0),void (i=i?o(i,s):s)):(i=[],!1)}),i?t.map(s(i),function(e){return u.datums[e]}):[]},reset:function(){this.datums=[],this.trie=i()},serialize:function(){return{datums:this.datums,trie:this.trie}}}),n}(),a=function(){function r(e){return e.local||null}function i(r){var i,s;return s={url:null,thumbprint:"",ttl:864e5,filter:null,ajax:{}},(i=r.prefetch||null)&&(i=t.isString(i)?{url:i}:i,i=t.mixin(s,i),i.thumbprint=n+i.thumbprint,i.ajax.type=i.ajax.type||"GET",i.ajax.dataType=i.ajax.dataType||"json",!i.url&&e.error("prefetch requires url to be set")),i}function s(n){function r(e){return function(n){return t.debounce(n,e)}}function i(e){return function(n){return t.throttle(n,e)}}var s,o;return o={url:null,cache:!0,wildcard:"%QUERY",replace:null,rateLimitBy:"debounce",rateLimitWait:300,send:null,filter:null,ajax:{}},(s=n.remote||null)&&(s=t.isString(s)?{url:s}:s,s=t.mixin(o,s),s.rateLimiter=/^throttle$/i.test(s.rateLimitBy)?i(s.rateLimitWait):r(s.rateLimitWait),s.ajax.type=s.ajax.type||"GET",s.ajax.dataType=s.ajax.dataType||"json",delete s.rateLimitBy,delete s.rateLimitWait,!s.url&&e.error("remote requires url to be set")),s}return{local:r,prefetch:i,remote:s}}();!function(n){function i(t){t&&(t.local||t.prefetch||t.remote)||e.error("one of local, prefetch, or remote is required"),this.limit=t.limit||5,this.sorter=f(t.sorter),this.dupDetector=t.dupDetector||l,this.local=a.local(t),this.prefetch=a.prefetch(t),this.remote=a.remote(t),this.cacheKey=this.prefetch?this.prefetch.cacheKey||this.prefetch.url:null,this.index=new u({datumTokenizer:t.datumTokenizer,queryTokenizer:t.queryTokenizer}),this.storage=this.cacheKey?new s(this.cacheKey):null}function f(e){function n(t){return t.sort(e)}function r(e){return e}return t.isFunction(e)?n:r}function l(){return!1}var c,h;return c=n.Bloodhound,h={data:"data",protocol:"protocol",thumbprint:"thumbprint"},n.Bloodhound=i,i.noConflict=function(){return n.Bloodhound=c,i},i.tokenizers=r,t.mixin(i.prototype,{_loadPrefetch:function(t){function n(e){s.clear(),s.add(t.filter?t.filter(e):e),s._saveToStorage(s.index.serialize(),t.thumbprint,t.ttl)}var r,i,s=this;return(r=this._readFromStorage(t.thumbprint))?(this.index.bootstrap(r),i=e.Deferred().resolve()):i=e.ajax(t.url,t.ajax).done(n),i},_getFromRemote:function(e,t){function n(e,n){t(e?[]:s.remote.filter?s.remote.filter(n):n)}var r,i,s=this;if(this.transport)return e=e||"",i=encodeURIComponent(e),r=this.remote.replace?this.remote.replace(this.remote.url,e):this.remote.url.replace(this.remote.wildcard,i),this.transport.get(r,this.remote.ajax,n)},_cancelLastRemoteRequest:function(){this.transport&&this.transport.cancel()},_saveToStorage:function(e,t,n){this.storage&&(this.storage.set(h.data,e,n),this.storage.set(h.protocol,location.protocol,n),this.storage.set(h.thumbprint,t,n))},_readFromStorage:function(e){var t,n={};return this.storage&&(n.data=this.storage.get(h.data),n.protocol=this.storage.get(h.protocol),n.thumbprint=this.storage.get(h.thumbprint)),t=n.thumbprint!==e||n.protocol!==location.protocol,n.data&&!t?n.data:null},_initialize:function(){function n(){i.add(t.isFunction(s)?s():s)}var r,i=this,s=this.local;return r=this.prefetch?this._loadPrefetch(this.prefetch):e.Deferred().resolve(),s&&r.done(n),this.transport=this.remote?new o(this.remote):null,this.initPromise=r.promise()},initialize:function(e){return!this.initPromise||e?this._initialize():this.initPromise},add:function(e){this.index.add(e)},get:function(e,n){function r(e){var r=s.slice(0);t.each(e,function(e){var n;return n=t.some(r,function(t){return i.dupDetector(e,t)}),!n&&r.push(e),r.length<i.limit}),n&&n(i.sorter(r))}var i=this,s=[],o=!1;s=this.index.get(e),s=this.sorter(s).slice(0,this.limit),s.length<this.limit?o=this._getFromRemote(e,r):this._cancelLastRemoteRequest(),o||(s.length>0||!this.transport)&&n&&n(s)},clear:function(){this.index.reset()},clearPrefetchCache:function(){this.storage&&this.storage.clear()},clearRemoteCache:function(){this.transport&&o.resetCache()},ttAdapter:function(){return t.bind(this.get,this)}}),i}(this);var f=function(){return{wrapper:'<span class="twitter-typeahead"></span>',dropdown:'<span class="tt-dropdown-menu"></span>',dataset:'<div class="tt-dataset-%CLASS%"></div>',suggestions:'<span class="tt-suggestions"></span>',suggestion:'<div class="tt-suggestion"></div>'}}(),l=function(){var e={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},dropdown:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},suggestions:{display:"block"},suggestion:{whiteSpace:"nowrap",cursor:"pointer"},suggestionChild:{whiteSpace:"normal"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};return t.isMsie()&&t.mixin(e.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),t.isMsie()&&t.isMsie()<=7&&t.mixin(e.input,{marginTop:"-1px"}),e}(),c=function(){function n(t){t&&t.el||e.error("EventBus initialized without el"),this.$el=e(t.el)}var r="typeahead:";return t.mixin(n.prototype,{trigger:function(e){var t=[].slice.call(arguments,1);this.$el.trigger(r+e,t)}}),n}(),h=function(){function e(e,t,n,r){var i;if(!n)return this;for(t=t.split(a),n=r?u(n,r):n,this._callbacks=this._callbacks||{};i=t.shift();)this._callbacks[i]=this._callbacks[i]||{sync:[],async:[]},this._callbacks[i][e].push(n);return this}function t(t,n,r){return e.call(this,"async",t,n,r)}function n(t,n,r){return e.call(this,"sync",t,n,r)}function r(e){var t;if(!this._callbacks)return this;for(e=e.split(a);t=e.shift();)delete this._callbacks[t];return this}function i(e){var t,n,r,i,o;if(!this._callbacks)return this;for(e=e.split(a),r=[].slice.call(arguments,1);(t=e.shift())&&(n=this._callbacks[t]);)i=s(n.sync,this,[t].concat(r)),o=s(n.async,this,[t].concat(r)),i()&&f(o);return this}function s(e,t,n){function r(){for(var r,i=0,s=e.length;!r&&s>i;i+=1)r=e[i].apply(t,n)===!1;return!r}return r}function o(){var e;return e=window.setImmediate?function(e){setImmediate(function(){e()})}:function(e){setTimeout(function(){e()},0)}}function u(e,t){return e.bind?e.bind(t):function(){e.apply(t,[].slice.call(arguments,0))}}var a=/\s+/,f=o();return{onSync:n,onAsync:t,off:r,trigger:i}}(),p=function(e){function n(e,n,r){for(var i,s=[],o=0,u=e.length;u>o;o++)s.push(t.escapeRegExChars(e[o]));return i=r?"\\b("+s.join("|")+")\\b":"("+s.join("|")+")",n?new RegExp(i):new RegExp(i,"i")}var r={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:!1,caseSensitive:!1};return function(i){function s(t){var n,r,s;return(n=u.exec(t.data))&&(s=e.createElement(i.tagName),i.className&&(s.className=i.className),r=t.splitText(n.index),r.splitText(n[0].length),s.appendChild(r.cloneNode(!0)),t.parentNode.replaceChild(s,r)),!!n}function o(e,t){for(var n,r=3,i=0;i<e.childNodes.length;i++)n=e.childNodes[i],n.nodeType===r?i+=t(n)?1:0:o(n,t)}var u;i=t.mixin({},r,i),i.node&&i.pattern&&(i.pattern=t.isArray(i.pattern)?i.pattern:[i.pattern],u=n(i.pattern,i.caseSensitive,i.wordsOnly),o(i.node,s))}}(window.document),d=function(){function n(n){var i,s,u,a,f=this;n=n||{},n.input||e.error("input is missing"),i=t.bind(this._onBlur,this),s=t.bind(this._onFocus,this),u=t.bind(this._onKeydown,this),a=t.bind(this._onInput,this),this.$hint=e(n.hint),this.$input=e(n.input).on("blur.tt",i).on("focus.tt",s).on("keydown.tt",u),0===this.$hint.length&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=t.noop),t.isMsie()?this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",function(e){o[e.which||e.keyCode]||t.defer(t.bind(f._onInput,f,e))}):this.$input.on("input.tt",a),this.query=this.$input.val(),this.$overflowHelper=r(this.$input)}function r(t){return e('<pre aria-hidden="true"></pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:t.css("font-family"),fontSize:t.css("font-size"),fontStyle:t.css("font-style"),fontVariant:t.css("font-variant"),fontWeight:t.css("font-weight"),wordSpacing:t.css("word-spacing"),letterSpacing:t.css("letter-spacing"),textIndent:t.css("text-indent"),textRendering:t.css("text-rendering"),textTransform:t.css("text-transform")}).insertAfter(t)}function i(e,t){return n.normalizeQuery(e)===n.normalizeQuery(t)}function s(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}var o;return o={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"},n.normalizeQuery=function(e){return(e||"").replace(/^\s*/g,"").replace(/\s{2,}/g," ")},t.mixin(n.prototype,h,{_onBlur:function(){this.resetInputValue(),this.trigger("blurred")},_onFocus:function(){this.trigger("focused")},_onKeydown:function(e){var t=o[e.which||e.keyCode];this._managePreventDefault(t,e),t&&this._shouldTrigger(t,e)&&this.trigger(t+"Keyed",e)},_onInput:function(){this._checkInputValue()},_managePreventDefault:function(e,t){var n,r,i;switch(e){case"tab":r=this.getHint(),i=this.getInputValue(),n=r&&r!==i&&!s(t);break;case"up":case"down":n=!s(t);break;default:n=!1}n&&t.preventDefault()},_shouldTrigger:function(e,t){var n;switch(e){case"tab":n=!s(t);break;default:n=!0}return n},_checkInputValue:function(){var e,t,n;e=this.getInputValue(),t=i(e,this.query),n=t?this.query.length!==e.length:!1,this.query=e,t?n&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query)},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getQuery:function(){return this.query},setQuery:function(e){this.query=e},getInputValue:function(){return this.$input.val()},setInputValue:function(e,t){this.$input.val(e),t?this.clearHint():this._checkInputValue()},resetInputValue:function(){this.setInputValue(this.query,!0)},getHint:function(){return this.$hint.val()},setHint:function(e){this.$hint.val(e)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var e,t,n,r;e=this.getInputValue(),t=this.getHint(),n=e!==t&&0===t.indexOf(e),r=""!==e&&n&&!this.hasOverflow(),!r&&this.clearHint()},getLanguageDirection:function(){return(this.$input.css("direction")||"ltr").toLowerCase()},hasOverflow:function(){var e=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=e},isCursorAtEnd:function(){var e,n,r;return e=this.$input.val().length,n=this.$input[0].selectionStart,t.isNumber(n)?n===e:document.selection?(r=document.selection.createRange(),r.moveStart("character",-e),e===r.text.length):!0},destroy:function(){this.$hint.off(".tt"),this.$input.off(".tt"),this.$hint=this.$input=this.$overflowHelper=null}}),n}(),v=function(){function n(n){n=n||{},n.templates=n.templates||{},n.source||e.error("missing source"),n.name&&!s(n.name)&&e.error("invalid dataset name: "+n.name),this.query=null,this.highlight=!!n.highlight,this.name=n.name||t.getUniqueId(),this.source=n.source,this.displayFn=r(n.display||n.displayKey),this.templates=i(n.templates,this.displayFn),this.$el=e(f.dataset.replace("%CLASS%",this.name))}function r(e){function n(t){return t[e]}return e=e||"value",t.isFunction(e)?e:n}function i(e,n){function r(e){return"<p>"+n(e)+"</p>"}return{empty:e.empty&&t.templatify(e.empty),header:e.header&&t.templatify(e.header),footer:e.footer&&t.templatify(e.footer),suggestion:e.suggestion||r}}function s(e){return/^[_a-zA-Z0-9-]+$/.test(e)}var o="ttDataset",u="ttValue",a="ttDatum";return n.extractDatasetName=function(t){return e(t).data(o)},n.extractValue=function(t){return e(t).data(u)},n.extractDatum=function(t){return e(t).data(a)},t.mixin(n.prototype,h,{_render:function(n,r){function i(){return v.templates.empty({query:n,isEmpty:!0})}function s(){function i(t){var n;return n=e(f.suggestion).append(v.templates.suggestion(t)).data(o,v.name).data(u,v.displayFn(t)).data(a,t),n.children().each(function(){e(this).css(l.suggestionChild)}),n}var s,c;return s=e(f.suggestions).css(l.suggestions),c=t.map(r,i),s.append.apply(s,c),v.highlight&&p({className:"tt-highlight",node:s[0],pattern:n}),s}function c(){return v.templates.header({query:n,isEmpty:!d})}function h(){return v.templates.footer({query:n,isEmpty:!d})}if(this.$el){var d,v=this;this.$el.empty(),d=r&&r.length,!d&&this.templates.empty?this.$el.html(i()).prepend(v.templates.header?c():null).append(v.templates.footer?h():null):d&&this.$el.html(s()).prepend(v.templates.header?c():null).append(v.templates.footer?h():null),this.trigger("rendered")}},getRoot:function(){return this.$el},update:function(e){function t(t){n.canceled||e!==n.query||n._render(e,t)}var n=this;this.query=e,this.canceled=!1,this.source(e,t)},cancel:function(){this.canceled=!0},clear:function(){this.cancel(),this.$el.empty(),this.trigger("rendered")},isEmpty:function(){return this.$el.is(":empty")},destroy:function(){this.$el=null}}),n}(),m=function(){function n(n){var i,s,o,u=this;n=n||{},n.menu||e.error("menu is required"),this.isOpen=!1,this.isEmpty=!0,this.datasets=t.map(n.datasets,r),i=t.bind(this._onSuggestionClick,this),s=t.bind(this._onSuggestionMouseEnter,this),o=t.bind(this._onSuggestionMouseLeave,this),this.$menu=e(n.menu).on("click.tt",".tt-suggestion",i).on("mouseenter.tt",".tt-suggestion",s).on("mouseleave.tt",".tt-suggestion",o),t.each(this.datasets,function(e){u.$menu.append(e.getRoot()),e.onSync("rendered",u._onRendered,u)})}function r(e){return new v(e)}return t.mixin(n.prototype,h,{_onSuggestionClick:function(t){this.trigger("suggestionClicked",e(t.currentTarget))},_onSuggestionMouseEnter:function(t){this._removeCursor(),this._setCursor(e(t.currentTarget),!0)},_onSuggestionMouseLeave:function(){this._removeCursor()},_onRendered:function(){function e(e){return e.isEmpty()}this.isEmpty=t.every(this.datasets,e),this.isEmpty?this._hide():this.isOpen&&this._show(),this.trigger("datasetRendered")},_hide:function(){this.$menu.hide()},_show:function(){this.$menu.css("display","block")},_getSuggestions:function(){return this.$menu.find(".tt-suggestion")},_getCursor:function(){return this.$menu.find(".tt-cursor").first()},_setCursor:function(e,t){e.first().addClass("tt-cursor"),!t&&this.trigger("cursorMoved")},_removeCursor:function(){this._getCursor().removeClass("tt-cursor")},_moveCursor:function(e){var t,n,r,i;if(this.isOpen){if(n=this._getCursor(),t=this._getSuggestions(),this._removeCursor(),r=t.index(n)+e,r=(r+1)%(t.length+1)-1,-1===r)return void this.trigger("cursorRemoved");-1>r&&(r=t.length-1),this._setCursor(i=t.eq(r)),this._ensureVisible(i)}},_ensureVisible:function(e){var t,n,r,i;t=e.position().top,n=t+e.outerHeight(!0),r=this.$menu.scrollTop(),i=this.$menu.height()+parseInt(this.$menu.css("paddingTop"),10)+parseInt(this.$menu.css("paddingBottom"),10),0>t?this.$menu.scrollTop(r+t):n>i&&this.$menu.scrollTop(r+(n-i))},close:function(){this.isOpen&&(this.isOpen=!1,this._removeCursor(),this._hide(),this.trigger("closed"))},open:function(){this.isOpen||(this.isOpen=!0,!this.isEmpty&&this._show(),this.trigger("opened"))},setLanguageDirection:function(e){this.$menu.css("ltr"===e?l.ltr:l.rtl)},moveCursorUp:function(){this._moveCursor(-1)},moveCursorDown:function(){this._moveCursor(1)},getDatumForSuggestion:function(e){var t=null;return e.length&&(t={raw:v.extractDatum(e),value:v.extractValue(e),datasetName:v.extractDatasetName(e)}),t},getDatumForCursor:function(){return this.getDatumForSuggestion(this._getCursor().first())},getDatumForTopSuggestion:function(){return this.getDatumForSuggestion(this._getSuggestions().first())},update:function(e){function n(t){t.update(e)}t.each(this.datasets,n)},empty:function(){function e(e){e.clear()}t.each(this.datasets,e),this.isEmpty=!0},isVisible:function(){return this.isOpen&&!this.isEmpty},destroy:function(){function e(e){e.destroy()}this.$menu.off(".tt"),this.$menu=null,t.each(this.datasets,e)}}),n}(),g=function(){function n(n){var i,s,o;n=n||{},n.input||e.error("missing input"),this.isActivated=!1,this.autoselect=!!n.autoselect,this.minLength=t.isNumber(n.minLength)?n.minLength:1,this.$node=r(n.input,n.withHint),i=this.$node.find(".tt-dropdown-menu"),s=this.$node.find(".tt-input"),o=this.$node.find(".tt-hint"),s.on("blur.tt",function(e){var n,r,o;n=document.activeElement,r=i.is(n),o=i.has(n).length>0,t.isMsie()&&(r||o)&&(e.preventDefault(),e.stopImmediatePropagation(),t.defer(function(){s.focus()}))}),i.on("mousedown.tt",function(e){e.preventDefault()}),this.eventBus=n.eventBus||new c({el:s}),this.dropdown=(new m({menu:i,datasets:n.datasets})).onSync("suggestionClicked",this._onSuggestionClicked,this).onSync("cursorMoved",this._onCursorMoved,this).onSync("cursorRemoved",this._onCursorRemoved,this).onSync("opened",this._onOpened,this).onSync("closed",this._onClosed,this).onAsync("datasetRendered",this._onDatasetRendered,this),this.input=(new d({input:s,hint:o})).onSync("focused",this._onFocused,this).onSync("blurred",this._onBlurred,this).onSync("enterKeyed",this._onEnterKeyed,this).onSync("tabKeyed",this._onTabKeyed,this).onSync("escKeyed",this._onEscKeyed,this).onSync("upKeyed",this._onUpKeyed,this).onSync("downKeyed",this._onDownKeyed,this).onSync("leftKeyed",this._onLeftKeyed,this).onSync("rightKeyed",this._onRightKeyed,this).onSync("queryChanged",this._onQueryChanged,this).onSync("whitespaceChanged",this._onWhitespaceChanged,this),this._setLanguageDirection()}function r(t,n){var r,s,u,a;r=e(t),s=e(f.wrapper).css(l.wrapper),u=e(f.dropdown).css(l.dropdown),a=r.clone().css(l.hint).css(i(r)),a.val("").removeData().addClass("tt-hint").removeAttr("id name placeholder required").prop("readonly",!0).attr({autocomplete:"off",spellcheck:"false",tabindex:-1}),r.data(o,{dir:r.attr("dir"),autocomplete:r.attr("autocomplete"),spellcheck:r.attr("spellcheck"),style:r.attr("style")}),r.addClass("tt-input").attr({autocomplete:"off",spellcheck:!1}).css(n?l.input:l.inputWithNoHint);try{!r.attr("dir")&&r.attr("dir","auto")}catch(c){}return r.wrap(s).parent().prepend(n?a:null).append(u)}function i(e){return{backgroundAttachment:e.css("background-attachment"),backgroundClip:e.css("background-clip"),backgroundColor:e.css("background-color"),backgroundImage:e.css("background-image"),backgroundOrigin:e.css("background-origin"),backgroundPosition:e.css("background-position"),backgroundRepeat:e.css("background-repeat"),backgroundSize:e.css("background-size")}}function s(e){var n=e.find(".tt-input");t.each(n.data(o),function(e,r){t.isUndefined(e)?n.removeAttr(r):n.attr(r,e)}),n.detach().removeData(o).removeClass("tt-input").insertAfter(e),e.remove()}var o="ttAttrs";return t.mixin(n.prototype,{_onSuggestionClicked:function(e,t){var n;(n=this.dropdown.getDatumForSuggestion(t))&&this._select(n)},_onCursorMoved:function(){var e=this.dropdown.getDatumForCursor();this.input.setInputValue(e.value,!0),this.eventBus.trigger("cursorchanged",e.raw,e.datasetName)},_onCursorRemoved:function(){this.input.resetInputValue(),this._updateHint()},_onDatasetRendered:function(){this._updateHint()},_onOpened:function(){this._updateHint(),this.eventBus.trigger("opened")},_onClosed:function(){this.input.clearHint(),this.eventBus.trigger("closed")},_onFocused:function(){this.isActivated=!0,this.dropdown.open()},_onBlurred:function(){this.isActivated=!1,this.dropdown.empty(),this.dropdown.close()},_onEnterKeyed:function(e,t){var n,r;n=this.dropdown.getDatumForCursor(),r=this.dropdown.getDatumForTopSuggestion(),n?(this._select(n),t.preventDefault()):this.autoselect&&r&&(this._select(r),t.preventDefault())},_onTabKeyed:function(e,t){var n;(n=this.dropdown.getDatumForCursor())?(this._select(n),t.preventDefault()):this._autocomplete(!0)},_onEscKeyed:function(){this.dropdown.close(),this.input.resetInputValue()},_onUpKeyed:function(){var e=this.input.getQuery();this.dropdown.isEmpty&&e.length>=this.minLength?this.dropdown.update(e):this.dropdown.moveCursorUp(),this.dropdown.open()},_onDownKeyed:function(){var e=this.input.getQuery();this.dropdown.isEmpty&&e.length>=this.minLength?this.dropdown.update(e):this.dropdown.moveCursorDown(),this.dropdown.open()},_onLeftKeyed:function(){"rtl"===this.dir&&this._autocomplete()},_onRightKeyed:function(){"ltr"===this.dir&&this._autocomplete()},_onQueryChanged:function(e,t){this.input.clearHintIfInvalid(),t.length>=this.minLength?this.dropdown.update(t):this.dropdown.empty(),this.dropdown.open(),this._setLanguageDirection()},_onWhitespaceChanged:function(){this._updateHint(),this.dropdown.open()},_setLanguageDirection:function(){var e;this.dir!==(e=this.input.getLanguageDirection())&&(this.dir=e,this.$node.css("direction",e),this.dropdown.setLanguageDirection(e))},_updateHint:function(){var e,n,r,i,s,o;e=this.dropdown.getDatumForTopSuggestion(),e&&this.dropdown.isVisible()&&!this.input.hasOverflow()?(n=this.input.getInputValue(),r=d.normalizeQuery(n),i=t.escapeRegExChars(r),s=new RegExp("^(?:"+i+")(.+$)","i"),o=s.exec(e.value),o?this.input.setHint(n+o[1]):this.input.clearHint()):this.input.clearHint()},_autocomplete:function(e){var t,n,r,i;t=this.input.getHint(),n=this.input.getQuery(),r=e||this.input.isCursorAtEnd(),t&&n!==t&&r&&(i=this.dropdown.getDatumForTopSuggestion(),i&&this.input.setInputValue(i.value),this.eventBus.trigger("autocompleted",i.raw,i.datasetName))},_select:function(e){this.input.setQuery(e.value),this.input.setInputValue(e.value,!0),this._setLanguageDirection(),this.eventBus.trigger("selected",e.raw,e.datasetName),this.dropdown.close(),t.defer(t.bind(this.dropdown.empty,this.dropdown))},open:function(){this.dropdown.open()},close:function(){this.dropdown.close()},setVal:function(e){e=t.toStr(e),this.isActivated?this.input.setInputValue(e):(this.input.setQuery(e),this.input.setInputValue(e,!0)),this._setLanguageDirection()},getVal:function(){return this.input.getQuery()},destroy:function(){this.input.destroy(),this.dropdown.destroy(),s(this.$node),this.$node=null}}),n}();!function(){var n,r,i;n=e.fn.typeahead,r="ttTypeahead",i={initialize:function(n,i){function s(){var s,o,u=e(this);t.each(i,function(e){e.highlight=!!n.highlight}),o=new g({input:u,eventBus:s=new c({el:u}),withHint:t.isUndefined(n.hint)?!0:!!n.hint,minLength:n.minLength,autoselect:n.autoselect,datasets:i}),u.data(r,o)}return i=t.isArray(i)?i:[].slice.call(arguments,1),n=n||{},this.each(s)},open:function(){function t(){var t,n=e(this);(t=n.data(r))&&t.open()}return this.each(t)},close:function(){function t(){var t,n=e(this);(t=n.data(r))&&t.close()}return this.each(t)},val:function(t){function n(){var n,i=e(this);(n=i.data(r))&&n.setVal(t)}function i(e){var t,n;return(t=e.data(r))&&(n=t.getVal()),n}return arguments.length?this.each(n):i(this.first())},destroy:function(){function t(){var t,n=e(this);(t=n.data(r))&&(t.destroy(),n.removeData(r))}return this.each(t)}},e.fn.typeahead=function(t){var n;return i[t]&&"initialize"!==t?(n=this.filter(function(){return!!e(this).data(r)}),i[t].apply(n,[].slice.call(arguments,1))):i.initialize.apply(this,arguments)},e.fn.typeahead.noConflict=function(){return e.fn.typeahead=n,this}}()}(window.jQuery),define("typeahead",["jquery"],function(){}),define("search",["jquery","config","typeahead"],function(e,t){(function(e){function i(e){return e?document.createElement("a").appendChild(document.createTextNode(e)).parentNode.innerHTML:""}function s(t,n){var t=t.replace("%QUERY",encodeURIComponent(n)),r=e("label.active > input[name=smatch]").val();return r&&(t+="&match="+r),t}var n="search",r={_init:function(n){return this.each(function(){function u(e){return(e.tags||[]).push(e.name)}function a(e){function t(e){return e.split(".").pop()}function n(e){return e.split(".").slice(0,-1).join(".")}var r='<div class="tt-match file type-icon '+t(e.name)+'">'+'<span class="tt-label">'+i(n(e.name));0/0;if(e.tags){r+='<span class="tt-tags">';for(var s=0;s<e.tags.length;s++){var o=e.tags[s];r+='<span class="tt-tag">'+i(o)+"</span>"}r+="</span>"}return e.title&&(r+='<div class="tt-title file">'+i(e.title)+"</div>"),r+="</div>",r}function h(e){var t="";if(e.file!=l||e.alias!=c){var n=e.file.split(".").pop();l=e.file,c=e.alias,t='<div class="tt-file-header type-icon '+n+'">'+'<span class="tt-path-file">'+i(e.file)+"</span>"+"</div>"}return t+w(e)}function d(e){return Bloodhound.tokenizers.whitespace(e.text)}function v(e){var t="";if(e.file!=l||e.alias!=c)l=e.file,c=e.alias,t='<div class="tt-file-header type-icon '+e.ext+'">'+'<span class="tt-path-alias">'+i(e.alias)+'</span>(<span class="tt-path-file">'+i(e.file)+")</span>"+"</div>";return e.text&&(t+=w(e)),t}function m(e,n){var r=t.swish.templates,i=[],s=e.split(" "),o=[];for(var u=0;u<s.length;u++)o.push({prefix:s[u],regex:new RegExp("_"+s[u])});for(var u=0;u<r.length;u++){var a=r[u];if(a.arity!==undefined){for(var f=0,l=!0;f<o.length&&l;f++)!a.name.startsWith(o[f].prefix)&&!a.name.match(o[f].regex)&&(l=!1);l&&i.push(a)}}n(i)}function g(e){var t='<div class="tt-match predicate';return e.type&&(t+=" "+e.type),e.mode&&(t+='" title="'+e.mode),t+='"><span class="tt-label">'+i(e.name)+"/"+e.arity+"</span>",e.iso&&(t+='<span class="tt-tags">',e.iso&&(t+='<span class="tt-tag">ISO</span>'),t+="</span>"),e.summary&&(t+='<div class="tt-title file">'+i(e.summary)+"</div>"),t+="</div>",t+="</div>",t}function b(t,n){r=t;if(t.length<2)return[];var i=[],s=new RegExp("\\b"+t,"g");y=s,e(".prolog-editor").each(function(){var t=this,n=e(t).prologEditor("search",s,{max:7});for(var r=0;r<n.length;r++)n[r].editor=t,n[r].regex=y,i.push(n[r])}),n(i)}function w(e){var t=e.text,n;(n=t.search(y))>20&&(t="..."+t.slice(n-17)),t.length>80&&(t=t.substring(0,80));var r='<div class="tt-match source"><span class="tt-line"><span class="tt-lineno">'+e.line+"</span>"+'<span class="tt-text">'+i(t)+"</span>"+"</span>"+"</div>";return r}function x(e){var t=[],n=e.replace(/\s+/g," ").split(" ");for(var r=0;r<n.length;r++)t.push(E[n[r]]);return t}var n=e(this),r,o=new Bloodhound({name:"files",remote:t.http.locations.swish_typeahead+"?set=file&q=%QUERY",datumTokenizer:u,queryTokenizer:Bloodhound.tokenizers.whitespace});o.initialize();var f=new Bloodhound({name:"store_content",limit:20,cache:!1,remote:{url:t.http.locations.swish_typeahead+"?set=store_content&q=%QUERY",replace:s},datumTokenizer:d,queryTokenizer:Bloodhound.tokenizers.whitespace});f.initialize();var l=null,c=null,p=new Bloodhound({name:"source",limit:15,cache:!1,query_cache_length:1,remote:{url:t.http.locations.swish_typeahead+"?set=sources&q=%QUERY",replace:s},datumTokenizer:d,queryTokenizer:Bloodhound.tokenizers.whitespace});p.initialize();var y,E={source:{name:"source",source:b,templates:{suggestion:w}},sources:{name:"sources",source:p.ttAdapter(),templates:{suggestion:v},limit:15},files:{name:"files",source:o.ttAdapter(),templates:{suggestion:a}},store_content:{name:"store_content",source:f.ttAdapter(),templates:{suggestion:h}},predicates:{name:"predicates",source:m,templates:{suggestion:g}}},S=E.sources.source;E.sources.source=function(e,t){return l=null,c=null,y=new RegExp(RegExp.escape(e)),S(e,t)},n.typeahead({minLength:2,highlight:!0},x(n.data("search-in"))).on("typeahead:selected typeahead:autocompleted",function(t,r,i){if(r.type=="store")r.query&&(r.regex=new RegExp(RegExp.escape(r.query),"g"),r.showAllMatches=!0),e(t.target).parents(".swish").swish("playFile",r);else if(r.arity!==undefined)e(".swish-event-receiver").trigger("pldoc",r);else if(r.editor!==undefined&&r.line!==undefined)e(r.editor).prologEditor("gotoLine",r.line,{regex:r.regex,showAllMatches:!0});else if(r.alias!==undefined){var s=encodeURI("/"+r.alias+"/"+r.file+"."+r.ext),o={url:s,line:r.line};r.query&&(o.regex=new RegExp(RegExp.escape(r.query),"g"),o.showAllMatches=!0),e(t.target).parents(".swish").swish("playURL",o)}else n.data("target",{datum:r,set:i}),console.log(n.data("target"))}),n.parents("form").submit(function(e){var t=n.data("target"),r=n.val();if(!t||!t.datum||t.datum.label!=r)t=r;return n.val(""),n.data("target",null),n.search("search",t),!1})})},search:function(e){alert("Full search not yet implemented\nPlease select from auto completion list")}};typeof String.prototype.startsWith!="function"&&(String.prototype.startsWith=function(e){return this.lastIndexOf(e,0)===0}),e.fn.search=function(t){if(r[t])return r[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return r._init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery."+n)}})(jQuery),RegExp.escape=function(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}}),define("tabbed",["jquery","form","config","preferences","modal","laconic","search"],function(e,t,n,r,i){var s={tabTypes:{},type:function(e){var t=e.split(".").pop();for(var n in s.tabTypes)if(s.tabTypes.hasOwnProperty(n)&&s.tabTypes[n].dataType==t)return s.tabTypes[n]}};return function(e){function f(t,n,r){e(t).wrap('<div role="tabpanel" class="tab-pane" id="'+n+'"></div>');var i=e(t).parent();return r&&i.addClass("active"),i}function l(t,n){var r=e.el.span({"class":"glyphicon glyphicon-"+t});return n&&e(r).addClass(n),r}function c(){return"tabbed-tab-"+u++}function h(e){if(n.swish.profiles)for(var t=0;t<n.swish.profiles.length;t++)if(n.swish.profiles[t].value==e)return n.swish.profiles[t]}var o="tabbed",u=0,a={_init:function(t){return t=t||{},this.each(function(){var n=e(this),r={};r.newTab=t.newTab,r.tabTypes=t.tabTypes||s.tabTypes,n.data(o,r),n.addClass("tabbed"),n.tabbed("makeTabbed"),n.on("source",function(e,t){n.tabbed("tabFromSource",t)}),n.on("trace-location",function(e,t){n.tabbed("showTracePort",t)}),n.on("data-is-clean",function(t,r){var i=e(t.target).closest(".tab-pane"),s=n.tabbed("navTab",i.attr("id"));s&&(r?s.removeClass("data-dirty"):s.addClass("data-dirty"))})})},makeTabbed:function(){var t=this.children(),n=e.el.ul({"class":"nav nav-tabs",role:"tablist"}),r=e.el.div({"class":"tab-content"});this.prepend(r),this.prepend(n),e(n).on("click","span.xclose",function(t){var n=e(t.target).parent().attr("data-id");e(t.target).parents(".tabbed").first().tabbed("removeTab",n),t.preventDefault()}),e(n).on("click","a",function(t){e(t.target).closest("a").tab("show"),t.preventDefault()});for(var i=0;i<t.length;i++){var s=e(t[i]),o=c(),u=s.attr("data-label")||"Unknown",a=s.attr("data-close")!="disabled",h=i==t.length-1,p=this.tabbed("tabLabel",o,u,a);h&&e(p).addClass("active"),e(n).append(p),e(r).append(f(e(t[i]),o,h))}var d=e.el.a({"class":"tab-new compact",title:"Open a new tab"},l("plus"));e(n).append(e.el.li({role:"presentation"},d)),e(d).on("click",function(t){var n=e(t.target).parents(".tabbed").first();return n.tabbed("newTab"),t.preventDefault(),!1}),e(n).on("shown.bs.tab","a",function(t){var n=e(t.target).data("id");e("#"+n+" .swish-event-receiver").trigger("activate-tab")}),this.tabbed("navContent").children().length==0&&this.tabbed("newTab")},newTab:function(t){var n=this.data(o);return t==undefined&&(n.newTab?t=n.newTab():(t=this.tabbed("tabSelect"),e(t).append(this.tabbed("profileForm"),e.el.hr(),this.tabbed("searchForm")))),this.tabbed("addTab",t,{active:!0,close:!0})},tabFromSource:function(t){var n=this.find("div.tabbed-select");if(n.length>0){var r=e(n[0]).closest(".tab-pane");this.tabbed("show",r.attr("id")),typeof t=="object"&&delete t.newTab,this.tabbed("setSource",r,t)}else{var r=this.tabbed("newTab",e("<span></span>"));typeof t=="object"&&delete t.newTab,this.tabbed("setSource",r,t)||this.tabbed("removeTab",r.attr("id"))}return this},setSource:function(t,n){if(typeof n=="object"&&(n.meta&&n.meta.name||n.url)){var r=n.meta&&n.meta.name?n.meta.name:n.url,i=s.type(r),o=e.el.div();return t.html(""),t.tabbed("title",i.label,i.dataType),t.append(o),i.create(o),e(o).trigger("source",n),!0}return!1},showTracePort:function(t){if(t&&t.source&&t.source.file){var n=t.source.file,r,i,s;function o(){var e;if(n.startsWith("pengine://"))return n.split("/")[2]}function u(){var e="swish://";if(n.startsWith(e))return n.slice(e.length)}if(r=o())s=this.find(".prolog-editor").filter(function(t,n){return e(n).prologEditor("pengine",{has:r})});else if(i=u()){s=this.find(".storage").storage("match",{file:i});if(!s)return this.closest(".swish").swish("playFile",{file:i,newTab:!0,noHistory:!0,prompt:t}),this}s&&s.prologEditor("showTracePort",t)}return this},addTab:function(t,n){var r=this.tabbed("navTabs"),i=c(),s=f(t,i,n.close);this.tabbed("navContent").append(s);var o=this.tabbed("tabLabel",i,"New tab",close,"select"),u=r.find("a.tab-new");return u.length==1?e(o).insertBefore(u.first().parent()):r.append(o),n.active&&e(o).find("a").first().tab("show"),s},removeTab:function(t){var n=this.tabbed("navTabs").find("a[data-id='"+t+"']").parent(),r=e("#"+t),i;if(r.find(".storage").storage("unload","closetab")==0)return;r.is(":visible")&&(i=n.prev()||n.next()),n.remove(),r.find(".prolog-runner").prologRunner("close"),r.remove(),i&&i.length>0?i.find("a").first().tab("show"):this.tabbed("navContent").children().length==0&&this.tabbed("newTab")},show:function(e){var t=this.tabbed("navTab",e);if(t)return t.tab("show"),this},tabLabel:function(t,n,r,i){var s;r&&(s=l("remove","xclose"),e(s).attr("title","Close tab")),i=i||"pl";var o=e.el.a({"class":"compact",href:"#"+t,"data-id":t},e.el.span({"class":"tab-icon type-icon "+i}),e.el.span({"class":"tab-dirty",title:"Tab is modified.  See File/Save and Edit/View changes"}),e.el.span({"class":"tab-title"},n),s),u=e.el.li({role:"presentation"},o);return u},title:function(t,n){var r=this.closest(".tab-pane");r.length==0&&(fsorg=this.data("fullscreen_origin"),fsorg&&(r=e(fsorg).closest(".tab-pane")));var i=r.closest(".tabbed"),s=r.attr("id"),o=i.tabbed("navTabs"),u=o.find("a[data-id="+s+"]");u.find(".tab-title").text(t);if(n){var a=u.find(".tab-icon");a.removeClass(),a.addClass("tab-icon type-icon "+n)}return i},tabSelect:function(){var t=this.data(o),n=e.el.div({"class":"tabbed-select"},e.el.div({"class":"tabbed-create"},e.el.label({"class":"tabbed-left"},"Create a "),g=e.el.div({"class":"btn-group",role:"group"}),e.el.label({"class":"tabbed-right"},"here"))),u=[];for(var a in t.tabTypes)t.tabTypes.hasOwnProperty(a)&&t.tabTypes[a].order&&u.push(a);u.sort(function(e,n){return t.tabTypes[e].order-t.tabTypes[n].order});for(var f=0;f<u.length;f++){var l=t.tabTypes[u[f]];e(g).append(e.el.button({type:"button","class":"btn btn-primary","data-type":l.typeName,"data-ext":l.dataType},l.label))}return e(g).on("click",".btn",function(t){var n=e(t.target).data("type"),i=e(t.target).closest(".tab-pane"),o=e.el.div(),u=e.extend({},s.tabTypes[n]),a=i.find("label.active > input[name=profile]").val();a&&(u.profile=a,u.value=i.tabbed("profileValue",a,s.tabTypes[n].dataType),u.value!=undefined&&r.setVal("default-profile",a)),i.html(""),i.tabbed("title",u.label,u.dataType),i.append(o),s.tabTypes[n].create(o,u)}),e(g).addClass("swish-event-receiver"),e(g).on("download save fileInfo print",function(t){var n=e(t.target).closest(".tab-pane");if(n.is(":visible")){var r={download:"you wish to download",save:"you wish to save",print:"you wish to print",fileInfo:"for which you want details"};i.alert("Please activate the tab "+r[t.type]),t.stopPropagation()}}),e(g).on("profile-selected",function(t,n){e(t.target).find("button").each(function(){e(this).prop("disabled",n.type.indexOf(e(this).data("ext"))<0)})}),n},searchForm:function(){var n=e.el.form({"class":"search-sources"},e.el.label({"class":"control-label"},"Open source file containing"),e.el.div({"class":"input-group"},e.el.input({type:"text","class":"form-control search",placeholder:"Search sources","data-search-in":"sources store_content"}),e.el.div({"class":"input-group-btn"},e.el.button({"class":"btn btn-default",type:"submit"},e.el.i({"class":"glyphicon glyphicon-search"})))),e.el.div({"class":"input-group"},t.fields.radio("smatch",[{label:"Start of line",value:"sol"},{label:"Start of word",value:"sow",active:!0},{label:"Anywhere",value:"anywhere"}])));return e(n).find("input.search").search(),n},profileForm:function(){if(n.swish.profiles&&n.swish.profiles.length>0){var i;for(var s=0;s<n.swish.profiles.length;s++)delete n.swish.profiles[s].active;if(i=r.getVal("default-profile"))for(var s=0;s<n.swish.profiles.length;s++)n.swish.profiles[s].value==i&&(n.swish.profiles[s].active=!0);else n.swish.profiles[0].active=!0;var o=e.el.div({"class":"tabbed-profile"},e.el.label({"class":"tabbed-left"},"based on"),e.el.div({"class":"input-group select-profile"},t.fields.radio("profile",n.swish.profiles)),e.el.label({"class":"tabbed-right"},"profile"));return e(o).on("click",function(t){var n=e(t.target).find("input").val(),r=h(n);e(t.target).closest(".tab-pane").find(".tabbed-create .btn-group").trigger("profile-selected",r)}),o}},profileValue:function(t,r){var s=n.http.locations.swish+"profile/"+t+"."+r;return e.ajax({url:s,type:"GET",data:{format:"raw"},async:!1,error:function(e){i.ajaxError(e)}}).responseText},navTabs:function(){return this.find("ul.nav-tabs").first()},navTab:function(e){var t=this.find("ul.nav-tabs").first().find("a[data-id='"+e+"']");if(t.length>0)return t},navContent:function(){return this.find("div.tab-content").first()}};e.fn.tabbed=function(t){if(a[t])return a[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return a._init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery."+o)}}(jQuery),s}),define("prolog",["jquery","config","form","preferences"],function(e,t,n,r){var i={downloadCSV:function(s,o,u){u=u||{},u.disposition=u.disposition||u.filename||"swish-results.csv";if(u.projection){var a,f=u.format||"prolog";function l(t,n){return e.el.input({type:"hidden",name:t,value:n})}u.distinct&&(s="distinct(["+u.projection+"],("+s+"))");if(u.limit){var c=parseInt(u.limit.replace(/[ _]/g,""));if(typeof c!="number")return alert("Not an integer: ",u.limit),!1;s="limit("+c+",("+s+"))"}a=e.el.form({method:"POST",action:t.http.locations.pengines+"/create",target:"_blank"},l("format","csv"),l("chunk","10"),l("solutions","all"),l("disposition",u.disposition),l("application","swish"),l("ask",s),l("src_text",o),l("template",f+"("+u.projection+")")),console.log(a),e("body").append(a),a.submit(),e(a).remove()}else{var h=e().prologEditor("variables",s),p=u.disposition;p.indexOf(".")<0&&(p+=".csv");function d(){var u=e.el.form({"class":"form-horizontal"},n.fields.projection(h.join(",")),n.fields.csvFormat(t.swish.csv_formats,r.getVal("csvFormat")),n.fields.limit("10 000",!1),n.fields.filename(p,2),n.fields.buttons({label:"Download CSV",action:function(e,n){return e.preventDefault(),t.swish.csv_formats.length>1&&r.setVal("csvFormat",n.format),i.downloadCSV(s,o,n),!1}}));this.append(u)}n.showDialog({title:"Download query results as CSV",body:d})}return this},trimFullStop:function(e){return e.replace(/\.\s*$/m,"")},options:{application:"swish",chunk:5}};return e.swish=function(e){for(var t in i.options)i.options.hasOwnProperty(t)&&!e.hasOwnProperty(t)&&(e[t]=i.options[t]);return new Pengine(e)},i}),function(e){if(typeof exports=="object"&&typeof module=="object")module.exports=e();else{if(typeof define=="function"&&define.amd)return define("cm/lib/codemirror",[],e);(this||window).CodeMirror=e()}}(function(){function T(e,t){if(!(this instanceof T))return new T(e,t);this.options=t=t?mu(t):{},mu(_i,t,!1),j(t);var n=t.value;typeof n=="string"&&(n=new oo(n,t.mode,null,t.lineSeparator)),this.doc=n;var r=new T.inputStyles[t.inputStyle](this),i=this.display=new N(e,n,r);i.wrapper.CodeMirror=this,D(this),M(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),t.autofocus&&!v&&i.input.focus(),R(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new iu,keySeq:null,specialChars:null};var a=this;s&&o<11&&setTimeout(function(){a.display.input.reset(!0)},20),Er(this),Bu(),Zn(this),this.curOp.forceUpdate=!0,lo(this,n),t.autofocus&&!v||a.hasFocus()?setTimeout(gu(ri,this),20):ii(this);for(var f in Di)Di.hasOwnProperty(f)&&Di[f](this,t[f],Hi);V(this),t.finishInit&&t.finishInit(this);for(var l=0;l<Ii.length;++l)Ii[l](this);tr(this),u&&t.lineWrapping&&getComputedStyle(i.lineDiv).textRendering=="optimizelegibility"&&(i.lineDiv.style.textRendering="auto")}function N(e,t,r){var i=this;this.input=r,i.scrollbarFiller=Tu("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=Tu("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=Tu("div",null,"CodeMirror-code"),i.selectionDiv=Tu("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=Tu("div",null,"CodeMirror-cursors"),i.measure=Tu("div",null,"CodeMirror-measure"),i.lineMeasure=Tu("div",null,"CodeMirror-measure"),i.lineSpace=Tu("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none"),i.mover=Tu("div",[Tu("div",[i.lineSpace],"CodeMirror-lines")],null,"position: relative"),i.sizer=Tu("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=Tu("div",null,null,"position: absolute; height: "+Zo+"px; width: 1px;"),i.gutters=Tu("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=Tu("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=Tu("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),s&&o<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!u&&(!n||!v)&&(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,r.init(i)}function C(e){e.doc.mode=T.getMode(e.options,e.doc.modeOption),k(e)}function k(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,pn(e,100),e.state.modeGen++,e.curOp&&dr(e)}function L(e){e.options.lineWrapping?(_u(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Mu(e.display.wrapper,"CodeMirror-wrap"),B(e)),O(e),dr(e),jn(e),setTimeout(function(){U(e)},100)}function A(e){var t=Kn(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Qn(e.display)-3);return function(i){if(Ls(e.doc,i))return 0;var s=0;if(i.widgets)for(var o=0;o<i.widgets.length;o++)i.widgets[o].height&&(s+=i.widgets[o].height);return n?s+(Math.ceil(i.text.length/r)||1)*t:s+t}}function O(e){var t=e.doc,n=A(e);t.iter(function(e){var t=n(e);t!=e.height&&vo(e,t)})}function M(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),jn(e)}function _(e){D(e),dr(e),setTimeout(function(){X(e)},20)}function D(e){var t=e.display.gutters,n=e.options.gutters;Cu(t);for(var r=0;r<n.length;++r){var i=n[r],s=t.appendChild(Tu("div",null,"CodeMirror-gutter "+i));i=="CodeMirror-linenumbers"&&(e.display.lineGutter=s,s.style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=r?"":"none",P(e)}function P(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function H(e){if(e.height==0)return 0;var t=e.text.length,n,r=e;while(n=Es(r)){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}r=e;while(n=Ss(r)){var i=n.find(0,!0);t-=r.text.length-i.from.ch,r=i.to.line,t+=r.text.length-i.to.ch}return t}function B(e){var t=e.display,n=e.doc;t.maxLine=co(n,n.first),t.maxLineLength=H(t.maxLine),t.maxLineChanged=!0,n.iter(function(e){var n=H(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}function j(e){var t=cu(e.gutters,"CodeMirror-linenumbers");t==-1&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function F(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+yn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+wn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function I(e,t,n){this.cm=n;var r=this.vert=Tu("div",[Tu("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=Tu("div",[Tu("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(r),e(i),Ro(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Ro(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,s&&o<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function q(){}function R(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Mu(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new T.scrollbarModel[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ro(t,"mousedown",function(){e.state.focused&&setTimeout(function(){e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?qr(e,t):Ir(e,t)},e),e.display.scrollbars.addClass&&_u(e.display.wrapper,e.display.scrollbars.addClass)}function U(e,t){t||(t=F(e));var n=e.display.barWidth,r=e.display.barHeight;z(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&tt(e),z(e,F(e)),n=e.display.barWidth,r=e.display.barHeight}function z(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}function W(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-gn(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,s=go(t,r),o=go(t,i);if(n&&n.ensure){var u=n.ensure.from.line,a=n.ensure.to.line;u<s?(s=u,o=go(t,yo(co(t,u))+e.wrapper.clientHeight)):Math.min(a,t.lastLine())>=o&&(s=go(t,yo(co(t,a))-e.wrapper.clientHeight),o=a)}return{from:s,to:Math.max(o,s+1)}}function X(e){var t=e.display,n=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;var r=J(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,s=r+"px";for(var o=0;o<n.length;o++)if(!n[o].hidden){e.options.fixedGutter&&(n[o].gutter&&(n[o].gutter.style.left=s),n[o].gutterBackground&&(n[o].gutterBackground.style.left=s));var u=n[o].alignable;if(u)for(var a=0;a<u.length;a++)u[a].style.left=s}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}function V(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=$(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(Tu("div",[Tu("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),s=i.firstChild.offsetWidth,o=i.offsetWidth-s;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(s,r.lineGutter.offsetWidth-o)+1,r.lineNumWidth=r.lineNumInnerWidth+o,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",P(e),!0}return!1}function $(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function J(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function K(e,t,n){var r=e.display;this.viewport=t,this.visible=W(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=En(e),this.force=n,this.dims=rt(e),this.events=[]}function Q(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=wn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=wn(e)+"px",t.scrollbarsClipped=!0)}function G(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return mr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&wr(e)==0)return!1;V(e)&&(mr(e),t.dims=rt(e));var i=r.first+r.size,s=Math.max(t.visible.from-e.options.viewportMargin,r.first),o=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<s&&s-n.viewFrom<20&&(s=Math.max(r.first,n.viewFrom)),n.viewTo>o&&n.viewTo-o<20&&(o=Math.min(i,n.viewTo)),x&&(s=Cs(e.doc,s),o=ks(e.doc,o));var u=s!=n.viewFrom||o!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;br(e,s,o),n.viewOffset=yo(co(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var a=wr(e);if(!u&&a==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var f=Au();return a>4&&(n.lineDiv.style.display="none"),it(e,n.updateLineNumbers,t.dims),a>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,f&&Au()!=f&&f.offsetHeight&&f.focus(),Cu(n.cursorDiv),Cu(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,u&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,pn(e,400)),n.updateLineNumbers=null,!0}function Y(e,t){var n=t.viewport;for(var r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==En(e)){n&&n.top!=null&&(n={top:Math.min(e.doc.height+yn(e.display)-Sn(e),n.top)}),t.visible=W(e.display,e.doc,n);if(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}if(!G(e,t))break;tt(e);var i=F(e);an(e),U(e,i),et(e,i)}t.signal(e,"update",e);if(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo}function Z(e,t){var n=new K(e,t);if(G(e,n)){tt(e),Y(e,n);var r=F(e);an(e),U(e,r),et(e,r),n.finish()}}function et(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+wn(e)+"px"}function tt(e){var t=e.display,n=t.lineDiv.offsetTop;for(var r=0;r<t.view.length;r++){var i=t.view[r],u;if(i.hidden)continue;if(s&&o<8){var a=i.node.offsetTop+i.node.offsetHeight;u=a-n,n=a}else{var f=i.node.getBoundingClientRect();u=f.bottom-f.top}var l=i.line.height-u;u<2&&(u=Kn(t));if(l>.001||l<-0.001){vo(i.line,u),nt(i.line);if(i.rest)for(var c=0;c<i.rest.length;c++)nt(i.rest[c])}}}function nt(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.parentNode.offsetHeight}function rt(e){var t=e.display,n={},r={},i=t.gutters.clientLeft;for(var s=t.gutters.firstChild,o=0;s;s=s.nextSibling,++o)n[e.options.gutters[o]]=s.offsetLeft+s.clientLeft+i,r[e.options.gutters[o]]=s.clientWidth;return{fixedPos:J(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function it(e,t,n){function a(t){var n=t.nextSibling;return u&&m&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}var r=e.display,i=e.options.lineNumbers,s=r.lineDiv,o=s.firstChild,f=r.view,l=r.viewFrom;for(var c=0;c<f.length;c++){var h=f[c];if(!h.hidden)if(!h.node||h.node.parentNode!=s){var p=pt(e,h,l,n);s.insertBefore(p,o)}else{while(o!=h.node)o=a(o);var d=i&&t!=null&&t<=l&&h.lineNumber;h.changes&&(cu(h.changes,"gutter")>-1&&(d=!1),st(e,h,l,n)),d&&(Cu(h.lineNumber),h.lineNumber.appendChild(document.createTextNode($(e.options,l)))),o=h.node.nextSibling}l+=h.size}while(o)o=a(o)}function st(e,t,n,r){for(var i=0;i<t.changes.length;i++){var s=t.changes[i];s=="text"?ft(e,t):s=="gutter"?ct(e,t,n,r):s=="class"?lt(t):s=="widget"&&ht(e,t,r)}t.changes=null}function ot(e){return e.node==e.text&&(e.node=Tu("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),s&&o<8&&(e.node.style.zIndex=2)),e.node}function ut(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;t&&(t+=" CodeMirror-linebackground");if(e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var n=ot(e);e.background=n.insertBefore(Tu("div",null,t),n.firstChild)}}function at(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Js(e,t)}function ft(e,t){var n=t.text.className,r=at(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,lt(t)):n&&(t.text.className=n)}function lt(e){ut(e),e.line.wrapClass?ot(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function ct(e,t,n,r){t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null);if(t.line.gutterClass){var i=ot(t);t.gutterBackground=Tu("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),i.insertBefore(t.gutterBackground,t.text)}var s=t.line.gutterMarkers;if(e.options.lineNumbers||s){var i=ot(t),o=t.gutter=Tu("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");e.display.input.setUneditable(o),i.insertBefore(o,t.text),t.line.gutterClass&&(o.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!s||!s["CodeMirror-linenumbers"])&&(t.lineNumber=o.appendChild(Tu("div",$(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px")));if(s)for(var u=0;u<e.options.gutters.length;++u){var a=e.options.gutters[u],f=s.hasOwnProperty(a)&&s[a];f&&o.appendChild(Tu("div",[f],"CodeMirror-gutter-elt","left: "+r.gutterLeft[a]+"px; width: "+r.gutterWidth[a]+"px"))}}}function ht(e,t,n){t.alignable&&(t.alignable=null);for(var r=t.node.firstChild,i;r;r=i){var i=r.nextSibling;r.className=="CodeMirror-linewidget"&&t.node.removeChild(r)}dt(e,t,n)}function pt(e,t,n,r){var i=at(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),lt(t),ct(e,t,n,r),dt(e,t,r),t.node}function dt(e,t,n){vt(e,t.line,t,n,!0);if(t.rest)for(var r=0;r<t.rest.length;r++)vt(e,t.rest[r],t,n,!1)}function vt(e,t,n,r,i){if(!t.widgets)return;var s=ot(n);for(var o=0,u=t.widgets;o<u.length;++o){var a=u[o],f=Tu("div",[a.node],"CodeMirror-linewidget");a.handleMouseEvents||f.setAttribute("cm-ignore-events","true"),mt(a,f,n,r),e.display.input.setUneditable(f),i&&a.above?s.insertBefore(f,n.gutter||n.text):s.appendChild(f),$o(a,"redraw")}}function mt(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function bt(e){return gt(e.line,e.ch)}function wt(e,t){return yt(e,t)<0?t:e}function Et(e,t){return yt(e,t)<0?e:t}function St(e){e.state.focused||(e.display.input.focus(),ri(e))}function Tt(e,t,n,r,i){var s=e.doc;e.display.shift=!1,r||(r=s.sel);var o=e.state.pasteIncoming||i=="paste",u=s.splitLines(t),a=null;if(o&&r.ranges.length>1)if(xt&&xt.text.join("\n")==t){if(r.ranges.length%xt.text.length==0){a=[];for(var f=0;f<xt.text.length;f++)a.push(s.splitLines(xt.text[f]))}}else u.length==r.ranges.length&&(a=hu(u,function(e){return[e]}));for(var f=r.ranges.length-1;f>=0;f--){var l=r.ranges[f],c=l.from(),h=l.to();l.empty()&&(n&&n>0?c=gt(c.line,c.ch-n):e.state.overwrite&&!o?h=gt(h.line,Math.min(co(s,h.line).text.length,h.ch+fu(u).length)):xt&&xt.lineWise&&xt.text.join("\n")==t&&(c=h=gt(c.line,0)));var p=e.curOp.updateInput,d={from:c,to:h,text:a?a[f%a.length]:u,origin:i||(o?"paste":e.state.cutIncoming?"cut":"+input")};pi(e.doc,d),$o(e,"inputRead",e,d)}t&&!o&&Ct(e,t),Ni(e),e.curOp.updateInput=p,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function Nt(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&ar(t,function(){Tt(t,n,0,null,"paste")}),!0}function Ct(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;var n=e.doc.sel;for(var r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)continue;var s=e.getModeAt(i.head),o=!1;if(s.electricChars){for(var u=0;u<s.electricChars.length;u++)if(t.indexOf(s.electricChars.charAt(u))>-1){o=ki(e,i.head.line,"smart");break}}else s.electricInput&&s.electricInput.test(co(e.doc,i.head.line).text.slice(0,i.head.ch))&&(o=ki(e,i.head.line,"smart"));o&&$o(e,"electricInput",e,i.head.line)}}function kt(e){var t=[],n=[];for(var r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,s={anchor:gt(i,0),head:gt(i+1,0)};n.push(s),t.push(e.getRange(s.anchor,s.head))}return{text:t,ranges:n}}function Lt(e,t){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck",!!t)}function At(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new iu,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null}function Ot(){var e=Tu("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=Tu("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return u?e.style.width="1000px":e.setAttribute("wrap","off"),d&&(e.style.border="1px solid black"),Lt(e),t}function Mt(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new iu,this.gracePeriod=!1}function _t(e,t){var n=kn(e,t.line);if(!n||n.hidden)return null;var r=co(e.doc,t.line),i=Tn(n,r,t.line),s=bo(r),o="left";if(s){var u=sa(s,t.ch);o=u%2?"right":"left"}var a=Mn(i.map,t.ch,o);return a.offset=a.collapse=="right"?a.end:a.start,a}function Dt(e,t){return t&&(e.bad=!0),e}function Pt(e,t,n){var r;if(t==e.display.lineDiv){r=e.display.lineDiv.childNodes[n];if(!r)return Dt(e.clipPos(gt(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var s=e.display.view[i];if(s.node==r)return Ht(s,t,n)}}function Ht(e,t,n){function l(t,n,r){for(var i=-1;i<(f?f.length:0);i++){var s=i<0?a.map:f[i];for(var o=0;o<s.length;o+=3){var u=s[o+2];if(u==t||u==n){var l=mo(i<0?e.line:e.rest[i]),c=s[o]+r;if(r<0||u!=t)c=s[o+(r?1:0)];return gt(l,c)}}}}var r=e.text.firstChild,i=!1;if(!t||!Lu(r,t))return Dt(gt(mo(e.line),0),!0);if(t==r){i=!0,t=r.childNodes[n],n=0;if(!t){var s=e.rest?fu(e.rest):e.line;return Dt(gt(mo(s),s.text.length),i)}}var o=t.nodeType==3?t:null,u=t;!o&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(o=t.firstChild,n&&(n=o.nodeValue.length));while(u.parentNode!=r)u=u.parentNode;var a=e.measure,f=a.maps,c=l(o,u,n);if(c)return Dt(c,i);for(var h=u.nextSibling,p=o?o.nodeValue.length-n:0;h;h=h.nextSibling){c=l(h,h.firstChild,0);if(c)return Dt(gt(c.line,c.ch-p),i);p+=h.textContent.length}for(var d=u.previousSibling,p=n;d;d=d.previousSibling){c=l(d,d.firstChild,-1);if(c)return Dt(gt(c.line,c.ch+p),i);p+=d.textContent.length}}function Bt(e,t,n,r,i){function a(e){return function(t){return t.id==e}}function f(t){if(t.nodeType==1){var n=t.getAttribute("cm-text");if(n!=null){n==""&&(n=t.textContent.replace(/\u200b/g,"")),s+=n;return}var l=t.getAttribute("cm-marker"),c;if(l){var h=e.findMarks(gt(r,0),gt(i+1,0),a(+l));h.length&&(c=h[0].find())&&(s+=ho(e.doc,c.from,c.to).join(u));return}if(t.getAttribute("contenteditable")=="false")return;for(var p=0;p<t.childNodes.length;p++)f(t.childNodes[p]);/^(pre|div|p)$/i.test(t.nodeName)&&(o=!0)}else if(t.nodeType==3){var d=t.nodeValue;if(!d)return;o&&(s+=u,o=!1),s+=d}}var s="",o=!1,u=e.doc.lineSeparator();for(;;){f(t);if(t==n)break;t=t.nextSibling}return s}function jt(e,t){this.ranges=e,this.primIndex=t}function Ft(e,t){this.anchor=e,this.head=t}function It(e,t){var n=e[t];e.sort(function(e,t){return yt(e.from(),t.from())}),t=cu(e,n);for(var r=1;r<e.length;r++){var i=e[r],s=e[r-1];if(yt(s.to(),i.from())>=0){var o=Et(s.from(),i.from()),u=wt(s.to(),i.to()),a=s.empty()?i.from()==i.head:s.from()==s.head;r<=t&&--t,e.splice(--r,2,new Ft(a?u:o,a?o:u))}}return new jt(e,t)}function qt(e,t){return new jt([new Ft(e,t||e)],0)}function Rt(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Ut(e,t){if(t.line<e.first)return gt(e.first,0);var n=e.first+e.size-1;return t.line>n?gt(n,co(e,n).text.length):zt(t,co(e,t.line).text.length)}function zt(e,t){var n=e.ch;return n==null||n>t?gt(e.line,t):n<0?gt(e.line,0):e}function Wt(e,t){return t>=e.first&&t<e.first+e.size}function Xt(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=Ut(e,t[r]);return n}function Vt(e,t,n,r){if(e.cm&&e.cm.display.shift||e.extend){var i=t.anchor;if(r){var s=yt(n,i)<0;s!=yt(r,i)<0?(i=n,n=r):s!=yt(n,r)<0&&(n=r)}return new Ft(i,n)}return new Ft(r||n,n)}function $t(e,t,n,r){Zt(e,new jt([Vt(e,e.sel.primary(),t,n)],0),r)}function Jt(e,t,n){for(var r=[],i=0;i<e.sel.ranges.length;i++)r[i]=Vt(e,e.sel.ranges[i],t[i],null);var s=It(r,e.sel.primIndex);Zt(e,s,n)}function Kt(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Zt(e,It(i,e.sel.primIndex),r)}function Qt(e,t,n,r){Zt(e,qt(t,n),r)}function Gt(e,t,n){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new Ft(Ut(e,t[n].anchor),Ut(e,t[n].head))},origin:n&&n.origin};return Xo(e,"beforeSelectionChange",e,r),e.cm&&Xo(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?It(r.ranges,r.ranges.length-1):t}function Yt(e,t,n){var r=e.history.done,i=fu(r);i&&i.ranges?(r[r.length-1]=t,en(e,t,n)):Zt(e,t,n)}function Zt(e,t,n){en(e,t,n),Co(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function en(e,t,n){if(Go(e,"beforeSelectionChange")||e.cm&&Go(e.cm,"beforeSelectionChange"))t=Gt(e,t,n);var r=n&&n.bias||(yt(t.primary().head,e.sel.primary().head)<0?-1:1);tn(e,rn(e,t,r,!0)),(!n||n.scroll!==!1)&&e.cm&&Ni(e.cm)}function tn(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,Qo(e.cm)),$o(e,"cursorActivity",e)}function nn(e){tn(e,rn(e,e.sel,null,!1),tu)}function rn(e,t,n,r){var i;for(var s=0;s<t.ranges.length;s++){var o=t.ranges[s],u=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[s],a=on(e,o.anchor,u&&u.anchor,n,r),f=on(e,o.head,u&&u.head,n,r);if(i||a!=o.anchor||f!=o.head)i||(i=t.ranges.slice(0,s)),i[s]=new Ft(a,f)}return i?It(i,t.primIndex):t}function sn(e,t,n,r,i){var s=co(e,t.line);if(s.markedSpans)for(var o=0;o<s.markedSpans.length;++o){var u=s.markedSpans[o],a=u.marker;if((u.from==null||(a.inclusiveLeft?u.from<=t.ch:u.from<t.ch))&&(u.to==null||(a.inclusiveRight?u.to>=t.ch:u.to>t.ch))){if(i){Xo(a,"beforeCursorEnter");if(a.explicitlyCleared){if(!s.markedSpans)break;--o;continue}}if(!a.atomic)continue;if(n){var f=a.find(r<0?1:-1),l;if(r<0?a.inclusiveRight:a.inclusiveLeft)f=un(e,f,-r,f&&f.line==t.line?s:null);if(f&&f.line==t.line&&(l=yt(f,n))&&(r<0?l<0:l>0))return sn(e,f,t,r,i)}var c=a.find(r<0?-1:1);if(r<0?a.inclusiveLeft:a.inclusiveRight)c=un(e,c,r,c.line==t.line?s:null);return c?sn(e,c,t,r,i):null}}return t}function on(e,t,n,r,i){var s=r||1,o=sn(e,t,n,s,i)||!i&&sn(e,t,n,s,!0)||sn(e,t,n,-s,i)||!i&&sn(e,t,n,-s,!0);return o?o:(e.cantEdit=!0,gt(e.first,0))}function un(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?Ut(e,gt(t.line-1)):null:n>0&&t.ch==(r||co(e,t.line)).text.length?t.line<e.first+e.size-1?gt(t.line+1,0):null:new gt(t.line,t.ch+n)}function an(e){e.display.input.showSelection(e.display.input.prepareSelection())}function fn(e,t){var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),s=r.selection=document.createDocumentFragment();for(var o=0;o<n.sel.ranges.length;o++){if(t===!1&&o==n.sel.primIndex)continue;var u=n.sel.ranges[o];if(u.from().line>=e.display.viewTo||u.to().line<e.display.viewFrom)continue;var a=u.empty();(a||e.options.showCursorWhenSelecting)&&ln(e,u.head,i),a||cn(e,u,s)}return r}function ln(e,t,n){var r=zn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(Tu("div"," ","CodeMirror-cursor"));i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px";if(r.other){var s=n.appendChild(Tu("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=r.other.left+"px",s.style.top=r.other.top+"px",s.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function cn(e,t,n){function f(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),s.appendChild(Tu("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(n==null?a-e:n)+"px; height: "+(r-t)+"px"))}function l(t,n,r){function h(n,r){return Un(e,gt(t,n),"div",s,r)}var s=co(i,t),o=s.text.length,l,c;return Ku(bo(s),n||0,r==null?o:r,function(e,t,i){var s=h(e,"left"),p,d,v;if(e==t)p=s,d=v=s.left;else{p=h(t-1,"right");if(i=="rtl"){var m=s;s=p,p=m}d=s.left,v=p.right}n==null&&e==0&&(d=u),p.top-s.top>3&&(f(d,s.top,null,s.bottom),d=u,s.bottom<p.top&&f(d,s.bottom,null,p.top)),r==null&&t==o&&(v=a);if(!l||s.top<l.top||s.top==l.top&&s.left<l.left)l=s;if(!c||p.bottom>c.bottom||p.bottom==c.bottom&&p.right>c.right)c=p;d<u+1&&(d=u),f(d,p.top,v-d,p.bottom)}),{start:l,end:c}}var r=e.display,i=e.doc,s=document.createDocumentFragment(),o=bn(e.display),u=o.left,a=Math.max(r.sizerWidth,En(e)-r.sizer.offsetLeft)-o.right,c=t.from(),h=t.to();if(c.line==h.line)l(c.line,c.ch,h.ch);else{var p=co(i,c.line),d=co(i,h.line),v=Ts(p)==Ts(d),m=l(c.line,c.ch,v?p.text.length+1:null).end,g=l(h.line,v?0:null,h.ch).start;v&&(m.top<g.top-2?(f(m.right,m.top,null,m.bottom),f(u,g.top,g.left,g.bottom)):f(m.right,m.top,g.left-m.right,m.bottom)),m.bottom<g.top&&f(u,m.bottom,null,g.top)}n.appendChild(s)}function hn(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function pn(e,t){e.doc.mode.startState&&e.doc.frontier<e.display.viewTo&&e.state.highlight.set(t,gu(dn,e))}function dn(e){var t=e.doc;t.frontier<t.first&&(t.frontier=t.first);if(t.frontier>=e.display.viewTo)return;var n=+(new Date)+e.options.workTime,r=Ri(t.mode,mn(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(s){if(t.frontier>=e.display.viewFrom){var o=s.styles,u=s.text.length>e.options.maxHighlightLength,a=Us(e,s,u?Ri(t.mode,r):r,!0);s.styles=a.styles;var f=s.styleClasses,l=a.classes;l?s.styleClasses=l:f&&(s.styleClasses=null);var c=!o||o.length!=s.styles.length||f!=l&&(!f||!l||f.bgClass!=l.bgClass||f.textClass!=l.textClass);for(var h=0;!c&&h<o.length;++h)c=o[h]!=s.styles[h];c&&i.push(t.frontier),s.stateAfter=u?r:Ri(t.mode,r)}else s.text.length<=e.options.maxHighlightLength&&Ws(e,s.text,r),s.stateAfter=t.frontier%5==0?Ri(t.mode,r):null;++t.frontier;if(+(new Date)>n)return pn(e,e.options.workDelay),!0}),i.length&&ar(e,function(){for(var t=0;t<i.length;t++)vr(e,i[t],"text")})}function vn(e,t,n){var r,i,s=e.doc,o=n?-1:t-(e.doc.mode.innerMode?1e3:100);for(var u=t;u>o;--u){if(u<=s.first)return s.first;var a=co(s,u-1);if(a.stateAfter&&(!n||u<=s.frontier))return u;var f=su(a.text,null,e.options.tabSize);if(i==null||r>f)i=u-1,r=f}return i}function mn(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return!0;var s=vn(e,t,n),o=s>r.first&&co(r,s-1).stateAfter;return o?o=Ri(r.mode,o):o=Ui(r.mode),r.iter(s,t,function(n){Ws(e,n.text,o);var u=s==t-1||s%5==0||s>=i.viewFrom&&s<i.viewTo;n.stateAfter=u?Ri(r.mode,o):null,++s}),n&&(r.frontier=s),o}function gn(e){return e.lineSpace.offsetTop}function yn(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function bn(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=ku(e.measure,Tu("pre","x")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function wn(e){return Zo-e.display.nativeBarWidth}function En(e){return e.display.scroller.clientWidth-wn(e)-e.display.barWidth}function Sn(e){return e.display.scroller.clientHeight-wn(e)-e.display.barHeight}function xn(e,t,n){var r=e.options.lineWrapping,i=r&&En(e);if(!t.measure.heights||r&&t.measure.width!=i){var s=t.measure.heights=[];if(r){t.measure.width=i;var o=t.text.firstChild.getClientRects();for(var u=0;u<o.length-1;u++){var a=o[u],f=o[u+1];Math.abs(a.bottom-f.bottom)>2&&s.push((a.bottom+f.top)/2-n.top)}}s.push(n.bottom-n.top)}}function Tn(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var r=0;r<e.rest.length;r++)if(mo(e.rest[r])>n)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Nn(e,t){t=Ts(t);var n=mo(t),r=e.display.externalMeasured=new hr(e.doc,t,n);r.lineN=n;var i=r.built=Js(e,r);return r.text=i.pre,ku(e.display.lineMeasure,i.pre),r}function Cn(e,t,n,r){return An(e,Ln(e,t),n,r)}function kn(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[gr(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function Ln(e,t){var n=mo(t),r=kn(e,n);r&&!r.text?r=null:r&&r.changes&&(st(e,r,n,rt(e)),e.curOp.forceUpdate=!0),r||(r=Nn(e,t));var i=Tn(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function An(e,t,n,r,i){t.before&&(n=-1);var s=n+(r||""),o;return t.cache.hasOwnProperty(s)?o=t.cache[s]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(xn(e,t.view,t.rect),t.hasHeights=!0),o=Dn(e,t,n,r),o.bogus||(t.cache[s]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}function Mn(e,t,n){var r,i,s,o;for(var u=0;u<e.length;u+=3){var a=e[u],f=e[u+1];if(t<a)i=0,s=1,o="left";else if(t<f)i=t-a,s=i+1;else if(u==e.length-3||t==f&&e[u+3]>t)s=f-a,i=s-1,t>=f&&(o="right");if(i!=null){r=e[u+2],a==f&&n==(r.insertLeft?"left":"right")&&(o=n);if(n=="left"&&i==0)while(u&&e[u-2]==e[u-3]&&e[u-1].insertLeft)r=e[(u-=3)+2],o="left";if(n=="right"&&i==f-a)while(u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft)r=e[(u+=3)+2],o="right";break}}return{node:r,start:i,end:s,collapse:o,coverStart:a,coverEnd:f}}function _n(e,t){var n=On;if(t=="left"){for(var r=0;r<e.length;r++)if((n=e[r]).left!=n.right)break}else for(var r=e.length-1;r>=0;r--)if((n=e[r]).left!=n.right)break;return n}function Dn(e,t,n,r){var i=Mn(t.map,n,r),u=i.node,a=i.start,f=i.end,l=i.collapse,c;if(u.nodeType==3){for(var h=0;h<4;h++){while(a&&xu(t.line.text.charAt(i.coverStart+a)))--a;while(i.coverStart+f<i.coverEnd&&xu(t.line.text.charAt(i.coverStart+f)))++f;s&&o<9&&a==0&&f==i.coverEnd-i.coverStart?c=u.parentNode.getBoundingClientRect():c=_n(Nu(u,a,f).getClientRects(),r);if(c.left||c.right||a==0)break;f=a,a-=1,l="right"}s&&o<11&&(c=Pn(e.display.measure,c))}else{a>0&&(l=r="right");var p;e.options.lineWrapping&&(p=u.getClientRects()).length>1?c=p[r=="right"?p.length-1:0]:c=u.getBoundingClientRect()}if(s&&o<9&&!a&&(!c||!c.left&&!c.right)){var d=u.parentNode.getClientRects()[0];d?c={left:d.left,right:d.left+Qn(e.display),top:d.top,bottom:d.bottom}:c=On}var v=c.top-t.rect.top,m=c.bottom-t.rect.top,g=(v+m)/2,y=t.view.measure.heights;for(var h=0;h<y.length-1;h++)if(g<y[h])break;var b=h?y[h-1]:0,w=y[h],E={left:(l=="right"?c.right:c.left)-t.rect.left,right:(l=="left"?c.left:c.right)-t.rect.left,top:b,bottom:w};return!c.left&&!c.right&&(E.bogus=!0),e.options.singleCursorHeightPerLine||(E.rtop=v,E.rbottom=m),E}function Pn(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!$u(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function Hn(e){if(e.measure){e.measure.cache={},e.measure.heights=null;if(e.rest)for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}}function Bn(e){e.display.externalMeasure=null,Cu(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Hn(e.display.view[t])}function jn(e){Bn(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Fn(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function In(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function qn(e,t,n,r){if(t.widgets)for(var i=0;i<t.widgets.length;++i)if(t.widgets[i].above){var s=_s(t.widgets[i]);n.top+=s,n.bottom+=s}if(r=="line")return n;r||(r="local");var o=yo(t);r=="local"?o+=gn(e.display):o-=e.display.viewOffset;if(r=="page"||r=="window"){var u=e.display.lineSpace.getBoundingClientRect();o+=u.top+(r=="window"?0:In());var a=u.left+(r=="window"?0:Fn());n.left+=a,n.right+=a}return n.top+=o,n.bottom+=o,n}function Rn(e,t,n){if(n=="div")return t;var r=t.left,i=t.top;if(n=="page")r-=Fn(),i-=In();else if(n=="local"||!n){var s=e.display.sizer.getBoundingClientRect();r+=s.left,i+=s.top}var o=e.display.lineSpace.getBoundingClientRect();return{left:r-o.left,top:i-o.top}}function Un(e,t,n,r,i){return r||(r=co(e.doc,t.line)),qn(e,r,Cn(e,r,t.ch,i),n)}function zn(e,t,n,r,i,s){function o(t,o){var u=An(e,i,t,o?"right":"left",s);return o?u.left=u.right:u.right=u.left,qn(e,r,u,n)}function u(e,t){var n=a[t],r=n.level%2;return e==Qu(n)&&t&&n.level<a[t-1].level?(n=a[--t],e=Gu(n)-(n.level%2?0:1),r=!0):e==Gu(n)&&t<a.length-1&&n.level<a[t+1].level&&(n=a[++t],e=Qu(n)-n.level%2,r=!1),r&&e==n.to&&e>n.from?o(e-1):o(e,r)}r=r||co(e.doc,t.line),i||(i=Ln(e,r));var a=bo(r),f=t.ch;if(!a)return o(f);var l=sa(a,f),c=u(f,l);return ia!=null&&(c.other=u(f,ia)),c}function Wn(e,t){var n=0,t=Ut(e.doc,t);e.options.lineWrapping||(n=Qn(e.display)*t.ch);var r=co(e.doc,t.line),i=yo(r)+gn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Xn(e,t,n,r){var i=gt(e,t);return i.xRel=r,n&&(i.outside=!0),i}function Vn(e,t,n){var r=e.doc;n+=e.display.viewOffset;if(n<0)return Xn(r.first,0,!0,-1);var i=go(r,n),s=r.first+r.size-1;if(i>s)return Xn(r.first+r.size-1,co(r,s).text.length,!0,1);t<0&&(t=0);var o=co(r,i);for(;;){var u=$n(e,o,i,t,n),a=Ss(o),f=a&&a.find(0,!0);if(!a||!(u.ch>f.from.ch||u.ch==f.from.ch&&u.xRel>0))return u;i=mo(o=f.to.line)}}function $n(e,t,n,r,i){function f(r){var i=zn(e,gt(n,r),"line",t,a);return o=!0,s>i.bottom?i.left-u:s<i.top?i.left+u:(o=!1,i.left)}var s=i-yo(t),o=!1,u=2*e.display.wrapper.clientWidth,a=Ln(e,t),l=bo(t),c=t.text.length,h=Yu(t),p=Zu(t),d=f(h),v=o,m=f(p),g=o;if(r>m)return Xn(n,p,g,1);for(;;){if(l?p==h||p==ua(t,h,1):p-h<=1){var y=r<d||r-d<=m-r?h:p,b=y==h?v:g,w=r-(y==h?d:m);if(g&&!l&&!/\s/.test(t.text.charAt(y))&&w>0&&y<t.text.length&&a.view.measure.heights.length>1){var E=An(e,a,y,"right");s<=E.bottom&&s>=E.top&&Math.abs(r-E.right)<w&&(b=!1,y++,w=r-E.right)}while(xu(t.text.charAt(y)))++y;var S=Xn(n,y,b,w<-1?-1:w>1?1:0);return S}var x=Math.ceil(c/2),T=h+x;if(l){T=h;for(var N=0;N<x;++N)T=ua(t,T,1)}var C=f(T);if(C>r){p=T,m=C;if(g=o)m+=1e3;c=x}else h=T,d=C,v=o,c-=x}}function Kn(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Jn==null){Jn=Tu("pre");for(var t=0;t<49;++t)Jn.appendChild(document.createTextNode("x")),Jn.appendChild(Tu("br"));Jn.appendChild(document.createTextNode("x"))}ku(e.measure,Jn);var n=Jn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),Cu(e.measure),n||1}function Qn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=Tu("span","xxxxxxxxxx"),n=Tu("pre",[t]);ku(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Zn(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Yn},Gn?Gn.ops.push(e.curOp):e.curOp.ownsGroup=Gn={ops:[e.curOp],delayedCallbacks:[]}}function er(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)while(i.cursorActivityCalled<i.cursorActivityHandlers.length)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function tr(e){var t=e.curOp,n=t.ownsGroup;if(!n)return;try{er(n)}finally{Gn=null;for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;nr(n)}}function nr(e){var t=e.ops;for(var n=0;n<t.length;n++)rr(t[n]);for(var n=0;n<t.length;n++)ir(t[n]);for(var n=0;n<t.length;n++)sr(t[n]);for(var n=0;n<t.length;n++)or(t[n]);for(var n=0;n<t.length;n++)ur(t[n])}function rr(e){var t=e.cm,n=t.display;Q(t),e.updateMaxLine&&B(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new K(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function ir(e){e.updatedDisplay=e.mustUpdate&&G(e.cm,e.update)}function sr(e){var t=e.cm,n=t.display;e.updatedDisplay&&tt(t),e.barMeasure=F(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Cn(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+wn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-En(t)));if(e.updatedDisplay||e.selectionChanged)e.preparedSelection=n.input.prepareSelection(e.focus)}function or(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&qr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==Au()&&(!document.hasFocus||document.hasFocus());e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&U(t,e.barMeasure),e.updatedDisplay&&et(t,e.barMeasure),e.selectionChanged&&hn(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&St(e.cm)}function ur(e){var t=e.cm,n=t.display,r=t.doc;e.updatedDisplay&&Y(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&(n.scroller.scrollTop!=e.scrollTop||e.forceScroll)&&(r.scrollTop=Math.max(0,Math.min(n.scroller.scrollHeight-n.scroller.clientHeight,e.scrollTop)),n.scrollbars.setScrollTop(r.scrollTop),n.scroller.scrollTop=r.scrollTop),e.scrollLeft!=null&&(n.scroller.scrollLeft!=e.scrollLeft||e.forceScroll)&&(r.scrollLeft=Math.max(0,Math.min(n.scroller.scrollWidth-n.scroller.clientWidth,e.scrollLeft)),n.scrollbars.setScrollLeft(r.scrollLeft),n.scroller.scrollLeft=r.scrollLeft,X(t));if(e.scrollToPos){var i=Ei(t,Ut(r,e.scrollToPos.from),Ut(r,e.scrollToPos.to),e.scrollToPos.margin);e.scrollToPos.isCursor&&t.state.focused&&wi(t,i)}var s=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(s)for(var u=0;u<s.length;++u)s[u].lines.length||Xo(s[u],"hide");if(o)for(var u=0;u<o.length;++u)o[u].lines.length&&Xo(o[u],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Xo(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function ar(e,t){if(e.curOp)return t();Zn(e);try{return t()}finally{tr(e)}}function fr(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Zn(e);try{return t.apply(e,arguments)}finally{tr(e)}}}function lr(e){return function(){if(this.curOp)return e.apply(this,arguments);Zn(this);try{return e.apply(this,arguments)}finally{tr(this)}}}function cr(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Zn(t);try{return e.apply(this,arguments)}finally{tr(t)}}}function hr(e,t,n){this.line=t,this.rest=Ns(t),this.size=this.rest?mo(fu(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Ls(e,t)}function pr(e,t,n){var r=[],i;for(var s=t;s<n;s=i){var o=new hr(e.doc,co(e.doc,s),s);i=s+o.size,r.push(o)}return r}function dr(e,t,n,r){t==null&&(t=e.doc.first),n==null&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;r&&n<i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0;if(t>=i.viewTo)x&&Cs(e.doc,t)<i.viewTo&&mr(e);else if(n<=i.viewFrom)x&&ks(e.doc,n+r)>i.viewFrom?mr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)mr(e);else if(t<=i.viewFrom){var s=yr(e,n,n+r,1);s?(i.view=i.view.slice(s.index),i.viewFrom=s.lineN,i.viewTo+=r):mr(e)}else if(n>=i.viewTo){var s=yr(e,t,t,-1);s?(i.view=i.view.slice(0,s.index),i.viewTo=s.lineN):mr(e)}else{var o=yr(e,t,t,-1),u=yr(e,n,n+r,1);o&&u?(i.view=i.view.slice(0,o.index).concat(pr(e,o.lineN,u.lineN)).concat(i.view.slice(u.index)),i.viewTo+=r):mr(e)}var a=i.externalMeasured;a&&(n<a.lineN?a.lineN+=r:t<a.lineN+a.size&&(i.externalMeasured=null))}function vr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null);if(t<r.viewFrom||t>=r.viewTo)return;var s=r.view[gr(e,t)];if(s.node==null)return;var o=s.changes||(s.changes=[]);cu(o,n)==-1&&o.push(n)}function mr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function gr(e,t){if(t>=e.display.viewTo)return null;t-=e.display.viewFrom;if(t<0)return null;var n=e.display.view;for(var r=0;r<n.length;r++){t-=n[r].size;if(t<0)return r}}function yr(e,t,n,r){var i=gr(e,t),s,o=e.display.view;if(!x||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var u=0,a=e.display.viewFrom;u<i;u++)a+=o[u].size;if(a!=t){if(r>0){if(i==o.length-1)return null;s=a+o[i].size-t,i++}else s=a-t;t+=s,n+=s}while(Cs(e.doc,n)!=n){if(i==(r<0?0:o.length-1))return null;n+=r*o[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function br(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=pr(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=pr(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(gr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(pr(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,gr(e,n)))),r.viewTo=n}function wr(e){var t=e.display.view,n=0;for(var r=0;r<t.length;r++){var i=t[r];!i.hidden&&(!i.node||i.changes)&&++n}return n}function Er(e){function i(){t.activeTouch&&(n=setTimeout(function(){t.activeTouch=null},1e3),r=t.activeTouch,r.end=+(new Date))}function u(e){if(e.touches.length!=1)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function a(e,t){if(t.left==null)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}var t=e.display;Ro(t.scroller,"mousedown",fr(e,Cr)),s&&o<11?Ro(t.scroller,"dblclick",fr(e,function(t){if(Ko(e,t))return;var n=Nr(e,t);if(!n||Dr(e,t)||Tr(e.display,t))return;Ho(t);var r=e.findWordAt(n);$t(e.doc,r.anchor,r.head)})):Ro(t.scroller,"dblclick",function(t){Ko(e,t)||Ho(t)}),E||Ro(t.scroller,"contextmenu",function(t){si(e,t)});var n,r={end:0};Ro(t.scroller,"touchstart",function(i){if(!Ko(e,i)&&!u(i)){clearTimeout(n);var s=+(new Date);t.activeTouch={start:s,moved:!1,prev:s-r.end<=300?r:null},i.touches.length==1&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}}),Ro(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ro(t.scroller,"touchend",function(n){var r=t.activeTouch;if(r&&!Tr(t,n)&&r.left!=null&&!r.moved&&new Date-r.start<300){var s=e.coordsChar(t.activeTouch,"page"),o;!r.prev||a(r,r.prev)?o=new Ft(s,s):!r.prev.prev||a(r,r.prev.prev)?o=e.findWordAt(s):o=new Ft(gt(s.line,0),Ut(e.doc,gt(s.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),Ho(n)}i()}),Ro(t.scroller,"touchcancel",i),Ro(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Ir(e,t.scroller.scrollTop),qr(e,t.scroller.scrollLeft,!0),Xo(e,"scroll",e))}),Ro(t.scroller,"mousewheel",function(t){Wr(e,t)}),Ro(t.scroller,"DOMMouseScroll",function(t){Wr(e,t)}),Ro(t.wrapper,"scroll",function(){t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(t){Ko(e,t)||Fo(t)},over:function(t){Ko(e,t)||(jr(e,t),Fo(t))},start:function(t){Br(e,t)},drop:fr(e,Hr),leave:function(t){Ko(e,t)||Fr(e)}};var f=t.input.getField();Ro(f,"keyup",function(t){ei.call(e,t)}),Ro(f,"keydown",fr(e,Yr)),Ro(f,"keypress",fr(e,ti)),Ro(f,"focus",gu(ri,e)),Ro(f,"blur",gu(ii,e))}function Sr(e,t,n){var r=n&&n!=T.Init;if(!t!=!r){var i=e.display.dragFunctions,s=t?Ro:Wo;s(e.display.scroller,"dragstart",i.start),s(e.display.scroller,"dragenter",i.enter),s(e.display.scroller,"dragover",i.over),s(e.display.scroller,"dragleave",i.leave),s(e.display.scroller,"drop",i.drop)}}function xr(e){var t=e.display;if(t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth)return;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}function Tr(e,t){for(var n=Io(t);n!=e.wrapper;n=n.parentNode)if(!n||n.nodeType==1&&n.getAttribute("cm-ignore-events")=="true"||n.parentNode==e.sizer&&n!=e.mover)return!0}function Nr(e,t,n,r){var i=e.display;if(!n&&Io(t).getAttribute("cm-not-content")=="true")return null;var s,o,u=i.lineSpace.getBoundingClientRect();try{s=t.clientX-u.left,o=t.clientY-u.top}catch(t){return null}var a=Vn(e,s,o),f;if(r&&a.xRel==1&&(f=co(e.doc,a.line).text).length==a.ch){var l=su(f,f.length,e.options.tabSize)-f.length;a=gt(a.line,Math.max(0,Math.round((s-bn(e.display).left)/Qn(e.display))-l))}return a}function Cr(e){var t=this,n=t.display;if(Ko(t,e)||n.activeTouch&&n.input.supportsTouch())return;n.shift=e.shiftKey;if(Tr(n,e)){u||(n.scroller.draggable=!1,setTimeout(function(){n.scroller.draggable=!0},100));return}if(Dr(t,e))return;var r=Nr(t,e);window.focus();switch(qo(e)){case 1:t.state.selectingText?t.state.selectingText(e):r?Ar(t,e,r):Io(e)==n.scroller&&Ho(e);break;case 2:u&&(t.state.lastMiddleDown=+(new Date)),r&&$t(t.doc,r),setTimeout(function(){n.input.focus()},20),Ho(e);break;case 3:E?si(t,e):ni(t)}}function Ar(e,t,n){s?setTimeout(gu(St,e),0):e.curOp.focus=Au();var r=+(new Date),i;Lr&&Lr.time>r-400&&yt(Lr.pos,n)==0?i="triple":kr&&kr.time>r-400&&yt(kr.pos,n)==0?(i="double",Lr={time:r,pos:n}):(i="single",kr={time:r,pos:n});var o=e.doc.sel,u=m?t.metaKey:t.ctrlKey,a;e.options.dragDrop&&Fu&&!e.isReadOnly()&&i=="single"&&(a=o.contains(n))>-1&&(yt((a=o.ranges[a]).from(),n)<0||n.xRel>0)&&(yt(a.to(),n)>0||n.xRel<0)?Or(e,t,n,u):Mr(e,t,n,i,u)}function Or(e,t,n,r){var i=e.display,a=+(new Date),f=fr(e,function(l){u&&(i.scroller.draggable=!1),e.state.draggingText=!1,Wo(document,"mouseup",f),Wo(i.scroller,"drop",f),Math.abs(t.clientX-l.clientX)+Math.abs(t.clientY-l.clientY)<10&&(Ho(l),!r&&+(new Date)-200<a&&$t(e.doc,n),u||s&&o==9?setTimeout(function(){document.body.focus(),i.input.focus()},20):i.input.focus())});u&&(i.scroller.draggable=!0),e.state.draggingText=f,f.copy=m?t.altKey:t.ctrlKey,i.scroller.dragDrop&&i.scroller.dragDrop(),Ro(document,"mouseup",f),Ro(i.scroller,"drop",f)}function Mr(e,t,n,r,i){function d(t){if(yt(p,t)==0)return;p=t;if(r=="rect"){var i=[],s=e.options.tabSize,l=su(co(o,n.line).text,n.ch,s),c=su(co(o,t.line).text,t.ch,s),h=Math.min(l,c),d=Math.max(l,c);for(var v=Math.min(n.line,t.line),m=Math.min(e.lastLine(),Math.max(n.line,t.line));v<=m;v++){var g=co(o,v).text,y=ou(g,h,s);h==d?i.push(new Ft(gt(v,y),gt(v,y))):g.length>y&&i.push(new Ft(gt(v,y),gt(v,ou(g,d,s))))}i.length||i.push(new Ft(n,n)),Zt(o,It(f.ranges.slice(0,a).concat(i),a),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b=u,w=b.anchor,E=t;if(r!="single"){if(r=="double")var S=e.findWordAt(t);else var S=new Ft(gt(t.line,0),Ut(o,gt(t.line+1,0)));yt(S.anchor,w)>0?(E=S.head,w=Et(b.from(),S.anchor)):(E=S.anchor,w=wt(b.to(),S.head))}var i=f.ranges.slice(0);i[a]=new Ft(Ut(o,w),E),Zt(o,It(i,a),nu)}}function y(t){var n=++m,i=Nr(e,t,!0,r=="rect");if(!i)return;if(yt(i,p)!=0){e.curOp.focus=Au(),d(i);var u=W(s,o);(i.line>=u.to||i.line<u.from)&&setTimeout(fr(e,function(){m==n&&y(t)}),150)}else{var a=t.clientY<v.top?-20:t.clientY>v.bottom?20:0;a&&setTimeout(fr(e,function(){if(m!=n)return;s.scroller.scrollTop+=a,y(t)}),50)}}function b(t){e.state.selectingText=!1,m=Infinity,Ho(t),s.input.focus(),Wo(document,"mousemove",w),Wo(document,"mouseup",E),o.history.lastSelOrigin=null}var s=e.display,o=e.doc;Ho(t);var u,a,f=o.sel,l=f.ranges;i&&!t.shiftKey?(a=o.sel.contains(n),a>-1?u=l[a]:u=new Ft(n,n)):(u=o.sel.primary(),a=o.sel.primIndex);if(g?t.shiftKey&&t.metaKey:t.altKey)r="rect",i||(u=new Ft(n,n)),n=Nr(e,t,!0,!0),a=-1;else if(r=="double"){var c=e.findWordAt(n);e.display.shift||o.extend?u=Vt(o,u,c.anchor,c.head):u=c}else if(r=="triple"){var h=new Ft(gt(n.line,0),Ut(o,gt(n.line+1,0)));e.display.shift||o.extend?u=Vt(o,u,h.anchor,h.head):u=h}else u=Vt(o,u,n);i?a==-1?(a=l.length,Zt(o,It(l.concat([u]),a),{scroll:!1,origin:"*mouse"})):l.length>1&&l[a].empty()&&r=="single"&&!t.shiftKey?(Zt(o,It(l.slice(0,a).concat(l.slice(a+1)),0),{scroll:!1,origin:"*mouse"}),f=o.sel):Kt(o,a,u,nu):(a=0,Zt(o,new jt([u],0),nu),f=o.sel);var p=n,v=s.wrapper.getBoundingClientRect(),m=0,w=fr(e,function(e){qo(e)?y(e):b(e)}),E=fr(e,b);e.state.selectingText=E,Ro(document,"mousemove",w),Ro(document,"mouseup",E)}function _r(e,t,n,r){try{var i=t.clientX,s=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Ho(t);var o=e.display,u=o.lineDiv.getBoundingClientRect();if(s>u.bottom||!Go(e,n))return jo(t);s-=u.top-o.viewOffset;for(var a=0;a<e.options.gutters.length;++a){var f=o.gutters.childNodes[a];if(f&&f.getBoundingClientRect().right>=i){var l=go(e.doc,s),c=e.options.gutters[a];return Xo(e,n,e,l,c,t),jo(t)}}}function Dr(e,t){return _r(e,t,"gutterClick",!0)}function Hr(e){var t=this;Fr(t);if(Ko(t,e)||Tr(t.display,e))return;Ho(e),s&&(Pr=+(new Date));var n=Nr(t,e,!0),r=e.dataTransfer.files;if(!n||t.isReadOnly())return;if(r&&r.length&&window.FileReader&&window.File){var i=r.length,o=Array(i),u=0,a=function(e,r){if(t.options.allowDropFileTypes&&cu(t.options.allowDropFileTypes,e.type)==-1)return;var s=new FileReader;s.onload=fr(t,function(){var e=s.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[r]=e;if(++u==i){n=Ut(t.doc,n);var a={from:n,to:n,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};pi(t.doc,a),Yt(t.doc,qt(n,ui(a)))}}),s.readAsText(e)};for(var f=0;f<i;++f)a(r[f],f)}else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){t.display.input.focus()},20);return}try{var o=e.dataTransfer.getData("Text");if(o){if(t.state.draggingText&&!t.state.draggingText.copy)var l=t.listSelections();en(t.doc,qt(n,n));if(l)for(var f=0;f<l.length;++f)bi(t.doc,"",l[f].anchor,l[f].head,"drag");t.replaceSelection(o,"around","paste"),t.display.input.focus()}}catch(e){}}}function Br(e,t){if(s&&(!e.state.draggingText||+(new Date)-Pr<100)){Fo(t);return}if(Ko(e,t)||Tr(e.display,t))return;t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove";if(t.dataTransfer.setDragImage&&!c){var n=Tu("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",l&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),l&&n.parentNode.removeChild(n)}}function jr(e,t){var n=Nr(e,t);if(!n)return;var r=document.createDocumentFragment();ln(e,n,r),e.display.dragCursor||(e.display.dragCursor=Tu("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),ku(e.display.dragCursor,r)}function Fr(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ir(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;e.doc.scrollTop=t,n||Z(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),n&&Z(e),pn(e,100)}function qr(e,t,n){if(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)return;t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,X(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Wr(e,t){var r=zr(t),i=r.x,s=r.y,o=e.display,a=o.scroller,f=a.scrollWidth>a.clientWidth,c=a.scrollHeight>a.clientHeight;if(!(i&&f||s&&c))return;if(s&&m&&u)e:for(var h=t.target,p=o.view;h!=a;h=h.parentNode)for(var d=0;d<p.length;d++)if(p[d].node==h){e.display.currentWheelTarget=h;break e}if(i&&!n&&!l&&Ur!=null){s&&c&&Ir(e,Math.max(0,Math.min(a.scrollTop+s*Ur,a.scrollHeight-a.clientHeight))),qr(e,Math.max(0,Math.min(a.scrollLeft+i*Ur,a.scrollWidth-a.clientWidth))),(!s||s&&c)&&Ho(t),o.wheelStartX=null;return}if(s&&Ur!=null){var v=s*Ur,g=e.doc.scrollTop,y=g+o.wrapper.clientHeight;v<0?g=Math.max(0,g+v-50):y=Math.min(e.doc.height,y+v+50),Z(e,{top:g,bottom:y})}Rr<20&&(o.wheelStartX==null?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=i,o.wheelDY=s,setTimeout(function(){if(o.wheelStartX==null)return;var e=a.scrollLeft-o.wheelStartX,t=a.scrollTop-o.wheelStartY,n=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null;if(!n)return;Ur=(Ur*Rr+n)/(Rr+1),++Rr},200)):(o.wheelDX+=i,o.wheelDY+=s))}function Xr(e,t,n){if(typeof t=="string"){t=zi[t];if(!t)return!1}e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=eu}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function Vr(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Vi(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Vi(t,e.options.extraKeys,n,e)||Vi(t,e.options.keyMap,n,e)}function Jr(e,t,n,r){var i=e.state.keySeq;if(i){if($i(t))return"handled";$r.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),t=i+" "+t}var s=Vr(e,t,r);s=="multi"&&(e.state.keySeq=t),s=="handled"&&$o(e,"keyHandled",e,t,n);if(s=="handled"||s=="multi")Ho(n),hn(e);return i&&!s&&/\'$/.test(t)?(Ho(n),!0):!!s}function Kr(e,t){var n=Ji(t,!0);return n?t.shiftKey&&!e.state.keySeq?Jr(e,"Shift-"+n,t,function(t){return Xr(e,t,!0)})||Jr(e,n,t,function(t){if(typeof t=="string"?/^go[A-Z]/.test(t):t.motion)return Xr(e,t)}):Jr(e,n,t,function(t){return Xr(e,t)}):!1}function Qr(e,t,n){return Jr(e,"'"+n+"'",t,function(t){return Xr(e,t,!0)})}function Yr(e){var t=this;t.curOp.focus=Au();if(Ko(t,e))return;s&&o<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var r=Kr(t,e);l&&(Gr=r?n:null,!r&&n==88&&!Xu&&(m?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Zr(t)}function Zr(e){function n(e){if(e.keyCode==18||!e.altKey)Mu(t,"CodeMirror-crosshair"),Wo(document,"keyup",n),Wo(document,"mouseover",n)}var t=e.display.lineDiv;_u(t,"CodeMirror-crosshair"),Ro(document,"keyup",n),Ro(document,"mouseover",n)}function ei(e){e.keyCode==16&&(this.doc.sel.shift=!1),Ko(this,e)}function ti(e){var t=this;if(Tr(t.display,e)||Ko(t,e)||e.ctrlKey&&!e.altKey||m&&e.metaKey)return;var n=e.keyCode,r=e.charCode;if(l&&n==Gr){Gr=null,Ho(e);return}if(l&&(!e.which||e.which<10)&&Kr(t,e))return;var i=String.fromCharCode(r==null?n:r);if(Qr(t,e,i))return;t.display.input.onKeyPress(e)}function ni(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,ii(e))},100)}function ri(e){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1);if(e.options.readOnly=="nocursor")return;e.state.focused||(Xo(e,"focus",e),e.state.focused=!0,_u(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),u&&setTimeout(function(){e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),hn(e)}function ii(e){if(e.state.delayingBlurEvent)return;e.state.focused&&(Xo(e,"blur",e),e.state.focused=!1,Mu(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function si(e,t){if(Tr(e.display,t)||oi(e,t))return;if(Ko(e,t,"contextmenu"))return;e.display.input.onContextMenu(t)}function oi(e,t){return Go(e,"gutterContextMenu")?_r(e,t,"gutterContextMenu",!1):!1}function ai(e,t){if(yt(e,t.from)<0)return e;if(yt(e,t.to)<=0)return ui(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=ui(t).ch-t.to.ch),gt(n,r)}function fi(e,t){var n=[];for(var r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new Ft(ai(i.anchor,t),ai(i.head,t)))}return It(n,e.sel.primIndex)}function li(e,t,n){return e.line==t.line?gt(n.line,e.ch-t.ch+n.ch):gt(n.line+(e.line-t.line),e.ch)}function ci(e,t,n){var r=[],i=gt(e.first,0),s=i;for(var o=0;o<t.length;o++){var u=t[o],a=li(u.from,i,s),f=li(ui(u),i,s);i=u.to,s=f;if(n=="around"){var l=e.sel.ranges[o],c=yt(l.head,l.anchor)<0;r[o]=new Ft(c?f:a,c?a:f)}else r[o]=new Ft(a,a)}return new jt(r,e.sel.primIndex)}function hi(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){this.canceled=!0}};return n&&(r.update=function(t,n,r,i){t&&(this.from=Ut(e,t)),n&&(this.to=Ut(e,n)),r&&(this.text=r),i!==undefined&&(this.origin=i)}),Xo(e,"beforeChange",e,r),e.cm&&Xo(e.cm,"beforeChange",e.cm,r),r.canceled?null:{from:r.from,to:r.to,text:r.text,origin:r.origin}}function pi(e,t,n){if(e.cm){if(!e.cm.curOp)return fr(e.cm,pi)(e,t,n);if(e.cm.state.suppressEdits)return}if(Go(e,"beforeChange")||e.cm&&Go(e.cm,"beforeChange")){t=hi(e,t,!0);if(!t)return}var r=S&&!n&&ds(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)di(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text});else di(e,t)}function di(e,t){if(t.text.length==1&&t.text[0]==""&&yt(t.from,t.to)==0)return;var n=fi(e,t);To(e,t,n,e.cm?e.cm.curOp.id:NaN),gi(e,t,n,cs(e,t));var r=[];fo(e,function(e,n){!n&&cu(r,e.history)==-1&&(Po(e.history,t),r.push(e.history)),gi(e,t,null,cs(e,t))})}function vi(e,t,n){if(e.cm&&e.cm.state.suppressEdits&&!n)return;var r=e.history,i,s=e.sel,o=t=="undo"?r.done:r.undone,u=t=="undo"?r.undone:r.done;for(var a=0;a<o.length;a++){i=o[a];if(n?i.ranges&&!i.equals(e.sel):!i.ranges)break}if(a==o.length)return;r.lastOrigin=r.lastSelOrigin=null;for(;;){i=o.pop();if(!i.ranges)break;ko(i,u);if(n&&!i.equals(e.sel)){Zt(e,i,{clearRedo:!1});return}s=i}var f=[];ko(s,u),u.push({changes:f,generation:r.generation}),r.generation=i.generation||++r.maxGeneration;var l=Go(e,"beforeChange")||e.cm&&Go(e.cm,"beforeChange");for(var a=i.changes.length-1;a>=0;--a){var c=i.changes[a];c.origin=t;if(l&&!hi(e,c,!1)){o.length=0;return}f.push(Eo(e,c));var h=a?fi(e,c):fu(o);gi(e,c,h,ps(e,c)),!a&&e.cm&&e.cm.scrollIntoView({from:c.from,to:ui(c)});var p=[];fo(e,function(e,t){!t&&cu(p,e.history)==-1&&(Po(e.history,c),p.push(e.history)),gi(e,c,null,ps(e,c))})}}function mi(e,t){if(t==0)return;e.first+=t,e.sel=new jt(hu(e.sel.ranges,function(e){return new Ft(gt(e.anchor.line+t,e.anchor.ch),gt(e.head.line+t,e.head.ch))}),e.sel.primIndex);if(e.cm){dr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)vr(e.cm,r,"gutter")}}function gi(e,t,n,r){if(e.cm&&!e.cm.curOp)return fr(e.cm,gi)(e,t,n,r);if(t.to.line<e.first){mi(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);mi(e,i),t={from:gt(e.first,0),to:gt(t.to.line+i,t.to.ch),text:[fu(t.text)],origin:t.origin}}var s=e.lastLine();t.to.line>s&&(t={from:t.from,to:gt(s,co(e,s).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ho(e,t.from,t.to),n||(n=fi(e,t)),e.cm?yi(e.cm,t,r):no(e,t,r),en(e,n,tu)}function yi(e,t,n){var r=e.doc,i=e.display,s=t.from,o=t.to,u=!1,a=s.line;e.options.lineWrapping||(a=mo(Ts(co(r,s.line))),r.iter(a,o.line+1,function(e){if(e==i.maxLine)return u=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Qo(e),no(r,t,n,A(e)),e.options.lineWrapping||(r.iter(a,s.line+t.text.length,function(e){var t=H(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,u=!1)}),u&&(e.curOp.updateMaxLine=!0)),r.frontier=Math.min(r.frontier,s.line),pn(e,400);var f=t.text.length-(o.line-s.line)-1;t.full?dr(e):s.line==o.line&&t.text.length==1&&!to(e.doc,t)?vr(e,s.line,"text"):dr(e,s.line,o.line+1,f);var l=Go(e,"changes"),c=Go(e,"change");if(c||l){var h={from:s,to:o,text:t.text,removed:t.removed,origin:t.origin};c&&$o(e,"change",e,h),l&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}function bi(e,t,n,r,i){r||(r=n);if(yt(r,n)<0){var s=r;r=n,n=s}typeof t=="string"&&(t=e.splitLines(t)),pi(e,{from:n,to:r,text:t,origin:i})}function wi(e,t){if(Ko(e,"scrollCursorIntoView"))return;var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1);if(i!=null&&!p){var s=Tu("div","​",null,"position: absolute; top: "+(t.top-n.viewOffset-gn(e.display))+"px; height: "+(t.bottom-t.top+wn(e)+n.barHeight)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(s),s.scrollIntoView(i),e.display.lineSpace.removeChild(s)}}function Ei(e,t,n,r){r==null&&(r=0);for(var i=0;i<5;i++){var s=!1,o=zn(e,t),u=!n||n==t?o:zn(e,n),a=xi(e,Math.min(o.left,u.left),Math.min(o.top,u.top)-r,Math.max(o.left,u.left),Math.max(o.bottom,u.bottom)+r),f=e.doc.scrollTop,l=e.doc.scrollLeft;a.scrollTop!=null&&(Ir(e,a.scrollTop),Math.abs(e.doc.scrollTop-f)>1&&(s=!0)),a.scrollLeft!=null&&(qr(e,a.scrollLeft),Math.abs(e.doc.scrollLeft-l)>1&&(s=!0));if(!s)break}return o}function Si(e,t,n,r,i){var s=xi(e,t,n,r,i);s.scrollTop!=null&&Ir(e,s.scrollTop),s.scrollLeft!=null&&qr(e,s.scrollLeft)}function xi(e,t,n,r,i){var s=e.display,o=Kn(e.display);n<0&&(n=0);var u=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:s.scroller.scrollTop,a=Sn(e),f={};i-n>a&&(i=n+a);var l=e.doc.height+yn(s),c=n<o,h=i>l-o;if(n<u)f.scrollTop=c?0:n;else if(i>u+a){var p=Math.min(n,(h?l:i)-a);p!=u&&(f.scrollTop=p)}var d=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:s.scroller.scrollLeft,v=En(e)-(e.options.fixedGutter?s.gutters.offsetWidth:0),m=r-t>v;return m&&(r=t+v),t<10?f.scrollLeft=0:t<d?f.scrollLeft=Math.max(0,t-(m?0:10)):r>v+d-3&&(f.scrollLeft=r+(m?0:10)-v),f}function Ti(e,t,n){(t!=null||n!=null)&&Ci(e),t!=null&&(e.curOp.scrollLeft=(e.curOp.scrollLeft==null?e.doc.scrollLeft:e.curOp.scrollLeft)+t),n!=null&&(e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+n)}function Ni(e){Ci(e);var t=e.getCursor(),n=t,r=t;e.options.lineWrapping||(n=t.ch?gt(t.line,t.ch-1):t,r=gt(t.line,t.ch+1)),e.curOp.scrollToPos={from:n,to:r,margin:e.options.cursorScrollMargin,isCursor:!0}}function Ci(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=Wn(e,t.from),r=Wn(e,t.to),i=xi(e,Math.min(n.left,r.left),Math.min(n.top,r.top)-t.margin,Math.max(n.right,r.right),Math.max(n.bottom,r.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function ki(e,t,n,r){var i=e.doc,s;n==null&&(n="add"),n=="smart"&&(i.mode.indent?s=mn(e,t):n="prev");var o=e.options.tabSize,u=co(i,t),a=su(u.text,null,o);u.stateAfter&&(u.stateAfter=null);var f=u.text.match(/^\s*/)[0],l;if(!r&&!/\S/.test(u.text))l=0,n="not";else if(n=="smart"){l=i.mode.indent(s,u.text.slice(f.length),u.text);if(l==eu||l>150){if(!r)return;n="prev"}}n=="prev"?t>i.first?l=su(co(i,t-1).text,null,o):l=0:n=="add"?l=a+e.options.indentUnit:n=="subtract"?l=a-e.options.indentUnit:typeof n=="number"&&(l=a+n),l=Math.max(0,l);var c="",h=0;if(e.options.indentWithTabs)for(var p=Math.floor(l/o);p;--p)h+=o,c+="	";h<l&&(c+=au(l-h));if(c!=f)return bi(i,c,gt(t,0),gt(t,f.length),"+input"),u.stateAfter=null,!0;for(var p=0;p<i.sel.ranges.length;p++){var d=i.sel.ranges[p];if(d.head.line==t&&d.head.ch<f.length){var h=gt(t,f.length);Kt(i,p,new Ft(h,h));break}}}function Li(e,t,n,r){var i=t,s=t;return typeof t=="number"?s=co(e,Rt(e,t)):i=mo(t),i==null?null:(r(s,i)&&e.cm&&vr(e.cm,i,n),s)}function Ai(e,t){var n=e.doc.sel.ranges,r=[];for(var i=0;i<n.length;i++){var s=t(n[i]);while(r.length&&yt(s.from,fu(r).to)<=0){var o=r.pop();if(yt(o.from,s.from)<0){s.from=o.from;break}}r.push(s)}ar(e,function(){for(var t=r.length-1;t>=0;t--)bi(e.doc,"",r[t].from,r[t].to,"+delete");Ni(e)})}function Oi(e,t,n,r,i){function f(){var t=s+n;return t<e.first||t>=e.first+e.size?!1:(s=t,a=co(e,t))}function l(e){var t=(i?ua:aa)(a,o,n,!0);if(t==null){if(!!e||!f())return!1;i?o=(n<0?Zu:Yu)(a):o=n<0?a.text.length:0}else o=t;return!0}var s=t.line,o=t.ch,u=n,a=co(e,s);if(r=="char")l();else if(r=="column")l(!0);else if(r=="word"||r=="group"){var c=null,h=r=="group",p=e.cm&&e.cm.getHelper(t,"wordChars");for(var d=!0;;d=!1){if(n<0&&!l(!d))break;var v=a.text.charAt(o)||"\n",m=wu(v,p)?"w":h&&v=="\n"?"n":!h||/\s/.test(v)?null:"p";h&&!d&&!m&&(m="s");if(c&&c!=m){n<0&&(n=1,l());break}m&&(c=m);if(n>0&&!l(!d))break}}var g=on(e,gt(s,o),t,u,!0);return yt(t,g)||(g.hitSide=!0),g}function Mi(e,t,n,r){var i=e.doc,s=t.left,o;if(r=="page"){var u=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);o=t.top+n*(u-(n<0?1.5:.5)*Kn(e.display))}else r=="line"&&(o=n>0?t.bottom+3:t.top-3);for(;;){var a=Vn(e,s,o);if(!a.outside)break;if(n<0?o<=0:o>=i.height){a.hitSide=!0;break}o+=n*5}return a}function Pi(e,t,n,r){T.defaults[e]=t,n&&(Di[e]=r?function(e,t,r){r!=Hi&&n(e,t,r)}:n)}function Xi(e){var t=e.split(/-(?!$)/),e=t[t.length-1],n,r,i,s;for(var o=0;o<t.length-1;o++){var u=t[o];if(/^(cmd|meta|m)$/i.test(u))s=!0;else if(/^a(lt)?$/i.test(u))n=!0;else if(/^(c|ctrl|control)$/i.test(u))r=!0;else{if(!/^s(hift)$/i.test(u))throw new Error("Unrecognized modifier name: "+u);i=!0}}return n&&(e="Alt-"+e),r&&(e="Ctrl-"+e),s&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Ki(e){return typeof e=="string"?Wi[e]:e}function Zi(e,t,n,r,i){if(r&&r.shared)return ts(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return fr(e.cm,Zi)(e,t,n,r,i);var s=new Yi(e,i),o=yt(t,n);r&&mu(r,s,!1);if(o>0||o==0&&s.clearWhenEmpty!==!1)return s;s.replacedWith&&(s.collapsed=!0,s.widgetNode=Tu("span",[s.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(s.widgetNode.insertLeft=!0));if(s.collapsed){if(xs(e,t.line,t,n,s)||t.line!=n.line&&xs(e,n.line,t,n,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");x=!0}s.addToHistory&&To(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var u=t.line,a=e.cm,f;e.iter(u,n.line+1,function(e){a&&s.collapsed&&!a.options.lineWrapping&&Ts(e)==a.display.maxLine&&(f=!0),s.collapsed&&u!=t.line&&vo(e,0),as(e,new ss(s,u==t.line?t.ch:null,u==n.line?n.ch:null)),++u}),s.collapsed&&e.iter(t.line,n.line+1,function(t){Ls(e,t)&&vo(t,0)}),s.clearOnEnter&&Ro(s,"beforeCursorEnter",function(){s.clear()}),s.readOnly&&(S=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++Gi,s.atomic=!0);if(a){f&&(a.curOp.updateMaxLine=!0);if(s.collapsed)dr(a,t.line,n.line+1);else if(s.className||s.title||s.startStyle||s.endStyle||s.css)for(var l=t.line;l<=n.line;l++)vr(a,l,"text");s.atomic&&nn(a.doc),$o(a,"markerAdded",a,s)}return s}function ts(e,t,n,r,i){r=mu(r),r.shared=!1;var s=[Zi(e,t,n,r,i)],o=s[0],u=r.widgetNode;return fo(e,function(e){u&&(r.widgetNode=u.cloneNode(!0)),s.push(Zi(e,Ut(e,t),Ut(e,n),r,i));for(var a=0;a<e.linked.length;++a)if(e.linked[a].isParent)return;o=fu(s)}),new es(s,o)}function ns(e){return e.findMarks(gt(e.first,0),e.clipPos(gt(e.lastLine())),function(e){return e.parent})}function rs(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),s=e.clipPos(i.from),o=e.clipPos(i.to);if(yt(s,o)){var u=Zi(e,s,o,r.primary,r.primary.type);r.markers.push(u),u.parent=r}}}function is(e){for(var t=0;t<e.length;t++){var n=e[t],r=[n.primary.doc];fo(n.primary.doc,function(e){r.push(e)});for(var i=0;i<n.markers.length;i++){var s=n.markers[i];cu(r,s.doc)==-1&&(s.parent=null,n.markers.splice(i--,1))}}}function ss(e,t,n){this.marker=e,this.from=t,this.to=n}function os(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function us(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function as(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function fs(e,t,n){if(e)for(var r=0,i;r<e.length;++r){var s=e[r],o=s.marker,u=s.from==null||(o.inclusiveLeft?s.from<=t:s.from<t);if(u||s.from==t&&o.type=="bookmark"&&(!n||!s.marker.insertLeft)){var a=s.to==null||(o.inclusiveRight?s.to>=t:s.to>t);(i||(i=[])).push(new ss(o,s.from,a?null:s.to))}}return i}function ls(e,t,n){if(e)for(var r=0,i;r<e.length;++r){var s=e[r],o=s.marker,u=s.to==null||(o.inclusiveRight?s.to>=t:s.to>t);if(u||s.from==t&&o.type=="bookmark"&&(!n||s.marker.insertLeft)){var a=s.from==null||(o.inclusiveLeft?s.from<=t:s.from<t);(i||(i=[])).push(new ss(o,a?null:s.from-t,s.to==null?null:s.to-t))}}return i}function cs(e,t){if(t.full)return null;var n=Wt(e,t.from.line)&&co(e,t.from.line).markedSpans,r=Wt(e,t.to.line)&&co(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,s=t.to.ch,o=yt(t.from,t.to)==0,u=fs(n,i,o),a=ls(r,s,o),f=t.text.length==1,l=fu(t.text).length+(f?i:0);if(u)for(var c=0;c<u.length;++c){var h=u[c];if(h.to==null){var p=os(a,h.marker);p?f&&(h.to=p.to==null?null:p.to+l):h.to=i}}if(a)for(var c=0;c<a.length;++c){var h=a[c];h.to!=null&&(h.to+=l);if(h.from==null){var p=os(u,h.marker);p||(h.from=l,f&&(u||(u=[])).push(h))}else h.from+=l,f&&(u||(u=[])).push(h)}u&&(u=hs(u)),a&&a!=u&&(a=hs(a));var d=[u];if(!f){var v=t.text.length-2,m;if(v>0&&u)for(var c=0;c<u.length;++c)u[c].to==null&&(m||(m=[])).push(new ss(u[c].marker,null,null));for(var c=0;c<v;++c)d.push(m);d.push(a)}return d}function hs(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function ps(e,t){var n=Oo(e,t),r=cs(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var s=n[i],o=r[i];if(s&&o)e:for(var u=0;u<o.length;++u){var a=o[u];for(var f=0;f<s.length;++f)if(s[f].marker==a.marker)continue e;s.push(a)}else o&&(n[i]=o)}return n}function ds(e,t,n){var r=null;e.iter(t.line,n.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;n.readOnly&&(!r||cu(r,n)==-1)&&(r||(r=[])).push(n)}});if(!r)return null;var i=[{from:t,to:n}];for(var s=0;s<r.length;++s){var o=r[s],u=o.find(0);for(var a=0;a<i.length;++a){var f=i[a];if(yt(f.to,u.from)<0||yt(f.from,u.to)>0)continue;var l=[a,1],c=yt(f.from,u.from),h=yt(f.to,u.to);(c<0||!o.inclusiveLeft&&!c)&&l.push({from:f.from,to:u.from}),(h>0||!o.inclusiveRight&&!h)&&l.push({from:u.to,to:f.to}),i.splice.apply(i,l),a+=l.length-1}}return i}function vs(e){var t=e.markedSpans;if(!t)return;for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}function ms(e,t){if(!t)return;for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}function gs(e){return e.inclusiveLeft?-1:0}function ys(e){return e.inclusiveRight?1:0}function bs(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),s=yt(r.from,i.from)||gs(e)-gs(t);if(s)return-s;var o=yt(r.to,i.to)||ys(e)-ys(t);return o?o:t.id-e.id}function ws(e,t){var n=x&&e.markedSpans,r;if(n)for(var i,s=0;s<n.length;++s)i=n[s],i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||bs(r,i.marker)<0)&&(r=i.marker);return r}function Es(e){return ws(e,!0)}function Ss(e){return ws(e,!1)}function xs(e,t,n,r,i){var s=co(e,t),o=x&&s.markedSpans;if(o)for(var u=0;u<o.length;++u){var a=o[u];if(!a.marker.collapsed)continue;var f=a.marker.find(0),l=yt(f.from,n)||gs(a.marker)-gs(i),c=yt(f.to,r)||ys(a.marker)-ys(i);if(l>=0&&c<=0||l<=0&&c>=0)continue;if(l<=0&&(a.marker.inclusiveRight&&i.inclusiveLeft?yt(f.to,n)>=0:yt(f.to,n)>0)||l>=0&&(a.marker.inclusiveRight&&i.inclusiveLeft?yt(f.from,r)<=0:yt(f.from,r)<0))return!0}}function Ts(e){var t;while(t=Es(e))e=t.find(-1,!0).line;return e}function Ns(e){var t,n;while(t=Ss(e))e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function Cs(e,t){var n=co(e,t),r=Ts(n);return n==r?t:mo(r)}function ks(e,t){if(t>e.lastLine())return t;var n=co(e,t),r;if(!Ls(e,n))return t;while(r=Ss(n))n=r.find(1,!0).line;return mo(n)+1}function Ls(e,t){var n=x&&t.markedSpans;if(n)for(var r,i=0;i<n.length;++i){r=n[i];if(!r.marker.collapsed)continue;if(r.from==null)return!0;if(r.marker.widgetNode)continue;if(r.from==0&&r.marker.inclusiveLeft&&As(e,t,r))return!0}}function As(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return As(e,r.line,os(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i,s=0;s<t.markedSpans.length;++s){i=t.markedSpans[s];if(i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(i.to==null||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&As(e,t,i))return!0}}function Ms(e,t,n){yo(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ti(e,null,n)}function _s(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!Lu(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),ku(t.display.measure,Tu("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function Ds(e,t,n,r){var i=new Os(e,n,r),s=e.cm;return s&&i.noHScroll&&(s.display.alignWidgets=!0),Li(e,t,"widget",function(t){var n=t.widgets||(t.widgets=[]);i.insertAt==null?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i),i.line=t;if(s&&!Ls(e,t)){var r=yo(t)<e.scrollTop;vo(t,t.height+_s(i)),r&&Ti(s,null,i.height),s.curOp.forceUpdate=!0}return!0}),i}function Hs(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),vs(e),ms(e,n);var i=r?r(e):1;i!=e.height&&vo(e,i)}function Bs(e){e.parent=null,vs(e)}function js(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";t[r]==null?t[r]=n[2]:(new RegExp("(?:^|s)"+n[2]+"(?:$|s)")).test(t[r])||(t[r]+=" "+n[2])}return e}function Fs(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var n=T.innerMode(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}function Is(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=T.innerMode(e,n).mode);var s=e.token(t,n);if(t.pos>t.start)return s}throw new Error("Mode "+e.name+" failed to advance stream.")}function qs(e,t,n,r){function i(e){return{start:l.start,end:l.pos,string:l.current(),type:u||null,state:e?Ri(s.mode,f):f}}var s=e.doc,o=s.mode,u;t=Ut(s,t);var a=co(s,t.line),f=mn(e,t.line,n),l=new Qi(a.text,e.options.tabSize),c;r&&(c=[]);while((r||l.pos<t.ch)&&!l.eol())l.start=l.pos,u=Is(o,l,f),r&&c.push(i(!0));return r?c:i()}function Rs(e,t,n,r,i,s,o){var u=n.flattenSpans;u==null&&(u=e.options.flattenSpans);var a=0,f=null,l=new Qi(t,e.options.tabSize),c,h=e.options.addModeClass&&[null];t==""&&js(Fs(n,r),s);while(!l.eol()){l.pos>e.options.maxHighlightLength?(u=!1,o&&Ws(e,t,r,l.pos),l.pos=t.length,c=null):c=js(Is(n,l,r,h),s);if(h){var p=h[0].name;p&&(c="m-"+(c?p+" "+c:p))}if(!u||f!=c){while(a<l.start)a=Math.min(l.start,a+5e4),i(a,f);f=c}l.start=l.pos}while(a<l.pos){var d=Math.min(l.pos,a+5e4);i(d,f),a=d}}function Us(e,t,n,r){var i=[e.state.modeGen],s={};Rs(e,t.text,e.doc.mode,n,function(e,t){i.push(e,t)},s,r);for(var o=0;o<e.state.overlays.length;++o){var u=e.state.overlays[o],a=1,f=0;Rs(e,t.text,u.mode,!0,function(e,t){var n=a;while(f<e){var r=i[a];r>e&&i.splice(a,1,e,i[a+1],r),a+=2,f=Math.min(e,r)}if(!t)return;if(u.opaque)i.splice(n,a-n,e,"cm-overlay "+t),a=n+2;else for(;n<a;n+=2){var s=i[n+1];i[n+1]=(s?s+" ":"")+"cm-overlay "+t}},s)}return{styles:i,classes:s.bgClass||s.textClass?s:null}}function zs(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=mn(e,mo(t)),i=Us(e,t,t.text.length>e.options.maxHighlightLength?Ri(e.doc.mode,r):r);t.stateAfter=r,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.frontier&&e.doc.frontier++}return t.styles}function Ws(e,t,n,r){var i=e.doc.mode,s=new Qi(t,e.options.tabSize);s.start=s.pos=r||0,t==""&&Fs(i,n);while(!s.eol())Is(i,s,n),s.start=s.pos}function $s(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Vs:Xs;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Js(e,t){var n=Tu("span",null,null,u?"padding-right: .1px":null),r={pre:Tu("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(s||u)&&e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a;r.pos=0,r.addToken=Qs,Uu(e.display.measure)&&(a=bo(o))&&(r.addToken=Ys(r.addToken,a)),r.map=[];var f=t!=e.display.externalMeasured&&mo(o);eo(o,r,zs(e,o,f)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=Du(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=Du(o.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(qu(e.display.measure))),i==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(u){var l=r.content.lastChild;if(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab"))r.content.className="cm-tab-wrap-hack"}return Xo(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=Du(r.pre.className,r.textClass||"")),r}function Ks(e){var t=Tu("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Qs(e,t,n,r,i,u,a){if(!t)return;var f=e.splitSpaces?Gs(t,e.trailingSpace):t,l=e.cm.state.specialChars,c=!1;if(!l.test(t)){e.col+=t.length;var h=document.createTextNode(f);e.map.push(e.pos,e.pos+t.length,h),s&&o<9&&(c=!0),e.pos+=t.length}else{var h=document.createDocumentFragment(),p=0;for(;;){l.lastIndex=p;var d=l.exec(t),v=d?d.index-p:t.length-p;if(v){var m=document.createTextNode(f.slice(p,p+v));s&&o<9?h.appendChild(Tu("span",[m])):h.appendChild(m),e.map.push(e.pos,e.pos+v,m),e.col+=v,e.pos+=v}if(!d)break;p+=v+1;if(d[0]=="	"){var g=e.cm.options.tabSize,y=g-e.col%g,m=h.appendChild(Tu("span",au(y),"cm-tab"));m.setAttribute("role","presentation"),m.setAttribute("cm-text","	"),e.col+=y}else if(d[0]=="\r"||d[0]=="\n"){var m=h.appendChild(Tu("span",d[0]=="\r"?"␍":"␤","cm-invalidchar"));m.setAttribute("cm-text",d[0]),e.col+=1}else{var m=e.cm.options.specialCharPlaceholder(d[0]);m.setAttribute("cm-text",d[0]),s&&o<9?h.appendChild(Tu("span",[m])):h.appendChild(m),e.col+=1}e.map.push(e.pos,e.pos+1,m),e.pos++}}e.trailingSpace=f.charCodeAt(t.length-1)==32;if(n||r||i||c||a){var b=n||"";r&&(b+=r),i&&(b+=i);var w=Tu("span",[h],b,a);return u&&(w.title=u),e.content.appendChild(w)}e.content.appendChild(h)}function Gs(e,t){if(e.length>1&&!/  /.test(e))return e;var n=t,r="";for(var i=0;i<e.length;i++){var s=e.charAt(i);s==" "&&n&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(s=" "),r+=s,n=s==" "}return r}function Ys(e,t){return function(n,r,i,s,o,u,a){i=i?i+" cm-force-border":"cm-force-border";var f=n.pos,l=f+r.length;for(;;){for(var c=0;c<t.length;c++){var h=t[c];if(h.to>f&&h.from<=f)break}if(h.to>=l)return e(n,r,i,s,o,u,a);e(n,r.slice(0,h.to-f),i,s,null,u,a),s=null,r=r.slice(h.to-f),f=h.to}}}function Zs(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function eo(e,t,n){var r=e.markedSpans,i=e.text,s=0;if(!r){for(var o=1;o<n.length;o+=2)t.addToken(t,i.slice(s,s=n[o]),$s(n[o+1],t.cm.options));return}var u=i.length,a=0,o=1,f="",l,c,h=0,p,d,v,m,g;for(;;){if(h==a){p=d=v=m=c="",g=null,h=Infinity;var y=[],b;for(var w=0;w<r.length;++w){var E=r[w],S=E.marker;S.type=="bookmark"&&E.from==a&&S.widgetNode?y.push(S):E.from<=a&&(E.to==null||E.to>a||S.collapsed&&E.to==a&&E.from==a)?(E.to!=null&&E.to!=a&&h>E.to&&(h=E.to,d=""),S.className&&(p+=" "+S.className),S.css&&(c=(c?c+";":"")+S.css),S.startStyle&&E.from==a&&(v+=" "+S.startStyle),S.endStyle&&E.to==h&&(b||(b=[])).push(S.endStyle,E.to),S.title&&!m&&(m=S.title),S.collapsed&&(!g||bs(g.marker,S)<0)&&(g=E)):E.from>a&&h>E.from&&(h=E.from)}if(b)for(var w=0;w<b.length;w+=2)b[w+1]==h&&(d+=" "+b[w]);if(!g||g.from==a)for(var w=0;w<y.length;++w)Zs(t,0,y[w]);if(g&&(g.from||0)==a){Zs(t,(g.to==null?u+1:g.to)-a,g.marker,g.from==null);if(g.to==null)return;g.to==a&&(g=!1)}}if(a>=u)break;var x=Math.min(u,h);for(;;){if(f){var T=a+f.length;if(!g){var N=T>x?f.slice(0,x-a):f;t.addToken(t,N,l?l+p:p,v,a+N.length==h?d:"",m,c)}if(T>=x){f=f.slice(x-a),a=x;break}a=T,v=""}f=i.slice(s,s=n[o++]),l=$s(n[o++],t.cm.options)}}}function to(e,t){return t.from.ch==0&&t.to.ch==0&&fu(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function no(e,t,n,r){function i(e){return n?n[e]:null}function s(e,n,i){Hs(e,n,i,r),$o(e,"change",e,t)}function o(e,t){for(var n=e,s=[];n<t;++n)s.push(new Ps(f[n],i(n),r));return s}var u=t.from,a=t.to,f=t.text,l=co(e,u.line),c=co(e,a.line),h=fu(f),p=i(f.length-1),d=a.line-u.line;if(t.full)e.insert(0,o(0,f.length)),e.remove(f.length,e.size-f.length);else if(to(e,t)){var v=o(0,f.length-1);s(c,c.text,p),d&&e.remove(u.line,d),v.length&&e.insert(u.line,v)}else if(l==c)if(f.length==1)s(l,l.text.slice(0,u.ch)+h+l.text.slice(a.ch),p);else{var v=o(1,f.length-1);v.push(new Ps(h+l.text.slice(a.ch),p,r)),s(l,l.text.slice(0,u.ch)+f[0],i(0)),e.insert(u.line+1,v)}else if(f.length==1)s(l,l.text.slice(0,u.ch)+f[0]+c.text.slice(a.ch),i(0)),e.remove(u.line+1,d);else{s(l,l.text.slice(0,u.ch)+f[0],i(0)),s(c,h+c.text.slice(a.ch),p);var v=o(1,f.length-1);d>1&&e.remove(u.line+1,d-1),e.insert(u.line+1,v)}$o(e,"change",e,t)}function ro(e){this.lines=e,this.parent=null;for(var t=0,n=0;t<e.length;++t)e[t].parent=this,n+=e[t].height;this.height=n}function io(e){this.children=e;var t=0,n=0;for(var r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}function fo(e,t,n){function r(e,i,s){if(e.linked)for(var o=0;o<e.linked.length;++o){var u=e.linked[o];if(u.doc==i)continue;var a=s&&u.sharedHist;if(n&&!a)continue;t(u.doc,a),r(u.doc,e,a)}}r(e,null,!0)}function lo(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,O(e),C(e),e.options.lineWrapping||B(e),e.options.mode=t.modeOption,dr(e)}function co(e,t){t-=e.first;if(t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],s=i.chunkSize();if(t<s){n=i;break}t-=s}return n.lines[t]}function ho(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(e){var s=e.text;i==n.line&&(s=s.slice(0,n.ch)),i==t.line&&(s=s.slice(t.ch)),r.push(s),++i}),r}function po(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function vo(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function mo(e){if(e.parent==null)return null;var t=e.parent,n=cu(t.lines,e);for(var r=t.parent;r;t=r,r=r.parent)for(var i=0;;++i){if(r.children[i]==t)break;n+=r.children[i].chunkSize()}return n+t.first}function go(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],s=i.height;if(t<s){e=i;continue e}t-=s,n+=i.chunkSize()}return n}while(!e.lines);for(var r=0;r<e.lines.length;++r){var o=e.lines[r],u=o.height;if(t<u)break;t-=u}return n+r}function yo(e){e=Ts(e);var t=0,n=e.parent;for(var r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var s=n.parent;s;n=s,s=n.parent)for(var r=0;r<s.children.length;++r){var o=s.children[r];if(o==n)break;t+=o.height}return t}function bo(e){var t=e.order;return t==null&&(t=e.order=fa(e.text)),t}function wo(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Eo(e,t){var n={from:bt(t.from),to:ui(t),text:ho(e,t.from,t.to)};return Lo(e,n,t.from.line,t.to.line+1),fo(e,function(e){Lo(e,n,t.from.line,t.to.line+1)},!0),n}function So(e){while(e.length){var t=fu(e);if(!t.ranges)break;e.pop()}}function xo(e,t){if(t)return So(e.done),fu(e.done);if(e.done.length&&!fu(e.done).ranges)return fu(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),fu(e.done)}function To(e,t,n,r){var i=e.history;i.undone.length=0;var s=+(new Date),o;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&e.cm&&i.lastModTime>s-e.cm.options.historyEventDelay||t.origin.charAt(0)=="*"))&&(o=xo(i,i.lastOp==r))){var u=fu(o.changes);yt(t.from,t.to)==0&&yt(t.from,u.to)==0?u.to=ui(t):o.changes.push(Eo(e,t))}else{var a=fu(i.done);(!a||!a.ranges)&&ko(e.sel,i.done),o={changes:[Eo(e,t)],generation:i.generation},i.done.push(o);while(i.done.length>i.undoDepth)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,u||Xo(e,"historyAdded")}function No(e,t,n,r){var i=t.charAt(0);return i=="*"||i=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Co(e,t,n,r){var i=e.history,s=r&&r.origin;n==i.lastSelOp||s&&i.lastSelOrigin==s&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==s||No(e,s,fu(i.done),t))?i.done[i.done.length-1]=t:ko(t,i.done),i.lastSelTime=+(new Date),i.lastSelOrigin=s,i.lastSelOp=n,r&&r.clearRedo!==!1&&So(i.undone)}function ko(e,t){var n=fu(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Lo(e,t,n,r){var i=t["spans_"+e.id],s=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[s]=n.markedSpans),++s})}function Ao(e){if(!e)return null;for(var t=0,n;t<e.length;++t)e[t].marker.explicitlyCleared?n||(n=e.slice(0,t)):n&&n.push(e[t]);return n?n.length?n:null:e}function Oo(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=0,i=[];r<t.text.length;++r)i.push(Ao(n[r]));return i}function Mo(e,t,n){for(var r=0,i=[];r<e.length;++r){var s=e[r];if(s.ranges){i.push(n?jt.prototype.deepCopy.call(s):s);continue}var o=s.changes,u=[];i.push({changes:u});for(var a=0;a<o.length;++a){var f=o[a],l;u.push({from:f.from,to:f.to,text:f.text});if(t)for(var c in f)(l=c.match(/^spans_(\d+)$/))&&cu(t,Number(l[1]))>-1&&(fu(u)[c]=f[c],delete f[c])}}return i}function _o(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function Do(e,t,n,r){for(var i=0;i<e.length;++i){var s=e[i],o=!0;if(s.ranges){s.copied||(s=e[i]=s.deepCopy(),s.copied=!0);for(var u=0;u<s.ranges.length;u++)_o(s.ranges[u].anchor,t,n,r),_o(s.ranges[u].head,t,n,r);continue}for(var u=0;u<s.changes.length;++u){var a=s.changes[u];if(n<a.from.line)a.from=gt(a.from.line+r,a.from.ch),a.to=gt(a.to.line+r,a.to.ch);else if(t<=a.to.line){o=!1;break}}o||(e.splice(0,i+1),i=0)}}function Po(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;Do(e.done,n,r,i),Do(e.undone,n,r,i)}function jo(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==0}function Io(e){return e.target||e.srcElement}function qo(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),m&&e.ctrlKey&&t==1&&(t=3),t}function zo(e,t,n){var r=e._handlers&&e._handlers[t];return n?r&&r.length>0?r.slice():Uo:r||Uo}function $o(e,t){function s(e){return function(){e.apply(null,r)}}var n=zo(e,t,!1);if(!n.length)return;var r=Array.prototype.slice.call(arguments,2),i;Gn?i=Gn.delayedCallbacks:Vo?i=Vo:(i=Vo=[],setTimeout(Jo,0));for(var o=0;o<n.length;++o)i.push(s(n[o]))}function Jo(){var e=Vo;Vo=null;for(var t=0;t<e.length;++t)e[t]()}function Ko(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Xo(e,n||t.type,e,t),jo(t)||t.codemirrorIgnore}function Qo(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]);for(var r=0;r<t.length;++r)cu(n,t[r])==-1&&n.push(t[r])}function Go(e,t){return zo(e,t).length>0}function Yo(e){e.prototype.on=function(e,t){Ro(this,e,t)},e.prototype.off=function(e,t){Wo(this,e,t)}}function iu(){this.id=null}function au(e){while(uu.length<=e)uu.push(fu(uu)+" ");return uu[e]}function fu(e){return e[e.length-1]}function cu(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}function hu(e,t){var n=[];for(var r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function pu(e,t,n){var r=0,i=n(t);while(r<e.length&&n(e[r])<=i)r++;e.splice(r,0,t)}function du(){}function vu(e,t){var n;return Object.create?n=Object.create(e):(du.prototype=e,n=new du),t&&mu(t,n),n}function mu(e,t,n){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(n!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function gu(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function wu(e,t){return t?t.source.indexOf("\\w")>-1&&bu(e)?!0:t.test(e):bu(e)}function Eu(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function xu(e){return e.charCodeAt(0)>=768&&Su.test(e)}function Tu(e,t,n,r){var i=document.createElement(e);n&&(i.className=n),r&&(i.style.cssText=r);if(typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var s=0;s<t.length;++s)i.appendChild(t[s]);return i}function Cu(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function ku(e,t){return Cu(e).appendChild(t)}function Au(){var e=document.activeElement;while(e&&e.root&&e.root.activeElement)e=e.root.activeElement;return e}function Ou(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function Du(e,t){var n=e.split(" ");for(var r=0;r<n.length;r++)n[r]&&!Ou(n[r]).test(t)&&(t+=" "+n[r]);return t}function Pu(e){if(!document.body.getElementsByClassName)return;var t=document.body.getElementsByClassName("CodeMirror");for(var n=0;n<t.length;n++){var r=t[n].CodeMirror;r&&e(r)}}function Bu(){if(Hu)return;ju(),Hu=!0}function ju(){var e;Ro(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Pu(xr)},100))}),Ro(window,"blur",function(){Pu(ii)})}function qu(e){if(Iu==null){var t=Tu("span","​");ku(e,Tu("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Iu=t.offsetWidth<=1&&t.offsetHeight>2&&!(s&&o<8))}var n=Iu?Tu("span","​"):Tu("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Uu(e){if(Ru!=null)return Ru;var t=ku(e,document.createTextNode("AخA")),n=Nu(t,0,1).getBoundingClientRect(),r=Nu(t,1,2).getBoundingClientRect();return Cu(e),!n||n.left==n.right?!1:Ru=r.right-n.right<3}function $u(e){if(Vu!=null)return Vu;var t=ku(e,Tu("span","x")),n=t.getBoundingClientRect(),r=Nu(t,0,1).getBoundingClientRect();return Vu=Math.abs(n.left-r.left)>1}function Ku(e,t,n,r){if(!e)return r(t,n,"ltr");var i=!1;for(var s=0;s<e.length;++s){var o=e[s];if(o.from<n&&o.to>t||t==n&&o.to==t)r(Math.max(o.from,t),Math.min(o.to,n),o.level==1?"rtl":"ltr"),i=!0}i||r(t,n,"ltr")}function Qu(e){return e.level%2?e.to:e.from}function Gu(e){return e.level%2?e.from:e.to}function Yu(e){var t=bo(e);return t?Qu(t[0]):0}function Zu(e){var t=bo(e);return t?Gu(fu(t)):e.text.length}function ea(e,t){var n=co(e.doc,t),r=Ts(n);r!=n&&(t=mo(r));var i=bo(r),s=i?i[0].level%2?Zu(r):Yu(r):0;return gt(t,s)}function ta(e,t){var n,r=co(e.doc,t);while(n=Ss(r))r=n.find(1,!0).line,t=null;var i=bo(r),s=i?i[0].level%2?Yu(r):Zu(r):r.text.length;return gt(t==null?mo(r):t,s)}function na(e,t){var n=ea(e,t.line),r=co(e.doc,n.line),i=bo(r);if(!i||i[0].level==0){var s=Math.max(0,r.text.search(/\S/)),o=t.line==n.line&&t.ch<=s&&t.ch;return gt(n.line,o?0:s)}return n}function ra(e,t,n){var r=e[0].level;return t==r?!0:n==r?!1:t<n}function sa(e,t){ia=null;for(var n=0,r;n<e.length;++n){var i=e[n];if(i.from<t&&i.to>t)return n;if(i.from==t||i.to==t){if(r!=null)return ra(e,i.level,e[r].level)?(i.from!=i.to&&(ia=r),n):(i.from!=i.to&&(ia=n),r);r=n}}return r}function oa(e,t,n,r){if(!r)return t+n;do t+=n;while(t>0&&xu(e.text.charAt(t)));return t}function ua(e,t,n,r){var i=bo(e);if(!i)return aa(e,t,n,r);var s=sa(i,t),o=i[s],u=oa(e,t,o.level%2?-n:n,r);for(;;){if(u>o.from&&u<o.to)return u;if(u==o.from||u==o.to)return sa(i,u)==s?u:(o=i[s+=n],n>0==o.level%2?o.to:o.from);o=i[s+=n];if(!o)return null;n>0==o.level%2?u=oa(e,o.to,-1,r):u=oa(e,o.from,1,r)}}function aa(e,t,n,r){var i=t+n;if(r)while(i>0&&xu(e.text.charAt(i)))i+=n;return i<0||i>e.text.length?null:i}var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),s=r||i,o=s&&(r?document.documentMode||6:i[1]),u=/WebKit\//.test(e),a=u&&/Qt\/\d+\.\d+/.test(e),f=/Chrome\//.test(e),l=/Opera\//.test(e),c=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),p=/PhantomJS/.test(e),d=/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),v=d||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),m=d||/Mac/.test(t),g=/\bCrOS\b/.test(e),y=/win/i.test(t),b=l&&e.match(/Version\/(\d*\.\d*)/);b&&(b=Number(b[1])),b&&b>=15&&(l=!1,u=!0);var w=m&&(a||l&&(b==null||b<12.11)),E=n||s&&o>=9,S=!1,x=!1;I.prototype=mu({update:function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var s=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=e.scrollWidth-e.clientWidth+s+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},setScrollLeft:function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},setScrollTop:function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},zeroWidthHack:function(){var e=m&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new iu,this.disableVert=new iu},enableZeroWidthBar:function(e,t){function n(){var r=e.getBoundingClientRect(),i=document.elementFromPoint(r.left+1,r.bottom-1);i!=e?e.style.pointerEvents="none":t.set(1e3,n)}e.style.pointerEvents="auto",t.set(1e3,n)},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},I.prototype),q.prototype=mu({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},q.prototype),T.scrollbarModel={"native":I,"null":q},K.prototype.signal=function(e,t){Go(e,t)&&this.events.push(arguments)},K.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Xo.apply(null,this.events[e])};var gt=T.Pos=function(e,t){if(!(this instanceof gt))return new gt(e,t);this.line=e,this.ch=t},yt=T.cmpPos=function(e,t){return e.line-t.line||e.ch-t.ch},xt=null;At.prototype=mu({init:function(e){function u(e){if(Ko(n,e))return;if(n.somethingSelected())xt={lineWise:!1,text:n.getSelections()},t.inaccurateSelection&&(t.prevInput="",t.inaccurateSelection=!1,i.value=xt.text.join("\n"),lu(i));else{if(!n.options.lineWiseCopyCut)return;var r=kt(n);xt={lineWise:!0,text:r.text},e.type=="cut"?n.setSelections(r.ranges,null,tu):(t.prevInput="",i.value=r.text.join("\n"),lu(i))}e.type=="cut"&&(n.state.cutIncoming=!0)}var t=this,n=this.cm,r=this.wrapper=Ot(),i=this.textarea=r.firstChild;e.wrapper.insertBefore(r,e.wrapper.firstChild),d&&(i.style.width="0px"),Ro(i,"input",function(){s&&o>=9&&t.hasSelection&&(t.hasSelection=null),t.poll()}),Ro(i,"paste",function(e){if(Ko(n,e)||Nt(e,n))return;n.state.pasteIncoming=!0,t.fastPoll()}),Ro(i,"cut",u),Ro(i,"copy",u),Ro(e.scroller,"paste",function(r){if(Tr(e,r)||Ko(n,r))return;n.state.pasteIncoming=!0,t.focus()}),Ro(e.lineSpace,"selectstart",function(t){Tr(e,t)||Ho(t)}),Ro(i,"compositionstart",function(){var e=n.getCursor("from");t.composing&&t.composing.range.clear(),t.composing={start:e,range:n.markText(e,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Ro(i,"compositionend",function(){t.composing&&(t.poll(),t.composing.range.clear(),t.composing=null)})},prepareSelection:function(){var e=this.cm,t=e.display,n=e.doc,r=fn(e);if(e.options.moveInputWithCursor){var i=zn(e,n.sel.primary().head,"div"),s=t.wrapper.getBoundingClientRect(),o=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+o.top-s.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+o.left-s.left))}return r},showSelection:function(e){var t=this.cm,n=t.display;ku(n.cursorDiv,e.cursors),ku(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},reset:function(e){if(this.contextMenuPending)return;var t,n,r=this.cm,i=r.doc;if(r.somethingSelected()){this.prevInput="";var u=i.sel.primary();t=Xu&&(u.to().line-u.from().line>100||(n=r.getSelection()).length>1e3);var a=t?"-":n||r.getSelection();this.textarea.value=a,r.state.focused&&lu(this.textarea),s&&o>=9&&(this.hasSelection=a)}else e||(this.prevInput=this.textarea.value="",s&&o>=9&&(this.hasSelection=null));this.inaccurateSelection=t},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if(this.cm.options.readOnly!="nocursor"&&(!v||Au()!=this.textarea))try{this.textarea.focus()}catch(e){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var e=this;if(e.pollingFast)return;e.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},fastPoll:function(){function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,n)},poll:function(){var e=this.cm,t=this.textarea,n=this.prevInput;if(this.contextMenuPending||!e.state.focused||Wu(t)&&!n&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var r=t.value;if(r==n&&!e.somethingSelected())return!1;if(s&&o>=9&&this.hasSelection===r||m&&/[\uf700-\uf7ff]/.test(r))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var i=r.charCodeAt(0);i==8203&&!n&&(n="​");if(i==8666)return this.reset(),this.cm.execCommand("undo")}var u=0,a=Math.min(n.length,r.length);while(u<a&&n.charCodeAt(u)==r.charCodeAt(u))++u;var f=this;return ar(e,function(){Tt(e,r.slice(u),n.length-u,null,f.composing?"*compose":null),r.length>1e3||r.indexOf("\n")>-1?t.value=f.prevInput="":f.prevInput=r,f.composing&&(f.composing.range.clear(),f.composing.range=e.markText(f.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){s&&o>=9&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(e){function m(){if(i.selectionStart!=null){var e=n.somethingSelected(),s="​"+(e?i.value:"");i.value="⇚",i.value=s,t.prevInput=e?"":"​",i.selectionStart=1,i.selectionEnd=s.length,r.selForContextMenu=n.doc.sel}}function g(){t.contextMenuPending=!1,t.wrapper.style.cssText=p,i.style.cssText=h,s&&o<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=f);if(i.selectionStart!=null){(!s||s&&o<9)&&m();var e=0,u=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="​"?fr(n,zi.selectAll)(n):e++<10?r.detectingSelectAll=setTimeout(u,500):r.input.reset()};r.detectingSelectAll=setTimeout(u,200)}}var t=this,n=t.cm,r=n.display,i=t.textarea,a=Nr(n,e),f=r.scroller.scrollTop;if(!a||l)return;var c=n.options.resetSelectionOnContextMenu;c&&n.doc.sel.contains(a)==-1&&fr(n,Zt)(n.doc,qt(a),tu);var h=i.style.cssText,p=t.wrapper.style.cssText;t.wrapper.style.cssText="position: absolute";var d=t.wrapper.getBoundingClientRect();i.style.cssText="position: absolute; width: 30px; height: 30px; top: "+(e.clientY-d.top-5)+"px; left: "+(e.clientX-d.left-5)+"px; z-index: 1000; background: "+(s?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";if(u)var v=window.scrollY;r.input.focus(),u&&window.scrollTo(null,v),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=!0,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),s&&o>=9&&m();if(E){Fo(e);var y=function(){Wo(window,"mouseup",y),setTimeout(g,20)};Ro(window,"mouseup",y)}else setTimeout(g,50)},readOnlyChanged:function(e){e||this.reset()},setUneditable:du,needsContentAttribute:!1},At.prototype),Mt.prototype=mu({init:function(e){function i(e){if(Ko(n,e))return;if(n.somethingSelected())xt={lineWise:!1,text:n.getSelections()},e.type=="cut"&&n.replaceSelection("",null,"cut");else{if(!n.options.lineWiseCopyCut)return;var i=kt(n);xt={lineWise:!0,text:i.text},e.type=="cut"&&n.operation(function(){n.setSelections(i.ranges,0,tu),n.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var s=xt.text.join("\n");e.clipboardData.setData("Text",s);if(e.clipboardData.getData("Text")==s){e.preventDefault();return}}var o=Ot(),u=o.firstChild;n.display.lineSpace.insertBefore(o,n.display.lineSpace.firstChild),u.value=xt.text.join("\n");var a=document.activeElement;lu(u),setTimeout(function(){n.display.lineSpace.removeChild(o),a.focus(),a==r&&t.showPrimarySelection()},50)}var t=this,n=t.cm,r=t.div=e.lineDiv;Lt(r,n.options.spellcheck),Ro(r,"paste",function(e){if(Ko(n,e)||Nt(e,n))return;o<=11&&setTimeout(fr(n,function(){t.pollContent()||dr(n)}),20)}),Ro(r,"compositionstart",function(e){var r=e.data;t.composing={sel:n.doc.sel,data:r,startData:r};if(!r)return;var i=n.doc.sel.primary(),s=n.getLine(i.head.line),o=s.indexOf(r,Math.max(0,i.head.ch-r.length));o>-1&&o<=i.head.ch&&(t.composing.sel=qt(gt(i.head.line,o),gt(i.head.line,o+r.length)))}),Ro(r,"compositionupdate",function(e){t.composing.data=e.data}),Ro(r,"compositionend",function(e){var n=t.composing;if(!n)return;e.data!=n.startData&&!/\u200b/.test(e.data)&&(n.data=e.data),setTimeout(function(){n.handled||t.applyComposition(n),t.composing==n&&(t.composing=null)},50)}),Ro(r,"touchstart",function(){t.forceCompositionEnd()}),Ro(r,"input",function(){if(t.composing)return;(n.isReadOnly()||!t.pollContent())&&ar(t.cm,function(){dr(n)})}),Ro(r,"copy",i),Ro(r,"cut",i)},prepareSelection:function(){var e=fn(this.cm,!1);return e.focus=this.cm.state.focused,e},showSelection:function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},showPrimarySelection:function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),r=Pt(this.cm,e.anchorNode,e.anchorOffset),i=Pt(this.cm,e.focusNode,e.focusOffset);if(r&&!r.bad&&i&&!i.bad&&yt(Et(r,i),t.from())==0&&yt(wt(r,i),t.to())==0)return;var s=_t(this.cm,t.from()),o=_t(this.cm,t.to());if(!s&&!o)return;var u=this.cm.display.view,a=e.rangeCount&&e.getRangeAt(0);if(!s)s={node:u[0].measure.map[2],offset:0};else if(!o){var f=u[u.length-1].measure,l=f.maps?f.maps[f.maps.length-1]:f.map;o={node:l[l.length-1],offset:l[l.length-2]-l[l.length-3]}}try{var c=Nu(s.node,s.offset,o.offset,o.node)}catch(h){}c&&(!n&&this.cm.state.focused?(e.collapse(s.node,s.offset),c.collapsed||e.addRange(c)):(e.removeAllRanges(),e.addRange(c)),a&&e.anchorNode==null?e.addRange(a):n&&this.startGracePeriod()),this.rememberSelection()},startGracePeriod:function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){e.cm.curOp.selectionChanged=!0})},20)},showMultipleSelections:function(e){ku(this.cm.display.cursorDiv,e.cursors),ku(this.cm.display.selectionDiv,e.selection)},rememberSelection:function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},selectionInEditor:function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return Lu(this.div,t)},focus:function(){this.cm.options.readOnly!="nocursor"&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}var e=this;this.selectionInEditor()?this.pollSelection():ar(this.cm,function(){e.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,t)},selectionChanged:function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;this.rememberSelection();var n=Pt(t,e.anchorNode,e.anchorOffset),r=Pt(t,e.focusNode,e.focusOffset);n&&r&&ar(t,function(){Zt(t.doc,qt(n,r),tu);if(n.bad||r.bad)t.curOp.selectionChanged=!0})}},pollContent:function(){var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var s;if(r.line==t.viewFrom||(s=gr(e,r.line))==0)var o=mo(t.view[0].line),u=t.view[0].node;else var o=mo(t.view[s].line),u=t.view[s-1].node.nextSibling;var a=gr(e,i.line);if(a==t.view.length-1)var f=t.viewTo-1,l=t.lineDiv.lastChild;else var f=mo(t.view[a+1].line)-1,l=t.view[a+1].node.previousSibling;var c=e.doc.splitLines(Bt(e,u,l,o,f)),h=ho(e.doc,gt(o,0),gt(f,co(e.doc,f).text.length));while(c.length>1&&h.length>1)if(fu(c)==fu(h))c.pop(),h.pop(),f--;else{if(c[0]!=h[0])break;c.shift(),h.shift(),o++}var p=0,d=0,v=c[0],m=h[0],g=Math.min(v.length,m.length);while(p<g&&v.charCodeAt(p)==m.charCodeAt(p))++p;var y=fu(c),b=fu(h),w=Math.min(y.length-(c.length==1?p:0),b.length-(h.length==1?p:0));while(d<w&&y.charCodeAt(y.length-d-1)==b.charCodeAt(b.length-d-1))++d;c[c.length-1]=y.slice(0,y.length-d),c[0]=c[0].slice(p);var E=gt(o,p),S=gt(f,h.length?fu(h).length-d:0);if(c.length>1||c[0]||yt(E,S))return bi(e.doc,c,E,S,"+input"),!0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){if(!this.composing||this.composing.handled)return;this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus()},applyComposition:function(e){this.cm.isReadOnly()?fr(this.cm,dr)(this.cm):e.data&&e.data!=e.startData&&fr(this.cm,Tt)(this.cm,e.data,0,e.sel)},setUneditable:function(e){e.contentEditable="false"},onKeyPress:function(e){e.preventDefault(),this.cm.isReadOnly()||fr(this.cm,Tt)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},readOnlyChanged:function(e){this.div.contentEditable=String(e!="nocursor")},onContextMenu:du,resetPosition:du,needsContentAttribute:!0},Mt.prototype),T.inputStyles={textarea:At,contenteditable:Mt},jt.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(yt(n.anchor,r.anchor)!=0||yt(n.head,r.head)!=0)return!1}return!0},deepCopy:function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Ft(bt(this.ranges[t].anchor),bt(this.ranges[t].head));return new jt(e,this.primIndex)},somethingSelected:function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},contains:function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(yt(t,r.from())>=0&&yt(e,r.to())<=0)return n}return-1}},Ft.prototype={from:function(){return Et(this.anchor,this.head)},to:function(){return wt(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var On={left:0,right:0,top:0,bottom:0},Jn,Gn=null,Yn=0,kr,Lr,Pr=0,Rr=0,Ur=null;s?Ur=-0.53:n?Ur=15:f?Ur=-0.7:c&&(Ur=-1/3);var zr=function(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}};T.wheelEventPixels=function(e){var t=zr(e);return t.x*=Ur,t.y*=Ur,t};var $r=new iu,Gr=null,ui=T.changeEnd=function(e){return e.text?gt(e.from.line+e.text.length-1,fu(e.text).length+(e.text.length==1?e.from.ch:0)):e.to};T.prototype={constructor:T,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var n=this.options,r=n[e];if(n[e]==t&&e!="mode")return;n[e]=t,Di.hasOwnProperty(e)&&fr(this,Di[e])(this,t,r)},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Ki(e))},removeKeyMap:function(e){var t=this.state.keyMaps;for(var n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:lr(function(e,t){var n=e.token?e:T.getMode(this.options,e);if(n.startState)throw new Error("Overlays may not be stateful.");pu(this.state.overlays,{mode:n,modeSpec:e,opaque:t&&t.opaque,priority:t&&t.priority||0},function(e){return e.priority}),this.state.modeGen++,dr(this)}),removeOverlay:lr(function(e){var t=this.state.overlays;for(var n=0;n<t.length;++n){var r=t[n].modeSpec;if(r==e||typeof e=="string"&&r.name==e){t.splice(n,1),this.state.modeGen++,dr(this);return}}}),indentLine:lr(function(e,t,n){typeof t!="string"&&typeof t!="number"&&(t==null?t=this.options.smartIndent?"smart":"prev":t=t?"add":"subtract"),Wt(this.doc,e)&&ki(this,e,t,n)}),indentSelection:lr(function(e){var t=this.doc.sel.ranges,n=-1;for(var r=0;r<t.length;r++){var i=t[r];if(!i.empty()){var s=i.from(),o=i.to(),u=Math.max(n,s.line);n=Math.min(this.lastLine(),o.line-(o.ch?0:1))+1;for(var a=u;a<n;++a)ki(this,a,e);var f=this.doc.sel.ranges;s.ch==0&&t.length==f.length&&f[r].from().ch>0&&Kt(this.doc,r,new Ft(s,f[r].to()),tu)}else i.head.line>n&&(ki(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&Ni(this))}}),getTokenAt:function(e,t){return qs(this,e,t)},getLineTokens:function(e,t){return qs(this,gt(e),t,!0)},getTokenTypeAt:function(e){e=Ut(this.doc,e);var t=zs(this,co(this.doc,e.line)),n=0,r=(t.length-1)/2,i=e.ch,s;if(i==0)s=t[2];else for(;;){var o=n+r>>1;if((o?t[o*2-1]:0)>=i)r=o;else{if(!(t[o*2+1]<i)){s=t[o*2+2];break}n=o+1}}var u=s?s.indexOf("cm-overlay "):-1;return u<0?s:u==0?null:s.slice(0,u-1)},getModeAt:function(e){var t=this.doc.mode;return t.innerMode?T.innerMode(t,this.getTokenAt(e).state).mode:t},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=[];if(!qi.hasOwnProperty(t))return n;var r=qi[t],i=this.getModeAt(e);if(typeof i[t]=="string")r[i[t]]&&n.push(r[i[t]]);else if(i[t])for(var s=0;s<i[t].length;s++){var o=r[i[t][s]];o&&n.push(o)}else i.helperType&&r[i.helperType]?n.push(r[i.helperType]):r[i.name]&&n.push(r[i.name]);for(var s=0;s<r._global.length;s++){var u=r._global[s];u.pred(i,this)&&cu(n,u.val)==-1&&n.push(u.val)}return n},getStateAfter:function(e,t){var n=this.doc;return e=Rt(n,e==null?n.first+n.size-1:e),mn(this,e+1,t)},cursorCoords:function(e,t){var n,r=this.doc.sel.primary();return e==null?n=r.head:typeof e=="object"?n=Ut(this.doc,e):n=e?r.from():r.to(),zn(this,n,t||"page")},charCoords:function(e,t){return Un(this,Ut(this.doc,e),t||"page")},coordsChar:function(e,t){return e=Rn(this,e,t||"page"),Vn(this,e.left,e.top)},lineAtHeight:function(e,t){return e=Rn(this,{top:e,left:0},t||"page").top,go(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t){var n=!1,r;if(typeof e=="number"){var i=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>i&&(e=i,n=!0),r=co(this.doc,e)}else r=e;return qn(this,r,{top:0,left:0},t||"page").top+(n?this.doc.height-yo(r):0)},defaultTextHeight:function(){return Kn(this.display)},defaultCharWidth:function(){return Qn(this.display)},setGutterMarker:lr(function(e,t,n){return Li(this.doc,e,"gutter",function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&Eu(r)&&(e.gutterMarkers=null),!0})}),clearGutter:lr(function(e){var t=this,n=t.doc,r=n.first;n.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&(n.gutterMarkers[e]=null,vr(t,r,"gutter"),Eu(n.gutterMarkers)&&(n.gutterMarkers=null)),++r})}),lineInfo:function(e){if(typeof e=="number"){if(!Wt(this.doc,e))return null;var t=e;e=co(this.doc,e);if(!e)return null}else{var t=mo(e);if(t==null)return null}return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var s=this.display;e=zn(this,Ut(this.doc,e));var o=e.bottom,u=e.left;t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),s.sizer.appendChild(t);if(r=="over")o=e.top;else if(r=="above"||r=="near"){var a=Math.max(s.wrapper.clientHeight,this.doc.height),f=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);(r=="above"||e.bottom+t.offsetHeight>a)&&e.top>t.offsetHeight?o=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=a&&(o=e.bottom),u+t.offsetWidth>f&&(u=f-t.offsetWidth)}t.style.top=o+"px",t.style.left=t.style.right="",i=="right"?(u=s.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):(i=="left"?u=0:i=="middle"&&(u=(s.sizer.clientWidth-t.offsetWidth)/2),t.style.left=u+"px"),n&&Si(this,u,o,u+t.offsetWidth,o+t.offsetHeight)},triggerOnKeyDown:lr(Yr),triggerOnKeyPress:lr(ti),triggerOnKeyUp:ei,execCommand:function(e){if(zi.hasOwnProperty(e))return zi[e].call(null,this)},triggerElectric:lr(function(e){Ct(this,e)}),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var s=0,o=Ut(this.doc,e);s<t;++s){o=Oi(this.doc,o,i,n,r);if(o.hitSide)break}return o},moveH:lr(function(e,t){var n=this;n.extendSelectionsBy(function(r){return n.display.shift||n.doc.extend||r.empty()?Oi(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()},ru)}),deleteH:lr(function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Ai(this,function(n){var i=Oi(r,n.head,e,t,!1);return e<0?{from:i,to:n.head}:{from:n.head,to:i}})}),findPosV:function(e,t,n,r){var i=1,s=r;t<0&&(i=-1,t=-t);for(var o=0,u=Ut(this.doc,e);o<t;++o){var a=zn(this,u,"div");s==null?s=a.left:a.left=s,u=Mi(this,a,i,n);if(u.hitSide)break}return u},moveV:lr(function(e,t){var n=this,r=this.doc,i=[],s=!n.display.shift&&!r.extend&&r.sel.somethingSelected();r.extendSelectionsBy(function(o){if(s)return e<0?o.from():o.to();var u=zn(n,o.head,"div");o.goalColumn!=null&&(u.left=o.goalColumn),i.push(u.left);var a=Mi(n,u,e,t);return t=="page"&&o==r.sel.primary()&&Ti(n,null,Un(n,a,"div").top-u.top),a},ru);if(i.length)for(var o=0;o<r.sel.ranges.length;o++)r.sel.ranges[o].goalColumn=i[o]}),findWordAt:function(e){var t=this.doc,n=co(t,e.line).text,r=e.ch,i=e.ch;if(n){var s=this.getHelper(e,"wordChars");(e.xRel<0||i==n.length)&&r?--r:++i;var o=n.charAt(r),u=wu(o,s)?function(e){return wu(e,s)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!wu(e)};while(r>0&&u(n.charAt(r-1)))--r;while(i<n.length&&u(n.charAt(i)))++i}return new Ft(gt(e.line,r),gt(e.line,i))},toggleOverwrite:function(e){if(e!=null&&e==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?_u(this.display.cursorDiv,"CodeMirror-overwrite"):Mu(this.display.cursorDiv,"CodeMirror-overwrite"),Xo(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==Au()},isReadOnly:function(){return!!this.options.readOnly||!!this.doc.cantEdit},scrollTo:lr(function(e,t){(e!=null||t!=null)&&Ci(this),e!=null&&(this.curOp.scrollLeft=e),t!=null&&(this.curOp.scrollTop=t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-wn(this)-this.display.barHeight,width:e.scrollWidth-wn(this)-this.display.barWidth,clientHeight:Sn(this),clientWidth:En(this)}},scrollIntoView:lr(function(e,t){e==null?(e={from:this.doc.sel.primary().head,to:null},t==null&&(t=this.options.cursorScrollMargin)):typeof e=="number"?e={from:gt(e,0),to:null}:e.from==null&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0;if(e.from.line!=null)Ci(this),this.curOp.scrollToPos=e;else{var n=xi(this,Math.min(e.from.left,e.to.left),Math.min(e.from.top,e.to.top)-e.margin,Math.max(e.from.right,e.to.right),Math.max(e.from.bottom,e.to.bottom)+e.margin);this.scrollTo(n.scrollLeft,n.scrollTop)}}),setSize:lr(function(e,t){function r(e){return typeof e=="number"||/^\d+$/.test(String(e))?e+"px":e}var n=this;e!=null&&(n.display.wrapper.style.width=r(e)),t!=null&&(n.display.wrapper.style.height=r(t)),n.options.lineWrapping&&Bn(this);var i=n.display.viewFrom;n.doc.iter(i,n.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){vr(n,i,"widget");break}++i}),n.curOp.forceUpdate=!0,Xo(n,"refresh",this)}),operation:function(e){return ar(this,e)},refresh:lr(function(){var e=this.display.cachedTextHeight;dr(this),this.curOp.forceUpdate=!0,jn(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),P(this),(e==null||Math.abs(e-Kn(this.display))>.5)&&O(this),Xo(this,"refresh",this)}),swapDoc:lr(function(e){var t=this.doc;return t.cm=null,lo(this,e),jn(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,$o(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Yo(T);var _i=T.defaults={},Di=T.optionHandlers={},Hi=T.Init={toString:function(){return"CodeMirror.Init"}};Pi("value","",function(e,t){e.setValue(t)},!0),Pi("mode",null,function(e,t){e.doc.modeOption=t,C(e)},!0),Pi("indentUnit",2,C,!0),Pi("indentWithTabs",!1),Pi("smartIndent",!0),Pi("tabSize",4,function(e){k(e),jn(e),dr(e)},!0),Pi("lineSeparator",null,function(e,t){e.doc.lineSep=t;if(!t)return;var n=[],r=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var s=e.text.indexOf(t,i);if(s==-1)break;i=s+t.length,n.push(gt(r,s))}r++});for(var i=n.length-1;i>=0;i--)bi(e.doc,t,n[i],gt(n[i].line,n[i].ch+t.length))}),Pi("specialChars",/[\u0000-\u001f\u007f\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("	")?"":"|	"),"g"),n!=T.Init&&e.refresh()}),Pi("specialCharPlaceholder",Ks,function(e){e.refresh()},!0),Pi("electricChars",!0),Pi("inputStyle",v?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),Pi("spellcheck",!1,function(e,t){e.getInputField().spellcheck=t},!0),Pi("rtlMoveVisually",!y),Pi("wholeLineUpdateBefore",!0),Pi("theme","default",function(e){M(e),_(e)},!0),Pi("keyMap","default",function(e,t,n){var r=Ki(t),i=n!=T.Init&&Ki(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)}),Pi("extraKeys",null),Pi("lineWrapping",!1,L,!0),Pi("gutters",[],function(e){j(e.options),_(e)},!0),Pi("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?J(e.display)+"px":"0",e.refresh()},!0),Pi("coverGutterNextToScrollbar",!1,function(e){U(e)},!0),Pi("scrollbarStyle","native",function(e){R(e),U(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),Pi("lineNumbers",!1,function(e){j(e.options),_(e)},!0),Pi("firstLineNumber",1,_,!0),Pi("lineNumberFormatter",function(e){return e},_,!0),Pi("showCursorWhenSelecting",!1,an,!0),Pi("resetSelectionOnContextMenu",!0),Pi("lineWiseCopyCut",!0),Pi("readOnly",!1,function(e,t){t=="nocursor"?(ii(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),Pi("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),Pi("dragDrop",!0,Sr),Pi("allowDropFileTypes",null),Pi("cursorBlinkRate",530),Pi("cursorScrollMargin",0),Pi("cursorHeight",1,an,!0),Pi("singleCursorHeightPerLine",!0,an,!0),Pi("workTime",100),Pi("workDelay",100),Pi("flattenSpans",!0,k,!0),Pi("addModeClass",!1,k,!0),Pi("pollInterval",100),Pi("undoDepth",200,function(e,t){e.doc.history.undoDepth=t}),Pi("historyEventDelay",1250),Pi("viewportMargin",10,function(e){e.refresh()},!0),Pi("maxHighlightLength",1e4,k,!0),Pi("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),Pi("tabindex",null,function(e,t){e.display.input.getField().tabIndex=t||""}),Pi("autofocus",null);var Bi=T.modes={},ji=T.mimeModes={};T.defineMode=function(e,t){!T.defaults.mode&&e!="null"&&(T.defaults.mode=e),arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Bi[e]=t},T.defineMIME=function(e,t){ji[e]=t},T.resolveMode=function(e){if(typeof e=="string"&&ji.hasOwnProperty(e))e=ji[e];else if(e&&typeof e.name=="string"&&ji.hasOwnProperty(e.name)){var t=ji[e.name];typeof t=="string"&&(t={name:t}),e=vu(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return T.resolveMode("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return T.resolveMode("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}},T.getMode=function(e,t){var t=T.resolveMode(t),n=Bi[t.name];if(!n)return T.getMode(e,"text/plain");var r=n(e,t);if(Fi.hasOwnProperty(t.name)){var i=Fi[t.name];for(var s in i){if(!i.hasOwnProperty(s))continue;r.hasOwnProperty(s)&&(r["_"+s]=r[s]),r[s]=i[s]}}r.name=t.name,t.helperType&&(r.helperType=t.helperType);if(t.modeProps)for(var s in t.modeProps)r[s]=t.modeProps[s];return r},T.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),T.defineMIME("text/plain","null");var Fi=T.modeExtensions={};T.extendMode=function(e,t){var n=Fi.hasOwnProperty(e)?Fi[e]:Fi[e]={};mu(t,n)},T.defineExtension=function(e,t){T.prototype[e]=t},T.defineDocExtension=function(e,t){oo.prototype[e]=t},T.defineOption=Pi;var Ii=[];T.defineInitHook=function(e){Ii.push(e)};var qi=T.helpers={};T.registerHelper=function(e,t,n){qi.hasOwnProperty(e)||(qi[e]=T[e]={_global:[]}),qi[e][t]=n},T.registerGlobalHelper=function(e,t,n,r){T.registerHelper(e,t,r),qi[e]._global.push({pred:n,val:r})};var Ri=T.copyState=function(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n},Ui=T.startState=function(e,t,n){return e.startState?e.startState(t,n):!0};T.innerMode=function(e,t){while(e.innerMode){var n=e.innerMode(t);if(!n||n.mode==e)break;t=n.state,e=n.mode}return n||{mode:e,state:t}};var zi=T.commands={selectAll:function(e){e.setSelection(gt(e.firstLine(),0),gt(e.lastLine()),tu)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),tu)},killLine:function(e){Ai(e,function(t){if(t.empty()){var n=co(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:gt(t.head.line+1,0)}:{from:t.head,to:gt(t.head.line,n)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){Ai(e,function(t){return{from:gt(t.from().line,0),to:Ut(e.doc,gt(t.to().line+1,0))}})},delLineLeft:function(e){Ai(e,function(e){return{from:gt(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){Ai(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){Ai(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){e.undo()},redo:function(e){e.redo()},undoSelection:function(e){e.undoSelection()},redoSelection:function(e){e.redoSelection()},goDocStart:function(e){e.extendSelection(gt(e.firstLine(),0))},goDocEnd:function(e){e.extendSelection(gt(e.lastLine()))},goLineStart:function(e){e.extendSelectionsBy(function(t){return ea(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){e.extendSelectionsBy(function(t){return na(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){e.extendSelectionsBy(function(t){return ta(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},ru)},goLineLeft:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},ru)},goLineLeftSmart:function(e){e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?na(e,t.head):r},ru)},goLineUp:function(e){e.moveV(-1,"line")},goLineDown:function(e){e.moveV(1,"line")},goPageUp:function(e){e.moveV(-1,"page")},goPageDown:function(e){e.moveV(1,"page")},goCharLeft:function(e){e.moveH(-1,"char")},goCharRight:function(e){e.moveH(1,"char")},goColumnLeft:function(e){e.moveH(-1,"column")},goColumnRight:function(e){e.moveH(1,"column")},goWordLeft:function(e){e.moveH(-1,"word")},goGroupRight:function(e){e.moveH(1,"group")},goGroupLeft:function(e){e.moveH(-1,"group")},goWordRight:function(e){e.moveH(1,"word")},delCharBefore:function(e){e.deleteH(-1,"char")},delCharAfter:function(e){e.deleteH(1,"char")},delWordBefore:function(e){e.deleteH(-1,"word")},delWordAfter:function(e){e.deleteH(1,"word")},delGroupBefore:function(e){e.deleteH(-1,"group")},delGroupAfter:function(e){e.deleteH(1,"group")},indentAuto:function(e){e.indentSelection("smart")},indentMore:function(e){e.indentSelection("add")},indentLess:function(e){e.indentSelection("subtract")},insertTab:function(e){e.replaceSelection("	")},insertSoftTab:function(e){var t=[],n=e.listSelections(),r=e.options.tabSize;for(var i=0;i<n.length;i++){var s=n[i].from(),o=su(e.getLine(s.line),s.ch,r);t.push(au(r-o%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){ar(e,function(){var t=e.listSelections(),n=[];for(var r=0;r<t.length;r++){var i=t[r].head,s=co(e.doc,i.line).text;if(s){i.ch==s.length&&(i=new gt(i.line,i.ch-1));if(i.ch>0)i=new gt(i.line,i.ch+1),e.replaceRange(s.charAt(i.ch-1)+s.charAt(i.ch-2),gt(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var o=co(e.doc,i.line-1).text;o&&e.replaceRange(s.charAt(0)+e.doc.lineSeparator()+o.charAt(o.length-1),gt(i.line-1,o.length-1),gt(i.line,1),"+transpose")}}n.push(new Ft(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){ar(e,function(){var t=e.listSelections().length;for(var n=0;n<t;n++){var r=e.listSelections()[n];e.replaceRange(e.doc.lineSeparator(),r.anchor,r.head,"+input"),e.indentLine(r.from().line+1,null,!0)}Ni(e)})},openLine:function(e){e.replaceSelection("\n","start")},toggleOverwrite:function(e){e.toggleOverwrite()}},Wi=T.keyMap={};Wi.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Wi.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Wi.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Wi.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Wi["default"]=m?Wi.macDefault:Wi.pcDefault,T.normalizeKeyMap=function(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if(r=="..."){delete e[n];continue}var i=hu(n.split(" "),Xi);for(var s=0;s<i.length;s++){var o,u;s==i.length-1?(u=i.join(" "),o=r):(u=i.slice(0,s+1).join(" "),o="...");var a=t[u];if(!a)t[u]=o;else if(a!=o)throw new Error("Inconsistent bindings for "+u)}delete e[n]}for(var f in t)e[f]=t[f];return e};var Vi=T.lookupKey=function(e,t,n,r){t=Ki(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return"nothing";if(i==="...")return"multi";if(i!=null&&n(i))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Vi(e,t.fallthrough,n,r);for(var s=0;s<t.fallthrough.length;s++){var o=Vi(e,t.fallthrough[s],n,r);if(o)return o}}},$i=T.isModifierKey=function(e){var t=typeof e=="string"?e:Ju[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"},Ji=T.keyName=function(e,t){if(l&&e.keyCode==34&&e["char"])return!1;var n=Ju[e.keyCode],r=n;return r==null||e.altGraphKey?!1:(e.altKey&&n!="Alt"&&(r="Alt-"+r),(w?e.metaKey:e.ctrlKey)&&n!="Ctrl"&&(r="Ctrl-"+r),(w?e.ctrlKey:e.metaKey)&&n!="Cmd"&&(r="Cmd-"+r),!t&&e.shiftKey&&n!="Shift"&&(r="Shift-"+r),r)};T.fromTextArea=function(e,t){function r(){e.value=a.getValue()}t=t?mu(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder);if(t.autofocus==null){var n=Au();t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}if(e.form){Ro(e.form,"submit",r);if(!t.leaveSubmitMethodAlone){var i=e.form,s=i.submit;try{var o=i.submit=function(){r(),i.submit=s,i.submit(),i.submit=o}}catch(u){}}}t.finishInit=function(t){t.save=r,t.getTextArea=function(){return e},t.toTextArea=function(){t.toTextArea=isNaN,r(),e.parentNode.removeChild(t.getWrapperElement()),e.style.display="",e.form&&(Wo(e.form,"submit",r),typeof e.form.submit=="function"&&(e.form.submit=s))}},e.style.display="none";var a=T(function(t){e.parentNode.insertBefore(t,e.nextSibling)},t);return a};var Qi=T.StringStream=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};Qi.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||undefined},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(e){var t=this.string.charAt(this.pos);if(typeof e=="string")var n=t==e;else var n=t&&(e.test?e.test(t):e(t));if(n)return++this.pos,t},eatWhile:function(e){var t=this.pos;while(this.eat(e));return this.pos>t},eatSpace:function(){var e=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=su(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?su(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return su(this.string,null,this.tabSize)-(this.lineStart?su(this.string,this.lineStart,this.tabSize):0)},match:function(e,t,n){if(typeof e!="string"){var s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}var r=function(e){return n?e.toLowerCase():e},i=this.string.substr(this.pos,e.length);if(r(i)==r(e))return t!==!1&&(this.pos+=e.length),!0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}};var Gi=0,Yi=T.TextMarker=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Gi};Yo(Yi),Yi.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,t=e&&!e.curOp;t&&Zn(e);if(Go(this,"clear")){var n=this.find();n&&$o(this,"clear",n.from,n.to)}var r=null,i=null;for(var s=0;s<this.lines.length;++s){var o=this.lines[s],u=os(o.markedSpans,this);e&&!this.collapsed?vr(e,mo(o),"text"):e&&(u.to!=null&&(i=mo(o)),u.from!=null&&(r=mo(o))),o.markedSpans=us(o.markedSpans,u),u.from==null&&this.collapsed&&!Ls(this.doc,o)&&e&&vo(o,Kn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var a=Ts(this.lines[s]),f=H(a);f>e.display.maxLineLength&&(e.display.maxLine=a,e.display.maxLineLength=f,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&dr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&nn(e.doc)),e&&$o(e,"markerCleared",e,this),t&&tr(e),this.parent&&this.parent.clear()},Yi.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);var n,r;for(var i=0;i<this.lines.length;++i){var s=this.lines[i],o=os(s.markedSpans,this);if(o.from!=null){n=gt(t?s:mo(s),o.from);if(e==-1)return n}if(o.to!=null){r=gt(t?s:mo(s),o.to);if(e==1)return r}}return n&&{from:n,to:r}},Yi.prototype.changed=function(){var e=this.find(-1,!0),t=this,n=this.doc.cm;if(!e||!n)return;ar(n,function(){var r=e.line,i=mo(e.line),s=kn(n,i);s&&(Hn(s),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0;if(!Ls(t.doc,r)&&t.height!=null){var o=t.height;t.height=null;var u=_s(t)-o;u&&vo(r,r.height+u)}})},Yi.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||cu(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Yi.prototype.detachLine=function(e){this.lines.splice(cu(this.lines,e),1);if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}};var Gi=0,es=T.SharedTextMarker=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};Yo(es),es.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();$o(this,"clear")},es.prototype.find=function(e,t){return this.primary.find(e,t)};var Os=T.LineWidget=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};Yo(Os),Os.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=mo(n);if(r==null||!t)return;for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var s=_s(this);vo(n,Math.max(0,n.height-s)),e&&ar(e,function(){Ms(e,n,-s),vr(e,r,"widget")})},Os.prototype.changed=function(){var e=this.height,t=this.doc.cm,n=this.line;this.height=null;var r=_s(this)-e;if(!r)return;vo(n,n.height+r),t&&ar(t,function(){t.curOp.forceUpdate=!0,Ms(t,n,r)})};var Ps=T.Line=function(e,t,n){this.text=e,ms(this,t),this.height=n?n(this):1};Yo(Ps),Ps.prototype.lineNo=function(){return mo(this)};var Xs={},Vs={};ro.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,Bs(i),$o(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}},io.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var s=Math.min(t,i-e),o=r.height;r.removeInner(e,s),this.height-=o-r.height,i==s&&(this.children.splice(n--,1),r.parent=null);if((t-=s)==0)break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof ro))){var u=[];this.collapse(u),this.children=[new ro(u)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],s=i.chunkSize();if(e<=s){i.insertInner(e,t,n);if(i.lines&&i.lines.length>50){var o=i.lines.length%25+25;for(var u=o;u<i.lines.length;){var a=new ro(i.lines.slice(u,u+=25));i.height-=a.height,this.children.splice(++r,0,a),a.parent=this}i.lines=i.lines.slice(0,o),this.maybeSpill()}break}e-=s}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new io(t);if(!e.parent){var r=new io(e.children);r.parent=e,e.children=[r,n],e=r}else{e.size-=n.size,e.height-=n.height;var i=cu(e.parent.children,e);e.parent.children.splice(i+1,0,n)}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],s=i.chunkSize();if(e<s){var o=Math.min(t,s-e);if(i.iterN(e,o,n))return!0;if((t-=o)==0)break;e=0}else e-=s}}};var so=0,oo=T.Doc=function(e,t,n,r){if(!(this instanceof oo))return new oo(e,t,n,r);n==null&&(n=0),io.call(this,[new ro([new Ps("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=n;var i=gt(n,0);this.sel=qt(i),this.history=new wo(null),this.id=++so,this.modeOption=t,this.lineSep=r,this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),no(this,{from:i,to:i,text:e}),Zt(this,qt(i),tu)};oo.prototype=vu(io.prototype,{constructor:oo,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){var n=0;for(var r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=po(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:cr(function(e){var t=gt(this.first,0),n=this.first+this.size-1;pi(this,{from:t,to:gt(n,co(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),Zt(this,qt(t))}),replaceRange:function(e,t,n,r){t=Ut(this,t),n=n?Ut(this,n):t,bi(this,e,t,n,r)},getRange:function(e,t,n){var r=ho(this,Ut(this,e),Ut(this,t));return n===!1?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Wt(this,e))return co(this,e)},getLineNumber:function(e){return mo(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=co(this,e)),Ts(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Ut(this,e)},getCursor:function(e){var t=this.sel.primary(),n;return e==null||e=="head"?n=t.head:e=="anchor"?n=t.anchor:e=="end"||e=="to"||e===!1?n=t.to():n=t.from(),n},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:cr(function(e,t,n){Qt(this,Ut(this,typeof e=="number"?gt(e,t||0):e),null,n)}),setSelection:cr(function(e,t,n){Qt(this,Ut(this,e),Ut(this,t||e),n)}),extendSelection:cr(function(e,t,n){$t(this,Ut(this,e),t&&Ut(this,t),n)}),extendSelections:cr(function(e,t){Jt(this,Xt(this,e),t)}),extendSelectionsBy:cr(function(e,t){var n=hu(this.sel.ranges,e);Jt(this,Xt(this,n),t)}),setSelections:cr(function(e,t,n){if(!e.length)return;for(var r=0,i=[];r<e.length;r++)i[r]=new Ft(Ut(this,e[r].anchor),Ut(this,e[r].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Zt(this,It(i,t),n)}),addSelection:cr(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new Ft(Ut(this,e),Ut(this,t||e))),Zt(this,It(r,r.length-1),n)}),getSelection:function(e){var t=this.sel.ranges,n;for(var r=0;r<t.length;r++){var i=ho(this,t[r].from(),t[r].to());n=n?n.concat(i):i}return e===!1?n:n.join(e||this.lineSeparator())},getSelections:function(e){var t=[],n=this.sel.ranges;for(var r=0;r<n.length;r++){var i=ho(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){var r=[];for(var i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:cr(function(e,t,n){var r=[],i=this.sel;for(var s=0;s<i.ranges.length;s++){var o=i.ranges[s];r[s]={from:o.from(),to:o.to(),text:this.splitLines(e[s]),origin:n}}var u=t&&t!="end"&&ci(this,r,t);for(var s=r.length-1;s>=0;s--)pi(this,r[s]);u?Yt(this,u):this.cm&&Ni(this.cm)}),undo:cr(function(){vi(this,"undo")}),redo:cr(function(){vi(this,"redo")}),undoSelection:cr(function(){vi(this,"undo",!0)}),redoSelection:cr(function(){vi(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){var e=this.history,t=0,n=0;for(var r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var r=0;r<e.undone.length;r++)e.undone[r].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){this.history=new wo(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:Mo(this.history.done),undone:Mo(this.history.undone)}},setHistory:function(e){var t=this.history=new wo(this.history.maxGeneration);t.done=Mo(e.done.slice(0),null,!0),t.undone=Mo(e.undone.slice(0),null,!0)},addLineClass:cr(function(e,t,n){return Li(this,e,t=="gutter"?"gutter":"class",function(e){var r=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!e[r])e[r]=n;else{if(Ou(n).test(e[r]))return!1;e[r]+=" "+n}return!0})}),removeLineClass:cr(function(e,t,n){return Li(this,e,t=="gutter"?"gutter":"class",function(e){var r=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",i=e[r];if(!i)return!1;if(n==null)e[r]=null;else{var s=i.match(Ou(n));if(!s)return!1;var o=s.index+s[0].length;e[r]=i.slice(0,s.index)+(!s.index||o==i.length?"":" ")+i.slice(o)||null}return!0})}),addLineWidget:cr(function(e,t,n){return Ds(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Zi(this,Ut(this,e),Ut(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=Ut(this,e),Zi(this,e,e,n,"bookmark")},findMarksAt:function(e){e=Ut(this,e);var t=[],n=co(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=Ut(this,e),t=Ut(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(s){var o=s.markedSpans;if(o)for(var u=0;u<o.length;u++){var a=o[u];!(a.to!=null&&i==e.line&&e.ch>=a.to||a.from==null&&i!=e.line||a.from!=null&&i==t.line&&a.from>=t.ch)&&(!n||n(a.marker))&&r.push(a.marker.parent||a.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)n[r].from!=null&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var s=i.text.length+r;if(s>e)return t=e,!0;e-=s,++n}),Ut(this,gt(n,t))},indexFromPos:function(e){e=Ut(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+n}),t},copy:function(e){var t=new oo(po(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<n&&(n=e.to);var r=new oo(po(this,t,n),e.mode||this.modeOption,t,this.lineSep);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],rs(r,ns(this)),r},unlinkDoc:function(e){e instanceof T&&(e=e.doc);if(this.linked)for(var t=0;t<this.linked.length;++t){var n=this.linked[t];if(n.doc!=e)continue;this.linked.splice(t,1),e.unlinkDoc(this),is(ns(this));break}if(e.history==this.history){var r=[e.id];fo(e,function(e){r.push(e.id)},!0),e.history=new wo(null),e.history.done=Mo(this.history.done,r),e.history.undone=Mo(this.history.undone,r)}},iterLinkedDocs:function(e){fo(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):zu(e)},lineSeparator:function(){return this.lineSep||"\n"}}),oo.prototype.eachLine=oo.prototype.iter;var uo="iter insert remove copy getEditor constructor".split(" ");for(var ao in oo.prototype)oo.prototype.hasOwnProperty(ao)&&cu(uo,ao)<0&&(T.prototype[ao]=function(e){return function(){return e.apply(this.doc,arguments)}}(oo.prototype[ao]));Yo(oo);var Ho=T.e_preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},Bo=T.e_stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},Fo=T.e_stop=function(e){Ho(e),Bo(e)},Ro=T.on=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={}),i=r[t]||(r[t]=[]);i.push(n)}},Uo=[],Wo=T.off=function(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=zo(e,t,!1);for(var i=0;i<r.length;++i)if(r[i]==n){r.splice(i,1);break}}},Xo=T.signal=function(e,t){var n=zo(e,t,!0);if(!n.length)return;var r=Array.prototype.slice.call(arguments,2);for(var i=0;i<n.length;++i)n[i].apply(null,r)},Vo=null,Zo=30,eu=T.Pass={toString:function(){return"CodeMirror.Pass"}},tu={scroll:!1},nu={origin:"*mouse"},ru={origin:"+move"};iu.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var su=T.countColumn=function(e,t,n,r,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var s=r||0,o=i||0;;){var u=e.indexOf("	",s);if(u<0||u>=t)return o+(t-s);o+=u-s,o+=n-o%n,s=u+1}},ou=T.findColumn=function(e,t,n){for(var r=0,i=0;;){var s=e.indexOf("	",r);s==-1&&(s=e.length);var o=s-r;if(s==e.length||i+o>=t)return r+Math.min(o,t-i);i+=s-r,i+=n-i%n,r=s+1;if(i>=t)return r}},uu=[""],lu=function(e){e.select()};d?lu=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:s&&(lu=function(e){try{e.select()}catch(t){}});var yu=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,bu=T.isWordChar=function(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||yu.test(e))},Su=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/,Nu;document.createRange?Nu=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:Nu=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var Lu=T.contains=function(e,t){t.nodeType==3&&(t=t.parentNode);if(e.contains)return e.contains(t);do{t.nodeType==11&&(t=t.host);if(t==e)return!0}while(t=t.parentNode)};s&&o<11&&(Au=function(){try{return document.activeElement}catch(e){return document.body}});var Mu=T.rmClass=function(e,t){var n=e.className,r=Ou(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}},_u=T.addClass=function(e,t){var n=e.className;Ou(t).test(n)||(e.className+=(n?" ":"")+t)},Hu=!1,Fu=function(){if(s&&o<9)return!1;var e=Tu("div");return"draggable"in e||"dragDrop"in e}(),Iu,Ru,zu=T.splitLines="\n\nb".split(/\n/).length!=3?function(e){var t=0,n=[],r=e.length;while(t<=r){var i=e.indexOf("\n",t);i==-1&&(i=e.length);var s=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),o=s.indexOf("\r");o!=-1?(n.push(s.slice(0,o)),t+=o+1):(n.push(s),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Wu=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Xu=function(){var e=Tu("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Vu=null,Ju=T.keyNames={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};(function(){for(var e=0;e<10;e++)Ju[e+48]=Ju[e+96]=String(e);for(var e=65;e<=90;e++)Ju[e]=String.fromCharCode(e);for(var e=1;e<=12;e++)Ju[e+111]=Ju[e+63235]="F"+e})();var ia,fa=function(){function n(n){return n<=247?e.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1773?t.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":n==8204?"b":"L"}function f(e,t,n){this.level=e,this.from=t,this.to=n}var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,s=/[LRr]/,o=/[Lb1n]/,u=/[1n]/,a="L";return function(e){if(!r.test(e))return!1;var t=e.length,l=[];for(var c=0,h;c<t;++c)l.push(h=n(e.charCodeAt(c)));for(var c=0,p=a;c<t;++c){var h=l[c];h=="m"?l[c]=p:p=h}for(var c=0,d=a;c<t;++c){var h=l[c];h=="1"&&d=="r"?l[c]="n":s.test(h)&&(d=h,h=="r"&&(l[c]="R"))}for(var c=1,p=l[0];c<t-1;++c){var h=l[c];h=="+"&&p=="1"&&l[c+1]=="1"?l[c]="1":h==","&&p==l[c+1]&&(p=="1"||p=="n")&&(l[c]=p),p=h}for(var c=0;c<t;++c){var h=l[c];if(h==",")l[c]="N";else if(h=="%"){for(var v=c+1;v<t&&l[v]=="%";++v);var m=c&&l[c-1]=="!"||v<t&&l[v]=="1"?"1":"N";for(var g=c;g<v;++g)l[g]=m;c=v-1}}for(var c=0,d=a;c<t;++c){var h=l[c];d=="L"&&h=="1"?l[c]="L":s.test(h)&&(d=h)}for(var c=0;c<t;++c)if(i.test(l[c])){for(var v=c+1;v<t&&i.test(l[v]);++v);var y=(c?l[c-1]:a)=="L",b=(v<t?l[v]:a)=="L",m=y||b?"L":"R";for(var g=c;g<v;++g)l[g]=m;c=v-1}var w=[],E;for(var c=0;c<t;)if(o.test(l[c])){var S=c;for(++c;c<t&&o.test(l[c]);++c);w.push(new f(0,S,c))}else{var x=c,T=w.length;for(++c;c<t&&l[c]!="L";++c);for(var g=x;g<c;)if(u.test(l[g])){x<g&&w.splice(T,0,new f(1,x,g));var N=g;for(++g;g<c&&u.test(l[g]);++g);w.splice(T,0,new f(2,N,g)),x=g}else++g;x<c&&w.splice(T,0,new f(1,x,c))}return w[0].level==1&&(E=e.match(/^\s+/))&&(w[0].from=E[0].length,w.unshift(new f(0,0,E[0].length))),fu(w).level==1&&(E=e.match(/\s+$/))&&(fu(w).to-=E[0].length,w.push(new f(0,t-E[0].length,t))),w[0].level==2&&w.unshift(new f(1,w[0].to,w[0].to)),w[0].level!=fu(w).level&&w.push(new f(w[0].level,t,t)),w}}();return T.version="5.18.2",T}),define("answer",["jquery","laconic"],function(){(function($){function answerHasOutput(e){return e.variables.length>0||e.residuals}function renderSubstitutions(e,t){t.push(', <span class="pl-comment">% where</span><br/>');for(var n=0;n<e.length;n++)t.push('<span class="where-binding">',"<span class='pl-var'>",e[n].var+"</span> = ",e[n].value,"</span>"),n<e.length-1&&t.push(",<br/>")}function renderAnswer(e){var t=[],n=e.variables;for(var r=0;r<n.length;r++){var i=n[r].variables;for(var s=0;s<i.length-1;s++)t.push("<span class='pl-ovar'>",i[s],"</span> = ","<span class='pl-var'>",i[s+1],"</span>, ");t.push("<span class='pl-ovar'>",i[i.length-1],"</span> = ",n[r].value),n[r].substitutions&&renderSubstitutions(n[r].substitutions,t),(r<n.length-1||e.residuals)&&t.push(",<br/>")}var o;if(o=e.residuals)for(var r=0;r<o.length;r++)t.push(o[r]),r<o.length-1&&t.push(",<br/>");return t.join("")}function renderTabledAnswer(e,t){function r(t){var n=e.variables;for(var r=0;r<n.length;r++){var i=n[r].variables;for(var s=0;s<i.length;s++)if(i[s]==t)return n[r]}return null}function u(){t.find("tr.projection th.residuals").length==0&&($("<th class='residuals'>Residual goals</th>").insertBefore(t.find("tr.projection th.answer-nth")),$("<td></td>").insertBefore(t.find("tr td.answer-nth")))}var n=[];for(var i=0;i<e.projection.length;i++){var s=e.projection[i],o=r(s);n.push("<td>"),o?(n.push(o.value),o.substitutions&&renderSubstitutions(o.substitutions,n)):n.push("<span class='pl-var'>",s,"</span>"),n.push("</td>")}var a;if(a=e.residuals){u(),n.push("<td>");for(var i=0;i<a.length;i++)n.push(a[i]),i<a.length-1&&n.push(",<br/>");n.push("</td>")}return e.nth&&n.push("<td class='answer-nth'>",e.nth,"</td>"),n.join("")}function evalScripts(elem){elem.find("script").each(function(){var type=this.getAttribute("type")||"text/javascript";type=="text/javascript"&&($.ajaxScript=$(this),eval(this.textContent))}),$.ajaxScript&&delete $.ajaxScript}var pluginName="prologAnswer",methods={_init:function(e){return this.each(function(){var t=$(this);if(answerHasOutput(e))if(t.is("table")){var n=$.el.tr();t.append(n),n.innerHTML=renderTabledAnswer(e,t),evalScripts($(n)),$(n).find(".render-multi").renderMulti()}else t[0].innerHTML=renderAnswer(e),evalScripts(t),t.find(".render-multi").renderMulti();else t.append($.el.span({"class":"prolog-true"},"true"))})}};$.fn.prologAnswer=function(e){if(methods[e])return methods[e].apply(this,Array.prototype.slice.call(arguments,1));if(typeof e=="object"||!e)return methods._init.apply(this,arguments);$.error("Method "+e+" does not exist on jQuery."+pluginName)}})(jQuery),function(e){function s(){var t=e("#render-select");return t[0]||(t=e(e.el.form({id:"render-select",style:"display:none"})),t.on("click","a",function(n){var r=e(n.target).closest("a"),i=r.data("nr");return t.data("target").renderMulti(r.data("action"),i),!1}),t.on("click",function(){var n=e("input[name=render]:checked",e(this)).val();t.data("target").renderMulti("select",parseInt(n))}),t.hover(function(){r=!0,u()},function(){a()}),e("body").append(t)),t}function o(){if(!r){var e=s(),t=e.data("target");t&&(t.removeClass("render-selecting"),e.data("target",null)),e.hide(400)}}function u(){n=setTimeout(function(){o()},400)}function a(){r=!1,u()}function f(t){var n=t.originalEvent.dataTransfer;return n.setData("Text",e(t.target).renderMulti("prologText")),!0}var t="renderMulti",n=0,r=!1,i={_init:function(n){return this.each(function(){var n=e(this),r={current:0},i=[],s=e.el.div({"class":"render-multi-active"}),o=0;n.children().each(function(){var t=e(this).css("display");i.push(t),o++==0?(n.css("display",t),e(this).attr("draggable",!1)):e(this).hide()}),r.display=i,n.append(s),e(s).hover(function(e){n.renderMulti("showSelect",e)},function(e){n.renderMulti("hideSelect",e)}),n.attr("draggable",!0).bind("dragstart",f),n.data(t,r)})},selectMenu:function(){function s(e,t){var n,r;return t=="Prolog term"?(n="Copy",r="copy"):(n="Download",r="download"),btn='<a href="#" class="btn btn-style btn-sm" data-nr="'+e+'" data-action="'+r+'" title="'+n+'">'+'<span class="glyphicon glyphicon-'+r+'"></span></a>',btn}var n=this.data(t),r=["<label>View as</label><br>"],i=this.children(),o=0;for(var o=0;o<n.display.length;o++){var u=e(i[o]),a=u.attr("data-render");a||(o==0?a="Default rendered":a="Alt rendered ["+(o+1)+"]"),r.push("<div class='render-item'>",s(o,a),"<input type='radio' name='render' value='",o,"'"),o==n.current&&r.push(" checked"),r.push("> ",a,"</div>")}return r.push("</form"),r.join("")},showSelect:function(e){var t=this,i=s(),o=this.offset(),u;r=!0,n&&(clearTimeout(n),n=0),(u=i.data("target"))&&u.removeClass("render-selecting"),i.data("target",t),i.html(this.renderMulti("selectMenu")),i.css({top:o.top+5+"px",left:o.left+5+"px"}).show(400),this.addClass("render-selecting")},hideSelect:function(e){a()},select:function(n){var r=this.data(t);if(r.current!=n){var i=this.children(),s=r.display[n];e(i[r.current]).hide(400),e(i[n]).show(400,function(){e(this).css("display",s)}),this.css("display",s),e(i[n]).is("span.render-as-prolog")?this.attr("draggable",!1):this.attr("draggable",!0),r.current=n}o()},copy:function(e){function s(e){var t=document.createRange();t.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(t)}var n=this.children(),r=this.data(t),i=r.current;this.renderMulti("select",e),s(n[e]);try{document.execCommand("copy")}catch(o){alert("Sorry, cannot copy text with this browser")}return this.renderMulti("select",i),this},download:function(t){function o(){return e("<a>")[0].download!=undefined}var n=this.children(),r=e(n[t]),i="html",s;if(r.hasClass("export-dom")){var u={};r=r.trigger("export-dom",u),u.element?(s=u.element.outerHTML,i=u.extension||"html",type=u.contentType||"text/html"):alert("Failed to export rendered result")}else if(r.find("svg").length==1){var a=r.find("svg");a.attr("xmlns")||a.attr("xmlns","http://www.w3.org/2000/svg"),s=a[0].outerHTML,i="svg",type="image/svg+xml"}else s=r.html(),type="text/html";o()||(type="application/octet-stream");var f="data:"+type+";charset=UTF-8,"+encodeURIComponent(s),l=e.el.a({href:f,download:"swish-rendered."+i});return this.append(l),l.click(),e(l).remove(),this},prologText:function(){return this.find("span.render-as-prolog").text()}};e.fn.renderMulti=function(n){if(i[n])return i[n].apply(this,Array.prototype.slice.call(arguments,1));if(typeof n=="object"||!n)return i._init.apply(this,arguments);e.error("Method "+n+" does not exist on jQuery."+t)}}(jQuery)}),function(e,t,n){(function(e){typeof define=="function"&&define.amd?define("sparkline",["jquery"],e):jQuery&&!jQuery.fn.sparkline&&e(jQuery)})(function(r){var i={},s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N,C,k,L,A,O,M,_,D,P,H,B,j=0;s=function(){return{common:{type:"line",lineColor:"#00f",fillColor:"#cdf",defaultPixelsPerValue:3,width:"auto",height:"auto",composite:!1,tagValuesAttribute:"values",tagOptionsPrefix:"spark",enableTagOptions:!1,enableHighlight:!0,highlightLighten:1.4,tooltipSkipNull:!0,tooltipPrefix:"",tooltipSuffix:"",disableHiddenCheck:!1,numberFormatter:!1,numberDigitGroupCount:3,numberDigitGroupSep:",",numberDecimalMark:".",disableTooltips:!1,disableInteraction:!1},line:{spotColor:"#f80",highlightSpotColor:"#5f5",highlightLineColor:"#f22",spotRadius:1.5,minSpotColor:"#f80",maxSpotColor:"#f80",lineWidth:1,normalRangeMin:n,normalRangeMax:n,normalRangeColor:"#ccc",drawNormalOnTop:!1,chartRangeMin:n,chartRangeMax:n,chartRangeMinX:n,chartRangeMaxX:n,tooltipFormat:new u('<span style="color: {{color}}">&#9679;</span> {{prefix}}{{y}}{{suffix}}')},bar:{barColor:"#3366cc",negBarColor:"#f44",stackedBarColor:["#3366cc","#dc3912","#ff9900","#109618","#66aa00","#dd4477","#0099c6","#990099"],zeroColor:n,nullColor:n,zeroAxis:!0,barWidth:4,barSpacing:1,chartRangeMax:n,chartRangeMin:n,chartRangeClip:!1,colorMap:n,tooltipFormat:new u('<span style="color: {{color}}">&#9679;</span> {{prefix}}{{value}}{{suffix}}')},tristate:{barWidth:4,barSpacing:1,posBarColor:"#6f6",negBarColor:"#f44",zeroBarColor:"#999",colorMap:{},tooltipFormat:new u('<span style="color: {{color}}">&#9679;</span> {{value:map}}'),tooltipValueLookups:{map:{"-1":"Loss",0:"Draw",1:"Win"}}},discrete:{lineHeight:"auto",thresholdColor:n,thresholdValue:0,chartRangeMax:n,chartRangeMin:n,chartRangeClip:!1,tooltipFormat:new u("{{prefix}}{{value}}{{suffix}}")},bullet:{targetColor:"#f33",targetWidth:3,performanceColor:"#33f",rangeColors:["#d3dafe","#a8b6ff","#7f94ff"],base:n,tooltipFormat:new u("{{fieldkey:fields}} - {{value}}"),tooltipValueLookups:{fields:{r:"Range",p:"Performance",t:"Target"}}},pie:{offset:0,sliceColors:["#3366cc","#dc3912","#ff9900","#109618","#66aa00","#dd4477","#0099c6","#990099"],borderWidth:0,borderColor:"#000",tooltipFormat:new u('<span style="color: {{color}}">&#9679;</span> {{value}} ({{percent.1}}%)')},box:{raw:!1,boxLineColor:"#000",boxFillColor:"#cdf",whiskerColor:"#000",outlierLineColor:"#333",outlierFillColor:"#fff",medianColor:"#f00",showOutliers:!0,outlierIQR:1.5,spotRadius:1.5,target:n,targetColor:"#4a2",chartRangeMax:n,chartRangeMin:n,tooltipFormat:new u("{{field:fields}}: {{value}}"),tooltipFormatFieldlistKey:"field",tooltipValueLookups:{fields:{lq:"Lower Quartile",med:"Median",uq:"Upper Quartile",lo:"Left Outlier",ro:"Right Outlier",lw:"Left Whisker",rw:"Right Whisker"}}}}},O='.jqstooltip { position: absolute;left: 0px;top: 0px;visibility: hidden;background: rgb(0, 0, 0) transparent;background-color: rgba(0,0,0,0.6);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";color: white;font: 10px arial, san serif;text-align: left;white-space: nowrap;padding: 5px;border: 1px solid white;z-index: 10000;}.jqsfield { color: white;font: 10px arial, san serif;text-align: left;}',o=function(){var e,t;return e=function(){this.init.apply(this,arguments)},arguments.length>1?(arguments[0]?(e.prototype=r.extend(new arguments[0],arguments[arguments.length-1]),e._super=arguments[0].prototype):e.prototype=arguments[arguments.length-1],arguments.length>2&&(t=Array.prototype.slice.call(arguments,1,-1),t.unshift(e.prototype),r.extend.apply(r,t))):e.prototype=arguments[0],e.prototype.cls=e,e},r.SPFormatClass=u=o({fre:/\{\{([\w.]+?)(:(.+?))?\}\}/g,precre:/(\w+)\.(\d+)/,init:function(e,t){this.format=e,this.fclass=t},render:function(e,t,r){var i=this,s=e,o,u,a,f,l;return this.format.replace(this.fre,function(){var e;return u=arguments[1],a=arguments[3],o=i.precre.exec(u),o?(l=o[2],u=o[1]):l=!1,f=s[u],f===n?"":a&&t&&t[a]?(e=t[a],e.get?t[a].get(f)||f:t[a][f]||f):(p(f)&&(r.get("numberFormatter")?f=r.get("numberFormatter")(f):f=y(f,l,r.get("numberDigitGroupCount"),r.get("numberDigitGroupSep"),r.get("numberDecimalMark"))),f)})}}),r.spformat=function(e,t){return new u(e,t)},a=function(e,t,n){return e<t?t:e>n?n:e},f=function(e,n){var r;return n===2?(r=t.floor(e.length/2),e.length%2?e[r]:(e[r-1]+e[r])/2):e.length%2?(r=(e.length*n+n)/4,r%1?(e[t.floor(r)]+e[t.floor(r)-1])/2:e[r-1]):(r=(e.length*n+2)/4,r%1?(e[t.floor(r)]+e[t.floor(r)-1])/2:e[r-1])},l=function(e){var t;switch(e){case"undefined":e=n;break;case"null":e=null;break;case"true":e=!0;break;case"false":e=!1;break;default:t=parseFloat(e),e==t&&(e=t)}return e},c=function(e){var t,n=[];for(t=e.length;t--;)n[t]=l(e[t]);return n},h=function(e,t){var n,r,i=[];for(n=0,r=e.length;n<r;n++)e[n]!==t&&i.push(e[n]);return i},p=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},y=function(e,t,n,i,s){var o,u;e=(t===!1?parseFloat(e).toString():e.toFixed(t)).split(""),o=(o=r.inArray(".",e))<0?e.length:o,o<e.length&&(e[o]=s);for(u=o-n;u>0;u-=n)e.splice(u,0,i);return e.join("")},d=function(e,t,n){var r;for(r=t.length;r--;){if(n&&t[r]===null)continue;if(t[r]!==e)return!1}return!0},v=function(e){var t=0,n;for(n=e.length;n--;)t+=typeof e[n]=="number"?e[n]:0;return t},g=function(e){return r.isArray(e)?e:[e]},m=function(t){var n;e.createStyleSheet?e.createStyleSheet().cssText=t:(n=e.createElement("style"),n.type="text/css",e.getElementsByTagName("head")[0].appendChild(n),n[typeof e.body.style.WebkitAppearance=="string"?"innerText":"innerHTML"]=t)},r.fn.simpledraw=function(t,i,s,o){var u,a;if(s&&(u=this.data("_jqs_vcanvas")))return u;if(r.fn.sparkline.canvas===!1)return!1;if(r.fn.sparkline.canvas===n){var f=e.createElement("canvas");if(!f.getContext||!f.getContext("2d")){if(!e.namespaces||!!e.namespaces.v)return r.fn.sparkline.canvas=!1,!1;e.namespaces.add("v","urn:schemas-microsoft-com:vml","#default#VML"),r.fn.sparkline.canvas=function(e,t,n,r){return new H(e,t,n)}}else r.fn.sparkline.canvas=function(e,t,n,r){return new P(e,t,n,r)}}return t===n&&(t=r(this).innerWidth()),i===n&&(i=r(this).innerHeight()),u=r.fn.sparkline.canvas(t,i,this,o),a=r(this).data("_jqs_mhandler"),a&&a.registerCanvas(u),u},r.fn.cleardraw=function(){var e=this.data("_jqs_vcanvas");e&&e.reset()},r.RangeMapClass=b=o({init:function(e){var t,n,r=[];for(t in e)e.hasOwnProperty(t)&&typeof t=="string"&&t.indexOf(":")>-1&&(n=t.split(":"),n[0]=n[0].length===0?-Infinity:parseFloat(n[0]),n[1]=n[1].length===0?Infinity:parseFloat(n[1]),n[2]=e[t],r.push(n));this.map=e,this.rangelist=r||!1},get:function(e){var t=this.rangelist,r,i,s;if((s=this.map[e])!==n)return s;if(t)for(r=t.length;r--;){i=t[r];if(i[0]<=e&&i[1]>=e)return i[2]}return n}}),r.range_map=function(e){return new b(e)},w=o({init:function(e,t){var n=r(e);this.$el=n,this.options=t,this.currentPageX=0,this.currentPageY=0,this.el=e,this.splist=[],this.tooltip=null,this.over=!1,this.displayTooltips=!t.get("disableTooltips"),this.highlightEnabled=!t.get("disableHighlight")},registerSparkline:function(e){this.splist.push(e),this.over&&this.updateDisplay()},registerCanvas:function(e){var t=r(e.canvas);this.canvas=e,this.$canvas=t,t.mouseenter(r.proxy(this.mouseenter,this)),t.mouseleave(r.proxy(this.mouseleave,this)),t.click(r.proxy(this.mouseclick,this))},reset:function(e){this.splist=[],this.tooltip&&e&&(this.tooltip.remove(),this.tooltip=n)},mouseclick:function(e){var t=r.Event("sparklineClick");t.originalEvent=e,t.sparklines=this.splist,this.$el.trigger(t)},mouseenter:function(t){r(e.body).unbind("mousemove.jqs"),r(e.body).bind("mousemove.jqs",r.proxy(this.mousemove,this)),this.over=!0,this.currentPageX=t.pageX,this.currentPageY=t.pageY,this.currentEl=t.target,!this.tooltip&&this.displayTooltips&&(this.tooltip=new E(this.options),this.tooltip.updatePosition(t.pageX,t.pageY)),this.updateDisplay()},mouseleave:function(){r(e.body).unbind("mousemove.jqs");var t=this.splist,n=t.length,i=!1,s,o;this.over=!1,this.currentEl=null,this.tooltip&&(this.tooltip.remove(),this.tooltip=null);for(o=0;o<n;o++)s=t[o],s.clearRegionHighlight()&&(i=!0);i&&this.canvas.render()},mousemove:function(e){this.currentPageX=e.pageX,this.currentPageY=e.pageY,this.currentEl=e.target,this.tooltip&&this.tooltip.updatePosition(e.pageX,e.pageY),this.updateDisplay()},updateDisplay:function(){var e=this.splist,t=e.length,n=!1,i=this.$canvas.offset(),s=this.currentPageX-i.left,o=this.currentPageY-i.top,u,a,f,l,c;if(!this.over)return;for(f=0;f<t;f++)a=e[f],l=a.setRegionHighlight(this.currentEl,s,o),l&&(n=!0);if(n){c=r.Event("sparklineRegionChange"),c.sparklines=this.splist,this.$el.trigger(c);if(this.tooltip){u="";for(f=0;f<t;f++)a=e[f],u+=a.getCurrentRegionTooltip();this.tooltip.setContent(u)}this.disableHighlight||this.canvas.render()}l===null&&this.mouseleave()}}),E=o({sizeStyle:"position: static !important;display: block !important;visibility: hidden !important;float: left !important;",init:function(t){var n=t.get("tooltipClassname","jqstooltip"),i=this.sizeStyle,s;this.container=t.get("tooltipContainer")||e.body,this.tooltipOffsetX=t.get("tooltipOffsetX",10),this.tooltipOffsetY=t.get("tooltipOffsetY",12),r("#jqssizetip").remove(),r("#jqstooltip").remove(),this.sizetip=r("<div/>",{id:"jqssizetip",style:i,"class":n}),this.tooltip=r("<div/>",{id:"jqstooltip","class":n}).appendTo(this.container),s=this.tooltip.offset(),this.offsetLeft=s.left,this.offsetTop=s.top,this.hidden=!0,r(window).unbind("resize.jqs scroll.jqs"),r(window).bind("resize.jqs scroll.jqs",r.proxy(this.updateWindowDims,this)),this.updateWindowDims()},updateWindowDims:function(){this.scrollTop=r(window).scrollTop(),this.scrollLeft=r(window).scrollLeft(),this.scrollRight=this.scrollLeft+r(window).width(),this.updatePosition()},getSize:function(e){this.sizetip.html(e).appendTo(this.container),this.width=this.sizetip.width()+1,this.height=this.sizetip.height(),this.sizetip.remove()},setContent:function(e){if(!e){this.tooltip.css("visibility","hidden"),this.hidden=!0;return}this.getSize(e),this.tooltip.html(e).css({width:this.width,height:this.height,visibility:"visible"}),this.hidden&&(this.hidden=!1,this.updatePosition())},updatePosition:function(e,t){if(e===n){if(this.mousex===n)return;e=this.mousex-this.offsetLeft,t=this.mousey-this.offsetTop}else this.mousex=e-=this.offsetLeft,this.mousey=t-=this.offsetTop;if(!this.height||!this.width||this.hidden)return;t-=this.height+this.tooltipOffsetY,e+=this.tooltipOffsetX,t<this.scrollTop&&(t=this.scrollTop),e<this.scrollLeft?e=this.scrollLeft:e+this.width>this.scrollRight&&(e=this.scrollRight-this.width),this.tooltip.css({left:e,top:t})},remove:function(){this.tooltip.remove(),this.sizetip.remove(),this.sizetip=this.tooltip=n,r(window).unbind("resize.jqs scroll.jqs")}}),M=function(){m(O)},r(M),B=[],r.fn.sparkline=function(t,i){return this.each(function(){var s=new r.fn.sparkline.options(this,i),o=r(this),u,a;u=function(){var i,u,a,f,l,c,h;if(t==="html"||t===n){h=this.getAttribute(s.get("tagValuesAttribute"));if(h===n||h===null)h=o.html();i=h.replace(/(^\s*<!--)|(-->\s*$)|\s+/g,"").split(",")}else i=t;u=s.get("width")==="auto"?i.length*s.get("defaultPixelsPerValue"):s.get("width");if(s.get("height")==="auto"){if(!s.get("composite")||!r.data(this,"_jqs_vcanvas"))f=e.createElement("span"),f.innerHTML="a",o.html(f),a=r(f).innerHeight()||r(f).height(),r(f).remove(),f=null}else a=s.get("height");s.get("disableInteraction")?l=!1:(l=r.data(this,"_jqs_mhandler"),l?s.get("composite")||l.reset():(l=new w(this,s),r.data(this,"_jqs_mhandler",l)));if(s.get("composite")&&!r.data(this,"_jqs_vcanvas")){r.data(this,"_jqs_errnotify")||(alert("Attempted to attach a composite sparkline to an element with no existing sparkline"),r.data(this,"_jqs_errnotify",!0));return}c=new(r.fn.sparkline[s.get("type")])(this,i,s,u,a),c.render(),l&&l.registerSparkline(c)};if(r(this).html()&&!s.get("disableHiddenCheck")&&r(this).is(":hidden")||!r(this).parents("body").length){if(!s.get("composite")&&r.data(this,"_jqs_pending"))for(a=B.length;a;a--)B[a-1][0]==this&&B.splice(a-1,1);B.push([this,u]),r.data(this,"_jqs_pending",!0)}else u.call(this)})},r.fn.sparkline.defaults=s(),r.sparkline_display_visible=function(){var e,t,n,i=[];for(t=0,n=B.length;t<n;t++)e=B[t][0],r(e).is(":visible")&&!r(e).parents().is(":hidden")?(B[t][1].call(e),r.data(B[t][0],"_jqs_pending",!1),i.push(t)):!r(e).closest("html").length&&!r.data(e,"_jqs_pending")&&(r.data(B[t][0],"_jqs_pending",!1),i.push(t));for(t=i.length;t;t--)B.splice(i[t-1],1)},r.fn.sparkline.options=o({init:function(e,t){var n,s,o,u;this.userOptions=t=t||{},this.tag=e,this.tagValCache={},s=r.fn.sparkline.defaults,o=s.common,this.tagOptionsPrefix=t.enableTagOptions&&(t.tagOptionsPrefix||o.tagOptionsPrefix),u=this.getTagSetting("type"),u===i?n=s[t.type||o.type]:n=s[u],this.mergedOptions=r.extend({},o,n,t)},getTagSetting:function(e){var t=this.tagOptionsPrefix,r,s,o,u;if(t===!1||t===n)return i;if(this.tagValCache.hasOwnProperty(e))r=this.tagValCache.key;else{r=this.tag.getAttribute(t+e);if(r===n||r===null)r=i;else if(r.substr(0,1)==="["){r=r.substr(1,r.length-2).split(",");for(s=r.length;s--;)r[s]=l(r[s].replace(/(^\s*)|(\s*$)/g,""))}else if(r.substr(0,1)==="{"){o=r.substr(1,r.length-2).split(","),r={};for(s=o.length;s--;)u=o[s].split(":",2),r[u[0].replace(/(^\s*)|(\s*$)/g,"")]=l(u[1].replace(/(^\s*)|(\s*$)/g,""))}else r=l(r);this.tagValCache.key=r}return r},get:function(e,t){var r=this.getTagSetting(e),s;return r!==i?r:(s=this.mergedOptions[e])===n?t:s}}),r.fn.sparkline._base=o({disabled:!1,init:function(e,t,i,s,o){this.el=e,this.$el=r(e),this.values=t,this.options=i,this.width=s,this.height=o,this.currentRegion=n},initTarget:function(){var e=!this.options.get("disableInteraction");(this.target=this.$el.simpledraw(this.width,this.height,this.options.get("composite"),e))?(this.canvasWidth=this.target.pixelWidth,this.canvasHeight=this.target.pixelHeight):this.disabled=!0},render:function(){return this.disabled?(this.el.innerHTML="",!1):!0},getRegion:function(e,t){},setRegionHighlight:function(e,t,r){var i=this.currentRegion,s=!this.options.get("disableHighlight"),o;return t>this.canvasWidth||r>this.canvasHeight||t<0||r<0?null:(o=this.getRegion(e,t,r),i!==o?(i!==n&&s&&this.removeHighlight(),this.currentRegion=o,o!==n&&s&&this.renderHighlight(),!0):!1)},clearRegionHighlight:function(){return this.currentRegion!==n?(this.removeHighlight(),this.currentRegion=n,!0):!1},renderHighlight:function(){this.changeHighlight(!0)},removeHighlight:function(){this.changeHighlight(!1)},changeHighlight:function(e){},getCurrentRegionTooltip:function(){var e=this.options,t="",i=[],s,o,a,f,l,c,h,p,d,v,m,g,y,b;if(this.currentRegion===n)return"";s=this.getCurrentRegionFields(),m=e.get("tooltipFormatter");if(m)return m(this,e,s);e.get("tooltipChartTitle")&&(t+='<div class="jqs jqstitle">'+e.get("tooltipChartTitle")+"</div>\n"),o=this.options.get("tooltipFormat");if(!o)return"";r.isArray(o)||(o=[o]),r.isArray(s)||(s=[s]),h=this.options.get("tooltipFormatFieldlist"),p=this.options.get("tooltipFormatFieldlistKey");if(h&&p){d=[];for(c=s.length;c--;)v=s[c][p],(b=r.inArray(v,h))!=-1&&(d[b]=s[c]);s=d}a=o.length,y=s.length;for(c=0;c<a;c++){g=o[c],typeof g=="string"&&(g=new u(g)),f=g.fclass||"jqsfield";for(b=0;b<y;b++)if(!s[b].isNull||!e.get("tooltipSkipNull"))r.extend(s[b],{prefix:e.get("tooltipPrefix"),suffix:e.get("tooltipSuffix")}),l=g.render(s[b],e.get("tooltipValueLookups"),e),i.push('<div class="'+f+'">'+l+"</div>")}return i.length?t+i.join("\n"):""},getCurrentRegionFields:function(){},calcHighlightColor:function(e,n){var r=n.get("highlightColor"),i=n.get("highlightLighten"),s,o,u,f;if(r)return r;if(i){s=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(e)||/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);if(s){u=[],o=e.length===4?16:1;for(f=0;f<3;f++)u[f]=a(t.round(parseInt(s[f+1],16)*o*i),0,255);return"rgb("+u.join(",")+")"}}return e}}),S={changeHighlight:function(e){var t=this.currentRegion,n=this.target,i=this.regionShapes[t],s;i&&(s=this.renderRegion(t,e),r.isArray(s)||r.isArray(i)?(n.replaceWithShapes(i,s),this.regionShapes[t]=r.map(s,function(e){return e.id})):(n.replaceWithShape(i,s),this.regionShapes[t]=s.id))},render:function(){var e=this.values,t=this.target,n=this.regionShapes,i,s,o,u;if(!this.cls._super.render.call(this))return;for(o=e.length;o--;){i=this.renderRegion(o);if(i)if(r.isArray(i)){s=[];for(u=i.length;u--;)i[u].append(),s.push(i[u].id);n[o]=s}else i.append(),n[o]=i.id;else n[o]=null}t.render()}},r.fn.sparkline.line=x=o(r.fn.sparkline._base,{type:"line",init:function(e,t,n,r,i){x._super.init.call(this,e,t,n,r,i),this.vertices=[],this.regionMap=[],this.xvalues=[],this.yvalues=[],this.yminmax=[],this.hightlightSpotId=null,this.lastShapeId=null,this.initTarget()},getRegion:function(e,t,r){var i,s=this.regionMap;for(i=s.length;i--;)if(s[i]!==null&&t>=s[i][0]&&t<=s[i][1])return s[i][2];return n},getCurrentRegionFields:function(){var e=this.currentRegion;return{isNull:this.yvalues[e]===null,x:this.xvalues[e],y:this.yvalues[e],color:this.options.get("lineColor"),fillColor:this.options.get("fillColor"),offset:e}},renderHighlight:function(){var e=this.currentRegion,t=this.target,r=this.vertices[e],i=this.options,s=i.get("spotRadius"),o=i.get("highlightSpotColor"),u=i.get("highlightLineColor"),a,f;if(!r)return;s&&o&&(a=t.drawCircle(r[0],r[1],s,n,o),this.highlightSpotId=a.id,t.insertAfterShape(this.lastShapeId,a)),u&&(f=t.drawLine(r[0],this.canvasTop,r[0],this.canvasTop+this.canvasHeight,u),this.highlightLineId=f.id,t.insertAfterShape(this.lastShapeId,f))},removeHighlight:function(){var e=this.target;this.highlightSpotId&&(e.removeShapeId(this.highlightSpotId),this.highlightSpotId=null),this.highlightLineId&&(e.removeShapeId(this.highlightLineId),this.highlightLineId=null)},scanValues:function(){var e=this.values,n=e.length,r=this.xvalues,i=this.yvalues,s=this.yminmax,o,u,a,f,l;for(o=0;o<n;o++)u=e[o],a=typeof e[o]=="string",f=typeof e[o]=="object"&&e[o]instanceof Array,l=a&&e[o].split(":"),a&&l.length===2?(r.push(Number(l[0])),i.push(Number(l[1])),s.push(Number(l[1]))):f?(r.push(u[0]),i.push(u[1]),s.push(u[1])):(r.push(o),e[o]===null||e[o]==="null"?i.push(null):(i.push(Number(u)),s.push(Number(u))));this.options.get("xvalues")&&(r=this.options.get("xvalues")),this.maxy=this.maxyorg=t.max.apply(t,s),this.miny=this.minyorg=t.min.apply(t,s),this.maxx=t.max.apply(t,r),this.minx=t.min.apply(t,r),this.xvalues=r,this.yvalues=i,this.yminmax=s},processRangeOptions:function(){var e=this.options,t=e.get("normalRangeMin"),r=e.get("normalRangeMax");t!==n&&(t<this.miny&&(this.miny=t),r>this.maxy&&(this.maxy=r)),e.get("chartRangeMin")!==n&&(e.get("chartRangeClip")||e.get("chartRangeMin")<this.miny)&&(this.miny=e.get("chartRangeMin")),e.get("chartRangeMax")!==n&&(e.get("chartRangeClip")||e.get("chartRangeMax")>this.maxy)&&(this.maxy=e.get("chartRangeMax")),e.get("chartRangeMinX")!==n&&(e.get("chartRangeClipX")||e.get("chartRangeMinX")<this.minx)&&(this.minx=e.get("chartRangeMinX")),e.get("chartRangeMaxX")!==n&&(e.get("chartRangeClipX")||e.get("chartRangeMaxX")>this.maxx)&&(this.maxx=e.get("chartRangeMaxX"))},drawNormalRange:function(e,r,i,s,o){var u=this.options.get("normalRangeMin"),a=this.options.get("normalRangeMax"),f=r+t.round(i-i*((a-this.miny)/o)),l=t.round(i*(a-u)/o);this.target.drawRect(e,f,s,l,n,this.options.get("normalRangeColor")).append()},render:function(){var e=this.options,i=this.target,s=this.canvasWidth,o=this.canvasHeight,u=this.vertices,a=e.get("spotRadius"),f=this.regionMap,l,c,h,p,d,v,m,g,y,w,E,S,T,N,C,k,L,A,O,M,_,D,P,H,B;if(!x._super.render.call(this))return;this.scanValues(),this.processRangeOptions(),P=this.xvalues,H=this.yvalues;if(!this.yminmax.length||this.yvalues.length<2)return;p=d=0,l=this.maxx-this.minx===0?1:this.maxx-this.minx,c=this.maxy-this.miny===0?1:this.maxy-this.miny,h=this.yvalues.length-1,a&&(s<a*4||o<a*4)&&(a=0);if(a){_=e.get("highlightSpotColor")&&!e.get("disableInteraction");if(_||e.get("minSpotColor")||e.get("spotColor")&&H[h]===this.miny)o-=t.ceil(a);if(_||e.get("maxSpotColor")||e.get("spotColor")&&H[h]===this.maxy)o-=t.ceil(a),p+=t.ceil(a);if(_||(e.get("minSpotColor")||e.get("maxSpotColor"))&&(H[0]===this.miny||H[0]===this.maxy))d+=t.ceil(a),s-=t.ceil(a);if(_||e.get("spotColor")||e.get("minSpotColor")||e.get("maxSpotColor")&&(H[h]===this.miny||H[h]===this.maxy))s-=t.ceil(a)}o--,e.get("normalRangeMin")!==n&&!e.get("drawNormalOnTop")&&this.drawNormalRange(d,p,o,s,c),m=[],g=[m],N=C=null,k=H.length;for(B=0;B<k;B++)y=P[B],E=P[B+1],w=H[B],S=d+t.round((y-this.minx)*(s/l)),T=B<k-1?d+t.round((E-this.minx)*(s/l)):s,C=S+(T-S)/2,f[B]=[N||0,C,B],N=C,w===null?B&&(H[B-1]!==null&&(m=[],g.push(m)),u.push(null)):(w<this.miny&&(w=this.miny),w>this.maxy&&(w=this.maxy),m.length||m.push([S,p+o]),v=[S,p+t.round(o-o*((w-this.miny)/c))],m.push(v),u.push(v));L=[],A=[],O=g.length;for(B=0;B<O;B++)m=g[B],m.length&&(e.get("fillColor")&&(m.push([m[m.length-1][0],p+o]),A.push(m.slice(0)),m.pop()),m.length>2&&(m[0]=[m[0][0],m[1][1]]),L.push(m));O=A.length;for(B=0;B<O;B++)i.drawShape(A[B],e.get("fillColor"),e.get("fillColor")).append();e.get("normalRangeMin")!==n&&e.get("drawNormalOnTop")&&this.drawNormalRange(d,p,o,s,c),O=L.length;for(B=0;B<O;B++)i.drawShape(L[B],e.get("lineColor"),n,e.get("lineWidth")).append();if(a&&e.get("valueSpots")){M=e.get("valueSpots"),M.get===n&&(M=new b(M));for(B=0;B<k;B++)D=M.get(H[B]),D&&i.drawCircle(d+t.round((P[B]-this.minx)*(s/l)),p+t.round(o-o*((H[B]-this.miny)/c)),a,n,D).append()}a&&e.get("spotColor")&&H[h]!==null&&i.drawCircle(d+t.round((P[P.length-1]-this.minx)*(s/l)),p+t.round(o-o*((H[h]-this.miny)/c)),a,n,e.get("spotColor")).append(),this.maxy!==this.minyorg&&(a&&e.get("minSpotColor")&&(y=P[r.inArray(this.minyorg,H)],i.drawCircle(d+t.round((y-this.minx)*(s/l)),p+t.round(o-o*((this.minyorg-this.miny)/c)),a,n,e.get("minSpotColor")).append()),a&&e.get("maxSpotColor")&&(y=P[r.inArray(this.maxyorg,H)],i.drawCircle(d+t.round((y-this.minx)*(s/l)),p+t.round(o-o*((this.maxyorg-this.miny)/c)),a,n,e.get("maxSpotColor")).append())),this.lastShapeId=i.getLastShapeId(),this.canvasTop=p,i.render()}}),r.fn.sparkline.bar=T=o(r.fn.sparkline._base,S,{type:"bar",init:function(e,i,s,o,u){var f=parseInt(s.get("barWidth"),10),p=parseInt(s.get("barSpacing"),10),d=s.get("chartRangeMin"),v=s.get("chartRangeMax"),m=s.get("chartRangeClip"),g=Infinity,y=-Infinity,w,E,S,x,N,C,k,L,A,O,M,_,D,P,H,B,j,F,I,q,R,U,z;T._super.init.call(this,e,i,s,o,u);for(C=0,k=i.length;C<k;C++){q=i[C],w=typeof q=="string"&&q.indexOf(":")>-1;if(w||r.isArray(q))H=!0,w&&(q=i[C]=c(q.split(":"))),q=h(q,null),E=t.min.apply(t,q),S=t.max.apply(t,q),E<g&&(g=E),S>y&&(y=S)}this.stacked=H,this.regionShapes={},this.barWidth=f,this.barSpacing=p,this.totalBarWidth=f+p,this.width=o=i.length*f+(i.length-1)*p,this.initTarget(),m&&(D=d===n?-Infinity:d,P=v===n?Infinity:v),N=[],x=H?[]:N;var W=[],X=[];for(C=0,k=i.length;C<k;C++)if(H){B=i[C],i[C]=I=[],W[C]=0,x[C]=X[C]=0;for(j=0,F=B.length;j<F;j++)q=I[j]=m?a(B[j],D,P):B[j],q!==null&&(q>0&&(W[C]+=q),g<0&&y>0?q<0?X[C]+=t.abs(q):x[C]+=q:x[C]+=t.abs(q-(q<0?y:g)),N.push(q))}else q=m?a(i[C],D,P):i[C],q=i[C]=l(q),q!==null&&N.push(q);this.max=_=t.max.apply(t,N),this.min=M=t.min.apply(t,N),this.stackMax=y=H?t.max.apply(t,W):_,this.stackMin=g=H?t.min.apply(t,N):M,s.get("chartRangeMin")!==n&&(s.get("chartRangeClip")||s.get("chartRangeMin")<M)&&(M=s.get("chartRangeMin")),s.get("chartRangeMax")!==n&&(s.get("chartRangeClip")||s.get("chartRangeMax")>_)&&(_=s.get("chartRangeMax")),this.zeroAxis=A=s.get("zeroAxis",!0),M<=0&&_>=0&&A?O=0:A==0?O=M:M>0?O=M:O=_,this.xaxisOffset=O,L=H?t.max.apply(t,x)+t.max.apply(t,X):_-M,this.canvasHeightEf=A&&M<0?this.canvasHeight-2:this.canvasHeight-1,M<O?(U=H&&_>=0?y:_,R=(U-O)/L*this.canvasHeight,R!==t.ceil(R)&&(this.canvasHeightEf-=2,R=t.ceil(R))):R=this.canvasHeight,this.yoffset=R,r.isArray(s.get("colorMap"))?(this.colorMapByIndex=s.get("colorMap"),this.colorMapByValue=null):(this.colorMapByIndex=null,this.colorMapByValue=s.get("colorMap"),this.colorMapByValue&&this.colorMapByValue.get===n&&(this.colorMapByValue=new b(this.colorMapByValue))),this.range=L},getRegion:function(e,r,i){var s=t.floor(r/this.totalBarWidth);return s<0||s>=this.values.length?n:s},getCurrentRegionFields:function(){var e=this.currentRegion,t=g(this.values[e]),n=[],r,i;for(i=t.length;i--;)r=t[i],n.push({isNull:r===null,value:r,color:this.calcColor(i,r,e),offset:e});return n},calcColor:function(e,t,i){var s=this.colorMapByIndex,o=this.colorMapByValue,u=this.options,a,f;return this.stacked?a=u.get("stackedBarColor"):a=t<0?u.get("negBarColor"):u.get("barColor"),t===0&&u.get("zeroColor")!==n&&(a=u.get("zeroColor")),o&&(f=o.get(t))?a=f:s&&s.length>i&&(a=s[i]),r.isArray(a)?a[e%a.length]:a},renderRegion:function(e,i){var s=this.values[e],o=this.options,u=this.xaxisOffset,a=[],f=this.range,l=this.stacked,c=this.target,h=e*this.totalBarWidth,p=this.canvasHeightEf,v=this.yoffset,m,g,y,b,w,E,S,x,T,N;s=r.isArray(s)?s:[s],S=s.length,x=s[0],b=d(null,s),N=d(u,s,!0);if(b)return o.get("nullColor")?(y=i?o.get("nullColor"):this.calcHighlightColor(o.get("nullColor"),o),m=v>0?v-1:v,c.drawRect(h,m,this.barWidth-1,0,y,y)):n;w=v;for(E=0;E<S;E++){x=s[E];if(l&&x===u){if(!N||T)continue;T=!0}f>0?g=t.floor(p*(t.abs(x-u)/f))+1:g=1,x<u||x===u&&v===0?(m=w,w+=g):(m=v-g,v-=g),y=this.calcColor(E,x,e),i&&(y=this.calcHighlightColor(y,o)),a.push(c.drawRect(h,m,this.barWidth-1,g-1,y,y))}return a.length===1?a[0]:a}}),r.fn.sparkline.tristate=N=o(r.fn.sparkline._base,S,{type:"tristate",init:function(e,t,i,s,o){var u=parseInt(i.get("barWidth"),10),a=parseInt(i.get("barSpacing"),10);N._super.init.call(this,e,t,i,s,o),this.regionShapes={},this.barWidth=u,this.barSpacing=a,this.totalBarWidth=u+a,this.values=r.map(t,Number),this.width=s=t.length*u+(t.length-1)*a,r.isArray(i.get("colorMap"))?(this.colorMapByIndex=i.get("colorMap"),this.colorMapByValue=null):(this.colorMapByIndex=null,this.colorMapByValue=i.get("colorMap"),this.colorMapByValue&&this.colorMapByValue.get===n&&(this.colorMapByValue=new b(this.colorMapByValue))),this.initTarget()},getRegion:function(e,n,r){return t.floor(n/this.totalBarWidth)},getCurrentRegionFields:function(){var e=this.currentRegion;return{isNull:this.values[e]===n,value:this.values[e],color:this.calcColor(this.values[e],e),offset:e}},calcColor:function(e,t){var n=this.values,r=this.options,i=this.colorMapByIndex,s=this.colorMapByValue,o,u;return s&&(u=s.get(e))?o=u:i&&i.length>t?o=i[t]:n[t]<0?o=r.get("negBarColor"):n[t]>0?o=r.get("posBarColor"):o=r.get("zeroBarColor"),o},renderRegion:function(e,n){var r=this.values,i=this.options,s=this.target,o,u,a,f,l,c;o=s.pixelHeight,a=t.round(o/2),f=e*this.totalBarWidth,r[e]<0?(l=a,u=a-1):r[e]>0?(l=0,u=a-1):(l=a-1,u=2),c=this.calcColor(r[e],e);if(c===null)return;return n&&(c=this.calcHighlightColor(c,i)),s.drawRect(f,l,this.barWidth-1,u-1,c,c)}}),r.fn.sparkline.discrete=C=o(r.fn.sparkline._base,S,{type:"discrete",init:function(e,i,s,o,u){C._super.init.call(this,e,i,s,o,u),this.regionShapes={},this.values=i=r.map(i,Number),this.min=t.min.apply(t,i),this.max=t.max.apply(t,i),this.range=this.max-this.min,this.width=o=s.get("width")==="auto"?i.length*2:this.width,this.interval=t.floor(o/i.length),this.itemWidth=o/i.length,s.get("chartRangeMin")!==n&&(s.get("chartRangeClip")||s.get("chartRangeMin")<this.min)&&(this.min=s.get("chartRangeMin")),s.get("chartRangeMax")!==n&&(s.get("chartRangeClip")||s.get("chartRangeMax")>this.max)&&(this.max=s.get("chartRangeMax")),this.initTarget(),this.target&&(this.lineHeight=s.get("lineHeight")==="auto"?t.round(this.canvasHeight*.3):s.get("lineHeight"))},getRegion:function(e,n,r){return t.floor(n/this.itemWidth)},getCurrentRegionFields:function(){var e=this.currentRegion;return{isNull:this.values[e]===n,value:this.values[e],offset:e}},renderRegion:function(e,n){var r=this.values,i=this.options,s=this.min,o=this.max,u=this.range,f=this.interval,l=this.target,c=this.canvasHeight,h=this.lineHeight,p=c-h,d,v,m,g;return v=a(r[e],s,o),g=e*f,d=t.round(p-p*((v-s)/u)),m=i.get("thresholdColor")&&v<i.get("thresholdValue")?i.get("thresholdColor"):i.get("lineColor"),n&&(m=this.calcHighlightColor(m,i)),l.drawLine(g,d,g,d+h,m)}}),r.fn.sparkline.bullet=k=o(r.fn.sparkline._base,{type:"bullet",init:function(e,r,i,s,o){var u,a,f;k._super.init.call(this,e,r,i,s,o),this.values=r=c(r),f=r.slice(),f[0]=f[0]===null?f[2]:f[0],f[1]=r[1]===null?f[2]:f[1],u=t.min.apply(t,r),a=t.max.apply(t,r),i.get("base")===n?u=u<0?u:0:u=i.get("base"),this.min=u,this.max=a,this.range=a-u,this.shapes={},this.valueShapes={},this.regiondata={},this.width=s=i.get("width")==="auto"?"4.0em":s,this.target=this.$el.simpledraw(s,o,i.get("composite")),r.length||(this.disabled=!0),this.initTarget()},getRegion:function(e,t,r){var i=this.target.getShapeAt(e,t,r);return i!==n&&this.shapes[i]!==n?this.shapes[i]:n},getCurrentRegionFields:function(){var e=this.currentRegion;return{fieldkey:e.substr(0,1),value:this.values[e.substr(1)],region:e}},changeHighlight:function(e){var t=this.currentRegion,n=this.valueShapes[t],r;delete this.shapes[n];switch(t.substr(0,1)){case"r":r=this.renderRange(t.substr(1),e);break;case"p":r=this.renderPerformance(e);break;case"t":r=this.renderTarget(e)}this.valueShapes[t]=r.id,this.shapes[r.id]=t,this.target.replaceWithShape(n,r)},renderRange:function(e,n){var r=this.values[e],i=t.round(this.canvasWidth*((r-this.min)/this.range)),s=this.options.get("rangeColors")[e-2];return n&&(s=this.calcHighlightColor(s,this.options)),this.target.drawRect(0,0,i-1,this.canvasHeight-1,s,s)},renderPerformance:function(e){var n=this.values[1],r=t.round(this.canvasWidth*((n-this.min)/this.range)),i=this.options.get("performanceColor");return e&&(i=this.calcHighlightColor(i,this.options)),this.target.drawRect(0,t.round(this.canvasHeight*.3),r-1,t.round(this.canvasHeight*.4)-1,i,i)},renderTarget:function(e){var n=this.values[0],r=t.round(this.canvasWidth*((n-this.min)/this.range)-this.options.get("targetWidth")/2),i=t.round(this.canvasHeight*.1),s=this.canvasHeight-i*2,o=this.options.get("targetColor");return e&&(o=this.calcHighlightColor(o,this.options)),this.target.drawRect(r,i,this.options.get("targetWidth")-1,s-1,o,o)},render:function(){var e=this.values.length,t=this.target,n,r;if(!k._super.render.call(this))return;for(n=2;n<e;n++)r=this.renderRange(n).append(),this.shapes[r.id]="r"+n,this.valueShapes["r"+n]=r.id;this.values[1]!==null&&(r=this.renderPerformance().append(),this.shapes[r.id]="p1",this.valueShapes.p1=r.id),this.values[0]!==null&&(r=this.renderTarget().append(),this.shapes[r.id]="t0",this.valueShapes.t0=r.id),t.render()}}),r.fn.sparkline.pie=L=o(r.fn.sparkline._base,{type:"pie",init:function(e,n,i,s,o){var u=0,a;L._super.init.call(this,e,n,i,s,o),this.shapes={},this.valueShapes={},this.values=n=r.map(n,Number),i.get("width")==="auto"&&(this.width=this.height);if(n.length>0)for(a=n.length;a--;)u+=n[a];this.total=u,this.initTarget(),this.radius=t.floor(t.min(this.canvasWidth,this.canvasHeight)/2)},getRegion:function(e,t,r){var i=this.target.getShapeAt(e,t,r);return i!==n&&this.shapes[i]!==n?this.shapes[i]:n},getCurrentRegionFields:function(){var e=this.currentRegion;return{isNull:this.values[e]===n,value:this.values[e],percent:this.values[e]/this.total*100,color:this.options.get("sliceColors")[e%this.options.get("sliceColors").length],offset:e}},changeHighlight:function(e){var t=this.currentRegion,n=this.renderSlice(t,e),r=this.valueShapes[t];delete this.shapes[r],this.target.replaceWithShape(r,n),this.valueShapes[t]=n.id,this.shapes[n.id]=t},renderSlice:function(e,r){var i=this.target,s=this.options,o=this.radius,u=s.get("borderWidth"),a=s.get("offset"),f=2*t.PI,l=this.values,c=this.total,h=a?2*t.PI*(a/360):0,p,d,v,m,g;m=l.length;for(v=0;v<m;v++){p=h,d=h,c>0&&(d=h+f*(l[v]/c));if(e===v)return g=s.get("sliceColors")[v%s.get("sliceColors").length],r&&(g=this.calcHighlightColor(g,s)),i.drawPieSlice(o,o,o-u,p,d,n,g);h=d}},render:function(){var e=this.target,r=this.values,i=this.options,s=this.radius,o=i.get("borderWidth"),u,a;if(!L._super.render.call(this))return;o&&e.drawCircle(s,s,t.floor(s-o/2),i.get("borderColor"),n,o).append();for(a=r.length;a--;)r[a]&&(u=this.renderSlice(a).append(),this.valueShapes[a]=u.id,this.shapes[u.id]=a);e.render()}}),r.fn.sparkline.box=A=o(r.fn.sparkline._base,{type:"box",init:function(e,t,n,i,s){A._super.init.call(this,e,t,n,i,s),this.values=r.map(t,Number),this.width=n.get("width")==="auto"?"4.0em":i,this.initTarget(),this.values.length||(this.disabled=1)},getRegion:function(){return 1},getCurrentRegionFields:function(){var e=[{field:"lq",value:this.quartiles[0]},{field:"med",value:this.quartiles[1]},{field:"uq",value:this.quartiles[2]}];return this.loutlier!==n&&e.push({field:"lo",value:this.loutlier}),this.routlier!==n&&e.push({field:"ro",value:this.routlier}),this.lwhisker!==n&&e.push({field:"lw",value:this.lwhisker}),this.rwhisker!==n&&e.push({field:"rw",value:this.rwhisker}),e},render:function(){var e=this.target,r=this.values,i=r.length,s=this.options,o=this.canvasWidth,u=this.canvasHeight,a=s.get("chartRangeMin")===n?t.min.apply(t,r):s.get("chartRangeMin"),l=s.get("chartRangeMax")===n?t.max.apply(t,r):s.get("chartRangeMax"),c=0,h,p,d,v,m,g,y,b,w,E,S;if(!A._super.render.call(this))return;if(s.get("raw"))s.get("showOutliers")&&r.length>5?(p=r[0],h=r[1],v=r[2],m=r[3],g=r[4],y=r[5],b=r[6]):(h=r[0],v=r[1],m=r[2],g=r[3],y=r[4]);else{r.sort(function(e,t){return e-t}),v=f(r,1),m=f(r,2),g=f(r,3),d=g-v;if(s.get("showOutliers")){h=y=n;for(w=0;w<i;w++)h===n&&r[w]>v-d*s.get("outlierIQR")&&(h=r[w]),r[w]<g+d*s.get("outlierIQR")&&(y=r[w]);p=r[0],b=r[i-1]}else h=r[0],y=r[i-1]}this.quartiles=[v,m,g],this.lwhisker=h,this.rwhisker=y,this.loutlier=p,this.routlier=b,S=o/(l-a+1),s.get("showOutliers")&&(c=t.ceil(s.get("spotRadius")),o-=2*t.ceil(s.get("spotRadius")),S=o/(l-a+1),p<h&&e.drawCircle((p-a)*S+c,u/2,s.get("spotRadius"),s.get("outlierLineColor"),s.get("outlierFillColor")).append(),b>y&&e.drawCircle((b-a)*S+c,u/2,s.get("spotRadius"),s.get("outlierLineColor"),s.get("outlierFillColor")).append()),e.drawRect(t.round((v-a)*S+c),t.round(u*.1),t.round((g-v)*S),t.round(u*.8),s.get("boxLineColor"),s.get("boxFillColor")).append(),e.drawLine(t.round((h-a)*S+c),t.round(u/2),t.round((v-a)*S+c),t.round(u/2),s.get("lineColor")).append(),e.drawLine(t.round((h-a)*S+c),t.round(u/4),t.round((h-a)*S+c),t.round(u-u/4),s.get("whiskerColor")).append(),e.drawLine(t.round((y-a)*S+c),t.round(u/2),t.round((g-a)*S+c),t.round(u/2),s.get("lineColor")).append(),e.drawLine(t.round((y-a)*S+c),t.round(u/4),t.round((y-a)*S+c),t.round(u-u/4),s.get("whiskerColor")).append(),e.drawLine(t.round((m-a)*S+c),t.round(u*.1),t.round((m-a)*S+c),t.round(u*.9),s.get("medianColor")).append(),s.get("target")&&(E=t.ceil(s.get("spotRadius")),e.drawLine(t.round((s.get("target")-a)*S+c),t.round(u/2-E),t.round((s.get("target")-a)*S+c),t.round(u/2+E),s.get("targetColor")).append(),e.drawLine(t.round((s.get("target")-a)*S+c-E),t.round(u/2),t.round((s.get("target")-a)*S+c+E),t.round(u/2),s.get("targetColor")).append()),e.render()}}),_=o({init:function(e,t,n,r){this.target=e,this.id=t,this.type=n,this.args=r},append:function(){return this.target.appendShape(this),this}}),D=o({_pxregex:/(\d+)(px)?\s*$/i,init:function(e,t,n){if(!e)return;this.width=e,this.height=t,this.target=n,this.lastShapeId=null,n[0]&&(n=n[0]),r.data(n,"_jqs_vcanvas",this)},drawLine:function(e,t,n,r,i,s){return this.drawShape([[e,t],[n,r]],i,s)},drawShape:function(e,t,n,r){return this._genShape("Shape",[e,t,n,r])},drawCircle:function(e,t,n,r,i,s){return this._genShape("Circle",[e,t,n,r,i,s])},drawPieSlice:function(e,t,n,r,i,s,o){return this._genShape("PieSlice",[e,t,n,r,i,s,o])},drawRect:function(e,t,n,r,i,s){return this._genShape("Rect",[e,t,n,r,i,s])},getElement:function(){return this.canvas},getLastShapeId:function(){return this.lastShapeId},reset:function(){alert("reset not implemented")},_insert:function(e,t){r(t).html(e)},_calculatePixelDims:function(e,t,n){var i;i=this._pxregex.exec(t),i?this.pixelHeight=i[1]:this.pixelHeight=r(n).height(),i=this._pxregex.exec(e),i?this.pixelWidth=i[1]:this.pixelWidth=r(n).width()},_genShape:function(e,t){var n=j++;return t.unshift(n),new _(this,n,e,t)},appendShape:function(e){alert("appendShape not implemented")},replaceWithShape:function(e,t){alert("replaceWithShape not implemented")},insertAfterShape:function(e,t){alert("insertAfterShape not implemented")},removeShapeId:function(e){alert("removeShapeId not implemented")},getShapeAt:function(e,t,n){alert("getShapeAt not implemented")},render:function(){alert("render not implemented")}}),P=o(D,{init:function(t,i,s,o){P._super.init.call(this,t,i,s),this.canvas=e.createElement("canvas"),s[0]&&(s=s[0]),r.data(s,"_jqs_vcanvas",this),r(this.canvas).css({display:"inline-block",width:t,height:i,verticalAlign:"top"}),this._insert(this.canvas,s),this._calculatePixelDims(t,i,this.canvas),this.canvas.width=this.pixelWidth,this.canvas.height=this.pixelHeight,this.interact=o,this.shapes={},this.shapeseq=[],this.currentTargetShapeId=n,r(this.canvas).css({width:this.pixelWidth,height:this.pixelHeight})},_getContext:function(e,t,r){var i=this.canvas.getContext("2d");return e!==n&&(i.strokeStyle=e),i.lineWidth=r===n?1:r,t!==n&&(i.fillStyle=t),i},reset:function(){var e=this._getContext();e.clearRect(0,0,this.pixelWidth,this.pixelHeight),this.shapes={},this.shapeseq=[],this.currentTargetShapeId=n},_drawShape:function(e,t,r,i,s){var o=this._getContext(r,i,s),u,a;o.beginPath(),o.moveTo(t[0][0]+.5,t[0][1]+.5);for(u=1,a=t.length;u<a;u++)o.lineTo(t[u][0]+.5,t[u][1]+.5);r!==n&&o.stroke(),i!==n&&o.fill(),this.targetX!==n&&this.targetY!==n&&o.isPointInPath(this.targetX,this.targetY)&&(this.currentTargetShapeId=e)},_drawCircle:function(e,r,i,s,o,u,a){var f=this._getContext(o,u,a);f.beginPath(),f.arc(r,i,s,0,2*t.PI,!1),this.targetX!==n&&this.targetY!==n&&f.isPointInPath(this.targetX,this.targetY)&&(this.currentTargetShapeId=e),o!==n&&f.stroke(),u!==n&&f.fill()},_drawPieSlice:function(e,t,r,i,s,o,u,a){var f=this._getContext(u,a);f.beginPath(),f.moveTo(t,r),f.arc(t,r,i,s,o,!1),f.lineTo(t,r),f.closePath(),u!==n&&f.stroke(),a&&f.fill(),this.targetX!==n&&this.targetY!==n&&f.isPointInPath(this.targetX,this.targetY)&&(this.currentTargetShapeId=e)},_drawRect:function(e,t,n,r,i,s,o){return this._drawShape(e,[[t,n],[t+r,n],[t+r,n+i],[t,n+i],[t,n]],s,o)},appendShape:function(e){return this.shapes[e.id]=e,this.shapeseq.push(e.id),this.lastShapeId=e.id,e.id},replaceWithShape:function(e,t){var n=this.shapeseq,r;this.shapes[t.id]=t;for(r=n.length;r--;)n[r]==e&&(n[r]=t.id);delete this.shapes[e]},replaceWithShapes:function(e,t){var n=this.shapeseq,r={},i,s,o;for(s=e.length;s--;)r[e[s]]=!0;for(s=n.length;s--;)i=n[s],r[i]&&(n.splice(s,1),delete this.shapes[i],o=s);for(s=t.length;s--;)n.splice(o,0,t[s].id),this.shapes[t[s].id]=t[s]},insertAfterShape:function(e,t){var n=this.shapeseq,r;for(r=n.length;r--;)if(n[r]===e){n.splice(r+1,0,t.id),this.shapes[t.id]=t;return}},removeShapeId:function(e){var t=this.shapeseq,n;for(n=t.length;n--;)if(t[n]===e){t.splice(n,1);break}delete this.shapes[e]},getShapeAt:function(e,t,n){return this.targetX=t,this.targetY=n,this.render(),this.currentTargetShapeId},render:function(){var e=this.shapeseq,t=this.shapes,n=e.length,r=this._getContext(),i,s,o;r.clearRect(0,0,this.pixelWidth,this.pixelHeight);for(o=0;o<n;o++)i=e[o],s=t[i],this["_draw"+s.type].apply(this,s.args);this.interact||(this.shapes={},this.shapeseq=[])}}),H=o(D,{init:function(t,n,i){var s;H._super.init.call(this,t,n,i),i[0]&&(i=i[0]),r.data(i,"_jqs_vcanvas",this),this.canvas=e.createElement("span"),r(this.canvas).css({display:"inline-block",position:"relative",overflow:"hidden",width:t,height:n,margin:"0px",padding:"0px",verticalAlign:"top"}),this._insert(this.canvas,i),this._calculatePixelDims(t,n,this.canvas),this.canvas.width=this.pixelWidth,this.canvas.height=this.pixelHeight,s='<v:group coordorigin="0 0" coordsize="'+this.pixelWidth+" "+this.pixelHeight+'"'+' style="position:absolute;top:0;left:0;width:'+this.pixelWidth+"px;height="+this.pixelHeight+'px;"></v:group>',this.canvas.insertAdjacentHTML("beforeEnd",s),this.group=r(this.canvas).children()[0],this.rendered=!1,this.prerender=""},_drawShape:function(e,t,r,i,s){var o=[],u,a,f,l,c,h,p;for(p=0,h=t.length;p<h;p++)o[p]=""+t[p][0]+","+t[p][1];return u=o.splice(0,1),s=s===n?1:s,a=r===n?' stroked="false" ':' strokeWeight="'+s+'px" strokeColor="'+r+'" ',f=i===n?' filled="false"':' fillColor="'+i+'" filled="true" ',l=o[0]===o[o.length-1]?"x ":"",c='<v:shape coordorigin="0 0" coordsize="'+this.pixelWidth+" "+this.pixelHeight+'" '+' id="jqsshape'+e+'" '+a+f+' style="position:absolute;left:0px;top:0px;height:'+this.pixelHeight+"px;width:"+this.pixelWidth+'px;padding:0px;margin:0px;" '+' path="m '+u+" l "+o.join(", ")+" "+l+'e">'+" </v:shape>",c},_drawCircle:function(e,t,r,i,s,o,u){var a,f,l;return t-=i,r-=i,a=s===n?' stroked="false" ':' strokeWeight="'+u+'px" strokeColor="'+s+'" ',f=o===n?' filled="false"':' fillColor="'+o+'" filled="true" ',l='<v:oval  id="jqsshape'+e+'" '+a+f+' style="position:absolute;top:'+r+"px; left:"+t+"px; width:"+i*2+"px; height:"+i*2+'px"></v:oval>',l},_drawPieSlice:function(e,r,i,s,o,u,a,f){var l,c,h,p,d,v,m,g;if(o===u)return"";u-o===2*t.PI&&(o=0,u=2*t.PI),c=r+t.round(t.cos(o)*s),h=i+t.round(t.sin(o)*s),p=r+t.round(t.cos(u)*s),d=i+t.round(t.sin(u)*s);if(c===p&&h===d){if(u-o<t.PI)return"";c=p=r+s,h=d=i}return c===p&&h===d&&u-o<t.PI?"":(l=[r-s,i-s,r+s,i+s,c,h,p,d],v=a===n?' stroked="false" ':' strokeWeight="1px" strokeColor="'+a+'" ',m=f===n?' filled="false"':' fillColor="'+f+'" filled="true" ',g='<v:shape coordorigin="0 0" coordsize="'+this.pixelWidth+" "+this.pixelHeight+'" '+' id="jqsshape'+e+'" '+v+m+' style="position:absolute;left:0px;top:0px;height:'+this.pixelHeight+"px;width:"+this.pixelWidth+'px;padding:0px;margin:0px;" '+' path="m '+r+","+i+" wa "+l.join(", ")+' x e">'+" </v:shape>",g)},_drawRect:function(e,t,n,r,i,s,o){return this._drawShape(e,[[t,n],[t,n+i],[t+r,n+i],[t+r,n],[t,n]],s,o)},reset:function(){this.group.innerHTML=""},appendShape:function(e){var t=this["_draw"+e.type].apply(this,e.args);return this.rendered?this.group.insertAdjacentHTML("beforeEnd",t):this.prerender+=t,this.lastShapeId=e.id,e.id},replaceWithShape:function(e,t){var n=r("#jqsshape"+e),i=this["_draw"+t.type].apply(this,t.args);n[0].outerHTML=i},replaceWithShapes:function(e,t){var n=r("#jqsshape"+e[0]),i="",s=t.length,o;for(o=0;o<s;o++)i+=this["_draw"+t[o].type].apply(this,t[o].args);n[0].outerHTML=i;for(o=1;o<e.length;o++)r("#jqsshape"+e[o]).remove()},insertAfterShape:function(e,t){var n=r("#jqsshape"+e),i=this["_draw"+t.type].apply(this,t.args);n[0].insertAdjacentHTML("afterEnd",i)},removeShapeId:function(e){var t=r("#jqsshape"+e);this.group.removeChild(t[0])},getShapeAt:function(e,t,n){var r=e.id.substr(8);return r},render:function(){this.rendered||(this.group.innerHTML=this.prerender,this.rendered=!0)}})})}(document,Math),define("download",["jquery","laconic"],function(){(function(e){var t="downloader",n={_init:function(t){return this.each(function(){function u(){return e("<a>")[0].download!=undefined}var n=e(this),r=e.extend({name:"swish-download",ext:"dat"},t),i=r.content_type,s=r.filename||"swish-download.dat",o=r.charset||"charset=UTF-8";if(!u()||!i)i="application/octet-stream";var a="data:"+i+";"+o+",";a+=o=="base64"?r.data:encodeURIComponent(r.data),n.attr("download",s),n.attr("href",a),n.attr("title","Download (use menu for save link as)"),n.text(s),n.addClass("btn btn-primary download"),n.append(e.el.span({"class":"glyphicon glyphicon-download"}))})}};e.fn.downloader=function(r){if(n[r])return n[r].apply(this,Array.prototype.slice.call(arguments,1));if(typeof r=="object"||!r)return n._init.apply(this,arguments);e.error("Method "+r+" does not exist on jQuery."+t)}})(jQuery)}),define("runner",["jquery","config","preferences","cm/lib/codemirror","form","prolog","links","answer","laconic","sparkline","download"],function($,config,preferences,CodeMirror,form,prolog,links){function glyphButton(e,t){var n=$.el.a({href:"#","class":"close btn btn-link btn-sm",title:t},$.el.span({"class":"glyphicon glyphicon-"+e}));return n}(function(e){var t="prologRunners",n={_init:function(n){return this.each(function(){function i(){var t=e.el.span({"class":"glyphicon glyphicon-menu-hamburger"}),r=form.widgets.dropdownButton(t,{divClass:"runners-menu btn-transparent",ulClass:"pull-right",client:n,actions:{"Collapse all":function(){this.find(".prolog-runner").prologRunner("toggleIconic",!0)},"Expand all":function(){this.find(".prolog-runner").prologRunner("toggleIconic",!1)},"Stop all":function(){this.find(".prolog-runner").prologRunner("stop")},Clear:function(){this.prologRunners("clear")}}});return r}var n=e(this),r={};r.stretch=e(e.el.div({"class":"stretch"})),r.inner=e(e.el.div({"class":"inner"})),n.append(i()),n.append(r.stretch),n.append(r.inner),n.on("pane.resize",function(){n.prologRunners("scrollToBottom",!0)}),n.data(t,r)})},run:function(t){var n=this.data("prologRunners");t.iconifyLast&&this.prologRunners("iconifyLast");var r=e.el.div({"class":"prolog-runner"});return n.inner.append(r),e(r).prologRunner(t),this.prologRunners("scrollToBottom"),this},clear:function(){this.find(".prolog-runner").prologRunner("close")},iconifyLast:function(){var t=e(this.inner).children().last();if(t.length==1){var n=t.prologRunner();n.alive()||n.toggleIconic(!0)}return this},scrollToBottom:function(t){return this.each(function(){var n=e(this),r=n.data("prologRunners"),i=r.inner.height(),s=n.height()-i-4-2;if(s>0||t!==!0)r.stretch.height(s>0?s:0),n.scrollTop(i)}),this}};e.fn.prologRunners=function(r){if(n[r])return n[r].apply(this,Array.prototype.slice.call(arguments,1));if(typeof r=="object"||!r)return n._init.apply(this,arguments);e.error("Method "+r+" does not exist on jQuery."+t)}})(jQuery),function($){function RS(e){return $(e).parents(".prolog-runners")}function addAnswer(e,t){var n=e.find(".runner-results");return n.append(t),this}function aliveState(e){switch(e){case"running":case"wait-next":case"wait-input":case"wait-debug":return!0;default:return!1}}function answerTable(e){var t=[{"class":"projection"}];for(i=0;i<e.length;i++)t.push($.el.th({"class":"pl-pvar"},e[i]));t.push($.el.th({"class":"answer-nth"},""));var n=$.el.table({"class":"prolog-answers"},$.el.tbody($.el.tr.apply(this,t)));return n}function runScripts(elem){var scripts=[];elem=$(elem),elem.find("script").each(function(){var e=this.getAttribute("type")||"text/javascript";e=="text/javascript"&&scripts.push(this.textContent)});if(scripts.length>0){var script="(function(node){"+scripts.join("\n")+"})",node=new Node({node:elem[0]});try{eval(script)(node)}catch(e){alert(e)}}}function Node(e){this.my_node=e.node}function breakpoints(e){var t=e.data(pluginName);return $(e).parents(".swish").swish("breakpoints",t.prolog.id)}function registerSources(e){var t=e.options.runner,n=t.data(pluginName);n.query.editor&&$(n.query.editor).prologEditor("pengine",{add:e.id})}function handleCreate(){var e=this.pengine.options.runner,t=e.data(pluginName),n={},r,i=config.swish.residuals_var||"Residuals";registerSources(this.pengine);if(r=breakpoints(e))n.breakpoints=Pengine.stringify(r);t.chunk&&(n.chunk=t.chunk),this.pengine.ask("'$swish wrapper'((\n"+termNoFullStop(t.query.query)+"\n), "+i+")",n),e.prologRunner("setState","running")}function handleSuccess(){var e=this.pengine.options.runner;for(var t=0;t<this.data.length;t++){var n=this.data[t];this.projection&&(n.projection=this.projection),e.prologRunner("renderAnswer",n)}this.time>.1&&addAnswer(e,$.el.div({"class":"cputime"},$.el.span(this.time.toFixed(3)," seconds cpu time"))),e.prologRunner("setState",this.more?"wait-next":"true")}function handleFailure(){var e=this.pengine.options.runner;addAnswer(e,$.el.span({"class":"prolog-false"},"false")),e.prologRunner("setState","false")}function handleStop(){var e=this.pengine.options.runner;e.prologRunner("setState","stopped")}function handlePrompt(){var e=this.pengine.options.runner,t=e.data("prologRunner"),n=this.data||"Please enter a Prolog term";t.wait_for="term";if(typeof n=="object"){if(n.type=="trace")return e.prologRunner("trace",this);if(n.type=="jQuery")return e.prologRunner("jQuery",this);n.type=="console"?(n=n.prompt||"console> ",t.wait_for="line"):n=JSON.stringify(n)}e.prologRunner("setPrompt",n),e.prologRunner("setState","wait-input")}function clickableLocations(e,t){var n=/pengine:\/\/[-0-9a-f]{36}\/src:(\d+)/;return e.replace(n,function(e){var t=e.match(n)[1];return"<a class='goto-error' title='Goto location'><span class='glyphicon glyphicon-hand-right'></span> <b>line <span class='line'>"+t+"</span></b></a>"})}function gotoError(e){var t=$(e.target).closest("a.goto-error"),n=$(e.target).closest(".error-context"),r=n.data("error_context");if(t[0]){var i=parseInt(t.find("span.line").text()),s=t.find("span.file").text();return e.preventDefault(),s?n.closest("body.swish").swish("playFile",{file:s,line:i}):$(r.editor).prologEditor("gotoLine",i),!1}r.location.file?n.closest("body.swish").swish("playFile",r.location):$(r.editor).prologEditor("gotoLine",r.location.line)}function handleOutput(e){var t=e.pengine.options.runner;if(typeof e.data=="string"){var n=t.data(pluginName),r={editor:n.query.editor};e.data=e.data.replace(/'[-0-9a-f]{36}':/g,"");if(e.location){var i=e.location,s="swish://",o;function u(){var n=i.file+":"+i.line+":";i.ch&&(n+=i.ch+":"),n+="\\s*",e.data=clickableLocations(e.data.replace(new RegExp(n,"g"),""),r.editor),o=t.prologRunner("outputHTML",e.data),$(o).addClass("error-context"),$(o).append($.el.span({"class":"glyphicon glyphicon-hand-right"})),$(o).attr("title","Error in program.  Click to show in context"),$(o).on("click",gotoError),$(o).data("error_context",r)}if(i.file.startsWith(s)){var a=i.file.slice(s.length);r.location={file:a,line:i.line},u()}else i.file.startsWith("pengine://")&&(r.location={line:i.line},u(n.query.editor));registerSources(e.pengine),e.error_context=r,e.error_handler=gotoError,$(".swish-event-receiver").trigger("source-error",e)}else{var o=t.prologRunner("outputHTML",clickableLocations(e.data,r.editor));$(o).on("click",gotoError),$(o).data("error_context",r)}}else typeof e.data=="object"?t.prologRunner(e.data.action,e.data):console.log(e.data);RS(t).prologRunners("scrollToBottom")}function handleError(){var e=this.pengine.options.runner,t;this.code=="too_many_pengines"?this.message="Too many open queries.  Please complete some\nqueries by using |Next|, |Stop| or by\nclosing some queries.":typeof this.data=="string"?this.message=this.data.replace(new RegExp("'"+this.pengine.id+"':","g"),""):this.message="Unknown error",e.prologRunner("error",this),e.prologRunner("setState","error")}function handleAbort(){var e=this.pengine.options.runner;e.prologRunner("error","** Execution aborted **"),e.prologRunner("setState","aborted")}function handlePing(){var e=this.pengine.options.runner;e.prologRunner("ping",this.data)}function answerHasOutput(e){return e.variables.length>0||e.residuals}function termNoFullStop(e){return String($.trim(e)).replace(/\.$/,"")}var pluginName="prologRunner",keyBindings={59:"next",186:"next",32:"next",190:"stop",13:"stop",65:"stopOrAbort",27:"stopOrAbort",46:"close",112:"help"},methods={_init:function(e){return this.each(function(){function r(e,n,r){var i=$.el.button({title:n,"class":"rtb-"+r},$.el.span({"class":"glyphicon glyphicon-"+e}));return $(i).on("click",function(){t.prologRunner(r)}),i}function i(){var e=$.el.span({"class":"runner-state show-state idle"});return form.widgets.dropdownButton(e)}function s(){function e(){t.prologRunner("next",1)}function r(){t.prologRunner("next",10)}function i(){t.prologRunner("next",100)}function s(){t.prologRunner("next",1e3)}function o(){n.prolog.stop()}function u(){n.prolog.abort()}function a(e,t){var n=$.el.button(t);return $(n).on("click",e),n}function f(){var e=$.el.input({"class":"prolog-input"}),n=$.el.button("Send");return $(e).keypress(function(n){if(n.which==13&&t.prologRunner("respond",$(e).val()))return $(e).val(""),n.preventDefault(),!1;n.key!="Esc"&&n.stopPropagation()}),$(n).on("click",function(){t.prologRunner("respond",$(e).val())}),{input:e,button:n}}function l(){var e=$.el.span({"class":"sparklines"},"");return e}var c=f(),h=$.el.div({"class":"controller show-state"},$.el.span({"class":"running"},a(u,"Abort")),$.el.span({"class":"wait-next"},a(e,"Next"),a(r,"10"),a(i,"100"),a(s,"1,000")," ",a(o,"Stop")),$.el.span({"class":"wait-input"},a(u,"Abort"),c.button,$.el.span(c.input)),l());return h}var t=$(this),n={};t.addClass("prolog-runner"),e.tabled&&t.addClass("tabled");if(e.title!=0){var o=$.el.span({"class":"query cm-s-prolog"});CodeMirror.runMode(e.query,"prolog",o),t.append($.el.div({"class":"runner-title ui-widget-header"},r("remove-circle","Close","close"),r("minus","Iconify","toggleIconic"),r("download","Download CSV","downloadCSV"),i(),o))}else{var u=glyphButton("remove-circle","Close");t.append(u),$(u).on("click",function(){t.prologRunner("close")})}return e.chunk&&(n.chunk=e.chunk),t.append($.el.div({"class":"runner-results"})),t.append(s()),t.data("prologRunner",n),t.prologRunner("populateActionMenu"),t.keydown(function(e){t.prologRunner("getState")!="wait-input"&&!e.ctrlKey&&!e.altKey&&keyBindings[e.which]&&(e.preventDefault(),t.prologRunner(keyBindings[e.which]))}),t.on("click","a",links.followLink),n.savedFocus=document.activeElement,t.attr("tabindex",-1),t.focus(),n.query=e,n.answers=0,require([config.http.locations.pengines+"/pengines.js"],function(){n.prolog=new Pengine({server:config.http.locations.pengines,runner:t,application:"swish",src:e.source,destroy:!1,format:"json-html",oncreate:handleCreate,onsuccess:handleSuccess,onfailure:handleFailure,onstop:handleStop,onprompt:handlePrompt,onoutput:handleOutput,onping:handlePing,onerror:handleError,onabort:handleAbort}),n.prolog.state="idle",config.swish.ping&&n.prolog.ping!=undefined&&n.prolog.ping(config.swish.ping*1e3)}),this})},renderAnswer:function(e){var t=this.data("prologRunner"),n=++t.answers%2==0;if(t.query.tabled){if(t.answers!=1)return e.projection=t.projection,e.nth=t.answers,$(t.table).prologAnswer(e),this;if(e.projection&&e.projection.length>0){var r=answerTable(e.projection);return addAnswer(this,r),t.table=r,t.projection=e.projection,e.nth=t.answers,$(t.table).prologAnswer(e),this}}var i=$.el.div({"class":"answer "+(n?"even":"odd")},$.el.span({"class":"answer-no"},t.answers));addAnswer(this,i),$(i).prologAnswer(e)},outputHTML:function(e){var t=$.el.span({"class":"output"});return addAnswer(this,t),t.innerHTML=e,runScripts(t),t},downloadButton:function(e){var t=$.el.a({"class":"download"});addAnswer(this,t),$(t).downloader(e)},syntaxError:function(e){var t=this.data(pluginName);return e.data='<pre class="output msg-error">'+e.message+"</pre>",e.location.file=!0,$(t.query.query_editor).prologEditor("highlightError",e),this},error:function(e){var t;if(typeof e=="object"){if(e.code=="died")return addAnswer(this,$.el.div({"class":"RIP",title:"Remote pengine timed out"})),this;if(e.code=="syntax_error"){var n=e.message.match(/^HTTP:DATA:(\d+):(\d+):\s*(.*)/);n&&n.length==4&&(this.prologRunner("syntaxError",{location:{line:parseInt(n[1])-1,ch:parseInt(n[2])},message:n[3]}),t="Cannot run query due to a syntax error (check query window)")}t||(t=e.message)}else t=e;return addAnswer(this,$.el.pre({"class":"prolog-message msg-error"},t)),this},trace:function(e){function i(e){return e.charAt(0).toUpperCase()+e.slice(1)}function s(t,n,r){var i=$.el.button({"class":n,title:t},$.el.span(t));return $(i).on("click",function(t){r!==undefined&&(n+="("+Pengine.stringify(r(t))+")"),e.pengine.respond(n),$(t.target).parent().remove()}),i}var t=this,n=$.el.span({"class":"goal"}),r=e.data;$(n).html(r.goal),addAnswer(this,$.el.div({"class":"prolog-trace"},$.el.span({"class":"depth",style:"width:"+(r.depth*5-1)+"px"}," "),$.el.span({"class":"port "+r.port},i(r.port),":"),n)),r.port=="exception"&&addAnswer(this,$.el.div({"class":"prolog-exception"},r.exception.message)),addAnswer(this,$.el.div({"class":"trace-buttons"},s("Continue","nodebug",function(e){return breakpoints($(e.target).closest(".prolog-runner"))}),s("Step into","continue"),s("Step over","skip"),s("Step out","up"),s("Retry","retry"),s("Abort","abort"))),this.closest(".swish").find(".tabbed").trigger("trace-location",r),this.prologRunner("setState","wait-debug")},setPrompt:function(e){this.find(".controller input").attr("placeholder",e)},jQuery:function(e){var t=e.data,n;if(typeof t.selector=="string")n=$(t.selector);else if(typeof t.selector=="object"){switch(t.selector.root){case"this":root=this;break;case"swish":root=this.closest(".swish")}t.selector.sub==""?n=root:n=root.find(t.selector.sub)}console.log(n);var r=n[t.method].apply(n,t.arguments);console.log(r),e.pengine.respond(Pengine.stringify(r))},respond:function(e){var t=this.data("prologRunner");if(t.wait_for=="term"){s=termNoFullStop(e);if(s=="")return null}else s=Pengine.stringify(e+"\n");return addAnswer(this,$.el.div({"class":"response"},e)),t.prolog.respond(s),this},stop:function(){return this.each(function(){var e=$(this),t=e.data("prologRunner");t.prolog.stop()})},stopOrAbort:function(){return this.each(function(){var e=$(this),t=e.data("prologRunner"),n=e.prologRunner("getState");switch(n){case"running":case"wait-input":t.prolog.abort();break;case"wait-next":t.prolog.stop()}})},next:function(e){return this.each(function(){var t=$(this),n=t.data("prologRunner");n.prolog.next(e),t.prologRunner("setState","running")})},abort:function(){return this.each(function(){var e=$(this),t=e.data("prologRunner");t.prolog.abort()})},close:function(){if(this.length){var e=RS(this);this.each(function(){var e=$(this),t=e.data("prologRunner");e.prologRunner("alive")&&($(".prolog-editor").trigger("pengine-died",t.prolog.id),t.prolog.destroy())}),this.remove(),e.prologRunners("scrollToBottom",!0)}return this},help:function(){$(".swish-event-receiver").trigger("help",{file:"runner.html"})},toggleIconic:function(e){return e==undefined?this.toggleClass("iconic"):e?this.addClass("iconic"):this.removeClass("iconic"),RS(this).prologRunners("scrollToBottom",!0),this},populateActionMenu:function(e){var t=this.find(".runner-title .btn-group.dropdown");return e=$.extend({"Re-run":function(){console.log("Re-Run ",this)}},e),form.widgets.populateMenu(t,this,e),this},downloadCSV:function(e){var t=this.data("prologRunner"),n=t.query.query.replace(/\.\s*$/,"");return prolog.downloadCSV(n,t.query.source,e),this},setState:function(e){var t=this.data("prologRunner");if(!t)return;if(t.prolog.state!=e){var n=this.find(".show-state");n.removeClass(t.prolog.state).addClass(e),t.prolog.state=e,!aliveState(e)&&t.savedFocus?($(t.savedFocus).focus(),t.savedFocus=null):e=="wait-input"&&this.find("input").focus(),aliveState(e)||($(".prolog-editor").trigger("pengine-died",t.prolog.id),t.prolog.destroy())}if(e=="wait-next"||e=="true"){var r=RS(this);setTimeout(function(){r.prologRunners("scrollToBottom")},100)}else RS(this).prologRunners("scrollToBottom");return this},getState:function(){var e=this.data("prologRunner");return e.prolog?e.prolog.state:"idle"},alive:function(){return aliveState(this.prologRunner("getState"))},ping:function(e){var t=this.data("prologRunner");if(t&&t.prolog&&t.prolog.state=="running"){var n=this.find(".sparklines"),r=["global","local","trail"],s=["red","blue","green"],o=["Global ","Local ","Trail "],u=10;t.stacks||(t.stacks={global:{usage:[]},local:{usage:[]},trail:{usage:[]}});for(i=0;i<r.length;i++){var a=r[i],f=e.stacks[a].limit,l=e.stacks[a].usage,c=Math.log10(l/f*1e4);function h(e,t){function r(e){e=e.toString();var t=/(-?\d+)(\d{3})/;while(t.test(e))e=e.replace(t,"$1,$2");return e}var n=Math.round(Math.pow(10,t)/1e4*e);return r(n)}t.stacks[a].limit=f,t.stacks[a].usage.length>=u&&(t.stacks[a].usage=t.stacks[a].usage.slice(1)),t.stacks[a].usage.push(c),n.sparkline(t.stacks[a].usage,{height:n.parent().height(),composite:i>0,chartRangeMin:0,chartRangeMax:4,lineColor:s[i],tooltipPrefix:o[i],tooltipSuffix:" bytes",tooltipChartTitle:i==0?"Stack usage":undefined,numberFormatter:function(e){return h(f,e)}})}}}},node_id=1;Node.prototype.node=function(){return $(this.my_node)},Node.prototype.unique_id=function(){return this.uid||(this.uid=node_id++),this.uid},$.fn.prologRunner=function(e){if(methods[e])return methods[e].apply(this,Array.prototype.slice.call(arguments,1));if(typeof e=="object"||!e)return methods._init.apply(this,arguments);$.error("Method "+e+" does not exist on jQuery."+pluginName)}}(jQuery)}),define("gitty",["jquery","config","form","modal","laconic"],function(e,t,n,r){function i(t,n){function i(e){(t[e]||n[e])&&t[e]!=n[e]&&(r[e]={from:t[e],to:n[e]})}var r={};i("author"),i("title"),i("data"),i("public"),i("example");if(d=o(t.tags,n.tags))r.tags=d;return e.isEmptyObject(r)?null:r}function s(t,n){var r={};for(var i in t)if(t.hasOwnProperty(i)){switch(typeof t[i]){case"object":if(e.isArray(t[i])&&!o(t[i],n[i]))continue;break;case"string":case"boolean":if(n[i]==t[i])continue}r[i]=t[i]}return r}function o(t,n){function s(e,t){var n=[];for(var r=0;r<t.length;r++)e.indexOf(t[r])<0&&n.push(t[r]);return n}var r,i={};return t=t||[],n=n||[],(r=s(t,n)).length>0&&(i.added=r),(r=s(n,t)).length>0&&(i.deleted=r),e.isEmptyObject(i)?null:i}return function(e){var s="gitty",o={_init:function(t){return this.each(function(){function u(t,n,r,i){var s={role:"presentation"},o=[];n&&o.push("active"),i&&o.push("disabled"),o!=[]&&(s.class=o.join(" "));var u=e.el.li(s,e.el.a({href:"#"+r,"data-toggle":"tab"},t));return u}var n=e(this),r=n.data(s)||{},i=t.meta,o;r.commits=[],r.commits[i.commit]=i,r.commit=i.commit,r.editor=t.editor,henabled=!Boolean(i.previous),o=e(e.el.div({"class":"tab-content"})),n.append(e.el.ul({"class":"nav nav-tabs"},u("Meta data",!0,"gitty-meta-data"),u("History",!1,"gitty-history",henabled),u("Changes",!1,"gitty-diff",henabled))),n.append(o),o.append(e.el.div({"class":"tab-pane fade in active gitty-meta-data",id:"gitty-meta-data"})),n.find('[href="#gitty-meta-data"]').on("show.bs.tab",function(e){n.gitty("showMetaData")}),o.append(e.el.div({"class":"tab-pane fade gitty-history",id:"gitty-history"})),n.find('[href="#gitty-history"]').on("show.bs.tab",function(e){n.gitty("showHistory")}),o.append(e.el.div({"class":"tab-pane fade gitty-diff",id:"gitty-diff"})),n.find('[href="#gitty-diff"]').on("show.bs.tab",function(e){n.gitty("showDiff")}),n.data(s,r),n.gitty("showMetaData")})},title:function(t){var n=e.el.span("File ",e.el.span({"class":"filename"},t.name));return t.symbolic!="HEAD"&&t.commit&&e(n).append("@",e.el.span({"class":"sha1 abbrev"},t.commit.substring(0,7))),n},showMetaData:function(){return this.each(function(){var t=e(this),r=t.data(s),i=t.find(".gitty-meta-data"),o,u=r.commits[r.commit];if(r.metaData==r.commit)return;r.metaData=r.commit,i.html(""),o=e.el.form({"class":"form-horizontal"},n.fields.fileName(u.name,u.public,u.example,!0),n.fields.title(u.title),n.fields.author(u.author),n.fields.date(u.time,"Date","date"),n.fields.tags(u.tags)),u.symbolic=="HEAD"&&e(o).append(n.fields.buttons({label:"Update meta data",action:function(e,t){return r.editor.storage("save",t,"only-meta-data"),!1}})),i.append(o)})},showHistory:function(){return this.each(function(){var i=e(this),o=i.data(s),u=i.find(".gitty-history"),a=o.commits[o.commit],f;if(o.history)return;u.html(""),u.append(e.el.table({"class":"table table-striped table-condensed gitty-history","data-click-to-select":!0,"data-single-select":!0},e.el.tr(e.el.th("Comment"),e.el.th("Date"),e.el.th("Author"),e.el.th("Changed")))),f=n.widgets.glyphIconButton("glyphicon-play",{title:"Open the highlighted version in SWISH"}),u.append(f),e(f).on("click",function(t){var n=i.find("tr.success");if(n.length==1){var r=n.data("commit");o.commits[r].symbolic=="HEAD"?file=o.commits[r].name:file=r,i.parents(".swish").swish("playFile",file),e("#ajaxModal").modal("hide")}return!1});var l=t.http.locations.web_storage+encodeURI(a.name);e.ajax({url:l,contentType:"application/json",type:"GET",data:{format:"history",depth:6,to:o.commit},success:function(e){i.gitty("fillHistoryTable",e),o.history=o.commit},error:function(e){r.ajaxError(jqXHR)}})})},fillHistoryTable:function(t){function f(t){var n,s,o=e.el.span();if(t.previous){if((n=r.commits[t.previous])&&(s=i(t,n)))for(var u in s)s.hasOwnProperty(u)&&e(o).append(e.el.span({"class":"change-type"},u))}else e(o).append("initial");return o}var n=this,r=this.data(s),o=this.find(".table.gitty-history");for(var u=0;u<t.length;u++){var a=t[u];r.commits[a.commit]||(r.commits[a.commit]=a)}for(var u=0;u<t.length;u++){var a=t[u],l;if(u==t.length-1&&a.previous&&!r.commit[a.previous])break;var c={"data-commit":a.commit};r.commit==a.commit&&(c.class="success"),l=e.el.tr(c,e.el.td({"class":"commit-message"},a.commit_message||"No comment"),e.el.td({"class":"date"},(new Date(a.time*1e3)).toLocaleString()),e.el.td({"class":"author"},a.author||"No author"),e.el.td({"class":"changes"},f(a))),o.append(l)}o.on("click","tr",function(t){var r=e(t.target).parents("tr"),i=r.data("commit");n.gitty("setCommit",i)})},setCommit:function(e){var t=this.data(s),n=this.parent(".modal-content").find("h2");return n.html(""),n.append(this.gitty("title",t.commits[e])),this.find("tr.success").removeClass("success"),this.find("tr[data-commit="+e+"]").addClass("success"),t.commit=e,this},showDiff:function(){return this.each(function(){var n=e(this),i=n.data(s);if(i.diff==i.commit)return;n.find(".gitty-diff").html("");var o=t.http.locations.web_storage+encodeURI(i.commit);e.ajax({url:o,contentType:"application/json",type:"GET",data:{format:"diff"},success:function(e){n.gitty("fillDiff",e),i.diff=i.commit},error:function(e){r.ajaxError(e)}})})},fillDiff:function(e){e.tags&&this.gitty("diffTags",e.tags),e.data&&this.gitty("udiffData",e.data)},diffTags:function(t){function s(t,n){i.append(e.el.span({"class":"diff-tag "+n},t))}var n=this.find(".gitty-diff"),r=e(e.el.div({"class":"diff-tags"},e.el.label("Tags"))),i=e(e.el.span({"class":"diff-tags"}));r.append(i);if(t.deleted.length){i.append("Removed: ");for(var o=0;o<t.deleted.length;o++)s(t.deleted[o],"deleted")}if(t.added.length){i.append(t.deleted.length?", ":"","Added: ");for(var o=0;o<t.added.length;o++)s(t.added[o],"added")}return n.append(r),this},udiffData:function(t){var n=this.find(".gitty-diff"),r=t.split("\n"),i=e(e.el.pre({"class":"udiff"}));for(var s=0;s<r.length;s++){var o=r[s],u={"@":"udiff-hdr"," ":"udiff-ctx","+":"udiff-add","-":"udiff-del"};i.append(e.el.span({"class":u[o.charAt(0)]},o),e.el.br())}n.append(i)}};e.fn.gitty=function(t){if(o[t])return o[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return o._init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery."+s)}}(jQuery),{diffMeta:i,reduceMeta:s,diffTags:o}});var __whitespace={" ":!0,"	":!0,"\n":!0,"\f":!0,"\r":!0},difflib={defaultJunkFunction:function(e){return __whitespace.hasOwnProperty(e)},stripLinebreaks:function(e){return e.replace(/^[\n\r]*|[\n\r]*$/g,"")},stringAsLines:function(e){var t=e.indexOf("\n"),n=e.indexOf("\r"),r=t>-1&&n>-1||n<0?"\n":"\r",i=e.split(r);for(var s=0;s<i.length;s++)i[s]=difflib.stripLinebreaks(i[s]);return i},__reduce:function(e,t,n){if(n!=null)var r=n,i=0;else{if(!t)return null;var r=t[0],i=1}for(;i<t.length;i++)r=e(r,t[i]);return r},__ntuplecomp:function(e,t){var n=Math.max(e.length,t.length);for(var r=0;r<n;r++){if(e[r]<t[r])return-1;if(e[r]>t[r])return 1}return e.length==t.length?0:e.length<t.length?-1:1},__calculate_ratio:function(e,t){return t?2*e/t:1},__isindict:function(e){return function(t){return e.hasOwnProperty(t)}},__dictget:function(e,t,n){return e.hasOwnProperty(t)?e[t]:n},SequenceMatcher:function(e,t,n){this.set_seqs=function(e,t){this.set_seq1(e),this.set_seq2(t)},this.set_seq1=function(e){if(e==this.a)return;this.a=e,this.matching_blocks=this.opcodes=null},this.set_seq2=function(e){if(e==this.b)return;this.b=e,this.matching_blocks=this.opcodes=this.fullbcount=null,this.__chain_b()},this.__chain_b=function(){var e=this.b,t=e.length,n=this.b2j={},r={};for(var i=0;i<e.length;i++){var s=e[i];if(n.hasOwnProperty(s)){var o=n[s];t>=200&&o.length*100>t?(r[s]=1,delete n[s]):o.push(i)}else n[s]=[i]}for(var s in r)r.hasOwnProperty(s)&&delete n[s];var u=this.isjunk,a={};if(u){for(var s in r)r.hasOwnProperty(s)&&u(s)&&(a[s]=1,delete r[s]);for(var s in n)n.hasOwnProperty(s)&&u(s)&&(a[s]=1,delete n[s])}this.isbjunk=difflib.__isindict(a),this.isbpopular=difflib.__isindict(r)},this.find_longest_match=function(e,t,n,r){var i=this.a,s=this.b,o=this.b2j,u=this.isbjunk,a=e,f=n,l=0,c=null,h,p={},d=[];for(var v=e;v<t;v++){var m={},g=difflib.__dictget(o,i[v],d);for(var y in g)if(g.hasOwnProperty(y)){c=g[y];if(c<n)continue;if(c>=r)break;m[c]=h=difflib.__dictget(p,c-1,0)+1,h>l&&(a=v-h+1,f=c-h+1,l=h)}p=m}while(a>e&&f>n&&!u(s[f-1])&&i[a-1]==s[f-1])a--,f--,l++;while(a+l<t&&f+l<r&&!u(s[f+l])&&i[a+l]==s[f+l])l++;while(a>e&&f>n&&u(s[f-1])&&i[a-1]==s[f-1])a--,f--,l++;while(a+l<t&&f+l<r&&u(s[f+l])&&i[a+l]==s[f+l])l++;return[a,f,l]},this.get_matching_blocks=function(){if(this.matching_blocks!=null)return this.matching_blocks;var e=this.a.length,t=this.b.length,n=[[0,e,0,t]],r=[],i,s,o,u,a,f,l,c,h;while(n.length)a=n.pop(),i=a[0],s=a[1],o=a[2],u=a[3],h=this.find_longest_match(i,s,o,u),f=h[0],l=h[1],c=h[2],c&&(r.push(h),i<f&&o<l&&n.push([i,f,o,l]),f+c<s&&l+c<u&&n.push([f+c,s,l+c,u]));r.sort(difflib.__ntuplecomp);var p=0,d=0,v=0,m=0,g,y,b,w=[];for(var E in r)r.hasOwnProperty(E)&&(m=r[E],g=m[0],y=m[1],b=m[2],p+v==g&&d+v==y?v+=b:(v&&w.push([p,d,v]),p=g,d=y,v=b));return v&&w.push([p,d,v]),w.push([e,t,0]),this.matching_blocks=w,this.matching_blocks},this.get_opcodes=function(){if(this.opcodes!=null)return this.opcodes;var e=0,t=0,n=[];this.opcodes=n;var r,i,s,o,u,a=this.get_matching_blocks();for(var f in a)a.hasOwnProperty(f)&&(r=a[f],i=r[0],s=r[1],o=r[2],u="",e<i&&t<s?u="replace":e<i?u="delete":t<s&&(u="insert"),u&&n.push([u,e,i,t,s]),e=i+o,t=s+o,o&&n.push(["equal",i,e,s,t]));return n},this.get_grouped_opcodes=function(e){e||(e=3);var t=this.get_opcodes();t||(t=[["equal",0,1,0,1]]);var n,r,i,s,o,u;t[0][0]=="equal"&&(n=t[0],r=n[0],i=n[1],s=n[2],o=n[3],u=n[4],t[0]=[r,Math.max(i,s-e),s,Math.max(o,u-e),u]),t[t.length-1][0]=="equal"&&(n=t[t.length-1],r=n[0],i=n[1],s=n[2],o=n[3],u=n[4],t[t.length-1]=[r,i,Math.min(s,i+e),o,Math.min(u,o+e)]);var a=e+e,f=[],l=[];for(var c in t)t.hasOwnProperty(c)&&(n=t[c],r=n[0],i=n[1],s=n[2],o=n[3],u=n[4],r=="equal"&&s-i>a&&(f.push([r,i,Math.min(s,i+e),o,Math.min(u,o+e)]),l.push(f),f=[],i=Math.max(i,s-e),o=Math.max(o,u-e)),f.push([r,i,s,o,u]));return f&&(f.length!=1||f[0][0]!="equal")&&l.push(f),l},this.ratio=function(){return matches=difflib.__reduce(function(e,t){return e+t[t.length-1]},this.get_matching_blocks(),0),difflib.__calculate_ratio(matches,this.a.length+this.b.length)},this.quick_ratio=function(){var e,t;if(this.fullbcount==null){this.fullbcount=e={};for(var n=0;n<this.b.length;n++)t=this.b[n],e[t]=difflib.__dictget(e,t,0)+1}e=this.fullbcount;var r={},i=difflib.__isindict(r),s=numb=0;for(var n=0;n<this.a.length;n++)t=this.a[n],i(t)?numb=r[t]:numb=difflib.__dictget(e,t,0),r[t]=numb-1,numb>0&&s++;return difflib.__calculate_ratio(s,this.a.length+this.b.length)},this.real_quick_ratio=function(){var e=this.a.length,t=this.b.length;return _calculate_ratio(Math.min(e,t),e+t)},this.isjunk=n?n:difflib.defaultJunkFunction,this.a=this.b=null,this.set_seqs(e,t)}};define("difflib",function(){}),diffview={buildView:function(e){function a(e,t){var n=document.createElement(e);return n.className=t,n}function f(e,t){var n=document.createElement(e);return n.appendChild(document.createTextNode(t)),n}function l(e,t,n){var r=document.createElement(e);return r.className=t,r.appendChild(document.createTextNode(n)),r}function v(e,t,n,r,i){return t<n?(e.appendChild(f("th",(t+1).toString())),e.appendChild(l("td",i,r[t].replace(/\t/g,"    "))),t+1):(e.appendChild(document.createElement("th")),e.appendChild(a("td","empty")),t)}function m(e,t,n,r,i){e.appendChild(f("th",t==null?"":(t+1).toString())),e.appendChild(f("th",n==null?"":(n+1).toString())),e.appendChild(l("td",i,r[t!=null?t:n].replace(/\t/g,"    ")))}var t=e.baseTextLines,n=e.newTextLines,r=e.opcodes,i=e.baseTextName?e.baseTextName:"Base Text",s=e.newTextName?e.newTextName:"New Text",o=e.contextSize,u=e.viewType==0||e.viewType==1?e.viewType:0;if(t==null)throw"Cannot build diff view; baseTextLines is not defined.";if(n==null)throw"Cannot build diff view; newTextLines is not defined.";if(!r)throw"Canno build diff view; opcodes is not defined.";var c=document.createElement("thead"),h=document.createElement("tr");c.appendChild(h),u?(h.appendChild(document.createElement("th")),h.appendChild(document.createElement("th")),h.appendChild(l("th","texttitle",i+" vs. "+s))):(h.appendChild(document.createElement("th")),h.appendChild(l("th","texttitle",i)),h.appendChild(document.createElement("th")),h.appendChild(l("th","texttitle",s))),c=[c];var p=[],d;for(var g=0;g<r.length;g++){code=r[g],change=code[0];var y=code[1],b=code[2],w=code[3],E=code[4],S=Math.max(b-y,E-w),x=[],T=[];for(var N=0;N<S;N++){if(o&&r.length>1&&(g>0&&N==o||g==0&&N==0)&&change=="equal"){var C=S-(g==0?1:2)*o;if(C>1){x.push(h=document.createElement("tr")),y+=C,w+=C,N+=C-1,h.appendChild(f("th","...")),u||h.appendChild(l("td","skip","")),h.appendChild(f("th","...")),h.appendChild(l("td","skip",""));if(g+1==r.length)break;continue}}x.push(h=document.createElement("tr")),u?change=="insert"?m(h,null,w++,n,change):change=="replace"?(T.push(d=document.createElement("tr")),y<b&&m(h,y++,null,t,"delete"),w<E&&m(d,null,w++,n,"insert")):change=="delete"?m(h,y++,null,t,change):m(h,y++,w++,t,change):(y=v(h,y,b,t,change),w=v(h,w,E,n,change))}for(var N=0;N<x.length;N++)p.push(x[N]);for(var N=0;N<T.length;N++)p.push(T[N])}p.push(h=l("th","author","diff view generated by ")),h.setAttribute("colspan",u?3:4),h.appendChild(d=f("a","jsdifflib")),d.setAttribute("href","http://github.com/cemerick/jsdifflib"),c.push(h=document.createElement("tbody"));for(var g in p)p.hasOwnProperty(g)&&h.appendChild(p[g]);h=a("table","diff"+(u?" inlinediff":""));for(var g in c)c.hasOwnProperty(g)&&h.appendChild(c[g]);return h}},define("diffview",function(){}),define("diff",["jquery","difflib","diffview"],function(){(function(e){var t="diff",n={_init:function(t){return this.each(function(){var n=difflib.stringAsLines(t.base),r=difflib.stringAsLines(t.head),i=new difflib.SequenceMatcher(n,r),s=i.get_opcodes(),o=t.contextSize==undefined?3:t.contextSize;this.appendChild(diffview.buildView({baseTextLines:n,newTextLines:r,opcodes:s,baseTextName:t.baseName||"Base text",newTextName:t.headName||"Current text",contextSize:o,viewType:e("inline").checked?1:0}))})}};e.fn.diff=function(r){if(n[r])return n[r].apply(this,Array.prototype.slice.call(arguments,1));if(typeof r=="object"||!r)return n._init.apply(this,arguments);e.error("Method "+r+" does not exist on jQuery."+t)}})(jQuery)}),define("storage",["jquery","config","modal","form","gitty","history","tabbed","laconic","diff"],function(e,t,n,r,i,s,o){function u(e){return e?e.split(".").slice(0,-1).join("."):null}function a(e){return e?e.split("/").pop():null}(function(e){function h(e){return e.charAt(0).toUpperCase()+e.slice(1)}function p(t,n){var r=e.el.table({"class":"table table-striped"});e(r).append(e.el.tr(e.el.th("Path"),e.el.td(n.path))),e(r).append(e.el.tr(e.el.th("Modified"),e.el.td((new Date(n.last_modified*1e3)).toLocaleString()))),e(r).append(e.el.tr(e.el.th("Loaded"),e.el.td(n.modified_since_loaded?"yes (modified)":n.loaded?"yes":"no"))),t.append(r)}function d(e,t){return t.error=="file_exists"?e+": file exists: "+t.file:JSON.stringify(t)}var f="storage",l={typeName:"program",markClean:function(e){}},c={_init:function(t){return this.each(function(){function i(t,n){var r=e(t.target);if(r.hasClass("storage")&&r.is(":visible")){var i=r.storage.apply(r,Array.prototype.slice.call(arguments,1));if(i=="propagate")return}t.stopPropagation()}var n=e(this),r=e.extend({},l,t);n.addClass("storage");if(t.title||t.file||t.url){var s=t.file;!s&&t.url&&(s=t.url.split("/").pop()),n.tabbed("title",t.title||u(s),s?s.split(".").pop():"pl")}n.on("source",function(e,t){i(e,"setSource",t)}),n.on("save",function(e,t){i(e,"save",t)}),n.on("download",function(e){i(e,"download")}),n.on("fileInfo",function(e){i(e,"info")}),n.on("diff",function(e){i(e,"diff")}),n.on("revert",function(e){i(e,"revert")}),n.on("activate-tab",function(e){}),e(window).bind("beforeunload",function(e){return n.storage("unload","beforeunload",e)}),n.data(f,r)})},setSource:function(e){function l(e){return e?e.split("/").pop():null}var n=this.data(f),r=o.tabTypes[n.typeName];typeof e=="string"&&(e={data:e});if(e.newTab)return"propagate";if(e.meta&&e.meta.name||e.url){var i=e.meta&&e.meta.name?e.meta.name:e.url,a=i.split(".").pop();if(a!=r.dataType)return"propagate"}if(this.storage("unload","setSource")==0)return!1;e.meta?(n.file=e.meta.name,n.meta=e.meta,n.url=null):(n.file=null,n.meta=null),n.url=e.url||undefined,n.st_type=e.st_type||undefined,n.setValue(e),n.cleanGeneration=n.changeGen(),n.cleanData=e.data,n.cleanCheckpoint=e.cleanCheckpoint||"load";var c=u(n.file)||u(l(e.url))||r.label;return e.url||(e.url=t.http.locations.swish),this.tabbed("title",c,r.dataType),e.noHistory||s.push(e),this},load:function(r){if(r){var i=this,s=this.data(f);e.ajax({url:t.http.locations.web_storage+r,dataType:"text",success:function(e){i.storage("setSource",{data:e,meta:{name:r}})},error:function(e){n.ajaxError(jqXHR)}})}return this},revert:function(){var e=this.data(f);return e.setValue(e.cleanData),e.cleanGeneration=e.changeGen(),e.markClean(!0),this},save:function(r,u){var a=this.data(f),l=o.tabTypes[a.typeName],c=t.http.locations.web_storage,h="POST",p=this,v;if(a.st_type!="filesys"&&a.st_type!="external"||!a.url){if(r=="as")return this.storage("saveAs"),this;a.file&&(!r||!r.name||r.name==a.file)&&(c+=encodeURI(a.file),h="PUT");if(u=="only-meta-data"){r=i.reduceMeta(r,a.meta);if(e.isEmptyObject(r)){alert("No change");return}v={update:"meta-data"}}else if(h=="POST")v={data:a.getValue(),type:l.dataType},a.meta&&(v.previous=a.meta.commit);else if(!a.isClean(a.cleanGeneration))v={data:a.getValue(),type:l.dataType};else if(i.diffTags(a.meta.tags,r.tags)==null){alert("No change");return}return r&&(v.meta=r),e.ajax({url:c,dataType:"json",contentType:"application/json",type:h,data:JSON.stringify(v),success:function(e){e.error?n.alert(d("Could not save",e)):(a.meta&&a.meta.example!=e.meta.example&&p.closest(".swish").trigger("examples-changed"),a.file=e.file,a.meta=e.meta,a.st_type="gitty",a.cleanGeneration=a.changeGen(),a.cleanData=a.getValue(),a.cleanCheckpoint="save",a.markClean(!0),n.feedback({html:"Saved",owner:p}),p.tabbed("title",a.meta.name),s.push(e))},error:function(e){p.storage("saveAs")}}),this}return this.storage("saveURL")},saveAs:function(n){function p(){this.append(e.el.form({"class":"form-horizontal"},r.fields.fileName(l?null:i.file,s.public,s.example),r.fields.title(s.title),r.fields.author(h),a?r.fields.commit_message():undefined,r.fields.tags(s.tags),r.fields.buttons({label:l?"Fork "+c.label:a?"Update "+c.label:"Save "+c.label,action:function(e,t){return u.storage("save",t),!1}})))}var i=this.data(f),s=i.meta||{},u=this,a=Boolean(i.file),l=i.meta&&s.symbolic!="HEAD",c=o.tabTypes[i.typeName],h=t.swish.user?t.swish.user.realname&&t.swish.user.email?t.swish.user.realname+" <"+t.swish.user.email+">":t.swish.user.user:s.author;return s.public===undefined&&(s.public=!0),n=n||{},r.showDialog({title:n.title?n.title:l?"Fork from "+s.commit.substring(0,7):a?"Save new version":"Save "+c.label+" as",body:p}),this},saveURL:function(){var t=this.data(f),r=t.getValue(),i=o.type(t.url)||{},s=this;return t.isClean(t.cleanGeneration)?(alert("No change"),this):(e.ajax({url:t.url,dataType:"json",contentType:i.contentType||"text/plain",type:"PUT",data:r,success:function(e){e.error?n.alert(d("Could not save",e)):(t.cleanGeneration=t.changeGen(),t.cleanData=t.getValue(),t.cleanCheckpoint="save",t.markClean(!0),n.feedback({html:"Saved",owner:s}))},error:function(e){if(e.status==403){var r=t.url;delete t.meta,delete t.st_type,delete t.url,s.storage("saveAs",{title:"<div class='warning'>Could not save to "+r+"</div> Save a copy as"})}else n.ajaxError(e)}}),this)},download:function(){var t=this.data(f),n=o.tabTypes[t.typeName],r=t.getValue(),i="data:text/plain;charset=UTF-8,"+encodeURIComponent(r),s=e.el.a({href:i,download:t.file||"swish."+n.dataType});return this.append(s),s.click(),e(s).remove(),this},getData:function(t){var n=[];return t=t||{},this.each(function(){var r=e(this).data(f),i={};i.type=r.type,r.url&&(i.url=r.url);if(r.meta){function s(e){r.meta[e]&&(i[e]=r.meta[e])}s("name"),s("path"),s("modified"),s("loaded"),s("modified_since_loaded"),s("module")}e(this).closest(".tab-pane.active").length==1&&(i.active=!0);if(!t.type||t.name&&t.name.split(".").pop()==t.type){if(t.data){var o=r.getValue();i.modified=o!=r.cleanData;if(t.data==1||i.modified&&t.data=="if_modified")i.data=o}n.push(i)}}),n},match:function(t){for(var n=0;n<this.length;n++){me=e(this[n]);var r=me.data(f);if(t.file&&t.file==r.file)return me;if(t.url&&t.url==r.url)return me}},expose:function(e){var t=this.closest(".tab-pane");if(t.length==1){var r=t.closest(".tabbed");return r.tabbed("show",t.attr("id")),e&&n.feedback({html:e,owner:this}),this}},info:function(){function o(){t.st_type=="gitty"?(t.editor=i,this.gitty(t)):t.st_type=="filesys"?p(this,n):t.st_type||this.append(e.el.p("The source is not associated with a file. ","Use ",e.el.b("Save ...")," to save the source with meta information."))}var t=this.data(f),n=t.meta||{},i=this,s;return t.st_type=="gitty"?s=e().gitty("title",n):t.st_type=="filesys"?s="File system -- "+a(n.path):t.st_type=="external"?s="External -- "+t.url:s="Scratch source",r.showDialog({title:s,body:o}),this},diff:function(){function i(){var r=e.el.div(),i=t.getValue();this.append(r);if(i==t.cleanData)e(r).append(e.el.p("No changes"));else{var s,o=e.el.div({"class":"btn-group diff",role:"group"},e.el.button({name:"close","data-dismiss":"modal","class":"btn btn-primary"},"Close"),s=e.el.button({name:"revert","class":"btn btn-danger","data-dismiss":"modal"},"Revert changes"));e(r).diff({base:t.cleanData,head:i,baseName:n[t.cleanCheckpoint]}),this.append(e.el.div({"class":"wrapper text-center"},o)),e(s).on("click",function(t){e(".swish-event-receiver").trigger("revert")}),this.parents("div.modal-dialog").addClass("modal-wide")}}var t=this.data(f),n={load:"Loaded text","new":"New text",save:"Saved text"};return r.showDialog({title:"Changes since "+n[t.cleanCheckpoint],body:i}),this},unload:function(e,t){var n=this.data(f);if(!n)return undefined;n.meta&&s.addRecent({st_type:"gitty",id:n.meta.name});if(n.cleanData!=n.getValue()){if(e=="beforeunload"){var r="The source editor has unsaved changes.\nThese will be lost if you leave the page";return t=t||window.event,t&&(t.returnValue=r),r}var r="The source editor has unsaved changes.\nThese will be lost"+(e=="setSource"?" if you load a new program":e=="closetab"?" close this tab":"");return confirm(r)}return undefined}};e.fn.storage=function(t){if(c[t])return c[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return c._init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery."+f)}})(jQuery)}),function(e,t){var n=typeof module!="undefined";n&&(e=global);var r="0123456789abcdef".split(""),i=[-2147483648,8388608,32768,128],s=[24,16,8,0],o=[],u=function(e){var t=typeof e!="string";t&&e.constructor==ArrayBuffer&&(e=new Uint8Array(e));var n,u,a,f,l,c=0,h,p=!1,d,v,m,g,y=0,b=0,w=0,E=e.length;n=1732584193,u=4023233417,a=2562383102,f=271733878,l=3285377520;do{o[0]=c,o[16]=o[1]=o[2]=o[3]=o[4]=o[5]=o[6]=o[7]=o[8]=o[9]=o[10]=o[11]=o[12]=o[13]=o[14]=o[15]=0;if(t)for(m=b;y<E&&m<64;++y)o[m>>2]|=e[y]<<s[m++&3];else for(m=b;y<E&&m<64;++y)h=e.charCodeAt(y),h<128?o[m>>2]|=h<<s[m++&3]:h<2048?(o[m>>2]|=(192|h>>6)<<s[m++&3],o[m>>2]|=(128|h&63)<<s[m++&3]):h<55296||h>=57344?(o[m>>2]|=(224|h>>12)<<s[m++&3],o[m>>2]|=(128|h>>6&63)<<s[m++&3],o[m>>2]|=(128|h&63)<<s[m++&3]):(h=65536+((h&1023)<<10|e.charCodeAt(++y)&1023),o[m>>2]|=(240|h>>18)<<s[m++&3],o[m>>2]|=(128|h>>12&63)<<s[m++&3],o[m>>2]|=(128|h>>6&63)<<s[m++&3],o[m>>2]|=(128|h&63)<<s[m++&3]);w+=m-b,b=m-64,y==E&&(o[m>>2]|=i[m&3],++y),c=o[16],y>E&&m<56&&(o[15]=w<<3,p=!0);for(g=16;g<80;++g)d=o[g-3]^o[g-8]^o[g-14]^o[g-16],o[g]=d<<1|d>>>31;var S=n,x=u,T=a,N=f,C=l;for(g=0;g<20;g+=5)v=x&T|~x&N,d=S<<5|S>>>27,C=d+v+C+1518500249+o[g]<<0,x=x<<30|x>>>2,v=S&x|~S&T,d=C<<5|C>>>27,N=d+v+N+1518500249+o[g+1]<<0,S=S<<30|S>>>2,v=C&S|~C&x,d=N<<5|N>>>27,T=d+v+T+1518500249+o[g+2]<<0,C=C<<30|C>>>2,v=N&C|~N&S,d=T<<5|T>>>27,x=d+v+x+1518500249+o[g+3]<<0,N=N<<30|N>>>2,v=T&N|~T&C,d=x<<5|x>>>27,S=d+v+S+1518500249+o[g+4]<<0,T=T<<30|T>>>2;for(;g<40;g+=5)v=x^T^N,d=S<<5|S>>>27,C=d+v+C+1859775393+o[g]<<0,x=x<<30|x>>>2,v=S^x^T,d=C<<5|C>>>27,N=d+v+N+1859775393+o[g+1]<<0,S=S<<30|S>>>2,v=C^S^x,d=N<<5|N>>>27,T=d+v+T+1859775393+o[g+2]<<0,C=C<<30|C>>>2,v=N^C^S,d=T<<5|T>>>27,x=d+v+x+1859775393+o[g+3]<<0,N=N<<30|N>>>2,v=T^N^C,d=x<<5|x>>>27,S=d+v+S+1859775393+o[g+4]<<0,T=T<<30|T>>>2;for(;g<60;g+=5)v=x&T|x&N|T&N,d=S<<5|S>>>27,C=d+v+C-1894007588+o[g]<<0,x=x<<30|x>>>2,v=S&x|S&T|x&T,d=C<<5|C>>>27,N=d+v+N-1894007588+o[g+1]<<0,S=S<<30|S>>>2,v=C&S|C&x|S&x,d=N<<5|N>>>27,T=d+v+T-1894007588+o[g+2]<<0,C=C<<30|C>>>2,v=N&C|N&S|C&S,d=T<<5|T>>>27,x=d+v+x-1894007588+o[g+3]<<0,N=N<<30|N>>>2,v=T&N|T&C|N&C,d=x<<5|x>>>27,S=d+v+S-1894007588+o[g+4]<<0,T=T<<30|T>>>2;for(;g<80;g+=5)v=x^T^N,d=S<<5|S>>>27,C=d+v+C-899497514+o[g]<<0,x=x<<30|x>>>2,v=S^x^T,d=C<<5|C>>>27,N=d+v+N-899497514+o[g+1]<<0,S=S<<30|S>>>2,v=C^S^x,d=N<<5|N>>>27,T=d+v+T-899497514+o[g+2]<<0,C=C<<30|C>>>2,v=N^C^S,d=T<<5|T>>>27,x=d+v+x-899497514+o[g+3]<<0,N=N<<30|N>>>2,v=T^N^C,d=x<<5|x>>>27,S=d+v+S-899497514+o[g+4]<<0,T=T<<30|T>>>2;n=n+S<<0,u=u+x<<0,a=a+T<<0,f=f+N<<0,l=l+C<<0}while(!p);return r[n>>28&15]+r[n>>24&15]+r[n>>20&15]+r[n>>16&15]+r[n>>12&15]+r[n>>8&15]+r[n>>4&15]+r[n&15]+r[u>>28&15]+r[u>>24&15]+r[u>>20&15]+r[u>>16&15]+r[u>>12&15]+r[u>>8&15]+r[u>>4&15]+r[u&15]+r[a>>28&15]+r[a>>24&15]+r[a>>20&15]+r[a>>16&15]+r[a>>12&15]+r[a>>8&15]+r[a>>4&15]+r[a&15]+r[f>>28&15]+r[f>>24&15]+r[f>>20&15]+r[f>>16&15]+r[f>>12&15]+r[f>>8&15]+r[f>>4&15]+r[f&15]+r[l>>28&15]+r[l>>24&15]+r[l>>20&15]+r[l>>16&15]+r[l>>12&15]+r[l>>8&15]+r[l>>4&15]+r[l&15]};if(!e.JS_SHA1_TEST&&typeof module!="undefined"){var a=require("crypto"),f=require("buffer").Buffer;module.exports=function(e){return typeof e=="string"?a.createHash("sha1").update(e,"utf8").digest("hex"):(e.constructor==ArrayBuffer&&(e=new Uint8Array(e)),a.createHash("sha1").update(new f(e)).digest("hex"))}}else e&&(e.sha1=u)}(this),define("sha1",function(){}),define("notebook",["jquery","config","tabbed","form","preferences","modal","prolog","links","laconic","runner","storage","sha1"],function($,config,tabbed,form,preferences,modal,prolog,links){function glyphButton(e,t,n,r,i){i=i||"sm";var s=$.el.a({href:"#","class":"btn btn-"+r+" btn-"+i+" action-"+t,title:n,"data-action":t},$.el.span({"class":"glyphicon glyphicon-"+e}));return s}function imageButton(e,t,n){n=n||"sm";var r=$.el.a({href:"#","class":"btn btn-default btn-image btn-"+n+" action-"+e,title:t,"data-action":e},$.el.span({"class":"image-icon"}));return r}function glyphButtonGlyph(e,t,n){var r=e.find("a[data-action="+t+"] > span.glyphicon");r.removeClass(function(e,t){return t.match(/glyphicon-[-a-z]*/g).join(" ")}).addClass("glyphicon-"+n)}function sep(){return $.el.span({"class":"thin-space"}," ")}function Notebook(e){this.my_cell=e.cell}var cellTypes={program:{label:"Program"},query:{label:"Query"},markdown:{label:"Markdown"},html:{label:"HTML"}};(function(e){function i(t){var n=e(t).find(".nb-cell.active");return n.length==1?n.first():null}function s(t){function n(e){attrs=e.match(/[-a-z]+="[^"]*"/g);if(attrs){var t=e.match(/^<[a-z]* /);for(var n=0;n<attrs.length;n++){var r=attrs[n].split(/=(.*)/);attrs[n]=r[0].toLowerCase()+"="+r[1]}return t[0]+attrs.sort().join(" ")+">"}return e}var r=e(e.el.div(t)).html(),i=[];return r.replace(/(<div [^>]*>|<\/div>)/g,function(e){var t;return e=="</div>"?(t=i.pop(),t?"\n"+e+"\n":e):(t=e.match(/(nb-cell|notebook)/)!=null,i.push(t),t?"\n"+n(e)+"\n":e)}).slice(1)}var t="notebook",n=null,r={_init:function(n){return n=n||{},this.each(function(){function a(){var t=e.el.span({"class":"glyphicon glyphicon-menu-hamburger"}),n=form.widgets.dropdownButton(t,{divClass:"notebook-menu btn-transparent",ulClass:"pull-right",client:r,actions:{"Delete cell":function(){this.notebook("delete")},"Copy cell":function(){this.notebook("copy")},"Paste cell":function(){this.notebook("paste")},"Move cell up":function(){this.notebook("up")},"Move cell down":function(){this.notebook("down")},"Insert cell":function(){this.notebook("insertBelow")},"--":"Notebook actions","Exit fullscreen":function(){this.notebook("fullscreen",!1)}}});return n}var r=e(this),i={},s={},o,u;r.addClass("notebook"),r.addClass("swish-event-receiver"),r.append(o=e.el.div({"class":"nb-toolbar"},glyphButton("trash","delete","Delete cell","warning"),glyphButton("copy","copy","Copy cell","default"),glyphButton("paste","paste","Paste cell below","default"),sep(),glyphButton("chevron-up","up","Move cell up","default"),glyphButton("chevron-down","down","Move cell down","default"),sep(),glyphButton("plus","insertBelow","Insert cell below","primary"),glyphButton("fullscreen","fullscreen","Full screen","default"))),r.append(a()),r.append(e.el.div({"class":"nb-view",tabIndex:"-1"},u=e.el.div({"class":"nb-content"}),e.el.div({"class":"nb-bottom"}))),e(o).on("click","a.btn",function(t){var n=e(t.target).closest("a").data("action");return r.notebook(n),t.preventDefault(),!1}),e(u).on("click",".nb-cell-buttons a.btn",function(t){var n=e(t.target).closest("a"),r=n.closest(".nb-cell"),i=n.data("action");return r.nbCell(i),t.preventDefault(),!1}),r.focusin(function(t){var n=e(t.target).closest(".nb-cell");n.length>0?r.notebook("active",n):e(t.target).closest(".nb-view").length>0&&r.find(".nb-content").children(".nb-cell.active").nbCell("active",!1)}),r.focusout(function(t){e(t.target).closest(".notebook")[0]!=r[0]&&r.find(".nb-content").children(".nb-cell.active").nbCell("active",!1)}),r.on("activate-tab",function(t){if(t.target==r[0]){var n=r.find(".nb-content").children(".nb-cell.program"),i=n.filter(".active"),s=i[0]||n[0];s&&e(s).find(".prolog-editor").prologEditor("makeCurrent"),t.stopPropagation()}}),r.data(t,s);var u=r.find(".notebook-data");if(n.value)r.notebook("value",n.value);else if(u.length>0){function f(e){var t=u.data(e);t&&(i[e]=t)}f("file"),f("url"),f("title"),f("meta"),f("st_type"),r.notebook("value",u.text(),{fullscreen:r.hasClass("fullscreen")}),u.remove()}else r.notebook("placeHolder");r.notebook("setupStorage",i),r.on("data-is-clean",function(t,n){if(e(t.target).hasClass("prolog-editor"))return r.notebook("checkModified"),t.stopPropagation(),!1})})},"delete":function(e){return e=e||i(this),e&&(this.notebook("active",e.next()||e.prev()),e.nbCell("close"),this.notebook("updatePlaceHolder")),this.notebook("checkModified"),this},copy:function(t){t=t||i(this);if(t){var r=e.el.div({"class":"notebook"});e(r).append(e(t).nbCell("saveDOM")),n=s(r)}},paste:function(t){var r=this;t=t||n;if(t){var i=e.el.div();e(i).html(t);var s=e(i).find(".nb-cell");if(s.length>0)return e(i).find(".nb-cell").each(function(){r.notebook("insert",{where:"below",restore:e(this)})}),this;modal.alert("Not a SWISH notebook")}else modal.alert("Clipboard is empty")},up:function(e){return e=e||i(this),e&&(e.insertBefore(e.prev()),this.notebook("checkModified")),this},down:function(e){return e=e||i(this),e&&(e.insertAfter(e.next()),this.notebook("checkModified")),this},insertAbove:function(){return this.notebook("insert",{where:"above"})},insertBelow:function(){return this.notebook("insert",{where:"below",if_visible:true})==0&&modal.alert("<p>New cell would appear outside the visible area of the notebook.<p>Please select the cell below which you want the new cell to appear or scroll to the bottom of the notebook."),this},run:function(e){e=e||i(this),e&&e.nbCell("run")},fullscreen:function(t){return t==undefined&&(t=!this.hasClass("fullscreen")),t?e("body.swish").swish("fullscreen",this):e("body.swish").swish("exitFullscreen"),this},cellType:function(e,t){e=e||i(this),e&&e.nbCell("type",t)},checkModified:function(){var e=this.data("storage"),t=e.cleanGeneration==this.notebook("changeGen");this.notebook("markClean",t)},markClean:function(e){var n=this.data(t);n.clean_signalled!=e&&(n.clean_signalled=e,this.trigger("data-is-clean",e)),e&&this.find(".prolog-editor").prologEditor("setIsClean")},active:function(e,t){if(e){var n=this.find(".nb-content .nb-cell.active");function r(e){e.find(".nb-content .nb-cell.not-for-query").removeClass("not-for-query")}if(e.length==1){if(n.length!=1||e[0]!=n[0])r(this),n.nbCell("active",!1),e.nbCell("active",!0),t&&e.focus()}else r(this),n.nbCell("active",!1)}},insert:function(t){t=t||{};var n=i(this),r=t.cell||e.el.div({"class":"nb-cell"}),s=this.find(".nb-view"),o;t.if_visible&&s.find(".nb-cell").length>0&&(o=s[0].getBoundingClientRect());if(n)if(t.where=="above"){if(o){var u=n[0].getBoundingClientRect().top;if(u<o.top)return!1}e(r).insertBefore(n)}else{if(o){var a=n[0].getBoundingClientRect().bottom;if(a>o.bottom-20)return!1}e(r).insertAfter(n)}else{var f=this.find(".nb-content");if(o){var l=f[0].getBoundingClientRect().bottom;if(l>o.bottom-20)return!1}f.append(r)}return t.cell||e(r).nbCell(t.restore),this.notebook("updatePlaceHolder"),this.notebook("active",e(r)),this.notebook("checkModified"),this},setupStorage:function(t){var n=this;return t=e.extend(t,{getValue:function(){return n.notebook("value")},setValue:function(e){return n.notebook("setSource",e)},changeGen:function(){return n.notebook("changeGen")},isClean:function(e){var t=n.notebook("changeGen");return e==t},markClean:function(e){n.notebook("markClean",e)},cleanGeneration:this.notebook("changeGen"),cleanData:this.notebook("value"),cleanCheckpoint:"load",typeName:"notebook"}),this.storage(t)},setSource:function(e){typeof e=="string"&&(e={data:e}),this.notebook("value",e.data)},value:function(t,n){n=n||{};if(t==undefined){var r=e.el.div({"class":"notebook"});return this.find(".nb-cell").each(function(){cell=e(this),(!n.skipEmpty||!cell.nbCell("isEmpty"))&&e(r).append(cell.nbCell("saveDOM"))}),s(r)}var i=this,o=this.find(".nb-content"),r=e.el.div();o.html(""),r.innerHTML=t,n.fullscreen==undefined&&(n.fullscreen=e(r).find("div.notebook").hasClass("fullscreen")),n.fullscreen&&(this.removeClass("fullscreen"),this.notebook("fullscreen",!0)),e(r).find(".nb-cell").each(function(){var t=e.el.div({"class":"nb-cell"});o.append(t),e(t).nbCell(e(this))}),this.find(".nb-cell").nbCell("onload"),this.notebook("updatePlaceHolder")},changeGen:function(){var t=[];return this.find(".nb-cell").each(function(){cell=e(this),t.push(cell.nbCell("changeGen"))}),sha1(t.join())},updatePlaceHolder:function(){this.find(".nb-content").children().length==0?this.notebook("placeHolder"):this.find(".nb-placeholder").remove()},placeHolder:function(){var t=e.el.div({"class":"nb-placeholder"});e.ajax({url:config.http.locations.help+"/notebook.html",dataType:"html",success:function(n){e(t).html(n)}}),this.find(".nb-content").append(t)}};tabbed.tabTypes.notebook={dataType:"swinb",typeName:"notebook",label:"Notebook",contentType:"text/x-prolog-notebook",order:200,create:function(t,n){e(t).notebook(n)}},e.fn.notebook=function(n){if(r[n])return r[n].apply(this,Array.prototype.slice.call(arguments,1));if(typeof n=="object"||!n)return r._init.apply(this,arguments);e.error("Method "+n+" does not exist on jQuery."+t)}})(jQuery),function($){function cellText(e){return e.find(".editor").prologEditor("getSource",undefined,!0)}function fileInsertInput(){var e=$('<input type="file" name="file">');return e.on("change",function(e){var t=new FileReader;return t.onload=function(n){var r=$(e.target).closest(".nb-cell"),i=r.closest(".notebook");i.notebook("paste",t.result)&&r.remove()},t.readAsText(e.target.files[0]),e.preventDefault(),!1}),e}function typeMore(){var e=$('<div class="form-more"> <a href="#">more<a></div>');return e.find("a").on("click",function(e){var t=$(e.target).closest(".form-more");t.hide(400),t.next().show(400)}),e[0]}function typeLess(){var e=$('<div class="form-less" style="display:none"> <div><a href="#" class="less">less<a></div></div>');for(var t=0;t<arguments.length;t++)e.append(arguments[t]);return e.find("a.less").on("click",function(e){var t=$(e.target).closest(".form-less");t.hide(400),t.prev().show(400)}),e[0]}var pluginName="nbCell",id=0,methods={_init:function(e){return this.each(function(){var t=$(this),n={},r;t.data(pluginName,n),t.attr("tabIndex",-1),t.attr("id","nbc"+id++);if(e instanceof jQuery)t.nbCell("restoreDOM",e);else{var i=glyphButton("remove-circle","close","Close","default","xs");t.append(i),$(i).addClass("close-select"),$(i).on("click",function(){t.nbCell("close")}),t.append($.el.div({"class":"nb-type-select"},$.el.label("Create a "),r=$.el.div({"class":"btn-group",role:"group"}),$.el.label("cell here.")));for(var s in cellTypes)cellTypes.hasOwnProperty(s)&&$(r).append($.el.button({type:"button","class":"btn btn-default","data-type":s},cellTypes[s].label));$(r).on("click",".btn",function(e){t.nbCell("type",$(e.target).data("type"))}),t.append($.el.div({"class":"nb-type-more"},typeMore(),typeLess($.el.label("Insert notebook from local file "),fileInsertInput()[0])))}})},active:function(e){var t=this.data(pluginName);if(e){this.addClass("active");switch(t.type){case"program":this.find(".editor").prologEditor("makeCurrent");break;case"query":var n=this.prevAll(".program").first().find(".editor");n.length==1&&n.prologEditor("makeCurrent"),this.closest(".notebook").find(".nb-cell.program").not(this.nbCell("program_cells")).addClass("not-for-query")}}else if(this.length>0){this.removeClass("active");switch(t.type){case"markdown":case"html":this.hasClass("runnable")&&this.nbCell("run")}}},type:function(e){var t=this.data(pluginName);return t.type!=e&&(methods.type[e].apply(this),t.type=e,this.addClass(e)),this},run:function(){var e=arguments;return this.each(function(){var t=$(this);if(t.hasClass("runnable")){var n=t.data(pluginName);return methods.run[n.type].apply(t,e)}console.log("Cell is not runnable: ",t)})},runTabled:function(){return this.nbCell("run",{tabled:!0})},onload:function(){var e=arguments;return this.each(function(){var t=$(this),n=t.data(pluginName);methods.onload[n.type]&&methods.onload[n.type].apply(t,e)}),this.nbCell("refresh")},close:function(){return this.find(".prolog-runner").prologRunner("close"),this.remove()},refresh:function(){return this.hasClass("program")&&this.find("a[data-action='background']").attr("title",this.hasClass("background")?"Used for all queries in this notebook":"Used for queries below this cell"),this},getSettings:function(){return{tabled:this.data("tabled")=="true",run:this.data("run")=="onload",chunk:parseInt(this.data("chunk")||"1"),name:this.attr("name")}},settings:function(){function n(){this.append($.el.form({"class":"form-horizontal"},form.fields.checkboxes([{name:"tabled",label:"table results",value:t.tabled,title:"Table results"},{name:"run",label:"run on page load",value:t.run,title:"Run when document is loaded"}]),form.fields.chunk(t.chunk),form.fields.name(t.name||""),form.fields.buttons({label:"Apply",offset:3,action:function(n,r){r.tabled!=t.tabled&&(r.tabled?e.data("tabled","true"):e.removeData("tabled")),r.run!=t.run&&(r.run?e.data("run","onload"):e.removeData("run")),r.chunk!=t.chunk&&(r.chunk!=1?e.data("chunk",""+r.chunk):e.removeData("chunk"));var i=r.name?r.name.trim():"";i!=t.name&&(i?e.attr("name",i):e.attr("name",null)),e.closest(".notebook").notebook("checkModified")}})))}var e=this,t=this.nbCell("getSettings");form.showDialog({title:"Set options for query",body:n})},singleline:function(){return this.toggleClass("singleline"),this.find(".editor").prologEditor("refresh"),glyphButtonGlyph(this,"singleline",this.hasClass("singleline")?"triangle-left":"triangle-bottom"),this.find("a[data-action=singleline]").blur(),this},background:function(){return this.toggleClass("background"),this.find("a[data-action=background]").blur(),this.closest(".notebook").notebook("checkModified"),this.nbCell("refresh"),this},program_cells:function(){var e=this.data(pluginName),t=this.closest(".notebook").find(".nb-cell.program.background");return this.hasClass("program")?this.hasClass("background")||(t=t.add(this)):t=t.add(this.prevAll(".program").first()),t},programs:function(){var e=this.nbCell("program_cells");return e.find(".editor")},isEmpty:function(){return methods.isEmpty[this.data(pluginName).type].call(this)},saveDOM:function(){return methods.saveDOM[this.data(pluginName).type].call(this)},restoreDOM:function(e){function n(e){for(var t in cellTypes)if(cellTypes.hasOwnProperty(t)&&e.hasClass(t))return t}var t=this.data(pluginName);t.type=n(e),methods.restoreDOM[t.type].apply(this,arguments),this.addClass(t.type)},changeGen:function(){var e=this.data(pluginName).type;return e?methods.changeGen[e].call(this):0},text:function(){return cellText(this)}};methods.type.markdown=function(e){var t;e=e||{},e.mode="markdown",this.html(""),this.append(t=$.el.div({"class":"editor"})),$(t).prologEditor(e),this.addClass("runnable")},methods.type.html=function(e){var t;e=e||{},e.mode="htmlmixed",this.html(""),this.append(t=$.el.div({"class":"editor"})),$(t).prologEditor(e),this.addClass("runnable")},methods.type.program=function(e){var t=this,n;e=e||{},e.autoCurrent=!1,e.getSource=function(){var e=t.nbCell("programs");return e.prologEditor("getSource",undefined,!0)},this.html("");var r=$.el.div({"class":"btn-group nb-cell-buttons",role:"group"},glyphButton("triangle-bottom","singleline","Show only first line","default","xs"),imageButton("background","Use as background program","xs"));this.append(r,n=$.el.div({"class":"editor with-buttons"})),console.log("XXX"),e.background&&this.addClass("background"),e.singleline&&this.nbCell("singleline"),$(n).prologEditor(e)},methods.type.query=function(e){function r(t){e[t]!=undefined&&(n.data(t,""+e[t]),delete e[t])}function i(t){e[t]!=undefined&&(n.attr(t,""+e[t]),delete e[t])}function o(e){this.find(".editor.query").prologEditor("wrapSolution",$(e).text())}var t,n=this;this.html(""),e=e||{},e.tabled==undefined&&(e.tabled=preferences.getVal("tabled_results")),r("tabled"),r("chunk"),r("run"),i("name"),e=$.extend({},e,{role:"query",sourceID:function(){return n.nbCell("programs").prologEditor("getSourceID")}});var s=$.el.div({"class":"btn-group nb-cell-buttons",role:"group"},glyphButton("wrench","settings","Settings","default","xs"),glyphButton("play","run","Run query","primary","xs")),u=form.widgets.dropdownButton($.el.span({"class":"glyphicon glyphicon-menu-hamburger"}),{client:n,divClass:"nb-query-menu",actions:{"Aggregate (count all)":o,"--":null,"Order by":o,Distinct:o,Limit:o,"---":null,"Download answers as CSV":function(){var e=cellText(this).replace(/\.\s*$/,""),t=this.nbCell("programs").prologEditor("getSource",undefined,!0),n={},r=this.attr("name");r&&(n.disposition=r),prolog.downloadCSV(e,t,n)}}});this.append(s,$.el.div({"class":"query with-buttons"},u,$.el.span({"class":"prolog-prompt"},"?-"),t=$.el.div({"class":"editor query"}))),$(t).prologEditor(e),this.addClass("runnable")},methods.run.markdown=function(e){function n(e){var t=$(e.target).closest(".nb-cell"),r=t.data("markdownText");t.removeData("markdownText"),methods.type.markdown.call(t,{value:r}),t.off("dblclick",n),t.off("click",links.followLink)}function r(r){t.html(r),t.removeClass("runnable"),t.data("markdownText",e),t.on("dblclick",n),t.on("click","a",links.followLink)}var t=this;e=e||cellText(this),e.trim()!=""?$.ajax({type:"POST",url:config.http.locations.markdown,data:e,contentType:"text/plain; charset=UTF-8",success:r}):r("<div class='nb-placeholder'>Empty markdown cell.  Double click to edit</div>")},methods.run.html=function(htmlText,options){function makeEditable(e){var t=$(e.target).closest(".nb-cell"),n=t.data("htmlText");t.removeData("htmlText"),methods.type.html.call(t,{value:n}),t.off("dblclick",makeEditable),t.off("click",links.followLink)}function runScripts(){if(config.swish.notebook.eval_script==1&&options.eval_script!=0){var scripts=[];cell.find("script").each(function(){var e=this.getAttribute("type")||"text/javascript";e=="text/javascript"&&scripts.push(this.textContent)});if(scripts.length>0){var script="(function(notebook){"+scripts.join("\n")+"})",nb=new Notebook({cell:cell[0]});try{eval(script)(nb)}catch(e){alert(e)}}}}function runHTML(e){cell[0].innerHTML=e,runScripts()}function setHTML(e){runHTML(e),cell.removeClass("runnable"),cell.data("htmlText",htmlText),cell.on("dblclick",makeEditable),cell.on("click","a",links.followLink)}var cell=this;options=options||{};if(options.html==0){runScripts();return}htmlText=(htmlText||cellText(this)).trim(),htmlText!=""?setHTML(htmlText):setHTML("<div class='nb-placeholder'>Empty HTML cell.  Double click to edit</div>")},methods.run.program=function(){modal.alert("Please define a query to run this program")},methods.run.query=function(e){var t=this.nbCell("programs"),n=this.nbCell("getSettings"),r=cellText(this);e=e||{};if(e.bindings){var i="";if(typeof e.bindings=="string")i=e.bindings;else for(var s in e.bindings)e.bindings.hasOwnProperty(s)&&(i&&(i+=", "),i+=s+" = "+Pengine.stringify(e.bindings[s]));i&&(r=i+", ("+prolog.trimFullStop(r)+")")}var o={source:t.prologEditor("getSource",undefined,!0),query:r,tabled:n.tabled||!1,chunk:n.chunk,title:!1,query_editor:this.find(".prolog-editor.query")};t[0]&&(o.editor=t[0]);var u=$.el.div({"class":"prolog-runner"});this.find(".prolog-runner").prologRunner("close"),this.append(u),$(u).prologRunner(o)},methods.onload.query=function(){this.data("run")=="onload"&&this.nbCell("run")},methods.onload.html=function(){return methods.run.html.call(this,undefined,{html:!1,eval_script:!0})},methods.saveDOM.markdown=function(){var e=this.data("markdownText")||cellText(this);return $.el.div({"class":"nb-cell markdown"},e)},methods.saveDOM.html=function(){var e=this.data("htmlText")||cellText(this),t=$.el.div({"class":"nb-cell html"});return $(t).html(e),t},methods.saveDOM.program=function(){function n(n){e.hasClass(n)&&$(t).attr("data-"+n,!0)}var e=this,t=$.el.div({"class":"nb-cell program"},cellText(this));return n("background"),n("singleline"),t},methods.saveDOM.query=function(){function n(e,t){return e!="tabled"||!!t&&t!="false"?!1:!0}function r(r){var i;(i=e.data(r))&&!n(r,i)&&$(t).attr("data-"+r,i)}function i(n){var r;(r=e.attr(n))&&r&&$(t).attr(n,r)}var e=this,t=$.el.div({"class":"nb-cell query"},cellText(this));return r("tabled"),r("chunk"),r("run"),i("name"),t},methods.restoreDOM.markdown=function(e){var t=e.text().trim();this.data("markdownText",t),methods.run.markdown.call(this,t)},methods.restoreDOM.html=function(e){methods.run.html.call(this,e.html(),{eval_script:!1})},methods.restoreDOM.program=function(e){function n(n){var r;if(r=e.data(n))t[n]=r}var t={value:e.text().trim()};n("background"),n("singleline"),methods.type.program.call(this,t)},methods.restoreDOM.query=function(e){function n(n){var r;if(r=e.data(n))n=="chunk"?t.chunk=parseInt(r):t[n]=r}function r(n){var r;if(r=e.attr(n))t[n]=r}var t={value:e.text().trim()};n("tabled"),n("chunk"),n("run"),r("name"),t.tabled==undefined&&(t.tabled=!1),methods.type.query.call(this,t)},methods.changeGen.markdown=function(){var e=this.data("markdownText")||cellText(this);return sha1(e)},methods.changeGen.html=function(){var e=this.data("htmlText")||cellText(this);return sha1(e)},methods.changeGen.program=function(){function n(n,r){t.hasClass(n)&&(e+=r)}var e="",t=this;return n("background","B"),n("singleline","S"),e+="V"+cellText(this),sha1(e)},methods.changeGen.query=function(){function n(n,r){var i;if(i=t.data(n))e+=r+i}function r(n,r){var i;if(i=t.attr(n))e+=r+i}var e="",t=this;return n("tabled","T"),n("chunk","C"),n("run","R"),r("name","N"),e+="V"+cellText(this),sha1(e)},methods.isEmpty.markdown=function(){var e=this.data("markdownText")||cellText(this);return e.trim()==""},methods.isEmpty.html=function(){var e=this.data("htmlText")||cellText(this);return e.trim()==""},methods.isEmpty.program=function(){return cellText(this).trim()==""},methods.isEmpty.query=function(){return cellText(this).trim()==""},$.fn.nbCell=function(e){if(methods[e])return methods[e].apply(this,Array.prototype.slice.call(arguments,1));if(typeof e=="object"||!e)return methods._init.apply(this,arguments);$.error("Method "+e+" does not exist on jQuery."+pluginName)}}(jQuery),Notebook.prototype.swish=function(e){var t=this.cell().nbCell("programs"),n=t.prologEditor("getSource",undefined,!0);return n&&(e.src=n),$.swish(e)},Notebook.prototype.cell=function(e){return e?this.notebook().find('.nb-cell[name="'+e+'"]'):$(this.my_cell)},Notebook.prototype.notebook=function(){return $(this.my_cell).closest(".notebook")},Notebook.prototype.run=function(e,t){var n={};t&&(n.bindings=t),this.cell(e).nbCell("run",n)},Notebook.prototype.submit=function(e,t){var n=this.$(e),r=form.serializeAsObject(n);form.formError(n,null),this.swish({ask:t.predicate+"(("+Pengine.stringify(r)+"))",onerror:function(e){form.formError(n,e)},onsuccess:t.onsuccess})},Notebook.prototype.$=function(e){return this.cell().find(e)}}),define("navbar",["jquery","preferences","laconic"],function(e,t){(function(e){function i(n,r,i){if(i=="--")n.append(e.el.li({"class":"divider"}));else if(typeof i=="function"){var s,o;if(i.typeIcon)s=e.el.a(e.el.span({"class":"dropdown-icon type-icon "+i.typeIcon}),r);else if((o=r.indexOf("("))>0){var u=r.substr(o);s=e.el.a({"class":"accelerated"},r.substr(0,o).trim(),e.el.span({"class":"accell-spacer"},u),e.el.span({"class":"accell-text"},u))}else s=e.el.a(r);e(s).data("action",i),i.name&&e(s).attr("id",i.name),n.append(e.el.li(s))}else if(i.type=="checkbox"){var a=e(e.el.input({type:"checkbox"}));i.preference!==undefined?(a.addClass("swish-event-receiver"),t.getVal(i.preference)&&a.prop("checked",!0),a.on("click",function(){t.setVal(i.preference,e(this).prop("checked"))}),a.on("preference",function(e){e.name==i.preference&&a.prop("checked",e.value)})):(i.checked&&a.prop("checked",i.checked),a.on("click",function(){i.action(e(this).prop("checked"))})),n.append(e.el.li({"class":"checkbox"},a[0],e.el.span(r)))}else if(i.type=="submenu"){var f=e.el.ul({"class":"dropdown-menu sub-menu"});n.append(e.el.li(e.el.a({"class":"trigger right-caret"},r),f)),i.action&&e(f).data("action",i.action);if(i.items)for(var o=0;o<i.items.length;o++)e(f).append(e.el.li(e.el.a(i.items[o])));i.update&&e(f).on("update",function(e){i.update.call(e.target)})}else alert("Unknown navbar item")}function s(t,n){return t.find(".dropdown-menu").filter(function(){return e(this).attr("name")==n})}function o(t,n){if(!e(t).hasClass("trigger")){var r=e(t).data("action")||e(t).parents("ul").data("action");return a.call(t,n),r?(n.preventDefault(),r.call(t,n)):e(t).hasClass("trigger")&&u.call(t,n),!1}u.call(t,n)}function u(t){var n=e(this).next(),r=e(this).parent().parent();(e(this).hasClass("left-caret")||e(this).hasClass("right-caret"))&&e(this).toggleClass("right-caret left-caret"),r.find(".left-caret").not(this).toggleClass("right-caret left-caret"),r.find(".sub-menu:visible").not(n).hide(),n.trigger("update"),n.toggle(),t.stopPropagation()}function a(t){var n=e(this).closest(".dropdown");n.find(".left-caret").toggleClass("right-caret left-caret"),n.find(".sub-menu:visible").hide()}var n="navbar",r={_init:function(t){return this.each(function(){var n=e(this),r={};for(var i in t)t.hasOwnProperty(i)&&(n.navbar("appendDropdown",i),n.navbar("populateDropdown",i,t[i]));n.on("click","a",function(e){o(this,e)})})},appendDropdown:function(t){var n=this.children(".nav.navbar-nav"),r=e.el.ul({name:t,"class":"dropdown-menu"}),i=e.el.li({"class":"dropdown"},e.el.a({"class":"dropdown-toggle","data-toggle":"dropdown"},t,e.el.b({"class":"caret"})),r);return n.append(i),this},populateDropdown:function(e,t){if(typeof t=="function")t(this,e);else{var n=s(this,e);for(var r in t)t.hasOwnProperty(r)&&i(n,r,t[r])}},clearDropdown:function(e){var t=s(this,e);return t.html(""),this},extendDropdown:function(e,t,n){var r=s(this,e);i(r,t,n)}};e.fn.navbar=function(t){if(r[t])return r[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return r._init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery."+n)}})(jQuery)}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/addon/hint/templates-hint",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function r(e,t){return e.slice(0,t.length).toUpperCase()==t.toUpperCase()}function i(e){}function s(e){var t=e.template;return document.createTextNode(t.name)}function u(){this.marked=[],this.selectableMarkers=[],this.varIndex=-1}function a(e){return e._templateStack?e._templateStack.length:0}function f(e){this.name=e.name,this.description=e.description,this.text=e.text,e.varTemplates&&(this.varTemplates=e.varTemplates),e.template!=null?this.source=e.template:e.tokens!=null&&(this._tokens=e.tokens)}function l(e){var t=[],n=!1,r=null,i="";for(var s=0;s<e.length;s++){var o=e.charAt(s);if(o=="\n")i!=""&&t.push(i),i="",t.push(o),r=null;else{var u=!0;if(n)o=="}"&&(n=!1,u=!1,i=="cursor"?t.push({cursor:!0}):i=="line_selection"?t.push({line_selection:!0}):t.push({variable:i}),i="");else if(o=="$"&&s+1<=e.length){s++;var a=e.charAt(s);a=="{"&&(n=!0,u=!1,i!=""&&t.push(i),i="")}u&&r!="$"?(i+=o,r=o):r=null}}return i!=""&&t.push(i),t}function c(e,t){var n=e.findMarksAt(t.from);if(n)for(var r=0;r<n.length;r++){var i=n[r];if(i._templateVar)return i}return null}function h(e,t){var n=e._templateState;if(!t.origin||!n||n.updating)return;try{n.updating=!0;var r=c(e,t);if(r==null)g(e);else{var i=r.find(),s=e.getRange(i.from,i.to);for(var o=0;o<n.marked.length;o++){var u=n.marked[o];if(u!=r&&u._templateVar==r._templateVar){var a=u.find();e.replaceRange(s,a.from,a.to)}}}}finally{n.updating=!1}}function p(e){i("template","endCompletion()",a(e)),a(e)&&g(e,!0)}function d(e,t){var n=e._templateState;if(n.selectableMarkers.length>0){n.varIndex++;if(n.varIndex>=n.selectableMarkers.length){if(t){m(e);return}n.varIndex=0}var r=n.selectableMarkers[n.varIndex],i=r.find();e.setSelection(i.from,i.to);var s=r._templateVar;for(var o=0;o<n.marked.length;o++){var u=n.marked[o];u==r?(u.className="",u.startStyle="",u.endStyle=""):u._templateVar==r._templateVar?(u.className="CodeMirror-templates-variable-selected",u.startStyle="",u.endStyle=""):(u.className="CodeMirror-templates-variable",u.startStyle="CodeMirror-templates-variable-start",u.endStyle="CodeMirror-templates-variable-end")}e.refresh()}else m(e)}function v(t){function s(e,t){return e.ch==t.ch&&e.line==t.line}var n=t._templateState,r=n.selectableMarkers[n.varIndex],i={state:n};t._hintTemplateMarker&&(i.marker=t._hintTemplateMarker),t._templateStack||(t._templateStack=[]),t._templateStack.push(i),delete t._templateState,t._hintTemplateMarker=r;var o=r.find(),u=t.listSelections();u.length==1&&s(u[0].anchor,o.from)&&s(u[0].head,o.to)&&t.replaceRange("☰",o.from,o.to),e.commands.autocomplete(t)}function m(e){var t=e._templateState.cursor;if(t!=null){var n=t.find();n!=null&&e.setSelection(n,n)}g(e)}function g(e,t){function r(){i("template","Canceled?");for(var t=0;t<n.marked.length;t++){var r=n.marked[t];if(r==e._hintTemplateMarker){var s=r.find();s&&e.getRange(s.from,s.to)=="☰"&&e.replaceRange(r._templateVar,s.from,s.to)}}}var n=e._templateState;if(n){i("template","Uninstall, clearing: ",n.marked.length);for(var s=0;s<n.marked.length;s++)n.marked[s].clear();n.cursor!=null&&n.cursor.clear(),n.marked.length=0,n.selectableMarkers.length=0}else i("template","Uninstall, no state");if(e._templateStack&&e._templateStack.length>0){i("template","Popping from level",e._templateStack.length);var u=e._templateStack.pop();n=e._templateState=u.state,t&&e._hintTemplateMarker&&r(),u.marker?e._hintTemplateMarker=u.marker:delete e._hintTemplateMarker}else i("template","Leaving template mode"),e.off("change",h),e.off("endCompletion",p),e.removeKeyMap(o),delete e._templateState,delete e._hintTemplateMarker}var t=[],n=e.Pos;e.templatesHint={};var o={Tab:d,Enter:function(e){d(e,!0)},Esc:g,"Ctrl-Space":v};f.prototype.tokens=function(){return this._tokens==null&&(this._tokens=l(this.source)),this._tokens},f.prototype.content=function(){if(this._content==null){var e=this.tokens(),t="";for(var n=0;n<e.length;n++){var r=e[n];typeof r=="string"?t+=r:r.variable&&(t+=r.variable)}this._content=t}return this._content},f.prototype.insert=function(e,t){var r=this,s=a(e);i("template","Insert, nested",s,"template",r);if(e._templateState||s)i("template","Uninstall from insert()",s),g(e);if(r.text){e.replaceRange(r.text,t.from,t.to);return}var f=new u;e._templateState=f;var l=this.tokens(),c="",v=t.from.line,m=t.from.ch,y=[],b=[],w=null;for(var E=0;E<l.length;E++){var S=l[E];if(typeof S=="string")c+=S,S=="\n"?(v++,m=0):m+=S.length;else if(S.variable){c+=S.variable;var x=n(v,m),T=n(v,m+S.variable.length),N=b[S.variable]!=0;m+=S.variable.length,y.push({from:x,to:T,variable:S.variable,selectable:N}),b[S.variable]=!1}else S.cursor&&(w=n(v,m))}var x=t.from,T=t.to,C=x.line;e.replaceRange(c,x,T);for(var E=0;E<y.length;E++){function k(e){return r.varTemplates&&r.varTemplates[e]?r.varTemplates[e]:undefined}var L=y[E],x=L.from,T=L.to,A=e.markText(x,T,{className:"CodeMirror-templates-variable",startStyle:"CodeMirror-templates-variable-start",endStyle:"CodeMirror-templates-variable-end",inclusiveLeft:!0,inclusiveRight:!0,clearWhenEmpty:!1,_templateVar:L.variable,_templates:k(L.variable)});f.marked.push(A),L.selectable==1&&f.selectableMarkers.push(A)}w!=null&&(f.cursor=e.setBookmark(w));var O=c.split("\n");for(var M=1;M<O.length;M++){var _=C+M;e.indentLine(_)}s||(e.on("change",h),i("template","Installing endCompletion"),e.on("endCompletion",p),e.addKeyMap(o)),d(e,!0)},e.templatesHint.getCompletions=function(n,i,s){var o=n.doc.mode.name,u=t[o];if(u)for(var a=0;a<u.length;a++){var f=u[a];if(r(f.name,s)){var l=f.name;f.description&&(l+="- "+f.description);var c="CodeMirror-hint-template";f.className&&(c=f.className);var h={className:c,text:l,template:f};h.data=h,h.hint=function(e,t,n){n.template.insert(e,t)},h.info=function(t){var r=t.template.content();if(e.runMode){var i=document.createElement("div");return i.className="cm-s-default",n.options&&n.options.theme&&(i.className="cm-s-"+n.options.theme),e.runMode(r,n.getMode().name,i),i}return r},i.push(h)}}},e.templatesHint.Template=f,e.templatesHint.addTemplates=function(e){var n=e.context;if(n){var r=t[n];r||(r=[],t[n]=r),e.templates.forEach(function(e){r.push(new f(e))})}}}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/mode/prolog/prolog-template-hint",["../../lib/codemirror","../../addon/hint/templates-hint","jquery","config","laconic"],e):e(CodeMirror)}(function(e,t,n,r){function s(e){function r(e){var n=/[-+?:^@!]*([A-Z][A-Za-z_0-9]*)/g,r=/\bis\s+(det|nondet|semidet|fail|multi)$/;t.template||(t.template=e.replace(n,"$${$1}").replace(r,""),t.template.match(/\${cursor}/)||(t.template+="${cursor}")),t.displayText||(t.displayText=e);if(!t.varTemplates){var s=e.match(/:[A-Z][A-Za-z_0-9]*/g);if(s&&s.length>0){var o={};for(var u=0;u<s.length;u++)o[s[u].substring(1)]=i;t.varTemplates=o}}}var t=this,s=["template","displayText","text",{from:"summary",to:"description"},"className","varTemplates"];if(typeof e=="string")this.displayText=e,this.text=e;else{for(var o=0;o<s.length;o++){var u=s[o];typeof u=="string"?e[u]&&(this[u]=e[u]):e[u.from]&&(this[u.to]=e[u.from])}e.mode&&r(e.mode),e.classes&&(e.className=e.classes.join(" "))}this.render=function(e,t,r){n(e).append(r.displayText)},this.info=function(e){return e.description}}function o(t,n,r){function f(e,t){return e.slice(0,t.length)==t}var o=n.token.string,u=[],a=i;t._hintTemplateMarker&&(o=="☰"&&(o=""),a=t._hintTemplateMarker._templates);var l=o.length>0&&!o.match(/\w/);if(a)for(var c=0;c<a.length;c++){var h=a[c];if(typeof h=="string")f(h,o)&&u.push(new s(h));else{var p=["name","mode","template","text"];if(l)h.name&&h.name.indexOf(o)>=0&&u.push(new s(h));else for(var d=0;d<p.length;d++)if(h[p[d]]){f(h[p[d]],o)&&u.push(new s(h));break}}}if(u.length==0){var v=e.hint.anyword,m=o==""&&t._hintTemplateMarker?{word:/[A-Z][A-Za-z0-9_]*/}:r,g=v(t,m);for(var c=0;c<g.list.length;c++)u.push(new s(g.list[c]))}return{list:u,from:n.position.from,to:n.position.to}}function u(t,n,r){var i=a(t),s=o(t,i,r);e.attachContextInfo(s),n(s)}function a(t){var n=t.getCursor(),r=t.getTokenAt(n),i=e.innerMode(t.getMode(),r.state);if(i.mode.name!="prolog")return null;var s={from:new e.Pos(n.line,r.start),to:new e.Pos(n.line,r.end)};return{token:r,position:s}}var i=r.swish.templates||[];return s.prototype.hint=function(t,n,r){var i=new e.templatesHint.Template(this);i.insert(t,n)},u.async=!0,e.registerHelper("hint","prologTemplate",u),{getHints:u,getState:a}}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/mode/prolog/prolog",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("prolog",function(t,n){function r(e,t,n){return t.tokenize=n,n(e,t)}function p(e,t,n){if(n>0){while(n-->0)if(!t.test(e.next()))return!1}else while(t.test(e.peek()))e.next();return!0}function d(e){var t=e.next();if(o.test(t))return!0;switch(t){case"u":if(i.unicodeEscape)return p(e,a,4);return!1;case"U":if(i.unicodeEscape)return p(e,a,8);return!1;case null:return!0;case"c":return e.eatSpace(),!0;case"x":return p(e,a,2)}return u.test(t)?p(e,u,-1)?(e.peek()=="\\"&&e.next(),!0):!1:!1}function v(e,t,n){var r;while((r=e.next())!=null){if(r==n&&n!=e.peek())return t.nesting.pop(),!1;if(r=="\\"&&!d(e))return!1}return i.multiLineQuoted}function m(e){return e.nesting.slice(-1)[0]}function g(e){var t=m(e);t?t.arg==0?t.arg=1:t.type=="control"&&(e.goalStart=!1):e.goalStart=!1}function y(e){var t=m(e);t&&!t.alignment&&t.arg!=undefined&&(t.arg==0?t.alignment=t.leftCol?t.leftCol+4:t.column+4:t.alignment=t.column+1)}function b(e){var t=m(e);t?t.arg?t.arg++:t.type=="control"&&(e.goalStart=!0):e.goalStart=!0}function w(e){var t=m(e);return t?t.type=="control"?!0:!1:e.inBody}function x(e,t,n){return E=e,S=n,t}function T(e){return e.eol()||/[\s%]/.test(e.peek())?!0:!1}function N(e,t){var n=e.next();if(n=="(")return t.lastType=="functor"?(t.nesting.push({functor:t.functorName,column:e.column(),leftCol:t.functorColumn,arg:0}),delete t.functorName,delete t.functorColumn):t.nesting.push({type:"control",closeColumn:e.column(),alignment:e.column()+4}),x("solo",null,"(");if(n=="{"&&t.lastType=="tag")return t.nesting.push({tag:t.tagName,column:e.column(),leftCol:t.tagColumn,arg:0}),delete t.tagName,delete t.tagColumn,x("dict_open",null);if(n=="/"&&e.eat("*"))return r(e,t,L);if(n=="%")return e.skipToEnd(),x("comment","comment");g(t);if(l.test(n)){switch(n){case")":t.nesting.pop();break;case"]":return t.nesting.pop(),x("list_close",null);case"}":var s=m(t),o=s&&s.tag?"dict_close":"brace_term_close";return t.nesting.pop(),x(o,null);case",":e.eol()&&(t.commaAtEOL=!0),b(t);case";":w(t)&&(t.goalStart=!0);break;case"[":return t.nesting.push({type:"list",closeColumn:e.column(),alignment:e.column()+2}),x("list_open",null);case"{":return i.quasiQuotations&&e.eat("|")?(t.nesting.push({type:"quasi-quotation",alignment:e.column()+1}),x("qq_open","qq_open")):(t.nesting.push({type:"curly",closeColumn:e.column(),alignment:e.column()+2}),x("brace_term_open",null));case"|":if(i.quasiQuotations){if(e.eat("|"))return t.tokenize=k,x("qq_sep","qq_sep");if(e.eat("}"))return t.nesting.pop(),x("qq_close","qq_close")}w(t)&&(t.goalStart=!0)}return x("solo",null,n)}if(n=='"'||n=="'"||n=="`")return t.nesting.push({type:"quoted",alignment:e.column()+1}),r(e,t,C(n));if(n=="0"){if(e.eat(/x/i))return e.eatWhile(/[\da-f]/i),x("number","number");if(e.eat(/o/i))return e.eatWhile(/[0-7]/i),x("number","number");if(e.eat(/'/)){var u=e.next();return u=="\\"&&!d(e)?x("error","error"):x("code","code")}}if(/\d/.test(n)||/[+-]/.test(n)&&e.eat(/\d/))return i.groupedIntegers?e.match(/^\d*((_|\s+)\d+)*(?:\.\d+)?(?:[eE][+\-]?\d+)?/):e.match(/^\d*(?:\.\d+)?(?:[eE][+\-]?\d+)?/),x(n=="-"?"neg-number":n=="+"?"pos-number":"number");if(f.test(n)){e.eatWhile(f);var a=e.current();if(a=="."&&T(e))return m(t)?x("fullstop","error",a):x("fullstop","fullstop",a);return c.test(a)?x("neck","neck",a):w(t)&&h.test(a)?(t.goalStart=!0,x("symbol","operator",a)):x("symbol","operator",a)}e.eatWhile(/[\w_]/);var p=e.current();if(e.peek()=="{"&&i.dicts)return t.tagName=p,t.tagColumn=e.column(),x("tag","tag",p);if(n=="_"){if(p.length==1)return x("var","anon",p);var v=p.charAt(1);return v==v.toUpperCase()?x("var","var-2",p):x("var","var",p)}return n==n.toUpperCase()?x("var","var",p):e.peek()=="("?(t.functorName=p,t.functorColumn=e.column(),x("functor","functor",p)):x("atom","atom",p)}function C(e){return function(t,n){if(!v(t,n,e)){n.tokenize=N;if(t.peek()=="("){var r=t.current();return n.functorName=r,x("functor","functor",r)}if(t.peek()=="{"&&i.dicts){var r=t.current();return n.tagName=r,x("tag","tag",r)}}return x(s[e],s[e])}}function k(e,t){var n=!1,r;while(r=e.next()){if(r=="}"&&n){t.tokenize=N,e.backUp(2);break}n=r=="|"}return x("qq_content","qq_content")}function L(e,t){var n=!1,r;while(r=e.next()){if(r=="/"&&n){t.tokenize=N;break}n=r=="*"}return x("comment","comment")}var i={quasiQuotations:!0,dicts:!0,unicodeEscape:!0,multiLineQuoted:!0,groupedIntegers:!0},s={'"':"string","'":"qatom","`":"bqstring"},o=/[abref\\'"nrtsv]/,u=/[0-7]/,a=/[0-9a-fA-F]/,f=/[-#$&*+./:<=>?@\\^~]/,l=/[[\]{}(),;|!]/,c=/^(:-|-->)$/,h=/^(,|;|->|\*->|\\+|\|)$/,E,S;return{startState:function(){return{tokenize:N,inBody:!1,goalStart:!1,lastType:null,nesting:new Array,curTerm:null,curToken:null}},token:function(e,t){var r;t.curTerm==null&&n.metainfo&&(t.curTerm=0,t.curToken=0),e.sol()&&delete t.commaAtEOL;if(t.tokenize==N&&e.eatSpace())return e.eol()&&y(t),null;var i=t.tokenize(e,t);return e.eol()&&y(t),E=="neck"?(t.inBody=!0,t.goalStart=!0):E=="fullstop"&&(t.inBody=!1,t.goalStart=!1),t.lastType=E,typeof n.enrich=="function"&&(i=n.enrich(e,t,E,S,i)),i},indent:function(t,n){if(t.tokenize==L)return e.Pass;var r;return(r=m(t))?r.closeColumn&&!t.commaAtEOL?r.closeColumn:r.alignment:t.inBody?4:0},theme:"prolog",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"%"}}),e.defineMIME("text/x-prolog","prolog")}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/mode/prolog/prolog_keys",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.commands.prologStartIfThenElse=function(t){var n=t.getCursor("start"),r=t.getTokenAt(n,!0);if(r.state.goalStart==1){t.replaceSelection("(   ","end");return}return e.Pass},e.commands.prologStartThen=function(t){function i(e){var t=e.nesting.length;return t>0?e.nesting[t-1]:null}function s(e){var t=i(e);return t?t.type=="control"?!0:!1:e.inBody}var n=t.getCursor("start"),r=t.getTokenAt(n,!0);if(n.ch==r.end&&r.type=="operator"&&r.string=="-"&&s(r.state)){t.replaceSelection(">  ","end");return}return e.Pass},e.commands.prologStartElse=function(t){var n=t.getCursor("start"),r=t.getTokenAt(n,!0);if(r.start==0&&n.ch==r.end&&!/\S/.test(r.string)){t.replaceSelection(";   ","end");return}return e.Pass},e.defineOption("prologKeys",null,function(t,n,r){r&&r!=e.Init&&t.removeKeyMap("prolog");if(n){var i={name:"prolog","'('":"prologStartIfThenElse","'>'":"prologStartThen","';'":"prologStartElse","Ctrl-L":"refreshHighlight"};t.addKeyMap(i)}})}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/mode/prolog/prolog_query",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.commands.prologFireQuery=function(t){var n=t.lineCount(),r=t.getLine(n-1).length,i=t.getTokenAt({line:n,ch:r},!0);return i.type=="fullstop"?t.prologFireQuery(t.getValue()):e.Pass},e.defineOption("prologQuery",null,function(t,n,r){r&&r!=e.Init&&t.removeKeyMap("prologQuery");if(typeof n=="function"){var i={name:"prologQuery",Enter:"prologFireQuery","Ctrl-Enter":"newlineAndIndent"};t.addKeyMap(i),t.prologFireQuery=n}})}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/mode/prolog/prolog_server",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function r(e){typeof e=="object"&&(this.enabled=e.enabled||!1,this.role=e.role||"source",e.sourceID&&(this.sourceID=e.sourceID),this.url={change:e.url+"change",tokens:e.url+"tokens",leave:e.url+"leave",info:e.url+"info"},this.delay=e.delay?e.delay:t,this.generationFromServer=-1,this.tmo=null)}function i(e,t){var n=e.state.prologHighlightServer;if(n==null||n.url==null||!n.enabled)return;n.tmo&&e.askRefresh(),n.changes!==undefined&&n.changes.push(t);if(t.origin=="setValue"||n.generationFromServer==-1)n.changes=undefined,e.serverAssistedHighlight()}function s(e){var t=e.state.prologHighlightServer;if(t==null||t.url==null||t.uuid==null)return;var n=t.uuid;delete t.uuid,$.ajax({url:t.url.leave,async:!1,contentType:"application/json",type:"POST",dataType:"json",data:JSON.stringify({uuid:n})})}function o(){var e=(new Date).getTime(),t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(t=="x"?n:n&7|8).toString(16)});return t}function f(e,t,n,r,i){function o(e){var t=s.metainfo[e.curTerm];if(!t)return null;var n=t[e.curToken];return n?n:null}function f(){t.outOfSync||(console.log("Mismatch: ("+r+") "+n+"/"+d.type),t.outOfSync={okToken:t.curToken,okTerm:t.curTerm,skippedTerms:0,skippedTokens:[]}),s.editor.askRefresh()}function l(){var e=t.outOfSync,n={curToken:e.okToken,curTerm:e.okTerm};return e.skippedTerms,null}function c(t){var n;if(r==t)return!0;if((n=t.lastIndexOf(r,1))>=0){var i=t.substring(r.length+n);for(var s=0;s<i.length;s++)if(!e.eat(i.charAt(s)))return e.backUp(s),!1;return!0}return!1}function h(e){var t=e.slice(-1)[0];return t&&t.type=="quoted"}function p(e,t){if(e){if(!u[n])return r&&e.text==r?(t.curToken++,e.type):i;if(e.text&&r)return c(e.text)?(t.curToken++,e.type):undefined;if(u[n]==a[e.type])return n=="fullstop"?(t.curTerm++,t.curToken=0):h(t.nesting)||t.curToken++,e.type;if(u[n]==e.base)return t.curToken++,e.type;if(n=="qatom"&&a[e.type]=="atom")return t.curToken++,e.type;if(n=="number"&&e.type=="meta")return t.curToken++,e.type;if(n=="neg-number"&&e.text&&e.text=="-")return t.curToken+=2,"number";if(n=="pos-number"&&e.text&&e.text=="+")return t.curToken+=2,"number"}return undefined}var s=this;if(t.curTerm!=null){var d,v;if(t.syntax_error)return n=="fullstop"&&(s.editor.askRefresh(),delete t.syntax_error),i;if(t.outOfSync){var m=t.outOfSync;if(m.skippedTerms<=3){m.skippedTokens.push({type:n,style:i,content:r});if(v=l())return v;n=="fullstop"&&(m.skippedTokens=[],m.skippedTerms++)}return i}return(d=o(t))?(v=p(d,t))!==undefined?v:d.type=="syntax_error"?(t.syntax_error=!0,t.curToken=0,t.curTerm++,i):(f(),i+" outofsync"):(s.editor.askRefresh(),i)}return i}var t=1e3,n=1e3;e.defineOption("prologHighlightServer",!1,function(e,t,n){function o(){s(e)}e.state.prologHighlightServer?t==null?(s(e),e.off("change",i),window.removeEventListener("unload",o),delete e.state.prologHighlightServer,e.setOption("mode",{name:"prolog"})):t.enabled!=n.enabled&&(e.state.prologHighlightServer.enabled=t.enabled,t.enabled?(e.on("change",i),window.addEventListener("unload",o),e.lineCount()>0&&e.serverAssistedHighlight(!0)):(s(e),e.off("change",i),window.removeEventListener("unload",o),e.setOption("mode",{name:"prolog"}))):t&&(e.state.prologHighlightServer=new r(t),e.state.prologHighlightServer.enabled&&(e.on("change",i),window.addEventListener("unload",o),e.lineCount()>0&&e.serverAssistedHighlight(!0)))}),e.prototype.askRefresh=function(e){var t=this,n=t.state.prologHighlightServer;if(n==null)return;e===undefined&&(e=n.delay),n.tmo&&clearTimeout(n.tmo),n.tmo=setTimeout(function(){t.serverAssistedHighlight()},e)},e.prototype.serverAssistedHighlight=function(e){function s(){var e=t.getOption("mode");return typeof e!="object"?e={name:"prolog",enrich:f,editor:t}:e.enrich||(e.enrich=f,e.editor=t),e}var t=this,r=t.state.prologHighlightServer,i={};r.tmo=null;if(r==null||r.url==null||!r.enabled||t.isClean(r.generationFromServer)&&!e)return;if(r.uuid)i.uuid=r.uuid,r.changes==undefined?(i.text=t.getValue(),i.text.length>n&&(r.changes=[])):(i.changes=r.changes,r.changes=[]);else{i.text=t.getValue();if(i.text.trim()=="")return;r.uuid=o(),i.uuid=r.uuid}i.role=r.role,typeof r.sourceID=="function"&&(i.sourceID=r.sourceID()),r.generationFromServer=t.changeGeneration(),$.ajax({url:r.url.tokens,dataType:"json",contentType:"application/json",type:"POST",data:JSON.stringify(i),success:function(e,n){var r=s();r.metainfo=e.tokens,t.setOption("mode",r)},error:function(e){e.status==409&&delete r.uuid}})},e.commands.refreshHighlight=function(e){e.serverAssistedHighlight(!0)};var u={"var":"var",atom:"atom",qatom:"qatom",bqstring:"string",symbol:"atom",functor:"functor",tag:"tag",number:"number",string:"string",code:"number","neg-number":"number","pos-number":"number",list_open:"list_open",list_close:"list_close",qq_open:"qq_open",qq_sep:"qq_sep",qq_close:"qq_close",dict_open:"dict_open",dict_close:"dict_close",brace_term_open:"brace_term_open",brace_term_close:"brace_term_close",neck:"neck",fullstop:"fullstop"},a={"var":"var",singleton:"var",uatom:"var",atom:"atom",qatom:"qatom",string:"string",codes:"string",chars:"string",functor:"functor",tag:"tag",control:"atom",meta:"atom",op_type:"atom","int":"number","float":"number",key:"atom",sep:"atom",ext_quant:"atom",expanded:"expanded",comment_string:"string",identifier:"atom",delimiter:"atom",module:"atom",head_exported:"atom",head_public:"atom",head_extern:"atom",head_dynamic:"atom",head_multifile:"atom",head_unreferenced:"atom",head_hook:"atom",head_meta:"atom",head_constraint:"atom",head_imported:"atom",head_built_in:"atom",head_iso:"atom",head_def_iso:"atom",head_def_swi:"atom",head:"atom",goal_built_in:"atom",goal_imported:"atom",goal_autoload:"atom",goal_global:"atom",goal_undefined:"atom",goal_thread_local:"atom",goal_dynamic:"atom",goal_multifile:"atom",goal_expanded:"atom",goal_extern:"atom",goal_recursion:"atom",goal_meta:"atom",goal_foreign:"atom",goal_local:"atom",goal_constraint:"atom",goal_not_callable:"atom",xpce_method:"functor",xpce_class_builtin:"atom",xpce_class_lib:"atom",xpce_class_user:"atom",xpce_class_undef:"atom",option_name:"atom",no_option_name:"atom",flag_name:"atom",no_flag_name:"atom",file_no_depends:"atom",file:"atom",nofile:"atom",list_open:"list_open",list_close:"list_close",qq_open:"qq_open",qq_sep:"qq_sep",qq_close:"qq_close",qq_type:"atom",dict_open:"dict_open",dict_close:"dict_close",brace_term_open:"brace_term_open",brace_term_close:"brace_term_close",neck:"neck",fullstop:"fullstop",string_terminal:"string",html:"functor",entity:"atom",html_attribute:"functor",sgml_attr_function:"atom",http_location_for_id:"atom",http_no_location_for_id:"atom"};e.prototype.getEnrichedToken=function(e){if(e.state.curTerm!=null&&e.state.curToken!=null){var t=this.getOption("mode"),n;if(t.metainfo&&(n=t.metainfo[e.state.curTerm]))return n[e.state.curToken-1]}return undefined},e.prototype.tokenInfo=function(e,t){var n=this.state.prologHighlightServer;return t||(t=$($.el.span({"class":"token-info"},"..."))),$.ajax({url:n.url.info,data:e,success:function(e){t.html(e)}}),t[0]},e.prototype.getTokenReferences=function(e){function n(e,t){if(t&&t.indexOf("swish://")==0)return e.file=t.substring(8),!0}var t=[];switch(e.type){case"goal_local":var r={title:"Source for "+e.text+"/"+e.arity,line:e.line,regex:new RegExp("\\b"+RegExp.escape(e.text),"g"),showAllMatches:!0};n(r,e.file),t.push(r);break;case"file":var r={};n(r,e.path)&&(r.title="Included file "+r.file,t.push(r))}return t}}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/mode/xml/xml",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1};e.defineMode("xml",function(r,i){function c(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();if(r=="<")return e.eat("!")?e.eat("[")?e.match("CDATA[")?n(d("atom","]]>")):null:e.match("--")?n(d("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(v(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=d("meta","?>"),"meta"):(f=e.eat("/")?"closeTag":"openTag",t.tokenize=h,"tag bracket");if(r=="&"){var i;return e.eat("#")?e.eat("x")?i=e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):i=e.eatWhile(/[\d]/)&&e.eat(";"):i=e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),i?"atom":"error"}return e.eatWhile(/[^&<]/),null}function h(e,t){var n=e.next();if(n==">"||n=="/"&&e.eat(">"))return t.tokenize=c,f=n==">"?"endTag":"selfcloseTag","tag bracket";if(n=="=")return f="equals",null;if(n=="<"){t.tokenize=c,t.state=b,t.tagName=t.tagStart=null;var r=t.tokenize(e,t);return r?r+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=p(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function p(e){var t=function(t,n){while(!t.eol())if(t.next()==e){n.tokenize=h;break}return"string"};return t.isInAttribute=!0,t}function d(e,t){return function(n,r){while(!n.eol()){if(n.match(t)){r.tokenize=c;break}n.next()}return e}}function v(e){return function(t,n){var r;while((r=t.next())!=null){if(r=="<")return n.tokenize=v(e+1),n.tokenize(t,n);if(r==">"){if(e==1){n.tokenize=c;break}return n.tokenize=v(e-1),n.tokenize(t,n)}}return"meta"}}function m(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n;if(o.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)this.noIndent=!0}function g(e){e.context&&(e.context=e.context.prev)}function y(e,t){var n;for(;;){if(!e.context)return;n=e.context.tagName;if(!o.contextGrabbers.hasOwnProperty(n)||!o.contextGrabbers[n].hasOwnProperty(t))return;g(e)}}function b(e,t,n){return e=="openTag"?(n.tagStart=t.column(),w):e=="closeTag"?E:b}function w(e,t,n){return e=="word"?(n.tagName=t.current(),l="tag",T):(l="error",w)}function E(e,t,n){if(e=="word"){var r=t.current();return n.context&&n.context.tagName!=r&&o.implicitlyClosed.hasOwnProperty(n.context.tagName)&&g(n),n.context&&n.context.tagName==r||o.matchClosing===!1?(l="tag",S):(l="tag error",x)}return l="error",x}function S(e,t,n){return e!="endTag"?(l="error",S):(g(n),b)}function x(e,t,n){return l="error",S(e,t,n)}function T(e,t,n){if(e=="word")return l="attribute",N;if(e=="endTag"||e=="selfcloseTag"){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,e=="selfcloseTag"||o.autoSelfClosers.hasOwnProperty(r)?y(n,r):(y(n,r),n.context=new m(n,r,i==n.indented)),b}return l="error",T}function N(e,t,n){return e=="equals"?C:(o.allowMissing||(l="error"),T(e,t,n))}function C(e,t,n){return e=="string"?k:e=="word"&&o.allowUnquoted?(l="string",T):(l="error",T(e,t,n))}function k(e,t,n){return e=="string"?k:T(e,t,n)}var s=r.indentUnit,o={},u=i.htmlMode?t:n;for(var a in u)o[a]=u[a];for(var a in i)o[a]=i[a];var f,l;return c.isInText=!0,{startState:function(e){var t={tokenize:c,state:b,indented:e||0,tagName:null,tagStart:null,context:null};return e!=null&&(t.baseIndent=e),t},token:function(e,t){!t.tagName&&e.sol()&&(t.indented=e.indentation());if(e.eatSpace())return null;f=null;var n=t.tokenize(e,t);return(n||f)&&n!="comment"&&(l=null,t.state=t.state(f||n,e,t),l&&(n=l=="error"?n+" error":l)),n},indent:function(t,n,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+s;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=h&&t.tokenize!=c)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return o.multilineTagIndentPastTag!==!1?t.tagStart+t.tagName.length+2:t.tagStart+s*(o.multilineTagIndentFactor||1);if(o.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var u=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(u&&u[1])while(i){if(i.tagName==u[2]){i=i.prev;break}if(!o.implicitlyClosed.hasOwnProperty(i.tagName))break;i=i.prev}else if(u)while(i){var a=o.contextGrabbers[i.tagName];if(!a||!a.hasOwnProperty(u[2]))break;i=i.prev}while(i&&i.prev&&!i.startOfLine)i=i.prev;return i?i.indent+s:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:o.htmlMode?"html":"xml",helperType:o.htmlMode?"html":"xml",skipAttribute:function(e){e.state==C&&(e.state=T)}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/mode/meta",["../lib/codemirror"],e):e(CodeMirror)}(function(e){e.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["pgp"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists.txt$/},{name:"CoffeeScript",mime:"text/x-coffeescript",mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history).md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"]},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"null",mode:"jinja2"},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mime:"text/n-triples",mode:"ntriples",ext:["nt"]},{name:"Objective C",mime:"text/x-objectivec",mode:"clike",ext:["m","mm"],alias:["objective-c","objc"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mime:"application/x-httpd-php",mode:"php",ext:["php","php3","php4","php5","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mime:"text/x-sh",mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki ",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mime:"text/x-yaml",mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]}];for(var t=0;t<e.modeInfo.length;t++){var n=e.modeInfo[t];n.mimes&&(n.mime=n.mimes[0])}e.findModeByMIME=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.mime==t)return r;if(r.mimes)for(var i=0;i<r.mimes.length;i++)if(r.mimes[i]==t)return r}},e.findModeByExtension=function(t){for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.ext)for(var i=0;i<r.ext.length;i++)if(r.ext[i]==t)return r}},e.findModeByFileName=function(t){for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.file&&r.file.test(t))return r}var i=t.lastIndexOf("."),s=i>-1&&t.substring(i+1,t.length);if(s)return e.findModeByExtension(s)},e.findModeByName=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.name.toLowerCase()==t)return r;if(r.alias)for(var i=0;i<r.alias.length;i++)if(r.alias[i].toLowerCase()==t)return r}}}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror"),require("../xml/xml"),require("../meta")):typeof define=="function"&&define.amd?define("cm/mode/markdown/markdown",["../../lib/codemirror","../xml/xml","../meta"],e):e(CodeMirror)}(function(e){e.defineMode("markdown",function(t,n){function s(n){if(e.findModeByName){var r=e.findModeByName(n);r&&(n=r.mime||r.mimes[0])}var i=e.getMode(t,n);return i.name=="null"?null:i}function m(e,t,n){return t.f=t.inline=n,n(e,t)}function g(e,t,n){return t.f=t.block=n,n(e,t)}function y(e){return!e||!/\S/.test(e.string)}function b(e){return e.linkTitle=!1,e.em=!1,e.strong=!1,e.strikethrough=!1,e.quote=0,e.indentedCode=!1,i&&e.f==E&&(e.f=C,e.block=w),e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.prevLine=e.thisLine,e.thisLine=null,null}function w(t,r){var i=t.sol(),u=r.list!==!1,d=r.indentedCode;r.indentedCode=!1,u&&(r.indentationDiff>=0?(r.indentationDiff<4&&(r.indentation-=r.indentationDiff),r.list=null):r.indentation>0?r.list=null:r.list=!1);var g=null;if(r.indentationDiff>=4)return t.skipToEnd(),d||y(r.prevLine)?(r.indentation-=4,r.indentedCode=!0,o.code):null;if(t.eatSpace())return null;if((g=t.match(h))&&g[1].length<=6)return r.header=g[1].length,n.highlightFormatting&&(r.formatting="header"),r.f=r.inline,T(r);if(!y(r.prevLine)&&!r.quote&&!u&&!d&&(g=t.match(p)))return r.header=g[0].charAt(0)=="="?1:2,n.highlightFormatting&&(r.formatting="header"),r.f=r.inline,T(r);if(t.eat(">"))return r.quote=i?1:r.quote+1,n.highlightFormatting&&(r.formatting="quote"),t.eatSpace(),T(r);if(t.peek()==="[")return m(t,r,M);if(t.match(a,!0))return r.hr=!0,o.hr;if((y(r.prevLine)||u)&&(t.match(f,!1)||t.match(l,!1))){var b=null;t.match(f,!0)?b="ul":(t.match(l,!0),b="ol"),r.indentation=t.column()+t.current().length,r.list=!0;while(r.listStack&&t.column()<r.listStack[r.listStack.length-1])r.listStack.pop();return r.listStack.push(r.indentation),n.taskLists&&t.match(c,!1)&&(r.taskList=!0),r.f=r.inline,n.highlightFormatting&&(r.formatting=["list","list-"+b]),T(r)}return n.fencedCodeBlocks&&(g=t.match(v,!0))?(r.fencedChars=g[1],r.localMode=s(g[2]),r.localMode&&(r.localState=e.startState(r.localMode)),r.f=r.block=S,n.highlightFormatting&&(r.formatting="code-block"),r.code=-1,T(r)):m(t,r,r.inline)}function E(t,n){var s=r.token(t,n.htmlState);if(!i){var o=e.innerMode(r,n.htmlState);if(o.mode.name=="xml"&&o.state.tagStart===null&&!o.state.context&&o.state.tokenize.isInText||n.md_inside&&t.current().indexOf(">")>-1)n.f=C,n.block=w,n.htmlState=null}return s}function S(e,t){return t.fencedChars&&e.match(t.fencedChars,!1)?(t.localMode=t.localState=null,t.f=t.block=x,null):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),o.code)}function x(e,t){e.match(t.fencedChars),t.block=w,t.f=C,t.fencedChars=null,n.highlightFormatting&&(t.formatting="code-block"),t.code=1;var r=T(t);return t.code=0,r}function T(e){var t=[];if(e.formatting){t.push(o.formatting),typeof e.formatting=="string"&&(e.formatting=[e.formatting]);for(var r=0;r<e.formatting.length;r++)t.push(o.formatting+"-"+e.formatting[r]),e.formatting[r]==="header"&&t.push(o.formatting+"-"+e.formatting[r]+"-"+e.header),e.formatting[r]==="quote"&&(!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(o.formatting+"-"+e.formatting[r]+"-"+e.quote):t.push("error"))}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;e.linkHref?t.push(o.linkHref,"url"):(e.strong&&t.push(o.strong),e.em&&t.push(o.em),e.strikethrough&&t.push(o.strikethrough),e.linkText&&t.push(o.linkText),e.code&&t.push(o.code),e.image&&t.push(o.image),e.imageAltText&&t.push(o.imageAltText,"link"),e.imageMarker&&t.push(o.imageMarker)),e.header&&t.push(o.header,o.header+"-"+e.header),e.quote&&(t.push(o.quote),!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(o.quote+"-"+e.quote):t.push(o.quote+"-"+n.maxBlockquoteDepth));if(e.list!==!1){var i=(e.listStack.length-1)%3;i?i===1?t.push(o.list2):t.push(o.list3):t.push(o.list1)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function N(e,t){return e.match(d,!0)?T(t):undefined}function C(t,i){var s=i.text(t,i);if(typeof s!="undefined")return s;if(i.list)return i.list=null,T(i);if(i.taskList){var u=t.match(c,!0)[1]!=="x";return u?i.taskOpen=!0:i.taskClosed=!0,n.highlightFormatting&&(i.formatting="task"),i.taskList=!1,T(i)}i.taskOpen=!1,i.taskClosed=!1;if(i.header&&t.match(/^#+$/,!0))return n.highlightFormatting&&(i.formatting="header"),T(i);var a=t.sol(),f=t.next();if(i.linkTitle){i.linkTitle=!1;var l=f;f==="("&&(l=")"),l=(l+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");var h="^\\s*(?:[^"+l+"\\\\]+|\\\\\\\\|\\\\.)"+l;if(t.match(new RegExp(h),!0))return o.linkHref}if(f==="`"){var p=i.formatting;n.highlightFormatting&&(i.formatting="code"),t.eatWhile("`");var d=t.current().length;if(i.code==0)return i.code=d,T(i);if(d==i.code){var v=T(i);return i.code=0,v}return i.formatting=p,T(i)}if(i.code)return T(i);if(f==="\\"){t.next();if(n.highlightFormatting){var m=T(i),y=o.formatting+"-escape";return m?m+" "+y:y}}if(f==="!"&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return i.imageMarker=!0,i.image=!0,n.highlightFormatting&&(i.formatting="image"),T(i);if(f==="["&&i.imageMarker)return i.imageMarker=!1,i.imageAltText=!0,n.highlightFormatting&&(i.formatting="image"),T(i);if(f==="]"&&i.imageAltText){n.highlightFormatting&&(i.formatting="image");var m=T(i);return i.imageAltText=!1,i.image=!1,i.inline=i.f=L,m}if(f==="["&&t.match(/[^\]]*\](\(.*\)| ?\[.*?\])/,!1)&&!i.image)return i.linkText=!0,n.highlightFormatting&&(i.formatting="link"),T(i);if(f==="]"&&i.linkText&&t.match(/\(.*?\)| ?\[.*?\]/,!1)){n.highlightFormatting&&(i.formatting="link");var m=T(i);return i.linkText=!1,i.inline=i.f=L,m}if(f==="<"&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){i.f=i.inline=k,n.highlightFormatting&&(i.formatting="link");var m=T(i);return m?m+=" ":m="",m+o.linkInline}if(f==="<"&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){i.f=i.inline=k,n.highlightFormatting&&(i.formatting="link");var m=T(i);return m?m+=" ":m="",m+o.linkEmail}if(f==="<"&&t.match(/^(!--|\w)/,!1)){var b=t.string.indexOf(">",t.pos);if(b!=-1){var w=t.string.substring(t.start,b);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(w)&&(i.md_inside=!0)}return t.backUp(1),i.htmlState=e.startState(r),g(t,i,E)}if(f==="<"&&t.match(/^\/\w*?>/))return i.md_inside=!1,"tag";var S=!1;if(!n.underscoresBreakWords&&f==="_"&&t.peek()!=="_"&&t.match(/(\w)/,!1)){var x=t.pos-2;if(x>=0){var N=t.string.charAt(x);N!=="_"&&N.match(/(\w)/,!1)&&(S=!0)}}if(f==="*"||f==="_"&&!S){if(!a||t.peek()!==" "){if(i.strong===f&&t.eat(f)){n.highlightFormatting&&(i.formatting="strong");var v=T(i);return i.strong=!1,v}if(!i.strong&&t.eat(f))return i.strong=f,n.highlightFormatting&&(i.formatting="strong"),T(i);if(i.em===f){n.highlightFormatting&&(i.formatting="em");var v=T(i);return i.em=!1,v}if(!i.em)return i.em=f,n.highlightFormatting&&(i.formatting="em"),T(i)}}else if(f===" ")if(t.eat("*")||t.eat("_")){if(t.peek()===" ")return T(i);t.backUp(1)}if(n.strikethrough)if(f==="~"&&t.eatWhile(f)){if(i.strikethrough){n.highlightFormatting&&(i.formatting="strikethrough");var v=T(i);return i.strikethrough=!1,v}if(t.match(/^[^\s]/,!1))return i.strikethrough=!0,n.highlightFormatting&&(i.formatting="strikethrough"),T(i)}else if(f===" "&&t.match(/^~~/,!0)){if(t.peek()===" ")return T(i);t.backUp(2)}return f===" "&&(t.match(/ +$/,!1)?i.trailingSpace++:i.trailingSpace&&(i.trailingSpaceNewLine=!0)),T(i)}function k(e,t){var r=e.next();if(r===">"){t.f=t.inline=C,n.highlightFormatting&&(t.formatting="link");var i=T(t);return i?i+=" ":i="",i+o.linkInline}return e.match(/^[^>]+/,!0),o.linkInline}function L(e,t){if(e.eatSpace())return null;var r=e.next();return r==="("||r==="["?(t.f=t.inline=O(r==="("?")":"]",0),n.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,T(t)):"error"}function O(e){return function(t,r){var i=t.next();if(i===e){r.f=r.inline=C,n.highlightFormatting&&(r.formatting="link-string");var s=T(r);return r.linkHref=!1,s}return t.match(A[e]),r.linkHref=!0,T(r)}}function M(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=_,e.next(),n.highlightFormatting&&(t.formatting="link"),t.linkText=!0,T(t)):m(e,t,C)}function _(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=D,n.highlightFormatting&&(t.formatting="link");var r=T(t);return t.linkText=!1,r}return e.match(/^([^\]\\]|\\.)+/,!0),o.linkText}function D(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),e.peek()===undefined?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=C,o.linkHref+" url")}var r=e.getMode(t,"text/html"),i=r.name=="null";n.highlightFormatting===undefined&&(n.highlightFormatting=!1),n.maxBlockquoteDepth===undefined&&(n.maxBlockquoteDepth=0),n.underscoresBreakWords===undefined&&(n.underscoresBreakWords=!0),n.taskLists===undefined&&(n.taskLists=!1),n.strikethrough===undefined&&(n.strikethrough=!1),n.tokenTypeOverrides===undefined&&(n.tokenTypeOverrides={});var o={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough"};for(var u in o)o.hasOwnProperty(u)&&n.tokenTypeOverrides[u]&&(o[u]=n.tokenTypeOverrides[u]);var a=/^([*\-_])(?:\s*\1){2,}\s*$/,f=/^[*\-+]\s+/,l=/^[0-9]+([.)])\s+/,c=/^\[(x| )\](?=\s)/,h=n.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,p=/^ *(?:\={1,}|-{1,})\s*$/,d=/^[^#!\[\]*_\\<>` "'(~]+/,v=new RegExp("^("+(n.fencedCodeBlocks===!0?"~~~+|```+":n.fencedCodeBlocks)+")[ \\t]*([\\w+#-]*)"),A={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\\]]|\\.)*\])*?(?=\])/},P={startState:function(){return{f:w,prevLine:null,thisLine:null,block:w,htmlState:null,indentation:0,inline:C,text:N,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,fencedChars:null}},copyState:function(t){return{f:t.f,prevLine:t.prevLine,thisLine:t.thisLine,block:t.block,htmlState:t.htmlState&&e.copyState(r,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkTitle:t.linkTitle,code:t.code,em:t.em,strong:t.strong,strikethrough:t.strikethrough,header:t.header,hr:t.hr,taskList:t.taskList,list:t.list,listStack:t.listStack.slice(0),quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside,fencedChars:t.fencedChars}},token:function(e,t){t.formatting=!1;if(e!=t.thisLine){var n=t.header||t.hr;t.header=0,t.hr=!1;if(e.match(/^\s*$/,!0)||n){b(t);if(!n)return null;t.prevLine=null}t.prevLine=t.thisLine,t.thisLine=e,t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.f=t.block;var r=e.match(/^\s*/,!0)[0].replace(/\t/g,"    ").length;t.indentationDiff=Math.min(r-t.indentation,4),t.indentation=t.indentation+t.indentationDiff;if(r>0)return null}return t.f(e,t)},innerMode:function(e){return e.block==E?{state:e.htmlState,mode:r}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:P}},blankLine:b,getType:T,fold:"markdown"};return P},"xml"),e.defineMIME("text/x-markdown","markdown")}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/addon/edit/matchbrackets",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function i(e,t,i,o){var u=e.getLineHandle(t.line),a=t.ch-1,f=a>=0&&r[u.text.charAt(a)]||r[u.text.charAt(++a)];if(!f)return null;var l=f.charAt(1)==">"?1:-1;if(i&&l>0!=(a==t.ch))return null;var c=e.getTokenTypeAt(n(t.line,a+1)),h=s(e,n(t.line,a+(l>0?1:0)),l,c||null,o);return h==null?null:{from:n(t.line,a),to:h&&h.pos,match:h&&h.ch==f.charAt(0),forward:l>0}}function s(e,t,i,s,o){var u=o&&o.maxScanLineLength||1e4,a=o&&o.maxScanLines||1e3,f=[],l=o&&o.bracketRegex?o.bracketRegex:/[(){}[\]]/,c=i>0?Math.min(t.line+a,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-a);for(var h=t.line;h!=c;h+=i){var p=e.getLine(h);if(!p)continue;var d=i>0?0:p.length-1,v=i>0?p.length:-1;if(p.length>u)continue;h==t.line&&(d=t.ch-(i<0?1:0));for(;d!=v;d+=i){var m=p.charAt(d);if(l.test(m)&&(s===undefined||e.getTokenTypeAt(n(h,d+1))==s)){var g=r[m];if(g.charAt(1)==">"==i>0)f.push(m);else{if(!f.length)return{pos:n(h,d),ch:m};f.pop()}}}}return h-i==(i>0?e.lastLine():e.firstLine())?!1:null}function o(e,r,s){var o=e.state.matchBrackets.maxHighlightLineLength||1e3,u=[],a=e.listSelections();for(var f=0;f<a.length;f++){var l=a[f].empty()&&i(e,a[f].head,!1,s);if(l&&e.getLine(l.from.line).length<=o){var c=l.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";u.push(e.markText(l.from,n(l.from.line,l.from.ch+1),{className:c})),l.to&&e.getLine(l.to.line).length<=o&&u.push(e.markText(l.to,n(l.to.line,l.to.ch+1),{className:c}))}}if(u.length){t&&e.state.focused&&e.focus();var h=function(){e.operation(function(){for(var e=0;e<u.length;e++)u[e].clear()})};if(!r)return h;setTimeout(h,800)}}function a(e){e.operation(function(){u&&(u(),u=null),u=o(e,!1,e.state.matchBrackets)})}var t=/MSIE \d/.test(navigator.userAgent)&&(document.documentMode==null||document.documentMode<8),n=e.Pos,r={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},u=null;e.defineOption("matchBrackets",!1,function(t,n,r){r&&r!=e.Init&&(t.off("cursorActivity",a),u&&(u(),u=null)),n&&(t.state.matchBrackets=typeof n=="object"?n:{},t.on("cursorActivity",a))}),e.defineExtension("matchBrackets",function(){o(this,!0)}),e.defineExtension("findMatchingBracket",function(e,t,n){return i(this,e,t,n)}),e.defineExtension("scanForBracket",function(e,t,n,r){return s(this,e,t,n,r)})}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/addon/comment/continuecomment",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function r(t){if(t.getOption("disableInput"))return e.Pass;var n=t.listSelections(),r,s=[];for(var o=0;o<n.length;o++){var u=n[o].head,a=t.getTokenAt(u);if(a.type!="comment")return e.Pass;var f=e.innerMode(t.getMode(),a.state).mode;if(!r)r=f;else if(r!=f)return e.Pass;var l=null;if(r.blockCommentStart&&r.blockCommentContinue){var c=a.string.indexOf(r.blockCommentEnd),h=t.getRange(e.Pos(u.line,0),e.Pos(u.line,a.end)),p;if(!(c!=-1&&c==a.string.length-r.blockCommentEnd.length&&u.ch>=c))if(a.string.indexOf(r.blockCommentStart)==0){l=h.slice(0,a.start);if(!/^\s*$/.test(l)){l="";for(var d=0;d<a.start;++d)l+=" "}}else(p=h.indexOf(r.blockCommentContinue))!=-1&&p+r.blockCommentContinue.length>a.start&&/^\s*$/.test(h.slice(0,p))&&(l=h.slice(0,p));l!=null&&(l+=r.blockCommentContinue)}if(l==null&&r.lineComment&&i(t)){var v=t.getLine(u.line),p=v.indexOf(r.lineComment);p>-1&&(l=v.slice(0,p),/\S/.test(l)?l=null:l+=r.lineComment+v.slice(p+r.lineComment.length).match(/^\s*/)[0])}if(l==null)return e.Pass;s[o]="\n"+l}t.operation(function(){for(var e=n.length-1;e>=0;e--)t.replaceRange(s[e],n[e].from(),n[e].to(),"+insert")})}function i(e){var t=e.getOption("continueComments");return t&&typeof t=="object"?t.continueLineComment!==!1:!0}var t=["clike","css","javascript"];for(var n=0;n<t.length;++n)e.extendMode(t[n],{blockCommentContinue:" * "});e.defineOption("continueComments",null,function(t,n,i){i&&i!=e.Init&&t.removeKeyMap("continueComment");if(n){var s="Enter";typeof n=="string"?s=n:typeof n=="object"&&n.key&&(s=n.key);var o={name:"continueComment"};o[s]=r,t.addKeyMap(o)}})}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/addon/comment/comment",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function i(e){var t=e.search(n);return t==-1?0:t}function s(e,t,n){return/\bstring\b/.test(e.getTokenTypeAt(r(t.line,0)))&&!/^[\'\"`]/.test(n)}var t={},n=/[^\s\u00a0]/,r=e.Pos;e.commands.toggleComment=function(e){e.toggleComment()},e.defineExtension("toggleComment",function(e){e||(e=t);var n=this,i=Infinity,s=this.listSelections(),o=null;for(var u=s.length-1;u>=0;u--){var a=s[u].from(),f=s[u].to();if(a.line>=i)continue;f.line>=i&&(f=r(i,0)),i=a.line,o==null?n.uncomment(a,f,e)?o="un":(n.lineComment(a,f,e),o="line"):o=="un"?n.uncomment(a,f,e):n.lineComment(a,f,e)}}),e.defineExtension("lineComment",function(e,o,u){u||(u=t);var a=this,f=a.getModeAt(e),l=a.getLine(e.line);if(l==null||s(a,e,l))return;var c=u.lineComment||f.lineComment;if(!c){if(u.blockCommentStart||f.blockCommentStart)u.fullLines=!0,a.blockComment(e,o,u);return}var h=Math.min(o.ch!=0||o.line==e.line?o.line+1:o.line,a.lastLine()+1),p=u.padding==null?" ":u.padding,d=u.commentBlankLines||e.line==o.line;a.operation(function(){if(u.indent){var t=null;for(var s=e.line;s<h;++s){var o=a.getLine(s),f=o.slice(0,i(o));if(t==null||t.length>f.length)t=f}for(var s=e.line;s<h;++s){var o=a.getLine(s),l=t.length;if(!d&&!n.test(o))continue;o.slice(0,l)!=t&&(l=i(o)),a.replaceRange(t+c+p,r(s,0),r(s,l))}}else for(var s=e.line;s<h;++s)(d||n.test(a.getLine(s)))&&a.replaceRange(c+p,r(s,0))})}),e.defineExtension("blockComment",function(e,i,s){s||(s=t);var o=this,u=o.getModeAt(e),a=s.blockCommentStart||u.blockCommentStart,f=s.blockCommentEnd||u.blockCommentEnd;if(!a||!f){(s.lineComment||u.lineComment)&&s.fullLines!=0&&o.lineComment(e,i,s);return}var l=Math.min(i.line,o.lastLine());l!=e.line&&i.ch==0&&n.test(o.getLine(l))&&--l;var c=s.padding==null?" ":s.padding;if(e.line>l)return;o.operation(function(){if(s.fullLines!=0){var t=n.test(o.getLine(l));o.replaceRange(c+f,r(l)),o.replaceRange(a+c,r(e.line,0));var h=s.blockCommentLead||u.blockCommentLead;if(h!=null)for(var p=e.line+1;p<=l;++p)(p!=l||t)&&o.replaceRange(h+c,r(p,0))}else o.replaceRange(f,i),o.replaceRange(a,e)})}),e.defineExtension("uncomment",function(e,i,s){s||(s=t);var o=this,u=o.getModeAt(e),a=Math.min(i.ch!=0||i.line==e.line?i.line:i.line-1,o.lastLine()),f=Math.min(e.line,a),l=s.lineComment||u.lineComment,c=[],h=s.padding==null?" ":s.padding,p;e:{if(!l)break e;for(var d=f;d<=a;++d){var v=o.getLine(d),m=v.indexOf(l);m>-1&&!/comment/.test(o.getTokenTypeAt(r(d,m+1)))&&(m=-1);if(m==-1&&n.test(v))break e;if(m>-1&&n.test(v.slice(0,m)))break e;c.push(v)}o.operation(function(){for(var e=f;e<=a;++e){var t=c[e-f],n=t.indexOf(l),i=n+l.length;if(n<0)continue;t.slice(i,i+h.length)==h&&(i+=h.length),p=!0,o.replaceRange("",r(e,n),r(e,i))}});if(p)return!0}var g=s.blockCommentStart||u.blockCommentStart,y=s.blockCommentEnd||u.blockCommentEnd;if(!g||!y)return!1;var b=s.blockCommentLead||u.blockCommentLead,w=o.getLine(f),E=a==f?w:o.getLine(a),S=w.indexOf(g),x=E.lastIndexOf(y);x==-1&&f!=a&&(E=o.getLine(--a),x=E.lastIndexOf(y));if(S==-1||x==-1||!/comment/.test(o.getTokenTypeAt(r(f,S+1)))||!/comment/.test(o.getTokenTypeAt(r(a,x+1))))return!1;var T=w.lastIndexOf(g,e.ch),N=T==-1?-1:w.slice(0,e.ch).indexOf(y,T+g.length);if(T!=-1&&N!=-1&&N+y.length!=e.ch)return!1;N=E.indexOf(y,i.ch);var C=E.slice(i.ch).lastIndexOf(g,N-i.ch);return T=N==-1||C==-1?-1:i.ch+C,N!=-1&&T!=-1&&T!=i.ch?!1:(o.operation(function(){o.replaceRange("",r(a,x-(h&&E.slice(x-h.length,x)==h?h.length:0)),r(a,x+y.length));var e=S+g.length;h&&w.slice(e,e+h.length)==h&&(e+=h.length),o.replaceRange("",r(f,S),r(f,e));if(b)for(var t=f+1;t<=a;++t){var i=o.getLine(t),s=i.indexOf(b);if(s==-1||n.test(i.slice(0,s)))continue;var u=s+b.length;h&&i.slice(u,u+h.length)==h&&(u+=h.length),o.replaceRange("",r(t,s),r(t,u))}}),!0)})}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/addon/hint/show-hint",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function r(e,t){this.cm=e,this.options=t,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length;var n=this;e.on("cursorActivity",this.activityFunc=function(){n.cursorActivity()})}function o(t,n){var r=e.cmpPos(n.from,t.from);return r>0&&t.to.ch-t.from.ch!=n.to.ch-n.from.ch}function u(e,t,n){var r=e.options.hintOptions,i={};for(var s in v)i[s]=v[s];if(r)for(var s in r)r[s]!==undefined&&(i[s]=r[s]);if(n)for(var s in n)n[s]!==undefined&&(i[s]=n[s]);return i.hint.resolve&&(i.hint=i.hint.resolve(e,t)),i}function a(e){return typeof e=="string"?e:e.text}function f(e,t){function s(e,r){var s;typeof r!="string"?s=function(e){return r(e,t)}:n.hasOwnProperty(r)?s=n[r]:s=r,i[e]=s}var n={Up:function(){t.moveFocus(-1)},Down:function(){t.moveFocus(1)},PageUp:function(){t.moveFocus(-t.menuSize()+1,!0)},PageDown:function(){t.moveFocus(t.menuSize()-1,!0)},Home:function(){t.setFocus(0)},End:function(){t.setFocus(t.length-1)},Enter:t.pick,Tab:t.pick,Esc:t.close},r=e.options.customKeys,i=r?{}:n;if(r)for(var o in r)r.hasOwnProperty(o)&&s(o,r[o]);var u=e.options.extraKeys;if(u)for(var o in u)u.hasOwnProperty(o)&&s(o,u[o]);return i}function l(e,t){while(t&&t!=e){if(t.nodeName.toUpperCase()==="LI"&&t.parentNode==e)return t;t=t.parentNode}}function c(r,i){this.completion=r,this.data=i,this.picked=!1;var s=this,o=r.cm,u=this.hints=document.createElement("ul");u.className="CodeMirror-hints",this.selectedHint=i.selectedHint||0;var c=i.list;for(var h=0;h<c.length;++h){var p=u.appendChild(document.createElement("li")),d=c[h],v=t+(h!=this.selectedHint?"":" "+n);d.className!=null&&(v=d.className+" "+v),p.className=v,d.render?d.render(p,i,d):p.appendChild(document.createTextNode(d.displayText||a(d))),p.hintId=h}var m=o.cursorCoords(r.options.alignWithWord?i.from:null),g=m.left,y=m.bottom,b=!0;u.style.left=g+"px",u.style.top=y+"px";var w=window.innerWidth||Math.max(document.body.offsetWidth,document.documentElement.offsetWidth),E=window.innerHeight||Math.max(document.body.offsetHeight,document.documentElement.offsetHeight);(r.options.container||document.body).appendChild(u);var S=u.getBoundingClientRect(),x=S.bottom-E,T=u.scrollHeight>u.clientHeight+1,N=o.getScrollInfo();if(x>0){var C=S.bottom-S.top,k=m.top-(m.bottom-S.top);if(k-C>0)u.style.top=(y=m.top-C)+"px",b=!1;else if(C>E){u.style.height=E-5+"px",u.style.top=(y=m.bottom-S.top)+"px";var L=o.getCursor();i.from.ch!=L.ch&&(m=o.cursorCoords(L),u.style.left=(g=m.left)+"px",S=u.getBoundingClientRect())}}var A=S.right-w;A>0&&(S.right-S.left>w&&(u.style.width=w-5+"px",A-=S.right-S.left-w),u.style.left=(g=m.left-A)+"px");if(T)for(var O=u.firstChild;O;O=O.nextSibling)O.style.paddingRight=o.display.nativeBarWidth+"px";o.addKeyMap(this.keyMap=f(r,{moveFocus:function(e,t){s.changeActive(s.selectedHint+e,t)},setFocus:function(e){s.changeActive(e)},menuSize:function(){return s.screenAmount()},length:c.length,close:function(){r.close()},pick:function(){s.pick()},data:i}));if(r.options.closeOnUnfocus){var M;o.on("blur",this.onBlur=function(){M=setTimeout(function(){r.close()},100)}),o.on("focus",this.onFocus=function(){clearTimeout(M)})}return o.on("scroll",this.onScroll=function(){var e=o.getScrollInfo(),t=o.getWrapperElement().getBoundingClientRect(),n=y+N.top-e.top,i=n-(window.pageYOffset||(document.documentElement||document.body).scrollTop);b||(i+=u.offsetHeight);if(i<=t.top||i>=t.bottom)return r.close();u.style.top=n+"px",u.style.left=g+N.left-e.left+"px"}),e.on(u,"dblclick",function(e){var t=l(u,e.target||e.srcElement);t&&t.hintId!=null&&(s.changeActive(t.hintId),s.pick())}),e.on(u,"click",function(e){var t=l(u,e.target||e.srcElement);t&&t.hintId!=null&&(s.changeActive(t.hintId),r.options.completeOnSingleClick&&s.pick())}),e.on(u,"mousedown",function(){setTimeout(function(){o.focus()},20)}),e.signal(i,"select",c[0],u.firstChild),!0}function h(e,t){if(!e.somethingSelected())return t;var n=[];for(var r=0;r<t.length;r++)t[r].supportsSelection&&n.push(t[r]);return n}function p(e,t,n,r){if(e.async)e(t,r,n);else{var i=e(t,n);i&&i.then?i.then(r):r(i)}}function d(t,n){var r=t.getHelpers(n,"hint"),i;if(r.length){var s=function(e,t,n){function s(r){if(r==i.length)return t(null);p(i[r],e,n,function(e){e&&e.list.length>0?t(e):s(r+1)})}var i=h(e,r);s(0)};return s.async=!0,s.supportsSelection=!0,s}return(i=t.getHelper(t.getCursor(),"hintWords"))?function(t){return e.hint.fromList(t,{words:i})}:e.hint.anyword?function(t,n){return e.hint.anyword(t,n)}:function(){}}var t="CodeMirror-hint",n="CodeMirror-hint-active";e.showHint=function(e,t,n){if(!t)return e.showHint(n);n&&n.async&&(t.async=!0);var r={hint:t};if(n)for(var i in n)r[i]=n[i];return e.showHint(r)},e.defineExtension("showHint",function(t){t=u(this,this.getCursor("start"),t);var n=this.listSelections();if(n.length>1)return;if(this.somethingSelected()){if(!t.hint.supportsSelection)return;for(var i=0;i<n.length;i++)if(n[i].head.line!=n[i].anchor.line)return}this.state.completionActive&&this.state.completionActive.close();var s=this.state.completionActive=new r(this,t);if(!s.options.hint)return;e.signal(this,"startCompletion",this),s.update(!0)});var i=window.requestAnimationFrame||function(e){return setTimeout(e,1e3/60)},s=window.cancelAnimationFrame||clearTimeout;r.prototype={close:function(){if(!this.active())return;this.cm.state.completionActive=null,this.tick=null,this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&e.signal(this.data,"close"),this.widget&&this.widget.close(),e.signal(this.cm,"endCompletion",this.cm)},active:function(){return this.cm.state.completionActive==this},pick:function(t,n){var r=t.list[n];r.hint?r.hint(this.cm,t,r):this.cm.replaceRange(a(r),r.from||t.from,r.to||t.to,"complete"),e.signal(t,"pick",r),this.close()},cursorActivity:function(){this.debounce&&(s(this.debounce),this.debounce=0);var e=this.cm.getCursor(),t=this.cm.getLine(e.line);if(e.line!=this.startPos.line||t.length-e.ch!=this.startLen-this.startPos.ch||e.ch<this.startPos.ch||this.cm.somethingSelected()||e.ch&&this.options.closeCharacters.test(t.charAt(e.ch-1)))this.close();else{var n=this;this.debounce=i(function(){n.update()}),this.widget&&this.widget.disable()}},update:function(e){if(this.tick==null)return;var t=this,n=++this.tick;p(this.options.hint,this.cm,this.options,function(r){t.tick==n&&t.finishUpdate(r,e)})},finishUpdate:function(t,n){this.data&&e.signal(this.data,"update");var r=this.widget&&this.widget.picked||n&&this.options.completeSingle;this.widget&&this.widget.close();if(t&&this.data&&o(this.data,t))return;this.data=t,t&&t.list.length&&(r&&t.list.length==1?this.pick(t,0):(this.widget=new c(this,t),e.signal(t,"shown")))}},c.prototype={close:function(){if(this.completion.widget!=this)return;this.completion.widget=null,this.hints.parentNode.removeChild(this.hints),this.completion.cm.removeKeyMap(this.keyMap);var e=this.completion.cm;this.completion.options.closeOnUnfocus&&(e.off("blur",this.onBlur),e.off("focus",this.onFocus)),e.off("scroll",this.onScroll)},disable:function(){this.completion.cm.removeKeyMap(this.keyMap);var e=this;this.keyMap={Enter:function(){e.picked=!0}},this.completion.cm.addKeyMap(this.keyMap)},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(t,r){t>=this.data.list.length?t=r?this.data.list.length-1:0:t<0&&(t=r?0:this.data.list.length-1);if(this.selectedHint==t)return;var i=this.hints.childNodes[this.selectedHint];i.className=i.className.replace(" "+n,""),i=this.hints.childNodes[this.selectedHint=t],i.className+=" "+n,i.offsetTop<this.hints.scrollTop?this.hints.scrollTop=i.offsetTop-3:i.offsetTop+i.offsetHeight>this.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=i.offsetTop+i.offsetHeight-this.hints.clientHeight+3),e.signal(this.data,"select",this.data.list[this.selectedHint],i)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}},e.registerHelper("hint","auto",{resolve:d}),e.registerHelper("hint","fromList",function(t,n){var r=t.getCursor(),i=t.getTokenAt(r),s=e.Pos(r.line,i.end);if(i.string&&/\w/.test(i.string[i.string.length-1]))var o=i.string,u=e.Pos(r.line,i.start);else var o="",u=s;var a=[];for(var f=0;f<n.words.length;f++){var l=n.words[f];l.slice(0,o.length)==o&&a.push(l)}if(a.length)return{list:a,from:u,to:s}}),e.commands.autocomplete=e.showHint;var v={hint:e.hint.auto,completeSingle:!0,alignWithWord:!0,closeCharacters:/[\s()\[\]{};:>,]/,closeOnUnfocus:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null};e.defineOption("hintOptions",null)}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/addon/hint/anyword-hint",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){var t=/[\w$]+/,n=500;e.registerHelper("hint","anyword",function(r,i){var s=i&&i.word||t,o=i&&i.range||n,u=r.getCursor(),a=r.getLine(u.line),f=u.ch,l=f;while(l&&s.test(a.charAt(l-1)))--l;var c=l!=f&&a.slice(l,f),h=i&&i.list||[],p={},d=new RegExp(s.source,"g");for(var v=-1;v<=1;v+=2){var m=u.line,g=Math.min(Math.max(m+v*o,r.firstLine()),r.lastLine())+v;for(;m!=g;m+=v){var y=r.getLine(m),b;while(b=d.exec(y)){if(m==u.line&&b[0]===c)continue;(!c||b[0].lastIndexOf(c,0)==0)&&!Object.prototype.hasOwnProperty.call(p,b[0])&&(p[b[0]]=!0,h.push(b[0]))}}}return{list:h,from:e.Pos(u.line,l),to:e.Pos(u.line,f)}})}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/addon/display/placeholder",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function n(e){t(e);var n=e.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.className="CodeMirror-placeholder";var r=e.getOption("placeholder");typeof r=="string"&&(r=document.createTextNode(r)),n.appendChild(r),e.display.lineSpace.insertBefore(n,e.display.lineSpace.firstChild)}function r(e){s(e)&&n(e)}function i(e){var r=e.getWrapperElement(),i=s(e);r.className=r.className.replace(" CodeMirror-empty","")+(i?" CodeMirror-empty":""),i?n(e):t(e)}function s(e){return e.lineCount()===1&&e.getLine(0)===""}e.defineOption("placeholder","",function(n,s,o){var u=o&&o!=e.Init;if(s&&!u)n.on("blur",r),n.on("change",i),n.on("swapDoc",i),i(n);else if(!s&&u){n.off("blur",r),n.off("change",i),n.off("swapDoc",i),t(n);var a=n.getWrapperElement();a.className=a.className.replace(" CodeMirror-empty","")}s&&!n.hasFocus()&&r(n)})}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/addon/runmode/runmode",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.runMode=function(t,n,r,i){var s=e.getMode(e.defaults,n),o=/MSIE \d/.test(navigator.userAgent),u=o&&(document.documentMode==null||document.documentMode<9);if(r.appendChild){var a=i&&i.tabSize||e.defaults.tabSize,f=r,l=0;f.innerHTML="",r=function(e,t){if(e=="\n"){f.appendChild(document.createTextNode(u?"\r":e)),l=0;return}var n="";for(var r=0;;){var i=e.indexOf("	",r);if(i==-1){n+=e.slice(r),l+=e.length-r;break}l+=i-r,n+=e.slice(r,i);var s=a-l%a;l+=s;for(var o=0;o<s;++o)n+=" ";r=i+1}if(t){var c=f.appendChild(document.createElement("span"));c.className="cm-"+t.replace(/ +/g," cm-"),c.appendChild(document.createTextNode(n))}else f.appendChild(document.createTextNode(n))}}var c=e.splitLines(t),h=i&&i.state||e.startState(s);for(var p=0,d=c.length;p<d;++p){p&&r("\n");var v=new e.StringStream(c[p]);!v.string&&s.blankLine&&s.blankLine(h);while(!v.eol()){var m=s.token(v,h);r(v.current(),m,p,v.start,h),v.start=v.pos}}}}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/addon/search/searchcursor",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function n(e,n,i,s){this.atOccurrence=!1,this.doc=e,s==null&&typeof n=="string"&&(s=!1),i=i?e.clipPos(i):t(0,0),this.pos={from:i,to:i};if(typeof n!="string")n.global||(n=new RegExp(n.source,n.ignoreCase?"ig":"g")),this.matches=function(r,i){if(r){n.lastIndex=0;var s=e.getLine(i.line).slice(0,i.ch),o=0,u,a;for(;;){n.lastIndex=o;var f=n.exec(s);if(!f)break;u=f,a=u.index,o=u.index+(u[0].length||1);if(o==s.length)break}var l=u&&u[0].length||0;l||(a==0&&s.length==0?u=undefined:a!=e.getLine(i.line).length&&l++)}else{n.lastIndex=i.ch;var s=e.getLine(i.line),u=n.exec(s),l=u&&u[0].length||0,a=u&&u.index;a+l!=s.length&&!l&&(l=1)}if(u&&l)return{from:t(i.line,a),to:t(i.line,a+l),match:u}};else{var o=n;s&&(n=n.toLowerCase());var u=s?function(e){return e.toLowerCase()}:function(e){return e},a=n.split("\n");if(a.length==1)n.length?this.matches=function(i,s){if(i){var a=e.getLine(s.line).slice(0,s.ch),f=u(a),l=f.lastIndexOf(n);if(l>-1)return l=r(a,f,l),{from:t(s.line,l),to:t(s.line,l+o.length)}}else{var a=e.getLine(s.line).slice(s.ch),f=u(a),l=f.indexOf(n);if(l>-1)return l=r(a,f,l)+s.ch,{from:t(s.line,l),to:t(s.line,l+o.length)}}}:this.matches=function(){};else{var f=o.split("\n");this.matches=function(n,r){var i=a.length-1;if(n){if(r.line-(a.length-1)<e.firstLine())return;if(u(e.getLine(r.line).slice(0,f[i].length))!=a[a.length-1])return;var s=t(r.line,f[i].length);for(var o=r.line-1,l=i-1;l>=1;--l,--o)if(a[l]!=u(e.getLine(o)))return;var c=e.getLine(o),h=c.length-f[0].length;if(u(c.slice(h))!=a[0])return;return{from:t(o,h),to:s}}if(r.line+(a.length-1)>e.lastLine())return;var c=e.getLine(r.line),h=c.length-f[0].length;if(u(c.slice(h))!=a[0])return;var p=t(r.line,h);for(var o=r.line+1,l=1;l<i;++l,++o)if(a[l]!=u(e.getLine(o)))return;if(u(e.getLine(o).slice(0,f[i].length))!=a[i])return;return{from:p,to:t(o,f[i].length)}}}}}function r(e,t,n){if(e.length==t.length)return n;for(var r=Math.min(n,e.length);;){var i=e.slice(0,r).toLowerCase().length;if(i<n)++r;else{if(!(i>n))return r;--r}}}var t=e.Pos;n.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){function i(e){var r=t(e,0);return n.pos={from:r,to:r},n.atOccurrence=!1,!1}var n=this,r=this.doc.clipPos(e?this.pos.from:this.pos.to);for(;;){if(this.pos=this.matches(e,r))return this.atOccurrence=!0,this.pos.match||!0;if(e){if(!r.line)return i(0);r=t(r.line-1,this.doc.getLine(r.line-1).length)}else{var s=this.doc.lineCount();if(r.line==s-1)return i(s);r=t(r.line+1,0)}}},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(n,r){if(!this.atOccurrence)return;var i=e.splitLines(n);this.doc.replaceRange(i,this.pos.from,this.pos.to,r),this.pos.to=t(this.pos.from.line+i.length-1,i[i.length-1].length+(i.length==1?this.pos.from.ch:0))}},e.defineExtension("getSearchCursor",function(e,t,r){return new n(this.doc,e,t,r)}),e.defineDocExtension("getSearchCursor",function(e,t,r){return new n(this,e,t,r)}),e.defineExtension("selectMatches",function(t,n){var r=[],i=this.getSearchCursor(t,this.getCursor("from"),n);while(i.findNext()){if(e.cmpPos(i.to(),this.getCursor("to"))>0)break;r.push({anchor:i.from(),head:i.to()})}r.length&&this.setSelections(r,0)})}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/addon/dialog/dialog",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,n){var r=e.getWrapperElement(),i;return i=r.appendChild(document.createElement("div")),n?i.className="CodeMirror-dialog CodeMirror-dialog-bottom":i.className="CodeMirror-dialog CodeMirror-dialog-top",typeof t=="string"?i.innerHTML=t:i.appendChild(t),i}function n(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}e.defineExtension("openDialog",function(r,i,s){function f(e){if(typeof e=="string")l.value=e;else{if(u)return;u=!0,o.parentNode.removeChild(o),a.focus(),s.onClose&&s.onClose(o)}}s||(s={}),n(this,null);var o=t(this,r,s.bottom),u=!1,a=this,l=o.getElementsByTagName("input")[0],c;if(l)l.focus(),s.value&&(l.value=s.value,s.selectValueOnOpen!==!1&&l.select()),s.onInput&&e.on(l,"input",function(e){s.onInput(e,l.value,f)}),s.onKeyUp&&e.on(l,"keyup",function(e){s.onKeyUp(e,l.value,f)}),e.on(l,"keydown",function(t){if(s&&s.onKeyDown&&s.onKeyDown(t,l.value,f))return;if(t.keyCode==27||s.closeOnEnter!==!1&&t.keyCode==13)l.blur(),e.e_stop(t),f();t.keyCode==13&&i(l.value,t)}),s.closeOnBlur!==!1&&e.on(l,"blur",f);else if(c=o.getElementsByTagName("button")[0])e.on(c,"click",function(){f(),a.focus()}),s.closeOnBlur!==!1&&e.on(c,"blur",f),c.focus();return f}),e.defineExtension("openConfirm",function(r,i,s){function c(){if(a)return;a=!0,o.parentNode.removeChild(o),f.focus()}n(this,null);var o=t(this,r,s&&s.bottom),u=o.getElementsByTagName("button"),a=!1,f=this,l=1;u[0].focus();for(var h=0;h<u.length;++h){var p=u[h];(function(t){e.on(p,"click",function(n){e.e_preventDefault(n),c(),t&&t(f)})})(i[h]),e.on(p,"blur",function(){--l,setTimeout(function(){l<=0&&c()},200)}),e.on(p,"focus",function(){++l})}}),e.defineExtension("openNotification",function(r,i){function f(){if(o)return;o=!0,clearTimeout(u),s.parentNode.removeChild(s)}n(this,f);var s=t(this,r,i&&i.bottom),o=!1,u,a=i&&typeof i.duration!="undefined"?i.duration:5e3;return e.on(s,"click",function(t){e.e_preventDefault(t),f()}),a&&(u=setTimeout(f,a)),f})}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror"),require("./searchcursor"),require("../dialog/dialog")):typeof define=="function"&&define.amd?define("cm/addon/search/search",["../../lib/codemirror","./searchcursor","../dialog/dialog"],e):e(CodeMirror)}(function(e){function t(e,t){return typeof e=="string"?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),t?"gi":"g"):e.global||(e=new RegExp(e.source,e.ignoreCase?"gi":"g")),{token:function(t){e.lastIndex=t.pos;var n=e.exec(t.string);if(n&&n.index==t.pos)return t.pos+=n[0].length||1,"searching";n?t.pos=n.index:t.skipToEnd()}}}function n(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function r(e){return e.state.search||(e.state.search=new n)}function i(e){return typeof e=="string"&&e==e.toLowerCase()}function s(e,t,n){return e.getSearchCursor(t,n,i(t))}function o(e,t,n,r,i){e.openDialog(t,r,{value:n,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){v(e)},onKeyDown:i})}function u(e,t,n,r,i){e.openDialog?e.openDialog(t,i,{value:r,selectValueOnOpen:!0}):i(prompt(n,r))}function a(e,t,n,r){e.openConfirm?e.openConfirm(t,r):confirm(n)&&r[0]()}function f(e){return e.replace(/\\(.)/g,function(e,t){return t=="n"?"\n":t=="r"?"\r":t})}function l(e){var t=e.match(/^\/(.*)\/([a-z]*)$/);if(t)try{e=new RegExp(t[1],t[2].indexOf("i")==-1?"":"i")}catch(n){}else e=f(e);if(typeof e=="string"?e=="":e.test(""))e=/x^/;return e}function h(e,n,r){n.queryText=r,n.query=l(r),e.removeOverlay(n.overlay,i(n.query)),n.overlay=t(n.query,i(n.query)),e.addOverlay(n.overlay),e.showMatchesOnScrollbar&&(n.annotate&&(n.annotate.clear(),n.annotate=null),n.annotate=e.showMatchesOnScrollbar(n.query,i(n.query)))}function p(t,n,i,s){var a=r(t);if(a.query)return d(t,n);var f=t.getSelection()||a.lastQuery;if(i&&t.openDialog){var l=null,p=function(n,r){e.e_stop(r);if(!n)return;n!=a.queryText&&(h(t,a,n),a.posFrom=a.posTo=t.getCursor()),l&&(l.style.opacity=1),d(t,r.shiftKey,function(e,n){var r;n.line<3&&document.querySelector&&(r=t.display.wrapper.querySelector(".CodeMirror-dialog"))&&r.getBoundingClientRect().bottom-4>t.cursorCoords(n,"window").top&&((l=r).style.opacity=.4)})};o(t,c,f,p,function(n,i){var s=e.keyName(n),o=e.keyMap[t.getOption("keyMap")][s];o||(o=t.getOption("extraKeys")[s]);if(o=="findNext"||o=="findPrev"||o=="findPersistentNext"||o=="findPersistentPrev")e.e_stop(n),h(t,r(t),i),t.execCommand(o);else if(o=="find"||o=="findPersistent")e.e_stop(n),p(i,n)}),s&&f&&(h(t,a,f),d(t,n))}else u(t,c,"Search for:",f,function(e){e&&!a.query&&t.operation(function(){h(t,a,e),a.posFrom=a.posTo=t.getCursor(),d(t,n)})})}function d(t,n,i){t.operation(function(){var o=r(t),u=s(t,o.query,n?o.posFrom:o.posTo);if(!u.find(n)){u=s(t,o.query,n?e.Pos(t.lastLine()):e.Pos(t.firstLine(),0));if(!u.find(n))return}t.setSelection(u.from(),u.to()),t.scrollIntoView({from:u.from(),to:u.to()},20),o.posFrom=u.from(),o.posTo=u.to(),i&&i(u.from(),u.to())})}function v(e){e.operation(function(){var t=r(e);t.lastQuery=t.query;if(!t.query)return;t.query=t.queryText=null,e.removeOverlay(t.overlay),t.annotate&&(t.annotate.clear(),t.annotate=null)})}function b(e,t,n){e.operation(function(){for(var r=s(e,t);r.findNext();)if(typeof t!="string"){var i=e.getRange(r.from(),r.to()).match(t);r.replace(n.replace(/\$(\d)/g,function(e,t){return i[t]}))}else r.replace(n)})}function w(e,t){if(e.getOption("readOnly"))return;var n=e.getSelection()||r(e).lastQuery,i=t?"Replace all:":"Replace:";u(e,i+m,i,n,function(n){if(!n)return;n=l(n),u(e,g,"Replace with:","",function(r){r=f(r);if(t)b(e,n,r);else{v(e);var i=s(e,n,e.getCursor("from")),o=function(){var t=i.from(),f;if(!(f=i.findNext())){i=s(e,n);if(!(f=i.findNext())||t&&i.from().line==t.line&&i.from().ch==t.ch)return}e.setSelection(i.from(),i.to()),e.scrollIntoView({from:i.from(),to:i.to()}),a(e,y,"Replace?",[function(){u(f)},o,function(){b(e,n,r)}])},u=function(e){i.replace(typeof n=="string"?r:r.replace(/\$(\d)/g,function(t,n){return e[n]})),o()};o()}})})}var c='Search: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',m=' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',g='With: <input type="text" style="width: 10em" class="CodeMirror-search-field"/>',y="Replace? <button>Yes</button> <button>No</button> <button>All</button> <button>Stop</button>";e.commands.find=function(e){v(e),p(e)},e.commands.findPersistent=function(e){v(e),p(e,!1,!0)},e.commands.findPersistentNext=function(e){p(e,!1,!0,!0)},e.commands.findPersistentPrev=function(e){p(e,!0,!0,!0)},e.commands.findNext=p,e.commands.findPrev=function(e){p(e,!0)},e.commands.clearSearch=v,e.commands.replace=w,e.commands.replaceAll=function(e){w(e,!0)}}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror"),require("../dialog/dialog")):typeof define=="function"&&define.amd?define("cm/addon/search/jump-to-line",["../../lib/codemirror","../dialog/dialog"],e):e(CodeMirror)}(function(e){function t(e,t,n,r,i){e.openDialog?e.openDialog(t,i,{value:r,selectValueOnOpen:!0}):i(prompt(n,r))}function r(e,t){var n=Number(t);return/^[-+]/.test(t)?e.getCursor().line+n:n-1}var n='Jump to line: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use line:column or scroll% syntax)</span>';e.commands.jumpToLine=function(e){var i=e.getCursor();t(e,n,"Jump to line:",i.line+1+":"+i.ch,function(t){if(!t)return;var n;if(n=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(t))e.setCursor(r(e,n[1]),Number(n[2]));else if(n=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(t)){var s=Math.round(e.lineCount()*Number(n[1])/100);/^[-+]/.test(n[1])&&(s=i.line+s+1),e.setCursor(s-1,i.ch)}else(n=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(t))&&e.setCursor(r(e,n[1]),i.ch)})},e.keyMap["default"]["Alt-G"]="jumpToLine"}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/addon/hover/text-hover",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){(function(){function n(t,n){function i(t){if(!r.parentNode)return e.off(document,"mousemove",i);r.style.top=Math.max(0,t.clientY-r.offsetHeight-5)+"px",r.style.left=t.clientX+5+"px"}var r=document.createElement("div");return r.className="CodeMirror-hover-tooltip",typeof n=="string"&&(n=document.createTextNode(n)),r.appendChild(n),document.body.appendChild(r),e.on(document,"mousemove",i),i(t),r.style.opacity!=null&&(r.style.opacity=1),r}function r(e){e.parentNode&&e.parentNode.removeChild(e)}function i(e){if(!e.parentNode)return;e.style.opacity==null&&r(e),e.style.opacity=0,setTimeout(function(){r(e)},600)}function s(r,s,o,u,a){function l(){e.off(o,"mouseout",l),e.off(o,"click",l),o.className=o.className.replace(t,""),f&&(i(f),f=null),a.removeKeyMap(u.keyMap)}var f=n(r,s),c=setInterval(function(){if(f)for(var e=o;;e=e.parentNode){if(e==document.body)return;if(!e){l();break}}if(!f)return clearInterval(c)},400);e.on(o,"mouseout",l),e.on(o,"click",l),u.keyMap={Esc:l},a.addKeyMap(u.keyMap)}function o(e,t){this.options=t,this.timeout=null,t.delay?this.onMouseOver=function(t){a(e,t)}:this.onMouseOver=function(t){f(e,t)},this.keyMap=null}function u(t,n){if(n instanceof Function)return{getTextHover:n};if(!n||n===!0)n={};n.getTextHover||(n.getTextHover=t.getHelper(e.Pos(0,0),"textHover"));if(!n.getTextHover)throw new Error("Required option 'getTextHover' missing (text-hover addon)");return n}function a(e,t){var n=e.state.textHover,r=n.options.delay;clearTimeout(n.timeout);if(t.srcElement){var i={srcElement:t.srcElement,clientX:t.clientX,clientY:t.clientY};t=i}n.timeout=setTimeout(function(){f(e,t)},r)}function f(e,n){var r=n.target||n.srcElement;if(r){var i=e.state.textHover,o=h(e,n),u=i.options.getTextHover(e,o,n);u&&(r.className+=t,typeof u=="function"?u(s,o,n,r,i,e):s(n,u,r,i,e))}}function l(t,n,r){r&&r!=e.Init&&(e.off(t.getWrapperElement(),"mouseover",t.state.textHover.onMouseOver),delete t.state.textHover);if(n){var i=t.state.textHover=new o(t,u(t,n));e.on(t.getWrapperElement(),"mouseover",i.onMouseOver)}}function h(e,t){var n=t.target||t.srcElement,r=n.innerText||n.textContent;for(var i=0;i<c.length;i+=2){var s=e.coordsChar({left:t.clientX+c[i],top:t.clientY+c[i+1]}),o=e.getTokenAt(s);if(o&&o.string===r)return{token:o,pos:s}}}var t=" CodeMirror-hover",c=[0,0,0,5,0,-5,5,0,-5,0];e.defineOption("textHover",!1,l)})()}),define("cm/addon/hover/prolog-hover",["../../lib/codemirror","jquery","laconic"],function(e,t){function i(e){return t.el.span({"class":"pred-name"},e.text+"/"+e.arity)}function s(e,t,r){n[r]=t}function o(e,t){var r;return n[e.file]?n[e.file]:(r=e.file.lastIndexOf("/"))?e.file.substring(r+1):e.file}function u(e,n,r){return n&&n.file?t.el.div(a(e)+" included from ",t.el.span({"class":"file-path"},n.file)):n&&n.line?a(e)+" defined in line "+n.line:"Locally defined "+e}function a(e){return e[0].toUpperCase()+e.slice(1)}var n={},r={goal_built_in:function(e,n){return e?t.el.div(i(e),n.tokenInfo(e)):"Built-in predicate"},goal_global:function(e,n){return e?t.el.div(i(e),n.tokenInfo(e)):"Global predicate"},goal_autoload:function(e,n){return e?t.el.div(i(e)," (autoload from ",o(e,n),"): ",n.tokenInfo(e)):"Autoloaded predicate"},goal_imported:function(e,n){return e?t.el.div(i(e)," (imported from ",o(e,n),"): ",n.tokenInfo(e)):"Imported predicate"},goal_recursion:"Recursive call",goal_dynamic:"Dynamic predicate",goal_undefined:"Undefined predicate",goal_local:function(e,t){return u("predicate",e,t)},goal_constraint:function(e,t){return u("CHR constraint",e,t)},head_unreferenced:"Predicate is not called",unused_import:"Imported predicate is not used",undefined_import:"Imported predicate is not defined",head_constraint:"CHR constraint",file:function(e,n){return e?(s(n,e.text,e.path),t.el.div("File: ",t.el.span({"class":"file-path"},e.path))):"File name"},file_no_depends:function(e,n){return e?(s(n,e.text,e.path),t.el.div("File: ",t.el.span({"class":"file-path"},e.path),t.el.div({"class":"hover-remark"},"does not resolve any dependencies"))):"File name (does not resolve any dependencies)"},error:function(e,n){return e&&e.expected?t.el.div("error: ",t.el.strong(e.expected)," expected"):"error"},singleton:"Variable appearing only once",codes:"List of Unicode code points (integers)",chars:"List of one-character atoms",string:"Packed string (SWI7, use `text` for a list of codes)",qatom:"Quoted atom",uatom:"Uppercase atom due to var_prefix flag",tag:"Tag of a SWI7 dict",ext_quant:"Existential quantification operator",instantiation_error:"No variable allowed here",string_terminal:"Terminal (DCG)",head:null,control:null,fullstop:null,"var":null,"int":null,"float":null,number:null,atom:null,functor:null,comment:null,neck:null,operator:null,sep:null,list_open:null,list_close:null,dict_open:null,dict_close:null};e.registerHelper("textHover","prolog",function(e,n,i){if(n){var s=n.token,o=r[s.type],u;if(o===undefined)return(u=e.getEnrichedToken(s))?u.summary&&u.info==="ask"?t.el.div(u.summary,e.tokenInfo(u)):u.summary?t.el.div(u.summary):t.el.div(s.type):t.el.div(s.type);if(typeof o=="function"){var a=o(e.getEnrichedToken(s),e);return typeof a=="string"?t.el.div(a):a}if(typeof o=="string")return t.el.div(o)}return null})}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/addon/hint/show-context-info",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){var t=null;e.attachContextInfo=function(n){e.on(n,"select",function(e,n){n=n.parentNode;var r=null;e.info&&(r=e.info(e));if(r){var i=n.getBoundingClientRect();t==null&&(t=document.createElement("div"),t.className="CodeMirror-hints-contextInfo",document.body.appendChild(t)),t.innerHTML="",t.style.top=n.style.top,t.style.left=i.right+"px",typeof r=="string"?t.innerHTML=r:t.appendChild(r),t.style.display="block"}else t!=null&&(t.innerHTML="",t.style.display="none")}),e.on(n,"close",function(){t!=null&&t.parentNode.removeChild(t),t=null})},e.showContextInfo=function(t){return function(n,r,i){i||(i=r);var s=t(n,i);return e.attachContextInfo(s),s}}}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/keymap/emacs",["../lib/codemirror"],e):e(CodeMirror)}(function(e){function n(e,t){return e.line==t.line&&e.ch==t.ch}function i(e){r.push(e),r.length>50&&r.shift()}function s(e){if(!r.length)return i(e);r[r.length-1]+=e}function o(e){return r[r.length-(e?Math.min(e,1):1)]||""}function u(){return r.length>1&&r.pop(),o()}function f(e,t,r,o,u){u==null&&(u=e.getRange(t,r)),o&&a&&a.cm==e&&n(t,a.pos)&&e.isClean(a.gen)?s(u):i(u),e.replaceRange("",t,r,"+delete"),o?a={cm:e,pos:t,gen:e.changeGeneration()}:a=null}function l(e,t,n){return e.findPosH(t,n,"char",!0)}function c(e,t,n){return e.findPosH(t,n,"word",!0)}function h(e,t,n){return e.findPosV(t,n,"line",e.doc.sel.goalColumn)}function p(e,t,n){return e.findPosV(t,n,"page",e.doc.sel.goalColumn)}function d(e,n,r){var i=n.line,s=e.getLine(i),o=/\S/.test(r<0?s.slice(0,n.ch):s.slice(n.ch)),u=e.firstLine(),a=e.lastLine();for(;;){i+=r;if(i<u||i>a)return e.clipPos(t(i-r,r<0?0:null));s=e.getLine(i);var f=/\S/.test(s);if(f)o=!0;else if(o)return t(i,0)}}function v(e,n,r){var i=n.line,s=n.ch,o=e.getLine(n.line),u=!1;for(;;){var a=o.charAt(s+(r<0?-1:0));if(!a){if(i==(r<0?e.firstLine():e.lastLine()))return t(i,s);o=e.getLine(i+r);if(!/\S/.test(o))return t(i,s);i+=r,s=r<0?o.length:0;continue}if(u&&/[!?.]/.test(a))return t(i,s+(r>0?1:0));u||(u=/\w/.test(a)),s+=r}}function m(e,r,i){var s;if(e.findMatchingBracket&&(s=e.findMatchingBracket(r,!0))&&s.match&&(s.forward?1:-1)==i)return i>0?t(s.to.line,s.to.ch+1):s.to;for(var o=!0;;o=!1){var u=e.getTokenAt(r),a=t(r.line,i<0?u.start:u.end);if(!(o&&i>0&&u.end==r.ch||!/\w/.test(u.string)))return a;var f=e.findPosH(a,i,"char");if(n(a,f))return r;r=f}}function g(e,t){var n=e.state.emacsPrefix;return n?(C(e),n=="-"?-1:Number(n)):t?null:1}function y(e){var t=typeof e=="string"?function(t){t.execCommand(e)}:e;return function(e){var n=g(e);t(e);for(var r=1;r<n;++r)t(e)}}function b(e,t,r,i){var s=g(e);s<0&&(i=-i,s=-s);for(var o=0;o<s;++o){var u=r(e,t,i);if(n(u,t))break;t=u}return t}function w(e,t){var n=function(n){n.extendSelection(b(n,n.getCursor(),e,t))};return n.motion=!0,n}function E(e,t,n){var r=e.listSelections(),i,s=r.length;while(s--)i=r[s].head,f(e,i,b(e,i,t,n),!0)}function S(e){if(e.somethingSelected()){var t=e.listSelections(),n,r=t.length;while(r--)n=t[r],f(e,n.anchor,n.head);return!0}}function x(e,t){if(e.state.emacsPrefix){t!="-"&&(e.state.emacsPrefix+=t);return}e.state.emacsPrefix=t,e.on("keyHandled",N),e.on("inputRead",k)}function N(e,t){!e.state.emacsPrefixMap&&!T.hasOwnProperty(t)&&C(e)}function C(e){e.state.emacsPrefix=null,e.off("keyHandled",N),e.off("inputRead",k)}function k(e,t){var n=g(e);if(n>1&&t.origin=="+input"){var r=t.text.join("\n"),i="";for(var s=1;s<n;++s)i+=r;e.replaceSelection(i)}}function L(e){e.state.emacsPrefixMap=!0,e.addKeyMap(j),e.on("keyHandled",A),e.on("inputRead",A)}function A(e,t){if(!(typeof t!="string"||!/^\d$/.test(t)&&t!="Ctrl-U"))return;e.removeKeyMap(j),e.state.emacsPrefixMap=!1,e.off("keyHandled",A),e.off("inputRead",A)}function O(e){e.setCursor(e.getCursor()),e.setExtending(!e.getExtending()),e.on("change",function(){e.setExtending(!1)})}function M(e){e.setExtending(!1),e.setCursor(e.getCursor())}function _(e,t,n){e.openDialog?e.openDialog(t+': <input type="text" style="width: 10em"/>',n,{bottom:!0}):n(prompt(t,""))}function D(e,t){var n=e.getCursor(),r=e.findPosH(n,1,"word");e.replaceRange(t(e.getRange(n,r)),n,r),e.setCursor(r)}function P(e){var n=e.getCursor(),r=n.line,i=n.ch,s=[];while(r>=e.firstLine()){var o=e.getLine(r);for(var u=i==null?o.length:i;u>0;){var i=o.charAt(--u);if(i==")")s.push("(");else if(i=="]")s.push("[");else if(i=="}")s.push("{");else if(/[\(\{\[]/.test(i)&&(!s.length||s.pop()!=i))return e.extendSelection(t(r,u))}--r,i=null}}function H(e){e.execCommand("clearSearch"),M(e)}function F(e){j[e]=function(t){x(t,e)},B["Ctrl-"+e]=function(t){x(t,e)},T["Ctrl-"+e]=!0}var t=e.Pos,r=[],a=null,T={"Alt-G":!0,"Ctrl-X":!0,"Ctrl-Q":!0,"Ctrl-U":!0},B=e.keyMap.emacs=e.normalizeKeyMap({"Ctrl-W":function(e){f(e,e.getCursor("start"),e.getCursor("end"))},"Ctrl-K":y(function(e){var n=e.getCursor(),r=e.clipPos(t(n.line)),i=e.getRange(n,r);/\S/.test(i)||(i+="\n",r=t(n.line+1,0)),f(e,n,r,!0,i)}),"Alt-W":function(e){i(e.getSelection()),M(e)},"Ctrl-Y":function(e){var t=e.getCursor();e.replaceRange(o(g(e)),t,t,"paste"),e.setSelection(t,e.getCursor())},"Alt-Y":function(e){e.replaceSelection(u(),"around","paste")},"Ctrl-Space":O,"Ctrl-Shift-2":O,"Ctrl-F":w(l,1),"Ctrl-B":w(l,-1),Right:w(l,1),Left:w(l,-1),"Ctrl-D":function(e){E(e,l,1)},Delete:function(e){S(e)||E(e,l,1)},"Ctrl-H":function(e){E(e,l,-1)},Backspace:function(e){S(e)||E(e,l,-1)},"Alt-F":w(c,1),"Alt-B":w(c,-1),"Alt-D":function(e){E(e,c,1)},"Alt-Backspace":function(e){E(e,c,-1)},"Ctrl-N":w(h,1),"Ctrl-P":w(h,-1),Down:w(h,1),Up:w(h,-1),"Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd",End:"goLineEnd",Home:"goLineStart","Alt-V":w(p,-1),"Ctrl-V":w(p,1),PageUp:w(p,-1),PageDown:w(p,1),"Ctrl-Up":w(d,-1),"Ctrl-Down":w(d,1),"Alt-A":w(v,-1),"Alt-E":w(v,1),"Alt-K":function(e){E(e,v,1)},"Ctrl-Alt-K":function(e){E(e,m,1)},"Ctrl-Alt-Backspace":function(e){E(e,m,-1)},"Ctrl-Alt-F":w(m,1),"Ctrl-Alt-B":w(m,-1),"Shift-Ctrl-Alt-2":function(e){var t=e.getCursor();e.setSelection(b(e,t,m,1),t)},"Ctrl-Alt-T":function(e){var t=m(e,e.getCursor(),-1),n=m(e,t,1),r=m(e,n,1),i=m(e,r,-1);e.replaceRange(e.getRange(i,r)+e.getRange(n,i)+e.getRange(t,n),t,r)},"Ctrl-Alt-U":y(P),"Alt-Space":function(e){var n=e.getCursor(),r=n.ch,i=n.ch,s=e.getLine(n.line);while(r&&/\s/.test(s.charAt(r-1)))--r;while(i<s.length&&/\s/.test(s.charAt(i)))++i;e.replaceRange(" ",t(n.line,r),t(n.line,i))},"Ctrl-O":y(function(e){e.replaceSelection("\n","start")}),"Ctrl-T":y(function(e){e.execCommand("transposeChars")}),"Alt-C":y(function(e){D(e,function(e){var t=e.search(/\w/);return t==-1?e:e.slice(0,t)+e.charAt(t).toUpperCase()+e.slice(t+1).toLowerCase()})}),"Alt-U":y(function(e){D(e,function(e){return e.toUpperCase()})}),"Alt-L":y(function(e){D(e,function(e){return e.toLowerCase()})}),"Alt-;":"toggleComment","Ctrl-/":y("undo"),"Shift-Ctrl--":y("undo"),"Ctrl-Z":y("undo"),"Cmd-Z":y("undo"),"Shift-Alt-,":"goDocStart","Shift-Alt-.":"goDocEnd","Ctrl-S":"findNext","Ctrl-R":"findPrev","Ctrl-G":H,"Shift-Alt-5":"replace","Alt-/":"autocomplete","Ctrl-J":"newlineAndIndent",Enter:!1,Tab:"indentAuto","Alt-G G":function(e){var t=g(e,!0);if(t!=null&&t>0)return e.setCursor(t-1);_(e,"Goto line",function(t){var n;t&&!isNaN(n=Number(t))&&n==(n|0)&&n>0&&e.setCursor(n-1)})},"Ctrl-X Tab":function(e){e.indentSelection(g(e,!0)||e.getOption("indentUnit"))},"Ctrl-X Ctrl-X":function(e){e.setSelection(e.getCursor("head"),e.getCursor("anchor"))},"Ctrl-X Ctrl-S":"save","Ctrl-X Ctrl-W":"save","Ctrl-X S":"saveAll","Ctrl-X F":"open","Ctrl-X U":y("undo"),"Ctrl-X K":"close","Ctrl-X Delete":function(e){f(e,e.getCursor(),v(e,e.getCursor(),1),!0)},"Ctrl-X H":"selectAll","Ctrl-Q Tab":y("insertTab"),"Ctrl-U":L}),j={"Ctrl-G":C};for(var I=0;I<10;++I)F(String(I));F("-")}),define("editor",["cm/lib/codemirror","config","preferences","form","cm/mode/prolog/prolog-template-hint","modal","tabbed","prolog","storage","cm/mode/prolog/prolog","cm/mode/prolog/prolog_keys","cm/mode/prolog/prolog_query","cm/mode/prolog/prolog_server","cm/mode/markdown/markdown","cm/addon/edit/matchbrackets","cm/addon/comment/continuecomment","cm/addon/comment/comment","cm/addon/hint/show-hint","cm/addon/hint/anyword-hint","cm/addon/display/placeholder","cm/addon/runmode/runmode","cm/addon/search/search","cm/addon/search/searchcursor","cm/addon/search/jump-to-line","cm/addon/dialog/dialog","cm/addon/hover/text-hover","cm/addon/hover/prolog-hover","cm/addon/hint/templates-hint","cm/addon/hint/show-context-info","jquery","laconic","cm/keymap/emacs"],function(e,t,n,r,i,s,o,u){function a(e,t){var n=[];t=t||"",n.push("<style>\n");for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];n.push(t,r,"{");for(var s in i)i.hasOwnProperty(s)&&n.push(s,":",i[s],";");n.push("}\n")}n.push("</style>\n"),$("body").append(n.join(""))}(function(r){var a="prologEditor",f={prolog:{mode:"prolog",role:"source",placeholder:"Your Prolog rules and facts go here ...",lineNumbers:!0,autoCurrent:!0,save:!1,theme:"prolog",matchBrackets:!0,textHover:!0,prologKeys:!0,extraKeys:{"Ctrl-Space":"autocomplete","Alt-/":"autocomplete"},hintOptions:{hint:i.getHints,completeSingle:!1}},markdown:{mode:"markdown",placeholder:"Your markdown block goes here ...",lineWrapping:!0,save:!1}},l={query:{mode:"prolog",role:"query",placeholder:"Your query goes here ...",lineNumbers:!1,lineWrapping:!0,save:!1}},c,h={_init:function(i){return this.each(function(){var s=r(this),o={},u={},c;i=i||{},i.mode=i.mode||"prolog";var h=r.extend({},f[i.mode]);i.role&&l[i.role]&&(h=r.extend(h,l[i.role])),h=r.extend(h,i),n.getVal("emacs-keybinding")&&(h.keyMap="emacs");if(h.mode=="prolog"){u.role=h.role,h.getSource&&(u.getSource=h.getSource),t.http.locations.cm_highlight&&(h.prologHighlightServer={url:t.http.locations.cm_highlight,role:h.role,enabled:n.getVal("semantic-highlighting")},h.sourceID&&(h.prologHighlightServer.sourceID=h.sourceID),h.extraKeys["Ctrl-R"]="refreshHighlight"),h.role=="source"&&(h.continueComments="Enter",h.gutters=["Prolog-breakpoints"]),u.long_click={};function p(e){var t=u.long_click,n=e.clientX-t.clientX,r=e.clientY-t.clientY;Math.sqrt(n*n+r*r)>5&&d()}function d(){s.off("mousemove",p);var e=u.long_click;e.timeout&&(clearTimeout(e.timeout),e.target=undefined,e.timeout=undefined)}s.on("mousedown",".CodeMirror-code",function(e){var t=u.long_click;t.clientX=e.clientX,t.clientY=e.clientY,s.on("mousemove",p),u.long_click.timeout=setTimeout(function(){d(),s.prologEditor("contextAction")},500)}),s.on("mouseup",function(e){d()})}if(c=s.children("textarea")[0]){function v(e){var t=r(c).data(e);t&&(o[e]=t)}v("file"),v("url"),v("title"),v("meta"),v("st_type"),u.cm=e.fromTextArea(c,h)}else h.value||(h.value=s.text()),u.cm=e(s[0],h);s.data(a,u),s.prologEditor("loadMode",h.mode),s.addClass("swish-event-receiver"),s.addClass("prolog-editor"),s.on("preference",function(e,t){s.prologEditor("preference",t)}),s.on("print",function(){u.role!="query"&&s.prologEditor("print")}),s.on("clearMessages",function(e){s.prologEditor("clearMessages")}),s.on("edit-command",function(e,t){s.prologEditor("execCommand",t)}),u.cm.on("blur",function(e){s.prologEditor("execCommand","prepare")}),h.save&&(o.typeName=h.typeName||"program",s.prologEditor("setupStorage",o)),h.mode=="prolog"&&u.role=="source"&&(s.on("activate-tab",function(e){h.autoCurrent&&s.prologEditor("makeCurrent"),u.cm.refresh()}),s.on("source-error",function(e,t){s.prologEditor("highlightError",t)}),s.on("pengine-died",function(e,t){if(u.pengines){var n=u.pengines.indexOf(t);n>=0&&u.pengines.splice(n,1)}u.traceMark&&u.traceMark.pengine==t&&(u.traceMark.clear(),u.traceMark=null)}),u.cm.on("gutterClick",function(e,t){function i(){return r('<span class="breakpoint-marker">&#9679;</span>')[0]}var n=e.lineInfo(t);n.gutterMarkers?e.setGutterMarker(t,"Prolog-breakpoints",null):e.setGutterMarker(t,"Prolog-breakpoints",i())})),u.cm.on("change",function(e,t){var n;if(t.origin=="setValue")n=!0;else{var r=s.data("storage"),i=r?r.cleanGeneration:u.cleanGeneration;n=u.cm.isClean(i)}s.prologEditor("markClean",n)})})},getOption:function(e){return this.data(a)[e]},setKeybinding:function(e){e=e||"default",this.data(a).cm.options.keyMap=e},loadMode:function(t){var n=this.data(a);return e.modes[t]?t!=n.mode&&n.cm.setOption("mode",t):require(["cm/mode/"+t+"/"+t],function(){n.cm.setOption("mode",t)}),this},isPengineSource:function(){var e=r(this).data(a);if(e&&e.role=="source"){var t=r(this).data("storage");if(t&&t.meta)if(t.meta.loaded||t.meta.module)return!1}return this},getBreakpoints:function(e){var t=[];return this.each(function(){var n=r(this).data(a),i=[],s=0,o=n.cm,u=o.firstLine(),f=o.lastLine();for(;u<f;u++){var l=o.lineInfo(u);l.gutterMarkers&&i.push(s+u+1)}if(i.length>0){var c;if(n.pengines&&n.pengines.indexOf(e)>=0)c="pengine://"+e+"/src";else{var h=r(this).data("storage");h&&(c="swish://"+h.file)}c&&t.push({file:c,breakpoints:i})}}),t},getSource:function(e,t){var n=[];return this.each(function(){if(r(this).prologEditor("isPengineSource")){var i=r(this).data(a);if(i)if(!e||e==i.role){var s;typeof i.getSource=="function"&&!t?s=i.getSource():s=i.cm.getValue(),n.push(s)}}}),n.join("\n\n")},getSourceEx:function(){var e={value:this.data(a).cm.getValue()},t=this.prologEditor("getBreakpoints");return t.length>0&&(e.breakpoints=t),e},getSourceID:function(){var e=[];return this.each(function(){var t=r(this).data(a);t&&t.cm&&t.cm.state.prologHighlightServer?e.push(t.cm.state.prologHighlightServer.uuid):e.push(null)}),e},setSource:function(e,t){typeof e=="string"&&(e={data:e});if(this.data("storage")&&t!=1)this.storage("setSource",e);else{var n=this.data(a);n.cm.setValue(e.data);if(e.line||e.prompt)n.cm.refresh(),e.line?this.prologEditor("gotoLine",e.line,e):this.prologEditor("showTracePort",e.prompt);n.role=="source"&&r(".swish-event-receiver").trigger("program-loaded",this)}return this},makeCurrent:function(){return r(".swish-event-receiver").trigger("current-program",this),this},markClean:function(e){var t=this.data(a);t.clean_signalled!=e&&(t.clean_signalled=e,this.trigger("data-is-clean",e))},setIsClean:function(){return this.each(function(){var e=r(this),t=e.data(a);t.cleanGeneration=t.cm.changeGeneration()})},pengine:function(e){var t=this.data(a);if(t){if(e.add)return t.pengines=t.pengines||[],t.pengines.indexOf(e.add)<0&&t.pengines.push(e.add),this;if(e.has)return t.pengines&&t.pengines.indexOf(e.has)>=0}},print:function(n){function o(e){var t=r.el.iframe({src:"about:blank"});r("body").append(t),r("body",t.contentWindow.document).append(e),t.contentWindow.print()}var i=r.el.pre({"class":"cm-s-prolog"});return n||(n=this.prologEditor("getSource")),e.runMode(n,"prolog",i),r.ajax({url:t.http.locations.swish+"js/codemirror/theme/prolog.css",dataType:"text",success:function(e){o(r.el.div(r.el.style(e),i))},error:function(e){s.ajaxError(e)}}),this},preference:function(e){var t=this.data(a);return e.name=="semantic-highlighting"&&t.cm.setOption("prologHighlightServer",{enabled:e.value}),e.name=="emacs-keybinding"&&(e.value==1?t.cm.setOption("keyMap","emacs"):t.cm.setOption("keyMap","default")),this},highlightError:function(e){if(e.location.file&&(e.location.file==1||this.prologEditor("isMyFile",e.location.file))){var t=this.data(a),n;e.location.ch&&(left=t.cm.charCoords({line:e.location.line-1,ch:e.location.ch-1},"local").left,n=r.el.div({"class":"source-msg-charmark"},r.el.span({"class":"glyphicon glyphicon-chevron-up"})),r(n).css("padding-left",left+"px"));var i=r.el.div({"class":"source-msg error error-context",title:"Error message.  Click to remove"},n,r(e.data)[0],r.el.span({"class":"glyphicon glyphicon-remove-circle"})),s=t.cm.addLineWidget(e.location.line-1,i);e.error_context&&r(i).data("error_context",e.error_context),r(i).on("click",function(t){if(e.error_handler&&e.error_handler(t)==0)return;s.clear()}),r(i).data("cm-widget",s)}return this},refreshHighlight:function(){var e=this.data(a);return e.cm.serverAssistedHighlight(!0),this},refresh:function(){var e=this.data(a);return e&&e.cm.refresh(),this},clearMessages:function(){return this.find(".source-msg").each(function(){r(this).data("cm-widget").clear()}),this.prologEditor("showTracePort",null),this},execCommand:function(e){if(e=="prepare")c=this[0];else if(c==this[0]){elem=r(c);var t=elem.data(a);t.cm.execCommand(e),elem.find(".Codemirror-dialog input").focus()}return this},isMyFile:function(e){var t="swish://";if(e.startsWith("pengine://")){var n=this.data(a);if(n.pengines&&(id=e.split("/")[2])&&n.pengines.indexOf(id)>=0)return!0}if(e.startsWith(t)){var r=this.data("storage");if(r&&e.slice(t.length)==r.file)return!0}return!1},showTracePort:function(e){if(this.length==0)return this;var t=this.data(a);t.traceMark&&(t.traceMark.clear(),t.traceMark=null);if(!(e&&e.source&&e.source.file))return this;var n=e.source.file;if(this.prologEditor("isMyFile",n)){if(e.source.from&&e.source.to){var r=t.cm.charOffsetToPos(e.source.from),i=t.cm.charOffsetToPos(e.source.to);this.is(":visible")||this.storage("expose","trace"),r&&i&&(t.traceMark=t.cm.markText(r,i,{className:"trace "+e.port}),t.traceMark.pengine=e.pengine,t.cm.scrollIntoView(r,50))}return this}},getExamples:function(e,t){var n=e?e:this.prologEditor("getSource"),i,s=[];if(r.trim(n)=="")return null;t==0?i=[e]:i=n.match(/\/\*\* *<?examples>?[\s\S]*?\*\//igm);if(i)for(var o=0;o<i.length;o++){var u=i[o].match(/^ *\?-[\s\S]*?[^-#$&*+./:<=>?@\\^~]\.\s/gm);if(u)for(var a=0;a<u.length;a++){var f=u[a].replace(/^ *\?-\s*/,"").replace(/\s*$/,"");s.push(f)}}return s},search:function(e,t){var n=this.data(a).cm,r=n.firstLine(),i=n.lastLine(),s=[];for(var o=r;o<=i;o++){var u=n.getLine(o);if(u.search(e)>=0){s.push({line:o+1,text:u});if(t.max&&t.max===s.length)return s}}return s},gotoLine:function(e,t){function o(e){if(e._searchMarkers!==undefined){for(var t=0;t<e._searchMarkers.length;t++)e._searchMarkers[t].clear();e.off("cursorActivity",o)}e._searchMarkers=[]}var n=this.data(a),r=n.cm,i=0,s;o(r),t=t||{},s=t.regex,e-=1,s&&(i=r.getLine(e).search(s),i<0&&(i=0)),r.setCursor({line:e,ch:i});var u=r.getScrollInfo().clientHeight,f=r.charCoords({line:e,ch:0},"local");r.scrollTo(null,(f.top+f.bottom-u)/2);if(s){function l(e,t){var n;while(n=s.exec(r.getLine(e)))r._searchMarkers.push(r.markText({line:e,ch:n.index},{line:e,ch:n.index+n[0].length},{className:t,clearOnEnter:!0,clearWhenEmpty:!0,title:"Search match"}))}l(e,"CodeMirror-search-match");if(t.showAllMatches){var c=r.getViewport();for(var h=c.from;h<c.to;h++)h!=e&&l(h,"CodeMirror-search-alt-match")}r._searchMarkers.length>0&&r.on("cursorActivity",o)}else r._searchMarkers.push(r.markText({line:e,ch:0},{line:e,ch:r.getLine(e).length},{className:"CodeMirror-search-match",clearOnEnter:!0,clearWhenEmpty:!0,title:"Target line"}));return this},changeGen:function(){return this.data(a).cm.changeGeneration()},isClean:function(e){return this.data(a).cm.isClean(e)},setupStorage:function(e){var t=this.data(a),n=this;return e.setValue=function(e){n.prologEditor("setSource",e,!0)},e.getValue=function(){return t.cm.getValue()},e.changeGen=function(){return t.cm.changeGeneration()},e.isClean=function(e){return t.cm.isClean(e)},e.markClean=function(e){n.prologEditor("markClean",e)},e.cleanGeneration=t.cm.changeGeneration(),e.cleanData=t.cm.getValue(),e.cleanCheckpoint="load",this.storage(e),this},contextAction:function(){var e=this,t=this.data(a),n=t.cm.getCursor(),i=t.cm.getTokenAt(n,!0),o=t.cm.getEnrichedToken(i),u=t.cm.getTokenReferences(o);if(u&&u.length>0){var f=r.el.ul(),l=r.el.div({"class":"goto-source"},r.el.div("Go to"),f),c=r.el.div({"class":"edit-modal"},r.el.div({"class":"mask"}),l);for(var h=0;h<u.length;h++){var p=u[h];r(f).append(r.el.li(r.el.a({"data-locindex":h},p.title)))}var d=t.cm.cursorCoords(!0);r(l).css({top:d.bottom,left:d.left}),r("body").append(c),r(c).on("click",function(n){var i=r(n.target).data("locindex");r(c).remove();if(i!==undefined){var o=u[i];if(o.file)e.closest(".swish").swish("playFile",o);else{var a;t.role=="query"?(a=e.closest(".prolog-query-editor").queryEditor("getProgramEditor"),a[0]||s.alert("No related program editor")):a=e,a&&a[0]&&a.prologEditor("gotoLine",o.line,o).focus()}}}),r(c).show()}return this},variables:function(t,n){function o(e){r(i).find(e).each(function(){var e=r(this).text();s.indexOf(e)<0&&s.push(e)})}var i=r.el.span({"class":"query cm-s-prolog"}),s=[];return e.runMode(t,"prolog",i),o("span.cm-var"),n&&o("span.cm-var-2"),s},wrapSolution:function(e){function i(e,r){return n.prologEditor("setSource",e+"("+t+")"+r+".").focus(),n}function s(e){var t=[];for(var n=0;n<r.length;n++)t.push("asc("+r[n]+")");return t.join(",")}var t=u.trimFullStop(this.prologEditor("getSource","query")),n=this,r=this.prologEditor("variables",t);switch(e){case"Aggregate (count all)":return i("aggregate_all(count, ",", Count)");case"Order by":return i("order_by(["+s(r)+"], ",")");case"Distinct":return i("distinct(["+r.join(",")+"], ",")");case"Limit":return i("limit(10, ",")");case"Time":return i("time(",")");case"Debug (trace)":return i("trace, ","");default:alert('Unknown wrapper: "'+e+'"')}}};o.tabTypes.program={dataType:"pl",typeName:"program",label:"Program",contentType:"text/x-prolog",order:100,create:function(e,t){r(e).addClass("prolog-editor").prologEditor(r.extend({save:!0},t)).prologEditor("makeCurrent")}};if(t.swish.tab_types){var p={save:!0,lineNumbers:!0};for(var d=0;d<t.swish.tab_types.length;d++){var v=t.swish.tab_types[d];if(v.editor){var m=r.extend({typeName:v.typeName},p,v.editor);v.create=function(e){r(e).addClass("prolog-editor").prologEditor(m)},o.tabTypes[v.typeName]=v}}}r.fn.prologEditor=function(e){if(h[e])return h[e].apply(this,Array.prototype.slice.call(arguments,1));if(typeof e=="object"||!e)return h._init.apply(this,arguments);r.error("Method "+e+" does not exist on jQuery."+a)}})(jQuery),e.prototype.charOffsetToPos=function(e){var t=this.firstLine(),n=this.lastLine(),r=0;for(;t<n;t++){var i=this.getLine(t);if(r<=e&&r+i.length>=e)return{line:t,ch:e-r};r+=i.length+1}},e.keyMap.emacs.Enter="newlineAndIndent",t.swish.cm_style&&a(t.swish.cm_style,".cm-s-prolog span.cm-"),t.swish.cm_hover_style&&a(t.swish.cm_hover_style,".CodeMirror-hover-tooltip ")}),define("query",["jquery","config","preferences","cm/lib/codemirror","laconic","editor"],function(e,t,n,r){(function(e){function o(t){return e(t).parents(".prolog-query-editor")}function u(t,n,r){var i=e.el.div({"class":"btn-group dropup"},e.el.button({"class":"btn btn-default btn-xs dropdown-toggle "+t,"data-toggle":"dropdown"},n,e.el.span({"class":"caret"})),e.el.ul({"class":"dropdown-menu "+t}));return e(i).on("click","a",function(){o(this).queryEditor("setQuery",e(this).text())}),i}function a(t){function i(t){var r=t.examples();e.isArray(r)&&o(n).queryEditor("setExamples",r,!0)}var n=u("examples","Examples",t),r=e(n).find("ul");if(typeof t.examples=="function")e(n).mousedown(function(e){e.which==1&&i(t)});else if(t.examples){var s=t.examples;for(var a=0;a<s.length;a++)r.append(e.el.li(e.el.a(s[a])))}return n}function f(e){return u("history","History",e)}function l(t){var n="aggregate",r=t.aggregates||["Aggregate (count all)","--","Order by","Distinct","Limit","--","Time","Debug (trace)"],i,s=e.el.div({"class":"btn-group dropup"},e.el.button({"class":"btn btn-default btn-xs dropdown-toggle "+n,"data-toggle":"dropdown"},"Solutions",e.el.span({"class":"caret"})),i=e.el.ul({"class":"dropdown-menu "+n}));for(var u=0;u<r.length;u++){var a=r[u];a=="--"?e(i).append(e.el.li({"class":"divider"})):e(i).append(e.el.li(e.el.a(a)))}return e(s).on("click","a",function(){o(this).find(".query").prologEditor("wrapSolution",e(this).text())}),s}function c(t){var n=e.el.button({"class":"run-btn-query","class":"btn btn-default btn-primary btn-xs"},"Run!");return e(n).on("click",function(){o(this).queryEditor("run",undefined,h(this))}),n}function h(t){return e(t).parent().find("input").prop("checked")}function p(r){var i=n.getVal("tabled_results"),s={type:"checkbox",name:"table"};i===undefined&&(i=t.swish.tabled_results),i&&(s.checked="checked");var o=e.el.input(s),u=e.el.span({"class":"run-chk-table"},o," table results");return e(o).on("change",function(t){n.setVal("tabled_results",e(t.target).prop("checked"))}),u}var r="queryEditor",i={maxHistoryLength:50},s={_init:function(t){return this.each(function(){function h(){return e(u).find("input").prop("checked")}var n=e(this),s=e.extend({},i,t),o=e.el.div({"class":"query"}),u=p(s);n.addClass("prolog-query-editor swish-event-receiver reactive-size"),n.append(o,e.el.div({"class":"prolog-prompt"},"?-"),e.el.div({"class":"query-buttons"},e.el.span({"class":"buttons-left"},a(s),f(s),l(s)),e.el.span({"class":"buttons-right"},u,c(s)))),e(o).append(n.children("textarea")).prologEditor({role:"query",sourceID:function(){return s.sourceID()},prologQuery:function(e){n.queryEditor("run",e,h())}}),n.data(r,s),e(o).prologEditor("getSource","query")||(typeof s.examples=="object"?s.examples[0]&&e(o).prologEditor("setSource",s.examples[0]):n[r]("setProgramEditor",e(s.editor),!0)),n.on("current-program",function(t,i){n[r]("setProgramEditor",e(i))}),n.on("program-loaded",function(t,r){if(e(s.editor).data("prologEditor")==e(r).data("prologEditor")){var i=s.examples();n.queryEditor("setQuery",i&&i[0]?i[0]:"")}})})},setProgramEditor:function(t,n){var i=this.data(r);if(i.editor==t[0]&&!n)return this;i.editor=t[0];if(i.editor){i.examples=function(){var n=t.prologEditor("getExamples")||[],r=t.parents(".swish").swish("examples",!0)||[];return e.isArray(r)&&n.concat(r),n},t.prologEditor("isPengineSource")?i.source=function(){var n=t.prologEditor("getSource","source"),r=e(".background.prolog.source").text();return r&&(n+="\n%@background@\n"+r),n}:i.source="",i.sourceID=function(){return t.prologEditor("getSourceID")};var s=i.examples();s&&s[0]&&this.queryEditor("isClean")?this.queryEditor("setQuery",s[0]):t.prologEditor("refreshHighlight")}else i.examples=""},getProgramEditor:function(){var t=this.data(r);return t.editor?e(t.editor):e()},setExamples:function(t,n){function i(e){var t;if((t=r.data("examples"))&&t.length==e.length){for(var n=0;n<t.length;n++)if(t[n]!=e[n])return!1;return!0}return!1}var r=this.find("ul.examples");t||(t=[]),n===undefined&&(n=!0);if(n&&i(t))return this;n===!0&&r.html("");for(var s=0;s<t.length;s++)r.append(e.el.li(e.el.a(t[s])));return r.data("examples",t.slice(0)),this},addHistory:function(t){function i(){return n.children().filter(function(){return e(this).text()==t})}var n=this.find("ul.history"),r=this.data("queryEditor");if(t){var s;(s=i())&&s.remove(),n.children().length>=r.maxHistoryLength&&n.children().first().remove(),n.append(e.el.li(e.el.a(t)))}return this},setQuery:function(e){var t=this.data(r);return t.cleanGen=this.find(".query").prologEditor("setSource",e).focus().prologEditor("changeGen"),this},isClean:function(){var e=this.data(r);return!this.queryEditor("getQuery")||e.cleanGen&&this.find(".query").prologEditor("isClean",e.cleanGen)},getQuery:function(){return this.find(".query").prologEditor("getSource","query")},run:function(t,n){var r=this.data("queryEditor");t===undefined&&(t=this.queryEditor("getQuery")),t=e.trim(t);if(!t)return e(".swish-event-receiver").trigger("help",{file:"query.html"}),this;e(".swish-event-receiver").trigger("clearMessages");var i={query:t,editor:r.editor,query_editor:this.find(".query")};return typeof r.source=="function"?i.source=r.source(t):typeof r.source=="string"&&(i.source=r.source),n&&(i.tabled=!0),this.queryEditor("addHistory",t),r.runner.prologRunners("run",i),this}};e.fn.queryEditor=function(t){if(s[t])return s[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return s._init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery."+r)}})(jQuery)}),define("term",["jquery"],function(){function e(){$(this).next().toggleClass("fold"),$(this).remove()}$(document).on("click",".pl-functor, .pl-infix",function(){var t=$(this).parent();$(t).toggleClass("fold"),$(t).before('<span class="pl-ellipsis">...</span>').prev().click(e)})}),!function(){function i(e){return e&&(e.ownerDocument||e.document||e).documentElement}function s(e){return e&&(e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView)}function p(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function d(e){return e===null?NaN:+e}function v(e){return!isNaN(e)}function m(e){return{left:function(t,n,r,i){arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);while(r<i){var s=r+i>>>1;e(t[s],n)<0?r=s+1:i=s}return r},right:function(t,n,r,i){arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);while(r<i){var s=r+i>>>1;e(t[s],n)>0?i=s:r=s+1}return r}}}function y(e){return e.length}function w(e){var t=1;while(e*t%1)t*=10;return t}function E(e,t){for(var n in t)Object.defineProperty(e.prototype,n,{value:t[n],enumerable:!1})}function S(){this._=Object.create(null)}function N(e){return(e+="")===x||e[0]===T?T+e:e}function C(e){return(e+="")[0]===T?e.slice(1):e}function k(e){return N(e)in this._}function L(e){return(e=N(e))in this._&&delete this._[e]}function A(){var e=[];for(var t in this._)e.push(C(t));return e}function O(){var e=0;for(var t in this._)++e;return e}function M(){for(var e in this._)return!1;return!0}function _(){this._=Object.create(null)}function D(e){return e}function P(e,t,n){return function(){var r=n.apply(t,arguments);return r===t?e:r}}function H(e,t){if(t in e)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var n=0,r=B.length;n<r;++n){var i=B[n]+t;if(i in e)return i}}function j(){}function F(){}function I(e){function r(){var n=t,r=-1,i=n.length,s;while(++r<i)(s=n[r].on)&&s.apply(this,arguments);return e}var t=[],n=new S;return r.on=function(r,i){var s=n.get(r),o;return arguments.length<2?s&&s.on:(s&&(s.on=null,t=t.slice(0,o=t.indexOf(s)).concat(t.slice(o+1)),n.remove(r)),i&&t.push(n.set(r,{on:i})),e)},r}function q(){e.event.preventDefault()}function R(){var t=e.event,n;while(n=t.sourceEvent)t=n;return t}function U(t){var n=new F,r=0,i=arguments.length;while(++r<i)n[arguments[r]]=I(n);return n.of=function(r,i){return function(s){try{var o=s.sourceEvent=e.event;s.target=t,e.event=s,n[s.type].apply(r,i)}finally{e.event=o}}},n}function X(e){return W(e,K),e}function Q(e){return typeof e=="function"?e:function(){return V(e,this)}}function G(e){return typeof e=="function"?e:function(){return $(e,this)}}function et(t,n){function r(){this.removeAttribute(t)}function i(){this.removeAttributeNS(t.space,t.local)}function s(){this.setAttribute(t,n)}function o(){this.setAttributeNS(t.space,t.local,n)}function u(){var e=n.apply(this,arguments);e==null?this.removeAttribute(t):this.setAttribute(t,e)}function a(){var e=n.apply(this,arguments);e==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}return t=e.ns.qualify(t),n==null?t.local?i:r:typeof n=="function"?t.local?a:u:t.local?o:s}function tt(e){return e.trim().replace(/\s+/g," ")}function nt(t){return new RegExp("(?:^|\\s+)"+e.requote(t)+"(?:\\s+|$)","g")}function rt(e){return(e+"").trim().split(/^|\s+/)}function it(e,t){function r(){var r=-1;while(++r<n)e[r](this,t)}function i(){var r=-1,i=t.apply(this,arguments);while(++r<n)e[r](this,i)}e=rt(e).map(st);var n=e.length;return typeof t=="function"?i:r}function st(e){var t=nt(e);return function(n,r){if(i=n.classList)return r?i.add(e):i.remove(e);var i=n.getAttribute("class")||"";r?(t.lastIndex=0,t.test(i)||n.setAttribute("class",tt(i+" "+e))):n.setAttribute("class",tt(i.replace(t," ")))}}function ot(e,t,n){function r(){this.style.removeProperty(e)}function i(){this.style.setProperty(e,t,n)}function s(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}return t==null?r:typeof t=="function"?s:i}function ut(e,t){function n(){delete this[e]}function r(){this[e]=t}function i(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}return t==null?n:typeof t=="function"?i:r}function at(t){function n(){var e=this.ownerDocument,n=this.namespaceURI;return n===Y&&e.documentElement.namespaceURI===Y?e.createElement(t):e.createElementNS(n,t)}function r(){return this.ownerDocument.createElementNS(t.space,t.local)}return typeof t=="function"?t:(t=e.ns.qualify(t)).local?r:n}function ft(){var e=this.parentNode;e&&e.removeChild(this)}function lt(e){return{__data__:e}}function ct(e){return function(){return J(this,e)}}function ht(e){return arguments.length||(e=p),function(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}}function pt(e,t){for(var n=0,r=e.length;n<r;n++)for(var i=e[n],s=0,o=i.length,u;s<o;s++)(u=i[s])&&t(u,s,n);return e}function dt(e){return W(e,vt),e}function mt(e){var t,n;return function(r,i,s){var o=e[s].update,u=o.length,a;s!=n&&(n=s,t=0),i>=t&&(t=i+1);while(!(a=o[t])&&++t<u);return a}}function gt(t,r,i){function f(){var e=this[s];e&&(this.removeEventListener(t,e,e.$),delete this[s])}function l(){var e=u(r,n(arguments));f.call(this),this.addEventListener(t,this[s]=e,e.$=i),e._=r}function c(){var n=new RegExp("^__on([^.]+)"+e.requote(t)+"$"),r;for(var i in this)if(r=i.match(n)){var s=this[i];this.removeEventListener(r[1],s,s.$),delete this[i]}}var s="__on"+t,o=t.indexOf("."),u=bt;o>0&&(t=t.slice(0,o));var a=yt.get(t);return a&&(t=a,u=wt),o?r?l:f:r?j:c}function bt(t,n){return function(r){var i=e.event;e.event=r,n[0]=this.__data__;try{t.apply(this,n)}finally{e.event=i}}}function wt(e,t){var n=bt(e,t);return function(e){var t=this,r=e.relatedTarget;(!r||r!==t&&!(r.compareDocumentPosition(t)&8))&&n.call(t,e)}}function xt(t){var n=".dragsuppress-"+ ++St,r="click"+n,o=e.select(s(t)).on("touchmove"+n,q).on("dragstart"+n,q).on("selectstart"+n,q);Et==null&&(Et="onselectstart"in t?!1:H(t.style,"userSelect"));if(Et){var u=i(t).style,a=u[Et];u[Et]="none"}return function(e){o.on(n,null),Et&&(u[Et]=a);if(e){var t=function(){o.on(r,null)};o.on(r,function(){q(),t()},!0),setTimeout(t,0)}}}function Nt(t,n){n.changedTouches&&(n=n.changedTouches[0]);var r=t.ownerSVGElement||t;if(r.createSVGPoint){var i=r.createSVGPoint();if(Tt<0){var o=s(t);if(o.scrollX||o.scrollY){r=e.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var u=r[0][0].getScreenCTM();Tt=!u.f&&!u.e,r.remove()}}return Tt?(i.x=n.pageX,i.y=n.pageY):(i.x=n.clientX,i.y=n.clientY),i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}var a=t.getBoundingClientRect();return[n.clientX-a.left-t.clientLeft,n.clientY-a.top-t.clientTop]}function Ct(){return e.event.changedTouches[0].identifier}function Ht(e){return e>0?1:e<0?-1:0}function Bt(e,t,n){return(t[0]-e[0])*(n[1]-e[1])-(t[1]-e[1])*(n[0]-e[0])}function jt(e){return e>1?0:e<-1?At:Math.acos(e)}function Ft(e){return e>1?_t:e<-1?-_t:Math.asin(e)}function It(e){return((e=Math.exp(e))-1/e)/2}function qt(e){return((e=Math.exp(e))+1/e)/2}function Rt(e){return((e=Math.exp(2*e))-1)/(e+1)}function Ut(e){return(e=Math.sin(e/2))*e}function Kt(){}function Qt(e,t,n){return this instanceof Qt?void (this.h=+e,this.s=+t,this.l=+n):arguments.length<2?e instanceof Qt?new Qt(e.h,e.s,e.l):bn(""+e,wn,Qt):new Qt(e,t,n)}function Yt(e,t,n){function s(e){return e>360?e-=360:e<0&&(e+=360),e<60?r+(i-r)*e/60:e<180?i:e<240?r+(i-r)*(240-e)/60:r}function o(e){return Math.round(s(e)*255)}var r,i;return e=isNaN(e)?0:(e%=360)<0?e+360:e,t=isNaN(t)?0:t<0?0:t>1?1:t,n=n<0?0:n>1?1:n,i=n<=.5?n*(1+t):n+t-n*t,r=2*n-i,new dn(o(e+120),o(e),o(e-120))}function Zt(t,n,r){return this instanceof Zt?void (this.h=+t,this.c=+n,this.l=+r):arguments.length<2?t instanceof Zt?new Zt(t.h,t.c,t.l):t instanceof nn?ln(t.l,t.a,t.b):ln((t=En((t=e.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new Zt(t,n,r)}function tn(e,t,n){return isNaN(e)&&(e=0),isNaN(t)&&(t=0),new nn(n,Math.cos(e*=Dt)*t,Math.sin(e)*t)}function nn(e,t,n){return this instanceof nn?void (this.l=+e,this.a=+t,this.b=+n):arguments.length<2?e instanceof nn?new nn(e.l,e.a,e.b):e instanceof Zt?tn(e.h,e.c,e.l):En((e=dn(e)).r,e.g,e.b):new nn(e,t,n)}function fn(e,t,n){var r=(e+16)/116,i=r+t/500,s=r-n/200;return i=cn(i)*sn,r=cn(r)*on,s=cn(s)*un,new dn(pn(3.2404542*i-1.5371385*r-.4985314*s),pn(-0.969266*i+1.8760108*r+.041556*s),pn(.0556434*i-.2040259*r+1.0572252*s))}function ln(e,t,n){return e>0?new Zt(Math.atan2(n,t)*Pt,Math.sqrt(t*t+n*n),e):new Zt(NaN,NaN,e)}function cn(e){return e>.206893034?e*e*e:(e-4/29)/7.787037}function hn(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29}function pn(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))}function dn(e,t,n){return this instanceof dn?void (this.r=~~e,this.g=~~t,this.b=~~n):arguments.length<2?e instanceof dn?new dn(e.r,e.g,e.b):bn(""+e,dn,Yt):new dn(e,t,n)}function vn(e){return new dn(e>>16,e>>8&255,e&255)}function mn(e){return vn(e)+""}function yn(e){return e<16?"0"+Math.max(0,e).toString(16):Math.min(255,e).toString(16)}function bn(e,t,n){var r=0,i=0,s=0,o,u,a;o=/([a-z]+)\((.*)\)/.exec(e=e.toLowerCase());if(o){u=o[2].split(",");switch(o[1]){case"hsl":return n(parseFloat(u[0]),parseFloat(u[1])/100,parseFloat(u[2])/100);case"rgb":return t(xn(u[0]),xn(u[1]),xn(u[2]))}}return(a=Tn.get(e))?t(a.r,a.g,a.b):(e!=null&&e.charAt(0)==="#"&&!isNaN(a=parseInt(e.slice(1),16))&&(e.length===4?(r=(a&3840)>>4,r=r>>4|r,i=a&240,i=i>>4|i,s=a&15,s=s<<4|s):e.length===7&&(r=(a&16711680)>>16,i=(a&65280)>>8,s=a&255)),t(r,i,s))}function wn(e,t,n){var r=Math.min(e/=255,t/=255,n/=255),i=Math.max(e,t,n),s=i-r,o,u,a=(i+r)/2;return s?(u=a<.5?s/(i+r):s/(2-i-r),e==i?o=(t-n)/s+(t<n?6:0):t==i?o=(n-e)/s+2:o=(e-t)/s+4,o*=60):(o=NaN,u=a>0&&a<1?0:o),new Qt(o,u,a)}function En(e,t,n){e=Sn(e),t=Sn(t),n=Sn(n);var r=hn((.4124564*e+.3575761*t+.1804375*n)/sn),i=hn((.2126729*e+.7151522*t+.072175*n)/on),s=hn((.0193339*e+.119192*t+.9503041*n)/un);return nn(116*i-16,500*(r-i),200*(i-s))}function Sn(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function xn(e){var t=parseFloat(e);return e.charAt(e.length-1)==="%"?Math.round(t*2.55):t}function Nn(e){return typeof e=="function"?e:function(){return e}}function Cn(e){return function(t,n,r){return arguments.length===2&&typeof n=="function"&&(r=n,n=null),kn(t,n,e,r)}}function kn(t,r,i,s){function c(){var e=f.status,t;if(!e&&An(f)||e>=200&&e<300||e===304){try{t=i.call(o,f)}catch(n){u.error.call(o,n);return}u.load.call(o,t)}else u.error.call(o,f)}var o={},u=e.dispatch("beforesend","progress","load","error"),a={},f=new XMLHttpRequest,l=null;return this.XDomainRequest&&!("withCredentials"in f)&&/^(http(s)?:)?\/\//.test(t)&&(f=new XDomainRequest),"onload"in f?f.onload=f.onerror=c:f.onreadystatechange=function(){f.readyState>3&&c()},f.onprogress=function(t){var n=e.event;e.event=t;try{u.progress.call(o,f)}finally{e.event=n}},o.header=function(e,t){return e=(e+"").toLowerCase(),arguments.length<2?a[e]:(t==null?delete a[e]:a[e]=t+"",o)},o.mimeType=function(e){return arguments.length?(r=e==null?null:e+"",o):r},o.responseType=function(e){return arguments.length?(l=e,o):l},o.response=function(e){return i=e,o},["get","post"].forEach(function(e){o[e]=function(){return o.send.apply(o,[e].concat(n(arguments)))}}),o.send=function(e,n,i){arguments.length===2&&typeof n=="function"&&(i=n,n=null),f.open(e,t,!0),r!=null&&!("accept"in a)&&(a.accept=r+",*/*");if(f.setRequestHeader)for(var s in a)f.setRequestHeader(s,a[s]);return r!=null&&f.overrideMimeType&&f.overrideMimeType(r),l!=null&&(f.responseType=l),i!=null&&o.on("error",i).on("load",function(e){i(null,e)}),u.beforesend.call(o,f),f.send(n==null?null:n),o},o.abort=function(){return f.abort(),o},e.rebind(o,u,"on"),s==null?o:o.get(Ln(s))}function Ln(e){return e.length===1?function(t,n){e(t==null?n:null)}:e}function An(e){var t=e.responseType;return t&&t!=="text"?e.response:e.responseText}function Hn(e,t,n){var r=arguments.length;r<2&&(t=0),r<3&&(n=Date.now());var i=n+t,s={c:e,t:i,n:null};return Mn?Mn.n=s:On=s,Mn=s,_n||(Dn=clearTimeout(Dn),_n=1,Pn(Bn)),s}function Bn(){var e=jn(),t=Fn()-e;t>24?(isFinite(t)&&(clearTimeout(Dn),Dn=setTimeout(Bn,t)),_n=0):(_n=1,Pn(Bn))}function jn(){var e=Date.now(),t=On;while(t)e>=t.t&&t.c(e-t.t)&&(t.c=null),t=t.n;return e}function Fn(){var e,t=On,n=Infinity;while(t)t.c?(t.t<n&&(n=t.t),t=(e=t).n):t=e?e.n=t.n:On=t.n;return Mn=e,n}function In(e,t){return t-(e?Math.ceil(Math.log(e)/Math.LN10):1)}function Rn(e,t){var n=Math.pow(10,b(8-t)*3);return{scale:t>8?function(e){return e/n}:function(e){return e*n},symbol:e}}function Un(t){var n=t.decimal,r=t.thousands,i=t.grouping,s=t.currency,o=i&&r?function(e,t){var n=e.length,s=[],o=0,u=i[0],a=0;while(n>0&&u>0){a+u+1>t&&(u=Math.max(1,t-a)),s.push(e.substring(n-=u,n+u));if((a+=u+1)>t)break;u=i[o=(o+1)%i.length]}return s.reverse().join(r)}:D;return function(t){var r=zn.exec(t),i=r[1]||" ",u=r[2]||">",a=r[3]||"-",f=r[4]||"",l=r[5],c=+r[6],h=r[7],p=r[8],d=r[9],v=1,m="",g="",y=!1,b=!0;p&&(p=+p.substring(1));if(l||i==="0"&&u==="=")l=i="0",u="=";switch(d){case"n":h=!0,d="g";break;case"%":v=100,g="%",d="f";break;case"p":v=100,g="%",d="r";break;case"b":case"o":case"x":case"X":f==="#"&&(m="0"+d.toLowerCase());case"c":b=!1;case"d":y=!0,p=0;break;case"s":v=-1,d="r"}f==="$"&&(m=s[0],g=s[1]),d=="r"&&!p&&(d="g");if(p!=null)if(d=="g")p=Math.max(1,Math.min(21,p));else if(d=="e"||d=="f")p=Math.max(0,Math.min(20,p));d=Wn.get(d)||Xn;var w=l&&h;return function(t){var r=g;if(y&&t%1)return"";var s=t<0||t===0&&1/t<0?(t=-t,"-"):a==="-"?"":a;if(v<0){var f=e.formatPrefix(t,p);t=f.scale(t),r=f.symbol+g}else t*=v;t=d(t,p);var E=t.lastIndexOf("."),S,x;if(E<0){var T=b?t.lastIndexOf("e"):-1;T<0?(S=t,x=""):(S=t.substring(0,T),x=t.substring(T))}else S=t.substring(0,E),x=n+t.substring(E+1);!l&&h&&(S=o(S,Infinity));var N=m.length+S.length+x.length+(w?0:s.length),C=N<c?(new Array(N=c-N+1)).join(i):"";return w&&(S=o(C+S,C.length?c-x.length:Infinity)),s+=m,t=S+x,(u==="<"?s+t+C:u===">"?C+s+t:u==="^"?C.substring(0,N>>=1)+s+t+C.substring(N):s+(w?t:C+t))+r}}}function Xn(e){return e+""}function Jn(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Qn(e,t,n){function r(t){var n=e(t),r=s(n,1);return t-n<r-t?n:r}function i(n){return t(n=e(new $n(n-1)),1),n}function s(e,n){return t(e=new $n(+e),n),e}function o(e,r,s){var o=i(e),u=[];if(s>1)while(o<r)n(o)%s||u.push(new Date(+o)),t(o,1);else while(o<r)u.push(new Date(+o)),t(o,1);return u}function u(e,t,n){try{$n=Jn;var r=new Jn;return r._=e,o(r,t,n)}finally{$n=Date}}e.floor=e,e.round=r,e.ceil=i,e.offset=s,e.range=o;var a=e.utc=Gn(e);return a.floor=a,a.round=Gn(r),a.ceil=Gn(i),a.offset=Gn(s),a.range=u,e}function Gn(e){return function(t,n){try{$n=Jn;var r=new Jn;return r._=t,e(r,n)._}finally{$n=Date}}}function Yn(t){function l(e){function n(n){var r=[],i=-1,s=0,o,u,a;while(++i<t)if(e.charCodeAt(i)===37){r.push(e.slice(s,i)),(u=Zn[o=e.charAt(++i)])!=null&&(o=e.charAt(++i));if(a=E[o])o=a(n,u==null?o==="e"?" ":"0":u);r.push(o),s=i+1}return r.push(e.slice(s,i)),r.join("")}var t=e.length;return n.parse=function(t){var n={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},r=c(n,e,t,0);if(r!=t.length)return null;"p"in n&&(n.H=n.H%12+n.p*12);var i=n.Z!=null&&$n!==Jn,s=new(i?Jn:$n);return"j"in n?s.setFullYear(n.y,0,n.j):"W"in n||"U"in n?("w"in n||(n.w="W"in n?1:0),s.setFullYear(n.y,0,1),s.setFullYear(n.y,0,"W"in n?(n.w+6)%7+n.W*7-(s.getDay()+5)%7:n.w+n.U*7-(s.getDay()+6)%7)):s.setFullYear(n.y,n.m,n.d),s.setHours(n.H+(n.Z/100|0),n.M+n.Z%100,n.S,n.L),i?s._:s},n.toString=function(){return e},n}function c(e,t,n,r){var i,s,o,u=0,a=t.length,f=n.length;while(u<a){if(r>=f)return-1;i=t.charCodeAt(u++);if(i===37){o=t.charAt(u++),s=S[o in Zn?t.charAt(u++):o];if(!s||(r=s(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}function x(e,t,n){v.lastIndex=0;var r=v.exec(t.slice(n));return r?(e.w=m.get(r[0].toLowerCase()),n+r[0].length):-1}function T(e,t,n){p.lastIndex=0;var r=p.exec(t.slice(n));return r?(e.w=d.get(r[0].toLowerCase()),n+r[0].length):-1}function N(e,t,n){b.lastIndex=0;var r=b.exec(t.slice(n));return r?(e.m=w.get(r[0].toLowerCase()),n+r[0].length):-1}function C(e,t,n){g.lastIndex=0;var r=g.exec(t.slice(n));return r?(e.m=y.get(r[0].toLowerCase()),n+r[0].length):-1}function k(e,t,n){return c(e,E.c.toString(),t,n)}function L(e,t,n){return c(e,E.x.toString(),t,n)}function A(e,t,n){return c(e,E.X.toString(),t,n)}function O(e,t,n){var r=h.get(t.slice(n,n+=2).toLowerCase());return r==null?-1:(e.p=r,n)}var n=t.dateTime,r=t.date,i=t.time,s=t.periods,o=t.days,u=t.shortDays,a=t.months,f=t.shortMonths;l.utc=function(e){function n(e){try{$n=Jn;var n=new $n;return n._=e,t(n)}finally{$n=Date}}var t=l(e);return n.parse=function(e){try{$n=Jn;var n=t.parse(e);return n&&n._}finally{$n=Date}},n.toString=t.toString,n},l.multi=l.utc.multi=Er;var h=e.map(),p=rr(o),d=ir(o),v=rr(u),m=ir(u),g=rr(a),y=ir(a),b=rr(f),w=ir(f);s.forEach(function(e,t){h.set(e.toLowerCase(),t)});var E={a:function(e){return u[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return f[e.getMonth()]},B:function(e){return a[e.getMonth()]},c:l(n),d:function(e,t){return nr(e.getDate(),t,2)},e:function(e,t){return nr(e.getDate(),t,2)},H:function(e,t){return nr(e.getHours(),t,2)},I:function(e,t){return nr(e.getHours()%12||12,t,2)},j:function(e,t){return nr(1+Vn.dayOfYear(e),t,3)},L:function(e,t){return nr(e.getMilliseconds(),t,3)},m:function(e,t){return nr(e.getMonth()+1,t,2)},M:function(e,t){return nr(e.getMinutes(),t,2)},p:function(e){return s[+(e.getHours()>=12)]},S:function(e,t){return nr(e.getSeconds(),t,2)},U:function(e,t){return nr(Vn.sundayOfYear(e),t,2)},w:function(e){return e.getDay()},W:function(e,t){return nr(Vn.mondayOfYear(e),t,2)},x:l(r),X:l(i),y:function(e,t){return nr(e.getFullYear()%100,t,2)},Y:function(e,t){return nr(e.getFullYear()%1e4,t,4)},Z:br,"%":function(){return"%"}},S={a:x,A:T,b:N,B:C,c:k,d:pr,e:pr,H:vr,I:vr,j:dr,L:yr,m:hr,M:mr,p:O,S:gr,U:or,w:sr,W:ur,x:L,X:A,y:fr,Y:ar,Z:lr,"%":wr};return l}function nr(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",s=i.length;return r+(s<n?(new Array(n-s+1)).join(t)+i:i)}function rr(t){return new RegExp("^(?:"+t.map(e.requote).join("|")+")","i")}function ir(e){var t=new S,n=-1,r=e.length;while(++n<r)t.set(e[n].toLowerCase(),n);return t}function sr(e,t,n){er.lastIndex=0;var r=er.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function or(e,t,n){er.lastIndex=0;var r=er.exec(t.slice(n));return r?(e.U=+r[0],n+r[0].length):-1}function ur(e,t,n){er.lastIndex=0;var r=er.exec(t.slice(n));return r?(e.W=+r[0],n+r[0].length):-1}function ar(e,t,n){er.lastIndex=0;var r=er.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function fr(e,t,n){er.lastIndex=0;var r=er.exec(t.slice(n,n+2));return r?(e.y=cr(+r[0]),n+r[0].length):-1}function lr(e,t,n){return/^[+-]\d{4}$/.test(t=t.slice(n,n+5))?(e.Z=-t,n+5):-1}function cr(e){return e+(e>68?1900:2e3)}function hr(e,t,n){er.lastIndex=0;var r=er.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function pr(e,t,n){er.lastIndex=0;var r=er.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function dr(e,t,n){er.lastIndex=0;var r=er.exec(t.slice(n,n+3));return r?(e.j=+r[0],n+r[0].length):-1}function vr(e,t,n){er.lastIndex=0;var r=er.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function mr(e,t,n){er.lastIndex=0;var r=er.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function gr(e,t,n){er.lastIndex=0;var r=er.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function yr(e,t,n){er.lastIndex=0;var r=er.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function br(e){var t=e.getTimezoneOffset(),n=t>0?"-":"+",r=b(t)/60|0,i=b(t)%60;return n+nr(r,"0",2)+nr(i,"0",2)}function wr(e,t,n){tr.lastIndex=0;var r=tr.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Er(e){var t=e.length,n=-1;while(++n<t)e[n][0]=this(e[n][0]);return function(t){var n=0,r=e[n];while(!r[1](t))r=e[++n];return r[0](t)}}function xr(){}function Nr(e,t,n){var r=n.s=e+t,i=r-e,s=r-i;n.t=e-s+(t-i)}function Cr(e,t){e&&Lr.hasOwnProperty(e.type)&&Lr[e.type](e,t)}function Ar(e,t,n){var r=-1,i=e.length-n,s;t.lineStart();while(++r<i)s=e[r],t.point(s[0],s[1],s[2]);t.lineEnd()}function Or(e,t){var n=-1,r=e.length;t.polygonStart();while(++n<r)Ar(e[n],t,1);t.polygonEnd()}function Pr(){function s(e,t){e*=Dt,t=t*Dt/2+At/4;var s=e-n,o=s>=0?1:-1,u=o*s,a=Math.cos(t),f=Math.sin(t),l=i*f,c=r*a+l*Math.cos(u),h=l*o*Math.sin(u);_r.add(Math.atan2(h,c)),n=e,r=a,i=f}var e,t,n,r,i;Dr.point=function(o,u){Dr.point=s,n=(e=o)*Dt,r=Math.cos(u=(t=u)*Dt/2+At/4),i=Math.sin(u)},Dr.lineEnd=function(){s(e,t)}}function Hr(e){var t=e[0],n=e[1],r=Math.cos(n);return[r*Math.cos(t),r*Math.sin(t),Math.sin(n)]}function Br(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function jr(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function Fr(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Ir(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function qr(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function Rr(e){return[Math.atan2(e[1],e[0]),Ft(e[2])]}function Ur(e,t){return b(e[0]-t[0])<kt&&b(e[1]-t[1])<kt}function ti(e,t){e*=Dt;var n=Math.cos(t*=Dt);ni(n*Math.cos(e),n*Math.sin(e),Math.sin(t))}function ni(e,t,n){++zr,Xr+=(e-Xr)/zr,Vr+=(t-Vr)/zr,$r+=(n-$r)/zr}function ri(){function r(r,i){r*=Dt;var s=Math.cos(i*=Dt),o=s*Math.cos(r),u=s*Math.sin(r),a=Math.sin(i),f=Math.atan2(Math.sqrt((f=t*a-n*u)*f+(f=n*o-e*a)*f+(f=e*u-t*o)*f),e*o+t*u+n*a);Wr+=f,Jr+=f*(e+(e=o)),Kr+=f*(t+(t=u)),Qr+=f*(n+(n=a)),ni(e,t,n)}var e,t,n;ei.point=function(i,s){i*=Dt;var o=Math.cos(s*=Dt);e=o*Math.cos(i),t=o*Math.sin(i),n=Math.sin(s),ei.point=r,ni(e,t,n)}}function ii(){ei.point=ti}function si(){function s(e,t){e*=Dt;var s=Math.cos(t*=Dt),o=s*Math.cos(e),u=s*Math.sin(e),a=Math.sin(t),f=r*a-i*u,l=i*o-n*a,c=n*u-r*o,h=Math.sqrt(f*f+l*l+c*c),p=n*o+r*u+i*a,d=h&&-jt(p)/h,v=Math.atan2(h,p);Gr+=d*f,Yr+=d*l,Zr+=d*c,Wr+=v,Jr+=v*(n+(n=o)),Kr+=v*(r+(r=u)),Qr+=v*(i+(i=a)),ni(n,r,i)}var e,t,n,r,i;ei.point=function(o,u){e=o,t=u,ei.point=s,o*=Dt;var a=Math.cos(u*=Dt);n=a*Math.cos(o),r=a*Math.sin(o),i=Math.sin(u),ni(n,r,i)},ei.lineEnd=function(){s(e,t),ei.lineEnd=ii,ei.point=ti}}function oi(e,t){function n(n,r){return n=e(n,r),t(n[0],n[1])}return e.invert&&t.invert&&(n.invert=function(n,r){return n=t.invert(n,r),n&&e.invert(n[0],n[1])}),n}function ui(){return!0}function ai(e,t,n,r,i){var s=[],o=[];e.forEach(function(e){if((t=e.length-1)<=0)return;var t,n=e[0],r=e[t];if(Ur(n,r)){i.lineStart();for(var u=0;u<t;++u)i.point((n=e[u])[0],n[1]);i.lineEnd();return}var a=new li(n,e,null,!0),f=new li(n,null,a,!1);a.o=f,s.push(a),o.push(f),a=new li(r,e,null,!1),f=new li(r,null,a,!0),a.o=f,s.push(a),o.push(f)}),o.sort(t),fi(s),fi(o);if(!s.length)return;for(var u=0,a=n,f=o.length;u<f;++u)o[u].e=a=!a;var l=s[0],c,h;for(;;){var p=l,d=!0;while(p.v)if((p=p.n)===l)return;c=p.z,i.lineStart();do{p.v=p.o.v=!0;if(p.e){if(d)for(var u=0,f=c.length;u<f;++u)i.point((h=c[u])[0],h[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((h=c[u])[0],h[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 fi(e){if(!(t=e.length))return;var t,n=0,r=e[0],i;while(++n<t)r.n=i=e[n],i.p=r,r=i;r.n=i=e[0],i.p=r}function li(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function ci(t,n,r,i){return function(s,o){function l(e,n){var r=s(e,n);t(e=r[0],n=r[1])&&o.point(e,n)}function c(e,t){var n=s(e,t);u.point(n[0],n[1])}function h(){f.point=c,u.lineStart()}function p(){f.point=l,u.lineEnd()}function w(e,t){b.push([e,t]);var n=s(e,t);m.point(n[0],n[1])}function E(){m.lineStart(),b=[]}function S(){w(b[0][0],b[0][1]),m.lineEnd();var e=m.clean(),t=v.buffer(),n,r=t.length;b.pop(),y.push(b),b=null;if(!r)return;if(e&1){n=t[0];var r=n.length-1,i=-1,s;if(r>0){g||(o.polygonStart(),g=!0),o.lineStart();while(++i<r)o.point((s=n[i])[0],s[1]);o.lineEnd()}return}r>1&&e&2&&t.push(t.pop().concat(t.shift())),d.push(t.filter(hi))}var u=n(o),a=s.invert(i[0],i[1]),f={point:l,lineStart:h,lineEnd:p,polygonStart:function(){f.point=w,f.lineStart=E,f.lineEnd=S,d=[],y=[]},polygonEnd:function(){f.point=l,f.lineStart=h,f.lineEnd=p,d=e.merge(d);var t=bi(a,y);d.length?(g||(o.polygonStart(),g=!0),ai(d,di,t,r,o)):t&&(g||(o.polygonStart(),g=!0),o.lineStart(),r(null,null,1,o),o.lineEnd()),g&&(o.polygonEnd(),g=!1),d=y=null},sphere:function(){o.polygonStart(),o.lineStart(),r(null,null,1,o),o.lineEnd(),o.polygonEnd()}},d,v=pi(),m=n(v),g=!1,y,b;return f}}function hi(e){return e.length>1}function pi(){var e=[],t;return{lineStart:function(){e.push(t=[])},point:function(e,n){t.push([e,n])},lineEnd:j,buffer:function(){var n=e;return e=[],t=null,n},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function di(e,t){return((e=e.x)[0]<0?e[1]-_t-kt:_t-e[1])-((t=t.x)[0]<0?t[1]-_t-kt:_t-t[1])}function mi(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(s,o){var u=s>0?At:-At,a=b(s-t);b(a-At)<kt?(e.point(t,n=(n+o)/2>0?_t:-_t),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(u,n),e.point(s,n),i=0):r!==u&&a>=At&&(b(t-r)<kt&&(t-=r*kt),b(s-u)<kt&&(s-=u*kt),n=gi(t,n,s,o),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(u,n),i=0),e.point(t=s,n=o),r=u},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}}function gi(e,t,n,r){var i,s,o=Math.sin(e-n);return b(o)>kt?Math.atan((Math.sin(t)*(s=Math.cos(r))*Math.sin(n)-Math.sin(r)*(i=Math.cos(t))*Math.sin(e))/(i*s*o)):(t+r)/2}function yi(e,t,n,r){var i;if(e==null)i=n*_t,r.point(-At,i),r.point(0,i),r.point(At,i),r.point(At,0),r.point(At,-i),r.point(0,-i),r.point(-At,-i),r.point(-At,0),r.point(-At,i);else if(b(e[0]-t[0])>kt){var s=e[0]<t[0]?At:-At;i=n*s/2,r.point(-s,i),r.point(0,i),r.point(s,i)}else r.point(t[0],t[1])}function bi(e,t){var n=e[0],r=e[1],i=[Math.sin(n),-Math.cos(n),0],s=0,o=0;_r.reset();for(var u=0,a=t.length;u<a;++u){var f=t[u],l=f.length;if(!l)continue;var c=f[0],h=c[0],p=c[1]/2+At/4,d=Math.sin(p),v=Math.cos(p),m=1;for(;;){m===l&&(m=0),e=f[m];var g=e[0],y=e[1]/2+At/4,b=Math.sin(y),w=Math.cos(y),E=g-h,S=E>=0?1:-1,x=S*E,T=x>At,N=d*b;_r.add(Math.atan2(N*S*Math.sin(x),v*w+N*Math.cos(x))),s+=T?E+S*Ot:E;if(T^h>=n^g>=n){var C=jr(Hr(c),Hr(e));qr(C);var k=jr(i,C);qr(k);var L=(T^E>=0?-1:1)*Ft(k[2]);if(r>L||r===L&&(C[0]||C[1]))o+=T^E>=0?1:-1}if(!(m++))break;h=g,d=b,v=w,c=e}}return(s<-kt||s<kt&&_r<-kt)^o&1}function wi(e){function s(e,n){return Math.cos(e)*Math.cos(n)>t}function o(e){var t,i,o,f,l;return{lineStart:function(){f=o=!1,l=1},point:function(c,h){var p=[c,h],d,v=s(c,h),m=n?v?0:a(c,h):v?a(c+(c<0?At:-At),h):0;!t&&(f=o=v)&&e.lineStart();if(v!==o){d=u(t,p);if(Ur(t,d)||Ur(p,d))p[0]+=kt,p[1]+=kt,v=s(p[0],p[1])}if(v!==o)l=0,v?(e.lineStart(),d=u(p,t),e.point(d[0],d[1])):(d=u(t,p),e.point(d[0],d[1]),e.lineEnd()),t=d;else if(r&&t&&n^v){var g;!(m&i)&&(g=u(p,t,!0))&&(l=0,n?(e.lineStart(),e.point(g[0][0],g[0][1]),e.point(g[1][0],g[1][1]),e.lineEnd()):(e.point(g[1][0],g[1][1]),e.lineEnd(),e.lineStart(),e.point(g[0][0],g[0][1])))}v&&(!t||!Ur(t,p))&&e.point(p[0],p[1]),t=p,o=v,i=m},lineEnd:function(){o&&e.lineEnd(),t=null},clean:function(){return l|(f&&o)<<1}}}function u(e,n,r){var i=Hr(e),s=Hr(n),o=[1,0,0],u=jr(i,s),a=Br(u,u),f=u[0],l=a-f*f;if(!l)return!r&&e;var c=t*a/l,h=-t*f/l,p=jr(o,u),d=Ir(o,c),v=Ir(u,h);Fr(d,v);var m=p,g=Br(d,m),y=Br(m,m),w=g*g-y*(Br(d,d)-1);if(w<0)return;var E=Math.sqrt(w),S=Ir(m,(-g-E)/y);Fr(S,d),S=Rr(S);if(!r)return S;var x=e[0],T=n[0],N=e[1],C=n[1],k;T<x&&(k=x,x=T,T=k);var L=T-x,A=b(L-At)<kt,O=A||L<kt;!A&&C<N&&(k=N,N=C,C=k);if(O?A?N+C>0^S[1]<(b(S[0]-x)<kt?N:C):N<=S[1]&&S[1]<=C:L>At^(x<=S[0]&&S[0]<=T)){var M=Ir(m,(-g+E)/y);return Fr(M,d),[S,Rr(M)]}}function a(t,r){var i=n?e:At-e,s=0;return t<-i?s|=1:t>i&&(s|=2),r<-i?s|=4:r>i&&(s|=8),s}var t=Math.cos(e),n=t>0,r=b(t)>kt,i=rs(e,6*Dt);return ci(s,o,i,n?[0,-e]:[-At,e-At])}function Ei(e,t,n,r){return function(i){var s=i.a,o=i.b,u=s.x,a=s.y,f=o.x,l=o.y,c=0,h=1,p=f-u,d=l-a,v;v=e-u;if(!p&&v>0)return;v/=p;if(p<0){if(v<c)return;v<h&&(h=v)}else if(p>0){if(v>h)return;v>c&&(c=v)}v=n-u;if(!p&&v<0)return;v/=p;if(p<0){if(v>h)return;v>c&&(c=v)}else if(p>0){if(v<c)return;v<h&&(h=v)}v=t-a;if(!d&&v>0)return;v/=d;if(d<0){if(v<c)return;v<h&&(h=v)}else if(d>0){if(v>h)return;v>c&&(c=v)}v=r-a;if(!d&&v<0)return;v/=d;if(d<0){if(v>h)return;v>c&&(c=v)}else if(d>0){if(v<c)return;v<h&&(h=v)}return c>0&&(i.a={x:u+c*p,y:a+c*d}),h<1&&(i.b={x:u+h*p,y:a+h*d}),i}}function xi(t,n,r,i){function s(e,i){return b(e[0]-t)<kt?i>0?0:3:b(e[0]-r)<kt?i>0?2:1:b(e[1]-n)<kt?i>0?1:0:i>0?3:2}function o(e,t){return u(e.x,t.x)}function u(e,t){var n=s(e,1),r=s(t,1);return n!==r?n-r:n===0?t[1]-e[1]:n===1?e[0]-t[0]:n===2?e[1]-t[1]:t[0]-e[0]}return function(a){function m(e){var t=0,n=p.length,r=e[1];for(var i=0;i<n;++i)for(var s=1,o=p[i],u=o.length,a=o[0],f;s<u;++s)f=o[s],a[1]<=r?f[1]>r&&Bt(a,f,e)>0&&++t:f[1]<=r&&Bt(a,f,e)<0&&--t,a=f;return t!==0}function g(e,o,a,f){var l=0,c=0;if(e==null||(l=s(e,a))!==(c=s(o,a))||u(e,o)<0^a>0){do f.point(l===0||l===3?t:r,l>1?i:n);while((l=(l+a+4)%4)!==c)}else f.point(o[0],o[1])}function y(e,s){return t<=e&&e<=r&&n<=s&&s<=i}function b(e,t){y(e,t)&&a.point(e,t)}function L(){v.point=O,p&&p.push(d=[]),C=!0,N=!1,x=T=NaN}function A(){h&&(O(w,E),S&&N&&l.rejoin(),h.push(l.buffer())),v.point=b,N&&a.lineEnd()}function O(e,t){e=Math.max(-Si,Math.min(Si,e)),t=Math.max(-Si,Math.min(Si,t));var n=y(e,t);p&&d.push([e,t]);if(C)w=e,E=t,S=n,C=!1,n&&(a.lineStart(),a.point(e,t));else if(n&&N)a.point(e,t);else{var r={a:{x:x,y:T},b:{x:e,y:t}};c(r)?(N||(a.lineStart(),a.point(r.a.x,r.a.y)),a.point(r.b.x,r.b.y),n||a.lineEnd(),k=!1):n&&(a.lineStart(),a.point(e,t),k=!1)}x=e,T=t,N=n}var f=a,l=pi(),c=Ei(t,n,r,i),h,p,d,v={point:b,lineStart:L,lineEnd:A,polygonStart:function(){a=l,h=[],p=[],k=!0},polygonEnd:function(){a=f,h=e.merge(h);var n=m([t,i]),r=k&&n,s=h.length;if(r||s)a.polygonStart(),r&&(a.lineStart(),g(null,null,1,a),a.lineEnd()),s&&ai(h,o,n,g,a),a.polygonEnd();h=p=d=null}},w,E,S,x,T,N,C,k;return v}}function Ti(e){var t=0,n=At/3,r=Ki(e),i=r(t,n);return i.parallels=function(e){return arguments.length?r(t=e[0]*At/180,n=e[1]*At/180):[t/At*180,n/At*180]},i}function Ni(e,t){function o(e,t){var n=Math.sqrt(i-2*r*Math.sin(t))/r;return[n*Math.sin(e*=r),s-n*Math.cos(e)]}var n=Math.sin(e),r=(n+Math.sin(t))/2,i=1+n*(2*r-n),s=Math.sqrt(i)/r;return o.invert=function(e,t){var n=s-t;return[Math.atan2(e,n)/r,Ft((i-(e*e+n*n)*r*r)/(2*r))]},o}function Ai(){function i(e,t){ki+=r*e-n*t,n=e,r=t}var e,t,n,r;Li.point=function(s,o){Li.point=i,e=n=s,t=r=o},Li.lineEnd=function(){i(e,t)}}function Hi(e,t){e<Oi&&(Oi=e),e>_i&&(_i=e),t<Mi&&(Mi=t),t>Di&&(Di=t)}function Bi(){function r(n,r){t.push("M",n,",",r,e)}function i(e,r){t.push("M",e,",",r),n.point=s}function s(e,n){t.push("L",e,",",n)}function o(){n.point=r}function u(){t.push("Z")}var e=ji(4.5),t=[],n={point:r,lineStart:function(){n.point=i},lineEnd:o,polygonStart:function(){n.lineEnd=u},polygonEnd:function(){n.lineEnd=o,n.point=r},pointRadius:function(t){return e=ji(t),n},result:function(){if(t.length){var e=t.join("");return t=[],e}}};return n}function ji(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+ -2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}function Ii(e,t){Xr+=e,Vr+=t,++$r}function qi(){function n(n,r){var i=n-e,s=r-t,o=Math.sqrt(i*i+s*s);Jr+=o*(e+n)/2,Kr+=o*(t+r)/2,Qr+=o,Ii(e=n,t=r)}var e,t;Fi.point=function(r,i){Fi.point=n,Ii(e=r,t=i)}}function Ri(){Fi.point=Ii}function Ui(){function i(e,t){var i=e-n,s=t-r,o=Math.sqrt(i*i+s*s);Jr+=o*(n+e)/2,Kr+=o*(r+t)/2,Qr+=o,o=r*e-n*t,Gr+=o*(n+e),Yr+=o*(r+t),Zr+=o*3,Ii(n=e,r=t)}var e,t,n,r;Fi.point=function(s,o){Fi.point=i,Ii(e=n=s,t=r=o)},Fi.lineEnd=function(){i(e,t)}}function zi(e){function r(n,r){e.moveTo(n+t,r),e.arc(n,r,t,0,Ot)}function i(t,r){e.moveTo(t,r),n.point=s}function s(t,n){e.lineTo(t,n)}function o(){n.point=r}function u(){e.closePath()}var t=4.5,n={point:r,lineStart:function(){n.point=i},lineEnd:o,polygonStart:function(){n.lineEnd=u},polygonEnd:function(){n.lineEnd=o,n.point=r},pointRadius:function(e){return t=e,n},result:j};return n}function Wi(e){function i(e){return(r?o:s)(e)}function s(t){return $i(t,function(n,r){n=e(n,r),t.point(n[0],n[1])})}function o(t){function y(n,r){n=e(n,r),t.point(n[0],n[1])}function b(){h=NaN,g.point=w,t.lineStart()}function w(n,i){var s=Hr([n,i]),o=e(n,i);u(h,p,c,d,v,m,h=o[0],p=o[1],c=n,d=s[0],v=s[1],m=s[2],r,t),t.point(h,p)}function E(){g.point=y,t.lineEnd()}function S(){b(),g.point=x,g.lineEnd=T}function x(e,t){w(n=e,i=t),s=h,o=p,a=d,f=v,l=m,g.point=w}function T(){u(h,p,c,d,v,m,s,o,n,a,f,l,r,t),g.lineEnd=E,E()}var n,i,s,o,a,f,l,c,h,p,d,v,m,g={point:y,lineStart:b,lineEnd:E,polygonStart:function(){t.polygonStart(),g.lineStart=S},polygonEnd:function(){t.polygonEnd(),g.lineStart=b}};return g}function u(r,i,s,o,a,f,l,c,h,p,d,v,m,g){var y=l-r,w=c-i,E=y*y+w*w;if(E>4*t&&m--){var S=o+p,x=a+d,T=f+v,N=Math.sqrt(S*S+x*x+T*T),C=Math.asin(T/=N),k=b(b(T)-1)<kt||b(s-h)<kt?(s+h)/2:Math.atan2(x,S),L=e(k,C),A=L[0],O=L[1],M=A-r,_=O-i,D=w*M-y*_;if(D*D/E>t||b((y*M+w*_)/E-.5)>.3||o*p+a*d+f*v<n)u(r,i,s,o,a,f,A,O,k,S/=N,x/=N,T,m,g),g.point(A,O),u(A,O,k,S,x,T,l,c,h,p,d,v,m,g)}}var t=.5,n=Math.cos(30*Dt),r=16;return i.precision=function(e){return arguments.length?(r=(t=e*e)>0&&16,i):Math.sqrt(t)},i}function Xi(e){var t=Wi(function(t,n){return e([t*Pt,n*Pt])});return function(e){return Qi(t(e))}}function Vi(e){this.stream=e}function $i(e,t){return{point:t,sphere:function(){e.sphere()},lineStart:function(){e.lineStart()},lineEnd:function(){e.lineEnd()},polygonStart:function(){e.polygonStart()},polygonEnd:function(){e.polygonEnd()}}}function Ji(e){return Ki(function(){return e})()}function Ki(t){function E(e){return e=i(e[0]*Dt,e[1]*Dt),[e[0]*o+d,v-e[1]*o]}function S(e){return e=i.invert((e[0]-d)/o,(v-e[1])/o),e&&[e[0]*Pt,e[1]*Pt]}function x(){i=oi(r=Zi(c,h,p),n);var e=n(f,l);return d=u-e[0]*o,v=a+e[1]*o,T()}function T(){return w&&(w.valid=!1,w=null),E}var n,r,i,s=Wi(function(e,t){return e=n(e,t),[e[0]*o+d,v-e[1]*o]}),o=150,u=480,a=250,f=0,l=0,c=0,h=0,p=0,d,v,m=vi,g=D,y=null,b=null,w;return E.stream=function(e){return w&&(w.valid=!1),w=Qi(m(r,s(g(e)))),w.valid=!0,w},E.clipAngle=function(e){return arguments.length?(m=e==null?(y=e,vi):wi((y=+e)*Dt),T()):y},E.clipExtent=function(e){return arguments.length?(b=e,g=e?xi(e[0][0],e[0][1],e[1][0],e[1][1]):D,T()):b},E.scale=function(e){return arguments.length?(o=+e,x()):o},E.translate=function(e){return arguments.length?(u=+e[0],a=+e[1],x()):[u,a]},E.center=function(e){return arguments.length?(f=e[0]%360*Dt,l=e[1]%360*Dt,x()):[f*Pt,l*Pt]},E.rotate=function(e){return arguments.length?(c=e[0]%360*Dt,h=e[1]%360*Dt,p=e.length>2?e[2]%360*Dt:0,x()):[c*Pt,h*Pt,p*Pt]},e.rebind(E,s,"precision"),function(){return n=t.apply(this,arguments),E.invert=n.invert&&S,x()}}function Qi(e){return $i(e,function(t,n){e.point(t*Dt,n*Dt)})}function Gi(e,t){return[e,t]}function Yi(e,t){return[e>At?e-Ot:e<-At?e+Ot:e,t]}function Zi(e,t,n){return e?t||n?oi(ts(e),ns(t,n)):ts(e):t||n?ns(t,n):Yi}function es(e){return function(t,n){return t+=e,[t>At?t-Ot:t<-At?t+Ot:t,n]}}function ts(e){var t=es(e);return t.invert=es(-e),t}function ns(e,t){function o(e,t){var o=Math.cos(t),u=Math.cos(e)*o,a=Math.sin(e)*o,f=Math.sin(t),l=f*n+u*r;return[Math.atan2(a*i-l*s,u*n-f*r),Ft(l*i+a*s)]}var n=Math.cos(e),r=Math.sin(e),i=Math.cos(t),s=Math.sin(t);return o.invert=function(e,t){var o=Math.cos(t),u=Math.cos(e)*o,a=Math.sin(e)*o,f=Math.sin(t),l=f*i-a*s;return[Math.atan2(a*i+f*s,u*n+l*r),Ft(l*n-u*r)]},o}function rs(e,t){var n=Math.cos(e),r=Math.sin(e);return function(i,s,o,u){var a=o*t;if(i!=null){i=is(n,i),s=is(n,s);if(o>0?i<s:i>s)i+=o*Ot}else i=e+o*Ot,s=e-.5*a;for(var f,l=i;o>0?l>s:l<s;l-=a)u.point((f=Rr([n,-r*Math.cos(l),-r*Math.sin(l)]))[0],f[1])}}function is(e,t){var n=Hr(t);n[0]-=e,qr(n);var r=jt(-n[1]);return((-n[2]<0?-r:r)+2*Math.PI-kt)%(2*Math.PI)}function ss(t,n,r){var i=e.range(t,n-kt,r).concat(n);return function(e){return i.map(function(t){return[e,t]})}}function os(t,n,r){var i=e.range(t,n-kt,r).concat(n);return function(e){return i.map(function(t){return[t,e]})}}function us(e){return e.source}function as(e){return e.target}function fs(e,t,n,r){var i=Math.cos(t),s=Math.sin(t),o=Math.cos(r),u=Math.sin(r),a=i*Math.cos(e),f=i*Math.sin(e),l=o*Math.cos(n),c=o*Math.sin(n),h=2*Math.asin(Math.sqrt(Ut(r-t)+i*o*Ut(n-e))),p=1/Math.sin(h),d=h?function(e){var t=Math.sin(e*=h)*p,n=Math.sin(h-e)*p,r=n*a+t*l,i=n*f+t*c,o=n*s+t*u;return[Math.atan2(i,r)*Pt,Math.atan2(o,Math.sqrt(r*r+i*i))*Pt]}:function(){return[e*Pt,t*Pt]};return d.distance=h,d}function hs(){function r(r,i){var s=Math.sin(i*=Dt),o=Math.cos(i),u=b((r*=Dt)-e),a=Math.cos(u);ls+=Math.atan2(Math.sqrt((u=o*Math.sin(u))*u+(u=n*s-t*o*a)*u),t*s+n*o*a),e=r,t=s,n=o}var e,t,n;cs.point=function(i,s){e=i*Dt,t=Math.sin(s*=Dt),n=Math.cos(s),cs.point=r},cs.lineEnd=function(){cs.point=cs.lineEnd=j}}function ps(e,t){function n(t,n){var r=Math.cos(t),i=Math.cos(n),s=e(r*i);return[s*i*Math.sin(t),s*Math.sin(n)]}return n.invert=function(e,n){var r=Math.sqrt(e*e+n*n),i=t(r),s=Math.sin(i),o=Math.cos(i);return[Math.atan2(e*s,r*o),Math.asin(r&&n*s/r)]},n}function ms(e,t){function o(e,t){s>0?t<-_t+kt&&(t=-_t+kt):t>_t-kt&&(t=_t-kt);var n=s/Math.pow(r(t),i);return[n*Math.sin(i*e),s-n*Math.cos(i*e)]}var n=Math.cos(e),r=function(e){return Math.tan(At/4+e/2)},i=e===t?Math.sin(e):Math.log(n/Math.cos(t))/Math.log(r(t)/r(e)),s=n*Math.pow(r(e),i)/i;return i?(o.invert=function(e,t){var n=s-t,r=Ht(i)*Math.sqrt(e*e+n*n);return[Math.atan2(e,n)/i,2*Math.atan(Math.pow(s/r,1/i))-_t]},o):bs}function gs(e,t){function s(e,t){var n=i-t;return[n*Math.sin(r*e),i-n*Math.cos(r*e)]}var n=Math.cos(e),r=e===t?Math.sin(e):(n-Math.cos(t))/(t-e),i=n/r+e;return b(r)<kt?Gi:(s.invert=function(e,t){var n=i-t;return[Math.atan2(e,n)/r,i-Ht(r)*Math.sqrt(e*e+n*n)]},s)}function bs(e,t){return[e,Math.log(Math.tan(At/4+t/2))]}function ws(e){var t=Ji(e),n=t.scale,r=t.translate,i=t.clipExtent,s;return t.scale=function(){var e=n.apply(t,arguments);return e===t?s?t.clipExtent(null):t:e},t.translate=function(){var e=r.apply(t,arguments);return e===t?s?t.clipExtent(null):t:e},t.clipExtent=function(e){var o=i.apply(t,arguments);if(o===t){if(s=e==null){var u=At*n(),a=r();i([[a[0]-u,a[1]-u],[a[0]+u,a[1]+u]])}}else s&&(o=null);return o},t.clipExtent(null)}function xs(e,t){return[Math.log(Math.tan(At/4+t/2)),-e]}function Ts(e){return e[0]}function Ns(e){return e[1]}function Cs(e){var t=e.length,n=[0,1],r=2;for(var i=2;i<t;i++){while(r>1&&Bt(e[n[r-2]],e[n[r-1]],e[i])<=0)--r;n[r++]=i}return n.slice(0,r)}function ks(e,t){return e[0]-t[0]||e[1]-t[1]}function As(e,t,n){return(n[0]-t[0])*(e[1]-t[1])<(n[1]-t[1])*(e[0]-t[0])}function Os(e,t,n,r){var i=e[0],s=n[0],o=t[0]-i,u=r[0]-s,a=e[1],f=n[1],l=t[1]-a,c=r[1]-f,h=(u*(a-f)-c*(i-s))/(c*o-u*l);return[i+h*o,a+h*l]}function Ms(e){var t=e[0],n=e[e.length-1];return!(t[0]-n[0]||t[1]-n[1])}function Is(){oo(this),this.edge=this.site=this.circle=null}function qs(e){var t=Hs.pop()||new Is;return t.site=e,t}function Rs(e){Gs(e),Ps.remove(e),Hs.push(e),oo(e)}function Us(e){var t=e.circle,n=t.x,r=t.cy,i={x:n,y:r},s=e.P,o=e.N,u=[e];Rs(e);var a=s;while(a.circle&&b(n-a.circle.x)<kt&&b(r-a.circle.cy)<kt)s=a.P,u.unshift(a),Rs(a),a=s;u.unshift(a),Gs(a);var f=o;while(f.circle&&b(n-f.circle.x)<kt&&b(r-f.circle.cy)<kt)o=f.N,u.push(f),Rs(f),f=o;u.push(f),Gs(f);var l=u.length,c;for(c=1;c<l;++c)f=u[c],a=u[c-1],ro(f.edge,a.site,f.site,i);a=u[0],f=u[l-1],f.edge=to(a.site,f.site,null,i),Qs(a),Qs(f)}function zs(e){var t=e.x,n=e.y,r,i,s,o,u=Ps._;while(u){s=Ws(u,n)-t;if(s>kt)u=u.L;else{o=t-Xs(u,n);if(!(o>kt)){s>-kt?(r=u.P,i=u):o>-kt?(r=u,i=u.N):r=i=u;break}if(!u.R){r=u;break}u=u.R}}var a=qs(e);Ps.insert(r,a);if(!r&&!i)return;if(r===i){Gs(r),i=qs(r.site),Ps.insert(a,i),a.edge=i.edge=to(r.site,a.site),Qs(r),Qs(i);return}if(!i){a.edge=to(r.site,a.site);return}Gs(r),Gs(i);var f=r.site,l=f.x,c=f.y,h=e.x-l,p=e.y-c,d=i.site,v=d.x-l,m=d.y-c,g=2*(h*m-p*v),y=h*h+p*p,b=v*v+m*m,w={x:(m*y-p*b)/g+l,y:(h*b-v*y)/g+c};ro(i.edge,f,d,w),a.edge=to(f,e,null,w),i.edge=to(e,d,null,w),Qs(r),Qs(i)}function Ws(e,t){var n=e.site,r=n.x,i=n.y,s=i-t;if(!s)return r;var o=e.P;if(!o)return-Infinity;n=o.site;var u=n.x,a=n.y,f=a-t;if(!f)return u;var l=u-r,c=1/s-1/f,h=l/f;return c?(-h+Math.sqrt(h*h-2*c*(l*l/(-2*f)-a+f/2+i-s/2)))/c+r:(r+u)/2}function Xs(e,t){var n=e.N;if(n)return Ws(n,t);var r=e.site;return r.y===t?r.x:Infinity}function Vs(e){this.site=e,this.edges=[]}function $s(e){var t=e[0][0],n=e[1][0],r=e[0][1],i=e[1][1],s,o,u,a,f=Ds,l=f.length,c,h,p,d,v,m;while(l--){c=f[l];if(!c||!c.prepare())continue;p=c.edges,d=p.length,h=0;while(h<d){m=p[h].end(),u=m.x,a=m.y,v=p[++h%d].start(),s=v.x,o=v.y;if(b(u-s)>kt||b(a-o)>kt)p.splice(h,0,new io(no(c.site,m,b(u-t)<kt&&i-a>kt?{x:t,y:b(s-t)<kt?o:i}:b(a-i)<kt&&n-u>kt?{x:b(o-i)<kt?s:n,y:i}:b(u-n)<kt&&a-r>kt?{x:n,y:b(s-n)<kt?o:r}:b(a-r)<kt&&u-t>kt?{x:b(o-r)<kt?s:t,y:r}:null),c.site,null)),++d}}}function Js(e,t){return t.angle-e.angle}function Ks(){oo(this),this.x=this.y=this.arc=this.site=this.cy=null}function Qs(e){var t=e.P,n=e.N;if(!t||!n)return;var r=t.site,i=e.site,s=n.site;if(r===s)return;var o=i.x,u=i.y,a=r.x-o,f=r.y-u,l=s.x-o,c=s.y-u,h=2*(a*c-f*l);if(h>=-Lt)return;var p=a*a+f*f,d=l*l+c*c,v=(c*p-f*d)/h,m=(a*d-l*p)/h,c=m+u,g=Fs.pop()||new Ks;g.arc=e,g.site=i,g.x=v+o,g.y=c+Math.sqrt(v*v+m*m),g.cy=c,e.circle=g;var y=null,b=js._;while(b)if(g.y<b.y||g.y===b.y&&g.x<=b.x){if(!b.L){y=b.P;break}b=b.L}else{if(!b.R){y=b;break}b=b.R}js.insert(y,g),y||(Bs=g)}function Gs(e){var t=e.circle;t&&(t.P||(Bs=t.N),js.remove(t),Fs.push(t),oo(t),e.circle=null)}function Ys(e){var t=_s,n=Ei(e[0][0],e[0][1],e[1][0],e[1][1]),r=t.length,i;while(r--){i=t[r];if(!Zs(i,e)||!n(i)||b(i.a.x-i.b.x)<kt&&b(i.a.y-i.b.y)<kt)i.a=i.b=null,t.splice(r,1)}}function Zs(e,t){var n=e.b;if(n)return!0;var r=e.a,i=t[0][0],s=t[1][0],o=t[0][1],u=t[1][1],a=e.l,f=e.r,l=a.x,c=a.y,h=f.x,p=f.y,d=(l+h)/2,v=(c+p)/2,m,g;if(p===c){if(d<i||d>=s)return;if(l>h){if(!r)r={x:d,y:o};else if(r.y>=u)return;n={x:d,y:u}}else{if(!r)r={x:d,y:u};else if(r.y<o)return;n={x:d,y:o}}}else{m=(l-h)/(p-c),g=v-m*d;if(m<-1||m>1)if(l>h){if(!r)r={x:(o-g)/m,y:o};else if(r.y>=u)return;n={x:(u-g)/m,y:u}}else{if(!r)r={x:(u-g)/m,y:u};else if(r.y<o)return;n={x:(o-g)/m,y:o}}else if(c<p){if(!r)r={x:i,y:m*i+g};else if(r.x>=s)return;n={x:s,y:m*s+g}}else{if(!r)r={x:s,y:m*s+g};else if(r.x<i)return;n={x:i,y:m*i+g}}}return e.a=r,e.b=n,!0}function eo(e,t){this.l=e,this.r=t,this.a=this.b=null}function to(e,t,n,r){var i=new eo(e,t);return _s.push(i),n&&ro(i,e,t,n),r&&ro(i,t,e,r),Ds[e.i].edges.push(new io(i,e,t)),Ds[t.i].edges.push(new io(i,t,e)),i}function no(e,t,n){var r=new eo(e,null);return r.a=t,r.b=n,_s.push(r),r}function ro(e,t,n,r){!e.a&&!e.b?(e.a=r,e.l=t,e.r=n):e.l===n?e.b=r:e.a=r}function io(e,t,n){var r=e.a,i=e.b;this.edge=e,this.site=t,this.angle=n?Math.atan2(n.y-t.y,n.x-t.x):e.l===t?Math.atan2(i.x-r.x,r.y-i.y):Math.atan2(r.x-i.x,i.y-r.y)}function so(){this._=null}function oo(e){e.U=e.C=e.L=e.R=e.P=e.N=null}function uo(e,t){var n=t,r=t.R,i=n.U;i?i.L===n?i.L=r:i.R=r:e._=r,r.U=i,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function ao(e,t){var n=t,r=t.L,i=n.U;i?i.L===n?i.L=r:i.R=r:e._=r,r.U=i,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function fo(e){while(e.L)e=e.L;return e}function lo(e,t){var n=e.sort(co).pop(),r,i,s;_s=[],Ds=new Array(e.length),Ps=new so,js=new so;for(;;){s=Bs;if(n&&(!s||n.y<s.y||n.y===s.y&&n.x<s.x)){if(n.x!==r||n.y!==i)Ds[n.i]=new Vs(n),zs(n),r=n.x,i=n.y;n=e.pop()}else{if(!s)break;Us(s.arc)}}t&&(Ys(t),$s(t));var o={cells:Ds,edges:_s};return Ps=js=_s=Ds=null,o}function co(e,t){return t.y-e.y||t.x-e.x}function po(e,t,n){return(e.x-n.x)*(t.y-e.y)-(e.x-t.x)*(n.y-e.y)}function vo(e){return e.x}function mo(e){return e.y}function go(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function yo(e,t,n,r,i,s){if(!e(t,n,r,i,s)){var o=(n+i)*.5,u=(r+s)*.5,a=t.nodes;a[0]&&yo(e,a[0],n,r,o,u),a[1]&&yo(e,a[1],o,r,i,u),a[2]&&yo(e,a[2],n,u,o,s),a[3]&&yo(e,a[3],o,u,i,s)}}function bo(e,t,n,r,i,s,o){var u=Infinity,a;return function f(e,l,c,h,p){if(l>s||c>o||h<r||p<i)return;if(d=e.point){var d,v=t-e.x,m=n-e.y,g=v*v+m*m;if(g<u){var y=Math.sqrt(u=g);r=t-y,i=n-y,s=t+y,o=n+y,a=d}}var b=e.nodes,w=(l+h)*.5,E=(c+p)*.5,S=t>=w,x=n>=E;for(var T=x<<1|S,N=T+4;T<N;++T)if(e=b[T&3])switch(T&3){case 0:f(e,l,c,w,E);break;case 1:f(e,w,c,h,E);break;case 2:f(e,l,E,w,p);break;case 3:f(e,w,E,h,p)}}(e,r,i,s,o),a}function wo(t,n){t=e.rgb(t),n=e.rgb(n);var r=t.r,i=t.g,s=t.b,o=n.r-r,u=n.g-i,a=n.b-s;return function(e){return"#"+yn(Math.round(r+o*e))+yn(Math.round(i+u*e))+yn(Math.round(s+a*e))}}function Eo(e,t){var n={},r={},i;for(i in e)i in t?n[i]=Co(e[i],t[i]):r[i]=e[i];for(i in t)i in e||(r[i]=t[i]);return function(e){for(i in n)r[i]=n[i](e);return r}}function So(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function xo(e,t){var n=To.lastIndex=No.lastIndex=0,r,i,s,o=-1,u=[],a=[];e+="",t+="";while((r=To.exec(e))&&(i=No.exec(t)))(s=i.index)>n&&(s=t.slice(n,s),u[o]?u[o]+=s:u[++o]=s),(r=r[0])===(i=i[0])?u[o]?u[o]+=i:u[++o]=i:(u[++o]=null,a.push({i:o,x:So(r,i)})),n=No.lastIndex;return n<t.length&&(s=t.slice(n),u[o]?u[o]+=s:u[++o]=s),u.length<2?a[0]?(t=a[0].x,function(e){return t(e)+""}):function(){return t}:(t=a.length,function(e){for(var n=0,r;n<t;++n)u[(r=a[n]).i]=r.x(e);return u.join("")})}function Co(t,n){var r=e.interpolators.length,i;while(--r>=0&&!(i=e.interpolators[r](t,n)));return i}function ko(e,t){var n=[],r=[],i=e.length,s=t.length,o=Math.min(e.length,t.length),u;for(u=0;u<o;++u)n.push(Co(e[u],t[u]));for(;u<i;++u)r[u]=e[u];for(;u<s;++u)r[u]=t[u];return function(e){for(u=0;u<o;++u)r[u]=n[u](e);return r}}function Mo(e){return function(t){return t<=0?0:t>=1?1:e(t)}}function _o(e){return function(t){return 1-e(1-t)}}function Do(e){return function(t){return.5*(t<.5?e(2*t):2-e(2-2*t))}}function Po(e){return e*e}function Ho(e){return e*e*e}function Bo(e){if(e<=0)return 0;if(e>=1)return 1;var t=e*e,n=t*e;return 4*(e<.5?n:3*(e-t)+n-.75)}function jo(e){return function(t){return Math.pow(t,e)}}function Fo(e){return 1-Math.cos(e*_t)}function Io(e){return Math.pow(2,10*(e-1))}function qo(e){return 1-Math.sqrt(1-e*e)}function Ro(e,t){var n;return arguments.length<2&&(t=.45),arguments.length?n=t/Ot*Math.asin(1/e):(e=1,n=t/4),function(r){return 1+e*Math.pow(2,-10*r)*Math.sin((r-n)*Ot/t)}}function Uo(e){return e||(e=1.70158),function(t){return t*t*((e+1)*t-e)}}function zo(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}function Wo(t,n){t=e.hcl(t),n=e.hcl(n);var r=t.h,i=t.c,s=t.l,o=n.h-r,u=n.c-i,a=n.l-s;return isNaN(u)&&(u=0,i=isNaN(i)?n.c:i),isNaN(o)?(o=0,r=isNaN(r)?n.h:r):o>180?o-=360:o<-180&&(o+=360),function(e){return tn(r+o*e,i+u*e,s+a*e)+""}}function Xo(t,n){t=e.hsl(t),n=e.hsl(n);var r=t.h,i=t.s,s=t.l,o=n.h-r,u=n.s-i,a=n.l-s;return isNaN(u)&&(u=0,i=isNaN(i)?n.s:i),isNaN(o)?(o=0,r=isNaN(r)?n.h:r):o>180?o-=360:o<-180&&(o+=360),function(e){return Yt(r+o*e,i+u*e,s+a*e)+""}}function Vo(t,n){t=e.lab(t),n=e.lab(n);var r=t.l,i=t.a,s=t.b,o=n.l-r,u=n.a-i,a=n.b-s;return function(e){return fn(r+o*e,i+u*e,s+a*e)+""}}function $o(e,t){return t-=e,function(n){return Math.round(e+t*n)}}function Jo(e){var t=[e.a,e.b],n=[e.c,e.d],r=Qo(t),i=Ko(t,n),s=Qo(Go(n,t,-i))||0;t[0]*n[1]<n[0]*t[1]&&(t[0]*=-1,t[1]*=-1,r*=-1,i*=-1),this.rotate=(r?Math.atan2(t[1],t[0]):Math.atan2(-n[0],n[1]))*Pt,this.translate=[e.e,e.f],this.scale=[r,s],this.skew=s?Math.atan2(i,s)*Pt:0}function Ko(e,t){return e[0]*t[0]+e[1]*t[1]}function Qo(e){var t=Math.sqrt(Ko(e,e));return t&&(e[0]/=t,e[1]/=t),t}function Go(e,t,n){return e[0]+=n*t[0],e[1]+=n*t[1],e}function Zo(e){return e.length?e.pop()+",":""}function eu(e,t,n,r){if(e[0]!==t[0]||e[1]!==t[1]){var i=n.push("translate(",null,",",null,")");r.push({i:i-4,x:So(e[0],t[0])},{i:i-2,x:So(e[1],t[1])})}else(t[0]||t[1])&&n.push("translate("+t+")")}function tu(e,t,n,r){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),r.push({i:n.push(Zo(n)+"rotate(",null,")")-2,x:So(e,t)})):t&&n.push(Zo(n)+"rotate("+t+")")}function nu(e,t,n,r){e!==t?r.push({i:n.push(Zo(n)+"skewX(",null,")")-2,x:So(e,t)}):t&&n.push(Zo(n)+"skewX("+t+")")}function ru(e,t,n,r){if(e[0]!==t[0]||e[1]!==t[1]){var i=n.push(Zo(n)+"scale(",null,",",null,")");r.push({i:i-4,x:So(e[0],t[0])},{i:i-2,x:So(e[1],t[1])})}else(t[0]!==1||t[1]!==1)&&n.push(Zo(n)+"scale("+t+")")}function iu(t,n){var r=[],i=[];return t=e.transform(t),n=e.transform(n),eu(t.translate,n.translate,r,i),tu(t.rotate,n.rotate,r,i),nu(t.skew,n.skew,r,i),ru(t.scale,n.scale,r,i),t=n=null,function(e){var t=-1,n=i.length,s;while(++t<n)r[(s=i[t]).i]=s.x(e);return r.join("")}}function su(e,t){return t=(t-=e=+e)||1/t,function(n){return(n-e)/t}}function ou(e,t){return t=(t-=e=+e)||1/t,function(n){return Math.max(0,Math.min(1,(n-e)/t))}}function uu(e){var t=e.source,n=e.target,r=fu(t,n),i=[t];while(t!==r)t=t.parent,i.push(t);var s=i.length;while(n!==r)i.splice(s,0,n),n=n.parent;return i}function au(e){var t=[],n=e.parent;while(n!=null)t.push(e),e=n,n=n.parent;return t.push(e),t}function fu(e,t){if(e===t)return e;var n=au(e),r=au(t),i=n.pop(),s=r.pop(),o=null;while(i===s)o=i,i=n.pop(),s=r.pop();return o}function lu(e){e.fixed|=2}function cu(e){e.fixed&=-7}function hu(e){e.fixed|=4,e.px=e.x,e.py=e.y}function pu(e){e.fixed&=-5}function du(e,t,n){var r=0,i=0;e.charge=0;if(!e.leaf){var s=e.nodes,o=s.length,u=-1,a;while(++u<o){a=s[u];if(a==null)continue;du(a,t,n),e.charge+=a.charge,r+=a.charge*a.cx,i+=a.charge*a.cy}}if(e.point){e.leaf||(e.point.x+=Math.random()-.5,e.point.y+=Math.random()-.5);var f=t*n[e.point.index];e.charge+=e.pointCharge=f,r+=f*e.point.x,i+=f*e.point.y}e.cx=r/e.charge,e.cy=i/e.charge}function yu(t,n){return e.rebind(t,n,"sort","children","value"),t.nodes=t,t.links=Tu,t}function bu(e,t){var n=[e];while((e=n.pop())!=null){t(e);if((i=e.children)&&(r=i.length)){var r,i;while(--r>=0)n.push(i[r])}}}function wu(e,t){var n=[e],r=[];while((e=n.pop())!=null){r.push(e);if((o=e.children)&&(s=o.length)){var i=-1,s,o;while(++i<s)n.push(o[i])}}while((e=r.pop())!=null)t(e)}function Eu(e){return e.children}function Su(e){return e.value}function xu(e,t){return t.value-e.value}function Tu(t){return e.merge(t.map(function(e){return(e.children||[]).map(function(t){return{source:e,target:t}})}))}function Cu(e){return e.x}function ku(e){return e.y}function Lu(e,t,n){e.y0=t,e.y=n}function Mu(t){return e.range(t.length)}function _u(e){var t=-1,n=e[0].length,r=[];while(++t<n)r[t]=0;return r}function Du(e){var t=1,n=0,r=e[0][1],i,s=e.length;for(;t<s;++t)(i=e[t][1])>r&&(n=t,r=i);return n}function Pu(e){return e.reduce(Hu,0)}function Hu(e,t){return e+t[1]}function Bu(e,t){return ju(e,Math.ceil(Math.log(t.length)/Math.LN2+1))}function ju(e,t){var n=-1,r=+e[0],i=(e[1]-r)/t,s=[];while(++n<=t)s[n]=i*n+r;return s}function Fu(t){return[e.min(t),e.max(t)]}function Iu(e,t){return e.value-t.value}function qu(e,t){var n=e._pack_next;e._pack_next=t,t._pack_prev=e,t._pack_next=n,n._pack_prev=t}function Ru(e,t){e._pack_next=t,t._pack_prev=e}function Uu(e,t){var n=t.x-e.x,r=t.y-e.y,i=e.r+t.r;return.999*i*i>n*n+r*r}function zu(e){function p(e){n=Math.min(e.x-e.r,n),r=Math.max(e.x+e.r,r),i=Math.min(e.y-e.r,i),s=Math.max(e.y+e.r,s)}if(!(t=e.children)||!(h=t.length))return;var t,n=Infinity,r=-Infinity,i=Infinity,s=-Infinity,o,u,a,f,l,c,h;t.forEach(Wu),o=t[0],o.x=-o.r,o.y=0,p(o);if(h>1){u=t[1],u.x=u.r,u.y=0,p(u);if(h>2){a=t[2],$u(o,u,a),p(a),qu(o,a),o._pack_prev=a,qu(a,u),u=o._pack_next;for(f=3;f<h;f++){$u(o,u,a=t[f]);var d=0,v=1,m=1;for(l=u._pack_next;l!==u;l=l._pack_next,v++)if(Uu(l,a)){d=1;break}if(d==1)for(c=o._pack_prev;c!==l._pack_prev;c=c._pack_prev,m++)if(Uu(c,a))break;d?(v<m||v==m&&u.r<o.r?Ru(o,u=l):Ru(o=c,u),f--):(qu(o,a),u=a,p(a))}}}var g=(n+r)/2,y=(i+s)/2,b=0;for(f=0;f<h;f++)a=t[f],a.x-=g,a.y-=y,b=Math.max(b,a.r+Math.sqrt(a.x*a.x+a.y*a.y));e.r=b,t.forEach(Xu)}function Wu(e){e._pack_next=e._pack_prev=e}function Xu(e){delete e._pack_next,delete e._pack_prev}function Vu(e,t,n,r){var i=e.children;e.x=t+=r*e.x,e.y=n+=r*e.y,e.r*=r;if(i){var s=-1,o=i.length;while(++s<o)Vu(i[s],t,n,r)}}function $u(e,t,n){var r=e.r+n.r,i=t.x-e.x,s=t.y-e.y;if(r&&(i||s)){var o=t.r+n.r,u=i*i+s*s;o*=o,r*=r;var a=.5+(r-o)/(2*u),f=Math.sqrt(Math.max(0,2*o*(r+u)-(r-=u)*r-o*o))/(2*u);n.x=e.x+a*i+f*s,n.y=e.y+a*s-f*i}else n.x=e.x+r,n.y=e.y}function Ju(e,t){return e.parent==t.parent?1:2}function Ku(e){var t=e.children;return t.length?t[0]:e.t}function Qu(e){var t=e.children,n;return(n=t.length)?t[n-1]:e.t}function Gu(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function Yu(e){var t=0,n=0,r=e.children,i=r.length,s;while(--i>=0)s=r[i],s.z+=t,s.m+=t,t+=s.s+(n+=s.c)}function Zu(e,t,n){return e.a.parent===t.parent?e.a:n}function ea(t){return 1+e.max(t,function(e){return e.y})}function ta(e){return e.reduce(function(e,t){return e+t.x},0)/e.length}function na(e){var t=e.children;return t&&t.length?na(t[0]):e}function ra(e){var t=e.children,n;return t&&(n=t.length)?ra(t[n-1]):e}function ia(e){return{x:e.x,y:e.y,dx:e.dx,dy:e.dy}}function sa(e,t){var n=e.x+t[3],r=e.y+t[0],i=e.dx-t[1]-t[3],s=e.dy-t[0]-t[2];return i<0&&(n+=i/2,i=0),s<0&&(r+=s/2,s=0),{x:n,y:r,dx:i,dy:s}}function oa(e){var t=e[0],n=e[e.length-1];return t<n?[t,n]:[n,t]}function ua(e){return e.rangeExtent?e.rangeExtent():oa(e.range())}function aa(e,t,n,r){var i=n(e[0],e[1]),s=r(t[0],t[1]);return function(e){return s(i(e))}}function fa(e,t){var n=0,r=e.length-1,i=e[n],s=e[r],o;return s<i&&(o=n,n=r,r=o,o=i,i=s,s=o),e[n]=t.floor(i),e[r]=t.ceil(s),e}function la(e){return e?{floor:function(t){return Math.floor(t/e)*e},ceil:function(t){return Math.ceil(t/e)*e}}:ca}function ha(t,n,r,i){var s=[],o=[],u=0,a=Math.min(t.length,n.length)-1;t[a]<t[0]&&(t=t.slice().reverse(),n=n.slice().reverse());while(++u<=a)s.push(r(t[u-1],t[u])),o.push(i(n[u-1],n[u]));return function(n){var r=e.bisect(t,n,1,a)-1;return o[r](s[r](n))}}function pa(e,t,n,r){function o(){var o=Math.min(e.length,t.length)>2?ha:aa,a=r?ou:su;return i=o(e,t,a,n),s=o(t,e,a,Co),u}function u(e){return i(e)}var i,s;return u.invert=function(e){return s(e)},u.domain=function(t){return arguments.length?(e=t.map(Number),o()):e},u.range=function(e){return arguments.length?(t=e,o()):t},u.rangeRound=function(e){return u.range(e).interpolate($o)},u.clamp=function(e){return arguments.length?(r=e,o()):r},u.interpolate=function(e){return arguments.length?(n=e,o()):n},u.ticks=function(t){return ga(e,t)},u.tickFormat=function(t,n){return ya(e,t,n)},u.nice=function(t){return va(e,t),o()},u.copy=function(){return pa(e,t,n,r)},o()}function da(t,n){return e.rebind(t,n,"range","rangeRound","interpolate","clamp")}function va(e,t){return fa(e,la(ma(e,t)[2])),fa(e,la(ma(e,t)[2])),e}function ma(e,t){t==null&&(t=10);var n=oa(e),r=n[1]-n[0],i=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),s=t/r*i;return s<=.15?i*=10:s<=.35?i*=5:s<=.75&&(i*=2),n[0]=Math.ceil(n[0]/i)*i,n[1]=Math.floor(n[1]/i)*i+i*.5,n[2]=i,n}function ga(t,n){return e.range.apply(e,ma(t,n))}function ya(t,n,r){var i=ma(t,n);if(r){var s=zn.exec(r);s.shift();if(s[8]==="s"){var o=e.formatPrefix(Math.max(b(i[0]),b(i[1])));return s[7]||(s[7]="."+wa(o.scale(i[2]))),s[8]="f",r=e.format(s.join("")),function(e){return r(o.scale(e))+o.symbol}}s[7]||(s[7]="."+Ea(s[8],i)),r=s.join("")}else r=",."+wa(i[2])+"f";return e.format(r)}function wa(e){return-Math.floor(Math.log(e)/Math.LN10+.01)}function Ea(e,t){var n=wa(t[2]);return e in ba?Math.abs(n-wa(Math.max(b(t[0]),b(t[1]))))+ +(e!=="e"):n-(e==="%")*2}function Sa(t,n,r,i){function s(e){return(r?Math.log(e<0?0:e):-Math.log(e>0?0:-e))/Math.log(n)}function o(e){return r?Math.pow(n,e):-Math.pow(n,-e)}function u(e){return t(s(e))}return u.invert=function(e){return o(t.invert(e))},u.domain=function(e){return arguments.length?(r=e[0]>=0,t.domain((i=e.map(Number)).map(s)),u):i},u.base=function(e){return arguments.length?(n=+e,t.domain(i.map(s)),u):n},u.nice=function(){var e=fa(i.map(s),r?Math:Ta);return t.domain(e),i=e.map(o),u},u.ticks=function(){var e=oa(i),t=[],u=e[0],a=e[1],f=Math.floor(s(u)),l=Math.ceil(s(a)),c=n%1?2:n;if(isFinite(l-f)){if(r){for(;f<l;f++)for(var h=1;h<c;h++)t.push(o(f)*h);t.push(o(f))}else{t.push(o(f));for(;f++<l;)for(var h=c-1;h>0;h--)t.push(o(f)*h)}for(f=0;t[f]<u;f++);for(l=t.length;t[l-1]>a;l--);t=t.slice(f,l)}return t},u.tickFormat=function(t,r){if(!arguments.length)return xa;arguments.length<2?r=xa:typeof r!="function"&&(r=e.format(r));var i=Math.max(1,n*t/u.ticks().length);return function(e){var t=e/o(Math.round(s(e)));return t*n<n-.5&&(t*=n),t<=i?r(e):""}},u.copy=function(){return Sa(t.copy(),n,r,i)},da(u,t)}function Na(e,t,n){function s(t){return e(r(t))}var r=Ca(t),i=Ca(1/t);return s.invert=function(t){return i(e.invert(t))},s.domain=function(t){return arguments.length?(e.domain((n=t.map(Number)).map(r)),s):n},s.ticks=function(e){return ga(n,e)},s.tickFormat=function(e,t){return ya(n,e,t)},s.nice=function(e){return s.domain(va(n,e))},s.exponent=function(o){return arguments.length?(r=Ca(t=o),i=Ca(1/t),e.domain(n.map(r)),s):t},s.copy=function(){return Na(e.copy(),t,n)},da(s,e)}function Ca(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function ka(t,n){function o(e){return i[((r.get(e)||(n.t==="range"?r.set(e,t.push(e)):NaN))-1)%i.length]}function u(n,r){return e.range(t.length).map(function(e){return n+r*e})}var r,i,s;return o.domain=function(e){if(!arguments.length)return t;t=[],r=new S;var i=-1,s=e.length,u;while(++i<s)r.has(u=e[i])||r.set(u,t.push(u));return o[n.t].apply(o,n.a)},o.range=function(e){return arguments.length?(i=e,s=0,n={t:"range",a:arguments},o):i},o.rangePoints=function(e,r){arguments.length<2&&(r=0);var a=e[0],f=e[1],l=t.length<2?(a=(a+f)/2,0):(f-a)/(t.length-1+r);return i=u(a+l*r/2,l),s=0,n={t:"rangePoints",a:arguments},o},o.rangeRoundPoints=function(e,r){arguments.length<2&&(r=0);var a=e[0],f=e[1],l=t.length<2?(a=f=Math.round((a+f)/2),0):(f-a)/(t.length-1+r)|0;return i=u(a+Math.round(l*r/2+(f-a-(t.length-1+r)*l)/2),l),s=0,n={t:"rangeRoundPoints",a:arguments},o},o.rangeBands=function(e,r,a){arguments.length<2&&(r=0),arguments.length<3&&(a=r);var f=e[1]<e[0],l=e[f-0],c=e[1-f],h=(c-l)/(t.length-r+2*a);return i=u(l+h*a,h),f&&i.reverse(),s=h*(1-r),n={t:"rangeBands",a:arguments},o},o.rangeRoundBands=function(e,r,a){arguments.length<2&&(r=0),arguments.length<3&&(a=r);var f=e[1]<e[0],l=e[f-0],c=e[1-f],h=Math.floor((c-l)/(t.length-r+2*a));return i=u(l+Math.round((c-l-(t.length-r)*h)/2),h),f&&i.reverse(),s=Math.round(h*(1-r)),n={t:"rangeRoundBands",a:arguments},o},o.rangeBand=function(){return s},o.rangeExtent=function(){return oa(n.a[0])},o.copy=function(){return ka(t,n)},o.domain(t)}function _a(t,n){function i(){var i=0,o=n.length;r=[];while(++i<o)r[i-1]=e.quantile(t,i/o);return s}function s(t){if(!isNaN(t=+t))return n[e.bisect(r,t)]}var r;return s.domain=function(e){return arguments.length?(t=e.map(d).filter(v).sort(p),i()):t},s.range=function(e){return arguments.length?(n=e,i()):n},s.quantiles=function(){return r},s.invertExtent=function(e){return e=n.indexOf(e),e<0?[NaN,NaN]:[e>0?r[e-1]:t[0],e<r.length?r[e]:t[t.length-1]]},s.copy=function(){return _a(t,n)},i()}function Da(e,t,n){function s(t){return n[Math.max(0,Math.min(i,Math.floor(r*(t-e))))]}function o(){return r=n.length/(t-e),i=n.length-1,s}var r,i;return s.domain=function(n){return arguments.length?(e=+n[0],t=+n[n.length-1],o()):[e,t]},s.range=function(e){return arguments.length?(n=e,o()):n},s.invertExtent=function(t){return t=n.indexOf(t),t=t<0?NaN:t/r+e,[t,t+1/r]},s.copy=function(){return Da(e,t,n)},o()}function Pa(t,n){function r(r){if(r<=r)return n[e.bisect(t,r)]}return r.domain=function(e){return arguments.length?(t=e,r):t},r.range=function(e){return arguments.length?(n=e,r):n},r.invertExtent=function(e){return e=n.indexOf(e),[t[e-1],t[e]]},r.copy=function(){return Pa(t,n)},r}function Ha(e){function t(e){return+e}return t.invert=t,t.domain=t.range=function(n){return arguments.length?(e=n.map(t),t):e},t.ticks=function(t){return ga(e,t)},t.tickFormat=function(t,n){return ya(e,t,n)},t.copy=function(){return Ha(e)},t}function Ba(){return 0}function Fa(e){return e.innerRadius}function Ia(e){return e.outerRadius}function qa(e){return e.startAngle}function Ra(e){return e.endAngle}function Ua(e){return e&&e.padAngle}function za(e,t,n,r){return(e-n)*t-(t-r)*e>0?0:1}function Wa(e,t,n,r,i){var s=e[0]-t[0],o=e[1]-t[1],u=(i?r:-r)/Math.sqrt(s*s+o*o),a=u*o,f=-u*s,l=e[0]+a,c=e[1]+f,h=t[0]+a,p=t[1]+f,d=(l+h)/2,v=(c+p)/2,m=h-l,g=p-c,y=m*m+g*g,b=n-r,w=l*p-h*c,E=(g<0?-1:1)*Math.sqrt(Math.max(0,b*b*y-w*w)),S=(w*g-m*E)/y,x=(-w*m-g*E)/y,T=(w*g+m*E)/y,N=(-w*m+g*E)/y,C=S-d,k=x-v,L=T-d,A=N-v;return C*C+k*k>L*L+A*A&&(S=T,x=N),[[S-a,x-f],[S*n/b,x*n/b]]}function Xa(e){function u(s){function d(){u.push("M",i(e(a),o))}var u=[],a=[],f=-1,l=s.length,c,h=Nn(t),p=Nn(n);while(++f<l)r.call(this,c=s[f],f)?a.push([+h.call(this,c,f),+p.call(this,c,f)]):a.length&&(d(),a=[]);return a.length&&d(),u.length?u.join(""):null}var t=Ts,n=Ns,r=ui,i=$a,s=i.key,o=.7;return u.x=function(e){return arguments.length?(t=e,u):t},u.y=function(e){return arguments.length?(n=e,u):n},u.defined=function(e){return arguments.length?(r=e,u):r},u.interpolate=function(e){return arguments.length?(typeof e=="function"?s=i=e:s=(i=Va.get(e)||$a).key,u):s},u.tension=function(e){return arguments.length?(o=e,u):o},u}function $a(e){return e.length>1?e.join("L"):e+"Z"}function Ja(e){return e.join("L")+"Z"}function Ka(e){var t=0,n=e.length,r=e[0],i=[r[0],",",r[1]];while(++t<n)i.push("H",(r[0]+(r=e[t])[0])/2,"V",r[1]);return n>1&&i.push("H",r[0]),i.join("")}function Qa(e){var t=0,n=e.length,r=e[0],i=[r[0],",",r[1]];while(++t<n)i.push("V",(r=e[t])[1],"H",r[0]);return i.join("")}function Ga(e){var t=0,n=e.length,r=e[0],i=[r[0],",",r[1]];while(++t<n)i.push("H",(r=e[t])[0],"V",r[1]);return i.join("")}function Ya(e,t){return e.length<4?$a(e):e[1]+tf(e.slice(1,-1),nf(e,t))}function Za(e,t){return e.length<3?Ja(e):e[0]+tf((e.push(e[0]),e),nf([e[e.length-2]].concat(e,[e[1]]),t))}function ef(e,t){return e.length<3?$a(e):e[0]+tf(e,nf(e,t))}function tf(e,t){if(t.length<1||e.length!=t.length&&e.length!=t.length+2)return $a(e);var n=e.length!=t.length,r="",i=e[0],s=e[1],o=t[0],u=o,a=1;n&&(r+="Q"+(s[0]-o[0]*2/3)+","+(s[1]-o[1]*2/3)+","+s[0]+","+s[1],i=e[1],a=2);if(t.length>1){u=t[1],s=e[a],a++,r+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(s[0]-u[0])+","+(s[1]-u[1])+","+s[0]+","+s[1];for(var f=2;f<t.length;f++,a++)s=e[a],u=t[f],r+="S"+(s[0]-u[0])+","+(s[1]-u[1])+","+s[0]+","+s[1]}if(n){var l=e[a];r+="Q"+(s[0]+u[0]*2/3)+","+(s[1]+u[1]*2/3)+","+l[0]+","+l[1]}return r}function nf(e,t){var n=[],r=(1-t)/2,i,s=e[0],o=e[1],u=1,a=e.length;while(++u<a)i=s,s=o,o=e[u],n.push([r*(o[0]-i[0]),r*(o[1]-i[1])]);return n}function rf(e){if(e.length<3)return $a(e);var t=1,n=e.length,r=e[0],i=r[0],s=r[1],o=[i,i,i,(r=e[1])[0]],u=[s,s,s,r[1]],a=[i,",",s,"L",af(cf,o),",",af(cf,u)];e.push(e[n-1]);while(++t<=n)r=e[t],o.shift(),o.push(r[0]),u.shift(),u.push(r[1]),hf(a,o,u);return e.pop(),a.push("L",r),a.join("")}function sf(e){if(e.length<4)return $a(e);var t=[],n=-1,r=e.length,i,s=[0],o=[0];while(++n<3)i=e[n],s.push(i[0]),o.push(i[1]);t.push(af(cf,s)+","+af(cf,o)),--n;while(++n<r)i=e[n],s.shift(),s.push(i[0]),o.shift(),o.push(i[1]),hf(t,s,o);return t.join("")}function of(e){var t,n=-1,r=e.length,i=r+4,s,o=[],u=[];while(++n<4)s=e[n%r],o.push(s[0]),u.push(s[1]);t=[af(cf,o),",",af(cf,u)],--n;while(++n<i)s=e[n%r],o.shift(),o.push(s[0]),u.shift(),u.push(s[1]),hf(t,o,u);return t.join("")}function uf(e,t){var n=e.length-1;if(n){var r=e[0][0],i=e[0][1],s=e[n][0]-r,o=e[n][1]-i,u=-1,a,f;while(++u<=n)a=e[u],f=u/n,a[0]=t*a[0]+(1-t)*(r+f*s),a[1]=t*a[1]+(1-t)*(i+f*o)}return rf(e)}function af(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function hf(e,t,n){e.push("C",af(ff,t),",",af(ff,n),",",af(lf,t),",",af(lf,n),",",af(cf,t),",",af(cf,n))}function pf(e,t){return(t[1]-e[1])/(t[0]-e[0])}function df(e){var t=0,n=e.length-1,r=[],i=e[0],s=e[1],o=r[0]=pf(i,s);while(++t<n)r[t]=(o+(o=pf(i=s,s=e[t+1])))/2;return r[t]=o,r}function vf(e){var t=[],n,r,i,s,o=df(e),u=-1,a=e.length-1;while(++u<a)n=pf(e[u],e[u+1]),b(n)<kt?o[u]=o[u+1]=0:(r=o[u]/n,i=o[u+1]/n,s=r*r+i*i,s>9&&(s=n*3/Math.sqrt(s),o[u]=s*r,o[u+1]=s*i));u=-1;while(++u<=a)s=(e[Math.min(a,u+1)][0]-e[Math.max(0,u-1)][0])/(6*(1+o[u]*o[u])),t.push([s||0,o[u]*s||0]);return t}function mf(e){return e.length<3?$a(e):e[0]+tf(e,vf(e))}function gf(e){var t,n=-1,r=e.length,i,s;while(++n<r)t=e[n],i=t[0],s=t[1]-_t,t[0]=i*Math.cos(s),t[1]=i*Math.sin(s);return e}function yf(e){function c(u){function x(){c.push("M",o(e(p),l),f,a(e(h.reverse()),l),"Z")}var c=[],h=[],p=[],d=-1,v=u.length,m,g=Nn(t),y=Nn(r),b=t===n?function(){return E}:Nn(n),w=r===i?function(){return S}:Nn(i),E,S;while(++d<v)s.call(this,m=u[d],d)?(h.push([E=+g.call(this,m,d),S=+y.call(this,m,d)]),p.push([+b.call(this,m,d),+w.call(this,m,d)])):h.length&&(x(),h=[],p=[]);return h.length&&x(),c.length?c.join(""):null}var t=Ts,n=Ts,r=0,i=Ns,s=ui,o=$a,u=o.key,a=o,f="L",l=.7;return c.x=function(e){return arguments.length?(t=n=e,c):n},c.x0=function(e){return arguments.length?(t=e,c):t},c.x1=function(e){return arguments.length?(n=e,c):n},c.y=function(e){return arguments.length?(r=i=e,c):i},c.y0=function(e){return arguments.length?(r=e,c):r},c.y1=function(e){return arguments.length?(i=e,c):i},c.defined=function(e){return arguments.length?(s=e,c):s},c.interpolate=function(e){return arguments.length?(typeof e=="function"?u=o=e:u=(o=Va.get(e)||$a).key,a=o.reverse||o,f=o.closed?"M":"L",c):u},c.tension=function(e){return arguments.length?(l=e,c):l},c}function bf(e){return e.radius}function wf(e){return[e.x,e.y]}function Ef(e){return function(){var t=e.apply(this,arguments),n=t[0],r=t[1]-_t;return[n*Math.cos(r),n*Math.sin(r)]}}function Sf(){return 64}function xf(){return"circle"}function Tf(e){var t=Math.sqrt(e/At);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+ -t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}function Af(e){return function(){var t,n,r;(t=this[e])&&(r=t[n=t.active])&&(r.timer.c=null,r.timer.t=NaN,--t.count?delete t[n]:delete this[e],t.active+=.5,r.event&&r.event.interrupt.call(this,this.__data__,r.index))}}function Of(e,t,n){return W(e,Mf),e.namespace=t,e.id=n,e}function Hf(e,t,n,r){var i=e.id,s=e.namespace;return pt(e,typeof n=="function"?function(e,o,u){e[s][i].tween.set(t,r(n.call(e,e.__data__,o,u)))}:(n=r(n),function(e){e[s][i].tween.set(t,n)}))}function Bf(e){return e==null&&(e=""),function(){this.textContent=e}}function jf(e){return e==null?"__transition__":"__transition_"+e+"__"}function Ff(e,t,n,r,i){function h(e){var t=o.delay;a.t=t+u;if(t<=e)return p(e-t);a.c=p}function p(n){var i=s.active,h=s[i];h&&(h.timer.c=null,h.timer.t=NaN,--s.count,delete s[i],h.event&&h.event.interrupt.call(e,e.__data__,h.index));for(var p in s)if(+p<r){var v=s[p];v.timer.c=null,v.timer.t=NaN,--s.count,delete s[p]}a.c=d,Hn(function(){return a.c&&d(n||1)&&(a.c=null,a.t=NaN),1},0,u),s.active=r,o.event&&o.event.start.call(e,e.__data__,t),c=[],o.tween.forEach(function(n,r){(r=r.call(e,e.__data__,t))&&c.push(r)}),l=o.ease,f=o.duration}function d(i){var u=i/f,a=l(u),h=c.length;while(h>0)c[--h].call(e,a);if(u>=1)return o.event&&o.event.end.call(e,e.__data__,t),--s.count?delete s[r]:delete e[n],1}var s=e[n]||(e[n]={active:0,count:0}),o=s[r],u,a,f,l,c;o||(u=i.time,a=Hn(h,0,u),o=s[r]={tween:new S,time:u,timer:a,delay:i.delay,duration:i.duration,ease:i.ease,index:t},i=null,++s.count)}function Rf(e,t,n){e.attr("transform",function(e){var r=t(e);return"translate("+(isFinite(r)?r:n(e))+",0)"})}function Uf(e,t,n){e.attr("transform",function(e){var r=t(e);return"translate(0,"+(isFinite(r)?r:n(e))+")"})}function Jf(e){return e.toISOString()}function Kf(t,n,r){function i(e){return t(e)}function s(t,r){var i=t[1]-t[0],s=i/r,o=e.bisect(Gf,s);return o==Gf.length?[n.year,ma(t.map(function(e){return e/31536e6}),r)[2]]:o?n[s/Gf[o-1]<Gf[o]/s?o-1:o]:[el,ma(t,r)[2]]}return i.invert=function(e){return Qf(t.invert(e))},i.domain=function(e){return arguments.length?(t.domain(e),i):t.domain().map(Qf)},i.nice=function(e,t){function u(n){return!isNaN(n)&&!e.range(n,Qf(+n+1),t).length}var n=i.domain(),r=oa(n),o=e==null?s(r,10):typeof e=="number"&&s(r,e);return o&&(e=o[0],t=o[1]),i.domain(fa(n,t>1?{floor:function(t){while(u(t=e.floor(t)))t=Qf(t-1);return t},ceil:function(t){while(u(t=e.ceil(t)))t=Qf(+t+1);return t}}:e))},i.ticks=function(e,t){var n=oa(i.domain()),r=e==null?s(n,10):typeof e=="number"?s(n,e):!e.range&&[{range:e},t];return r&&(e=r[0],t=r[1]),e.range(n[0],Qf(+n[1]+1),t<1?1:t)},i.tickFormat=function(){return r},i.copy=function(){return Kf(t.copy(),n,r)},da(i,t)}function Qf(e){return new Date(e)}function rl(e){return JSON.parse(e.responseText)}function il(e){var t=r.createRange();return t.selectNode(r.body),t.createContextualFragment(e.responseText)}var e={version:"3.5.17"},t=[].slice,n=function(e){return t.call(e)},r=this.document;if(r)try{n(r.documentElement.childNodes)[0].nodeType}catch(o){n=function(e){var t=e.length,n=new Array(t);while(t--)n[t]=e[t];return n}}Date.now||(Date.now=function(){return+(new Date)});if(r)try{r.createElement("DIV").style.setProperty("opacity",0,"")}catch(u){var a=this.Element.prototype,f=a.setAttribute,l=a.setAttributeNS,c=this.CSSStyleDeclaration.prototype,h=c.setProperty;a.setAttribute=function(e,t){f.call(this,e,t+"")},a.setAttributeNS=function(e,t,n){l.call(this,e,t,n+"")},c.setProperty=function(e,t,n){h.call(this,e,t+"",n)}}e.ascending=p,e.descending=function(e,t){return t<e?-1:t>e?1:t>=e?0:NaN},e.min=function(e,t){var n=-1,r=e.length,i,s;if(arguments.length===1){while(++n<r)if((s=e[n])!=null&&s>=s){i=s;break}while(++n<r)(s=e[n])!=null&&i>s&&(i=s)}else{while(++n<r)if((s=t.call(e,e[n],n))!=null&&s>=s){i=s;break}while(++n<r)(s=t.call(e,e[n],n))!=null&&i>s&&(i=s)}return i},e.max=function(e,t){var n=-1,r=e.length,i,s;if(arguments.length===1){while(++n<r)if((s=e[n])!=null&&s>=s){i=s;break}while(++n<r)(s=e[n])!=null&&s>i&&(i=s)}else{while(++n<r)if((s=t.call(e,e[n],n))!=null&&s>=s){i=s;break}while(++n<r)(s=t.call(e,e[n],n))!=null&&s>i&&(i=s)}return i},e.extent=function(e,t){var n=-1,r=e.length,i,s,o;if(arguments.length===1){while(++n<r)if((s=e[n])!=null&&s>=s){i=o=s;break}while(++n<r)(s=e[n])!=null&&(i>s&&(i=s),o<s&&(o=s))}else{while(++n<r)if((s=t.call(e,e[n],n))!=null&&s>=s){i=o=s;break}while(++n<r)(s=t.call(e,e[n],n))!=null&&(i>s&&(i=s),o<s&&(o=s))}return[i,o]},e.sum=function(e,t){var n=0,r=e.length,i,s=-1;if(arguments.length===1)while(++s<r)v(i=+e[s])&&(n+=i);else while(++s<r)v(i=+t.call(e,e[s],s))&&(n+=i);return n},e.mean=function(e,t){var n=0,r=e.length,i,s=-1,o=r;if(arguments.length===1)while(++s<r)v(i=d(e[s]))?n+=i:--o;else while(++s<r)v(i=d(t.call(e,e[s],s)))?n+=i:--o;if(o)return n/o},e.quantile=function(e,t){var n=(e.length-1)*t+1,r=Math.floor(n),i=+e[r-1],s=n-r;return s?i+s*(e[r]-i):i},e.median=function(t,n){var r=[],i=t.length,s,o=-1;if(arguments.length===1)while(++o<i)v(s=d(t[o]))&&r.push(s);else while(++o<i)v(s=d(n.call(t,t[o],o)))&&r.push(s);if(r.length)return e.quantile(r.sort(p),.5)},e.variance=function(e,t){var n=e.length,r=0,i,s,o=0,u=-1,a=0;if(arguments.length===1)while(++u<n)v(i=d(e[u]))&&(s=i-r,r+=s/++a,o+=s*(i-r));else while(++u<n)v(i=d(t.call(e,e[u],u)))&&(s=i-r,r+=s/++a,o+=s*(i-r));if(a>1)return o/(a-1)},e.deviation=function(){var t=e.variance.apply(this,arguments);return t?Math.sqrt(t):t};var g=m(p);e.bisectLeft=g.left,e.bisect=e.bisectRight=g.right,e.bisector=function(e){return m(e.length===1?function(t,n){return p(e(t),n)}:e)},e.shuffle=function(e,t,n){(r=arguments.length)<3&&(n=e.length,r<2&&(t=0));var r=n-t,i,s;while(r)s=Math.random()*r--|0,i=e[r+t],e[r+t]=e[s+t],e[s+t]=i;return e},e.permute=function(e,t){var n=t.length,r=new Array(n);while(n--)r[n]=e[t[n]];return r},e.pairs=function(e){var t=0,n=e.length-1,r,i=e[0],s=new Array(n<0?0:n);while(t<n)s[t]=[r=i,i=e[++t]];return s},e.transpose=function(t){if(!(o=t.length))return[];for(var n=-1,r=e.min(t,y),i=new Array(r);++n<r;)for(var s=-1,o,u=i[n]=new Array(o);++s<o;)u[s]=t[s][n];return i},e.zip=function(){return e.transpose(arguments)},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t},e.values=function(e){var t=[];for(var n in e)t.push(e[n]);return t},e.entries=function(e){var t=[];for(var n in e)t.push({key:n,value:e[n]});return t},e.merge=function(e){var t=e.length,n,r=-1,i=0,s,o;while(++r<t)i+=e[r].length;s=new Array(i);while(--t>=0){o=e[t],n=o.length;while(--n>=0)s[--i]=o[n]}return s};var b=Math.abs;e.range=function(e,t,n){arguments.length<3&&(n=1,arguments.length<2&&(t=e,e=0));if((t-e)/n===Infinity)throw new Error("infinite range");var r=[],i=w(b(n)),s=-1,o;e*=i,t*=i,n*=i;if(n<0)while((o=e+n*++s)>t)r.push(o/i);else while((o=e+n*++s)<t)r.push(o/i);return r},e.map=function(e,t){var n=new S;if(e instanceof S)e.forEach(function(e,t){n.set(e,t)});else if(Array.isArray(e)){var r=-1,i=e.length,s;if(arguments.length===1)while(++r<i)n.set(r,e[r]);else while(++r<i)n.set(t.call(e,s=e[r],r),s)}else for(var o in e)n.set(o,e[o]);return n};var x="__proto__",T="\0";E(S,{has:k,get:function(e){return this._[N(e)]},set:function(e,t){return this._[N(e)]=t},remove:L,keys:A,values:function(){var e=[];for(var t in this._)e.push(this._[t]);return e},entries:function(){var e=[];for(var t in this._)e.push({key:C(t),value:this._[t]});return e},size:O,empty:M,forEach:function(e){for(var t in this._)e.call(this,C(t),this._[t])}}),e.nest=function(){function o(e,r,u){if(u>=n.length)return s?s.call(t,r):i?r.sort(i):r;var a=-1,f=r.length,l=n[u++],c,h,p,d=new S,v;while(++a<f)(v=d.get(c=l(h=r[a])))?v.push(h):d.set(c,[h]);return e?(h=e(),p=function(t,n){h.set(t,o(e,n,u))}):(h={},p=function(t,n){h[t]=o(e,n,u)}),d.forEach(p),h}function u(e,t){if(t>=n.length)return e;var i=[],s=r[t++];return e.forEach(function(e,n){i.push({key:e,values:u(n,t)})}),s?i.sort(function(e,t){return s(e.key,t.key)}):i}var t={},n=[],r=[],i,s;return t.map=function(e,t){return o(t,e,0)},t.entries=function(t){return u(o(e.map,t,0),0)},t.key=function(e){return n.push(e),t},t.sortKeys=function(e){return r[n.length-1]=e,t},t.sortValues=function(e){return i=e,t},t.rollup=function(e){return s=e,t},t},e.set=function(e){var t=new _;if(e)for(var n=0,r=e.length;n<r;++n)t.add(e[n]);return t},E(_,{has:k,add:function(e){return this._[N(e+="")]=!0,e},remove:L,values:A,size:O,empty:M,forEach:function(e){for(var t in this._)e.call(this,C(t))}}),e.behavior={},e.rebind=function(e,t){var n=1,r=arguments.length,i;while(++n<r)e[i=arguments[n]]=P(e,t,t[i]);return e};var B=["webkit","ms","moz","Moz","o","O"];e.dispatch=function(){var e=new F,t=-1,n=arguments.length;while(++t<n)e[arguments[t]]=I(e);return e},F.prototype.on=function(e,t){var n=e.indexOf("."),r="";n>=0&&(r=e.slice(n+1),e=e.slice(0,n));if(e)return arguments.length<2?this[e].on(r):this[e].on(r,t);if(arguments.length===2){if(t==null)for(e in this)this.hasOwnProperty(e)&&this[e].on(r,null);return this}},e.event=null,e.requote=function(e){return e.replace(z,"\\$&")};var z=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,W={}.__proto__?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)e[n]=t[n]},V=function(e,t){return t.querySelector(e)},$=function(e,t){return t.querySelectorAll(e)},J=function(e,t){var n=e.matches||e[H(e,"matchesSelector")];return J=function(e,t){return n.call(e,t)},J(e,t)};typeof Sizzle=="function"&&(V=function(e,t){return Sizzle(e,t)[0]||null},$=Sizzle,J=Sizzle.matchesSelector),e.selection=function(){return e.select(r.documentElement)};var K=e.selection.prototype=[];K.select=function(e){var t=[],n,r,i,s;e=Q(e);for(var o=-1,u=this.length;++o<u;){t.push(n=[]),n.parentNode=(i=this[o]).parentNode;for(var a=-1,f=i.length;++a<f;)(s=i[a])?(n.push(r=e.call(s,s.__data__,a,o)),r&&"__data__"in s&&(r.__data__=s.__data__)):n.push(null)}return X(t)},K.selectAll=function(e){var t=[],r,i;e=G(e);for(var s=-1,o=this.length;++s<o;)for(var u=this[s],a=-1,f=u.length;++a<f;)if(i=u[a])t.push(r=n(e.call(i,i.__data__,a,s))),r.parentNode=i;return X(t)};var Y="http://www.w3.org/1999/xhtml",Z={svg:"http://www.w3.org/2000/svg",xhtml:Y,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};e.ns={prefix:Z,qualify:function(e){var t=e.indexOf(":"),n=e;return t>=0&&(n=e.slice(0,t))!=="xmlns"&&(e=e.slice(t+1)),Z.hasOwnProperty(n)?{space:Z[n],local:e}:e}},K.attr=function(t,n){if(arguments.length<2){if(typeof t=="string"){var r=this.node();return t=e.ns.qualify(t),t.local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}for(n in t)this.each(et(n,t[n]));return this}return this.each(et(t,n))},K.classed=function(e,t){if(arguments.length<2){if(typeof e=="string"){var n=this.node(),r=(e=rt(e)).length,i=-1;if(t=n.classList){while(++i<r)if(!t.contains(e[i]))return!1}else{t=n.getAttribute("class");while(++i<r)if(!nt(e[i]).test(t))return!1}return!0}for(t in e)this.each(it(t,e[t]));return this}return this.each(it(e,t))},K.style=function(e,t,n){var r=arguments.length;if(r<3){if(typeof e!="string"){r<2&&(t="");for(n in e)this.each(ot(n,e[n],t));return this}if(r<2){var i=this.node();return s(i).getComputedStyle(i,null).getPropertyValue(e)}n=""}return this.each(ot(e,t,n))},K.property=function(e,t){if(arguments.length<2){if(typeof e=="string")return this.node()[e];for(t in e)this.each(ut(t,e[t]));return this}return this.each(ut(e,t))},K.text=function(e){return arguments.length?this.each(typeof e=="function"?function(){var t=e.apply(this,arguments);this.textContent=t==null?"":t}:e==null?function(){this.textContent=""}:function(){this.textContent=e}):this.node().textContent},K.html=function(e){return arguments.length?this.each(typeof e=="function"?function(){var t=e.apply(this,arguments);this.innerHTML=t==null?"":t}:e==null?function(){this.innerHTML=""}:function(){this.innerHTML=e}):this.node().innerHTML},K.append=function(e){return e=at(e),this.select(function(){return this.appendChild(e.apply(this,arguments))})},K.insert=function(e,t){return e=at(e),t=Q(t),this.select(function(){return this.insertBefore(e.apply(this,arguments),t.apply(this,arguments)||null)})},K.remove=function(){return this.each(ft)},K.data=function(e,t){function o(e,n){var r,i=e.length,s=n.length,o=Math.min(i,s),l=new Array(s),c=new Array(s),h=new Array(i),p,d;if(t){var v=new S,m=new Array(i),g;for(r=-1;++r<i;)if(p=e[r])v.has(g=t.call(p,p.__data__,r))?h[r]=p:v.set(g,p),m[r]=g;for(r=-1;++r<s;)(p=v.get(g=t.call(n,d=n[r],r)))?p!==!0&&(l[r]=p,p.__data__=d):c[r]=lt(d),v.set(g,!0);for(r=-1;++r<i;)r in m&&v.get(m[r])!==!0&&(h[r]=e[r])}else{for(r=-1;++r<o;)p=e[r],d=n[r],p?(p.__data__=d,l[r]=p):c[r]=lt(d);for(;r<s;++r)c[r]=lt(n[r]);for(;r<i;++r)h[r]=e[r]}c.update=l,c.parentNode=l.parentNode=h.parentNode=e.parentNode,u.push(c),a.push(l),f.push(h)}var n=-1,r=this.length,i,s;if(!arguments.length){e=new Array(r=(i=this[0]).length);while(++n<r)if(s=i[n])e[n]=s.__data__;return e}var u=dt([]),a=X([]),f=X([]);if(typeof e=="function")while(++n<r)o(i=this[n],e.call(i,i.parentNode.__data__,n));else while(++n<r)o(i=this[n],e);return a.enter=function(){return u},a.exit=function(){return f},a},K.datum=function(e){return arguments.length?this.property("__data__",e):this.property("__data__")},K.filter=function(e){var t=[],n,r,i;typeof e!="function"&&(e=ct(e));for(var s=0,o=this.length;s<o;s++){t.push(n=[]),n.parentNode=(r=this[s]).parentNode;for(var u=0,a=r.length;u<a;u++)(i=r[u])&&e.call(i,i.__data__,u,s)&&n.push(i)}return X(t)},K.order=function(){for(var e=-1,t=this.length;++e<t;)for(var n=this[e],r=n.length-1,i=n[r],s;--r>=0;)if(s=n[r])i&&i!==s.nextSibling&&i.parentNode.insertBefore(s,i),i=s;return this},K.sort=function(e){e=ht.apply(this,arguments);for(var t=-1,n=this.length;++t<n;)this[t].sort(e);return this.order()},K.each=function(e){return pt(this,function(t,n,r){e.call(t,t.__data__,n,r)})},K.call=function(e){var t=n(arguments);return e.apply(t[0]=this,t),this},K.empty=function(){return!this.node()},K.node=function(){for(var e=0,t=this.length;e<t;e++)for(var n=this[e],r=0,i=n.length;r<i;r++){var s=n[r];if(s)return s}return null},K.size=function(){var e=0;return pt(this,function(){++e}),e};var vt=[];e.selection.enter=dt,e.selection.enter.prototype=vt,vt.append=K.append,vt.empty=K.empty,vt.node=K.node,vt.call=K.call,vt.size=K.size,vt.select=function(e){var t=[],n,r,i,s,o;for(var u=-1,a=this.length;++u<a;){i=(s=this[u]).update,t.push(n=[]),n.parentNode=s.parentNode;for(var f=-1,l=s.length;++f<l;)(o=s[f])?(n.push(i[f]=r=e.call(s.parentNode,o.__data__,f,u)),r.__data__=o.__data__):n.push(null)}return X(t)},vt.insert=function(e,t){return arguments.length<2&&(t=mt(this)),K.insert.call(this,e,t)},e.select=function(e){var t;return typeof e=="string"?(t=[V(e,r)],t.parentNode=r.documentElement):(t=[e],t.parentNode=i(e)),X([t])},e.selectAll=function(e){var t;return typeof e=="string"?(t=n($(e,r)),t.parentNode=r.documentElement):(t=n(e),t.parentNode=null),X([t])},K.on=function(e,t,n){var r=arguments.length;if(r<3){if(typeof e!="string"){r<2&&(t=!1);for(n in e)this.each(gt(n,e[n],t));return this}if(r<2)return(r=this.node()["__on"+e])&&r._;n=!1}return this.each(gt(e,t,n))};var yt=e.map({mouseenter:"mouseover",mouseleave:"mouseout"});r&&yt.forEach(function(e){"on"+e in r&&yt.remove(e)});var Et,St=0;e.mouse=function(e){return Nt(e,R())};var Tt=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;e.touch=function(e,t,n){arguments.length<3&&(n=t,t=R().changedTouches);if(t)for(var r=0,i=t.length,s;r<i;++r)if((s=t[r]).identifier===n)return Nt(e,s)},e.behavior.drag=function(){function o(){this.on("mousedown.drag",r).on("touchstart.drag",i)}function u(r,i,s,o,u){return function(){function b(){var e=i(l,p),t,n;if(!e)return;t=e[0]-y[0],n=e[1]-y[1],h|=t|n,y=e,c({type:"drag",x:e[0]+v[0],y:e[1]+v[1],dx:t,dy:n})}function w(){if(!i(l,p))return;m.on(o+d,null).on(u+d,null),g(h),c({type:"dragend"})}var a=this,f=e.event.target.correspondingElement||e.event.target,l=a.parentNode,c=t.of(a,arguments),h=0,p=r(),d=".drag"+(p==null?"":"-"+p),v,m=e.select(s(f)).on(o+d,b).on(u+d,w),g=xt(f),y=i(l,p);n?(v=n.apply(a,arguments),v=[v.x-y[0],v.y-y[1]]):v=[0,0],c({type:"dragstart"})}}var t=U(o,"drag","dragstart","dragend"),n=null,r=u(j,e.mouse,s,"mousemove","mouseup"),i=u(Ct,e.touch,D,"touchmove","touchend");return o.origin=function(e){return arguments.length?(n=e,o):n},e.rebind(o,t,"on")},e.touches=function(e,t){return arguments.length<2&&(t=R().touches),t?n(t).map(function(t){var n=Nt(e,t);return n.identifier=t.identifier,n}):[]};var kt=1e-6,Lt=kt*kt,At=Math.PI,Ot=2*At,Mt=Ot-kt,_t=At/2,Dt=At/180,Pt=180/At,zt=Math.SQRT2,Wt=2,Xt=4;e.interpolateZoom=function(e,t){var n=e[0],r=e[1],i=e[2],s=t[0],o=t[1],u=t[2],a=s-n,f=o-r,l=a*a+f*f,c,h;if(l<Lt)h=Math.log(u/i)/zt,c=function(e){return[n+e*a,r+e*f,i*Math.exp(zt*e*h)]};else{var p=Math.sqrt(l),d=(u*u-i*i+Xt*l)/(2*i*Wt*p),v=(u*u-i*i-Xt*l)/(2*u*Wt*p),m=Math.log(Math.sqrt(d*d+1)-d),g=Math.log(Math.sqrt(v*v+1)-v);h=(g-m)/zt,c=function(e){var t=e*h,s=qt(m),o=i/(Wt*p)*(s*Rt(zt*t+m)-It(m));return[n+o*a,r+o*f,i*s/qt(zt*t+m)]}}return c.duration=h*1e3,c},e.behavior.zoom=function(){function S(e){e.on(c,_).on(Jt+".zoom",P).on("dblclick.zoom",H).on(v,D)}function x(e){return[(e[0]-t.x)/t.k,(e[1]-t.y)/t.k]}function T(e){return[e[0]*t.k+t.x,e[1]*t.k+t.y]}function N(e){t.k=Math.max(a[0],Math.min(a[1],e))}function C(e,n){n=T(n),t.x+=e[0]-n[0],t.y+=e[1]-n[1]}function k(n,r,s,o){n.__chart__={x:t.x,y:t.y,k:t.k},N(Math.pow(2,o)),C(i=r,s),n=e.select(n),f>0&&(n=n.transition().duration(f)),n.call(S.event)}function L(){b&&b.domain(y.range().map(function(e){return(e-t.x)/t.k}).map(y.invert)),E&&E.domain(w.range().map(function(e){return(e-t.y)/t.k}).map(w.invert))}function A(e){l++||e({type:"zoomstart"})}function O(e){L(),e({type:"zoom",scale:t.k,translate:[t.x,t.y]})}function M(e){--l||(e({type:"zoomend"}),i=null)}function _(){function a(){r=1,C(e.mouse(t),o),O(n)}function f(){i.on(h,null).on(p,null),u(r),M(n)}var t=this,n=g.of(t,arguments),r=0,i=e.select(s(t)).on(h,a).on(p,f),o=x(e.mouse(t)),u=xt(t);Lf.call(t),A(n)}function D(){function d(){var r=e.touches(n);return o=t.k,r.forEach(function(e){e.identifier in i&&(i[e.identifier]=x(e))}),r}function y(){var r=e.event.target;e.select(r).on(a,b).on(f,w),l.push(r);var o=e.event.changedTouches;for(var u=0,c=o.length;u<c;++u)i[o[u].identifier]=null;var h=d(),p=Date.now();if(h.length===1){if(p-m<500){var v=h[0];k(n,v,i[v.identifier],Math.floor(Math.log(t.k)/Math.LN2)+1),q()}m=p}else if(h.length>1){var v=h[0],g=h[1],y=v[0]-g[0],E=v[1]-g[1];s=y*y+E*E}}function b(){var t=e.touches(n),u,a,f,l;Lf.call(n);for(var c=0,h=t.length;c<h;++c,l=null){f=t[c];if(l=i[f.identifier]){if(a)break;u=f,a=l}}if(l){var p=(p=f[0]-u[0])*p+(p=f[1]-u[1])*p,d=s&&Math.sqrt(p/s);u=[(u[0]+f[0])/2,(u[1]+f[1])/2],a=[(a[0]+l[0])/2,(a[1]+l[1])/2],N(d*o)}m=null,C(u,a),O(r)}function w(){if(e.event.touches.length){var t=e.event.changedTouches;for(var n=0,s=t.length;n<s;++n)delete i[t[n].identifier];for(var o in i)return void d()}e.selectAll(l).on(u,null),h.on(c,_).on(v,D),p(),M(r)}var n=this,r=g.of(n,arguments),i={},s=0,o,u=".zoom-"+e.event.changedTouches[0].identifier,a="touchmove"+u,f="touchend"+u,l=[],h=e.select(n),p=xt(n);y(),A(r),h.on(c,null).on(v,y)}function P(){var r=g.of(this,arguments);d?clearTimeout(d):(Lf.call(this),n=x(i=o||e.mouse(this)),A(r)),d=setTimeout(function(){d=null,M(r)},50),q(),N(Math.pow(2,$t()*.002)*t.k),C(i,n),O(r)}function H(){var n=e.mouse(this),r=Math.log(t.k)/Math.LN2;k(this,n,x(n),e.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}var t={x:0,y:0,k:1},n,i,o,u=[960,500],a=Vt,f=250,l=0,c="mousedown.zoom",h="mousemove.zoom",p="mouseup.zoom",d,v="touchstart.zoom",m,g=U(S,"zoomstart","zoom","zoomend"),y,b,w,E;return Jt||(Jt="onwheel"in r?($t=function(){return-e.event.deltaY*(e.event.deltaMode?120:1)},"wheel"):"onmousewheel"in r?($t=function(){return e.event.wheelDelta},"mousewheel"):($t=function(){return-e.event.detail},"MozMousePixelScroll")),S.event=function(n){n.each(function(){var n=g.of(this,arguments),r=t;Df?e.select(this).transition().each("start.zoom",function(){t=this.__chart__||{x:0,y:0,k:1},A(n)}).tween("zoom:zoom",function(){var s=u[0],o=u[1],a=i?i[0]:s/2,f=i?i[1]:o/2,l=e.interpolateZoom([(a-t.x)/t.k,(f-t.y)/t.k,s/t.k],[(a-r.x)/r.k,(f-r.y)/r.k,s/r.k]);return function(e){var r=l(e),i=s/r[2];this.__chart__=t={x:a-r[0]*i,y:f-r[1]*i,k:i},O(n)}}).each("interrupt.zoom",function(){M(n)}).each("end.zoom",function(){M(n)}):(this.__chart__=t,A(n),O(n),M(n))})},S.translate=function(e){return arguments.length?(t={x:+e[0],y:+e[1],k:t.k},L(),S):[t.x,t.y]},S.scale=function(e){return arguments.length?(t={x:t.x,y:t.y,k:null},N(+e),L(),S):t.k},S.scaleExtent=function(e){return arguments.length?(a=e==null?Vt:[+e[0],+e[1]],S):a},S.center=function(e){return arguments.length?(o=e&&[+e[0],+e[1]],S):o},S.size=function(e){return arguments.length?(u=e&&[+e[0],+e[1]],S):u},S.duration=function(e){return arguments.length?(f=+e,S):f},S.x=function(e){return arguments.length?(b=e,y=e.copy(),t={x:0,y:0,k:1},S):b},S.y=function(e){return arguments.length?(E=e,w=e.copy(),t={x:0,y:0,k:1},S):E},e.rebind(S,g,"on")};var Vt=[0,Infinity],$t,Jt;e.color=Kt,Kt.prototype.toString=function(){return this.rgb()+""},e.hsl=Qt;var Gt=Qt.prototype=new Kt;Gt.brighter=function(e){return e=Math.pow(.7,arguments.length?e:1),new Qt(this.h,this.s,this.l/e)},Gt.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new Qt(this.h,this.s,e*this.l)},Gt.rgb=function(){return Yt(this.h,this.s,this.l)},e.hcl=Zt;var en=Zt.prototype=new Kt;en.brighter=function(e){return new Zt(this.h,this.c,Math.min(100,this.l+rn*(arguments.length?e:1)))},en.darker=function(e){return new Zt(this.h,this.c,Math.max(0,this.l-rn*(arguments.length?e:1)))},en.rgb=function(){return tn(this.h,this.c,this.l).rgb()},e.lab=nn;var rn=18,sn=.95047,on=1,un=1.08883,an=nn.prototype=new Kt;an.brighter=function(e){return new nn(Math.min(100,this.l+rn*(arguments.length?e:1)),this.a,this.b)},an.darker=function(e){return new nn(Math.max(0,this.l-rn*(arguments.length?e:1)),this.a,this.b)},an.rgb=function(){return fn(this.l,this.a,this.b)},e.rgb=dn;var gn=dn.prototype=new Kt;gn.brighter=function(e){e=Math.pow(.7,arguments.length?e:1);var t=this.r,n=this.g,r=this.b,i=30;return!t&&!n&&!r?new dn(i,i,i):(t&&t<i&&(t=i),n&&n<i&&(n=i),r&&r<i&&(r=i),new dn(Math.min(255,t/e),Math.min(255,n/e),Math.min(255,r/e)))},gn.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new dn(e*this.r,e*this.g,e*this.b)},gn.hsl=function(){return wn(this.r,this.g,this.b)},gn.toString=function(){return"#"+yn(this.r)+yn(this.g)+yn(this.b)};var Tn=e.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});Tn.forEach(function(e,t){Tn.set(e,vn(t))}),e.functor=Nn,e.xhr=Cn(D),e.dsv=function(e,t){function i(e,n,r){arguments.length<3&&(r=n,n=null);var i=kn(e,t,n==null?s:o(n),r);return i.row=function(e){return arguments.length?i.response((n=e)==null?s:o(e)):n},i}function s(e){return i.parse(e.responseText)}function o(e){return function(t){return i.parse(t.responseText,e)}}function u(t){return t.map(a).join(e)}function a(e){return n.test(e)?'"'+e.replace(/\"/g,'""')+'"':e}var n=new RegExp('["'+e+"\n]"),r=e.charCodeAt(0);return i.parse=function(e,t){var n;return i.parseRows(e,function(e,r){if(n)return n(e,r-1);var i=new Function("d","return {"+e.map(function(e,t){return JSON.stringify(e)+": d["+t+"]"}).join(",")+"}");n=t?function(e,n){return t(i(e),n)}:i})},i.parseRows=function(e,t){function c(){if(u>=o)return i;if(l)return l=!1,n;var t=u;if(e.charCodeAt(t)===34){var s=t;while(s++<o)if(e.charCodeAt(s)===34){if(e.charCodeAt(s+1)!==34)break;++s}u=s+2;var a=e.charCodeAt(s+1);return a===13?(l=!0,e.charCodeAt(s+2)===10&&++u):a===10&&(l=!0),e.slice(t+1,s).replace(/""/g,'"')}while(u<o){var a=e.charCodeAt(u++),f=1;if(a===10)l=!0;else if(a===13)l=!0,e.charCodeAt(u)===10&&(++u,++f);else if(a!==r)continue;return e.slice(t,u-f)}return e.slice(t)}var n={},i={},s=[],o=e.length,u=0,a=0,f,l;while((f=c())!==i){var h=[];while(f!==n&&f!==i)h.push(f),f=c();if(t&&(h=t(h,a++))==null)continue;s.push(h)}return s},i.format=function(t){if(Array.isArray(t[0]))return i.formatRows(t);var n=new _,r=[];return t.forEach(function(e){for(var t in e)n.has(t)||r.push(n.add(t))}),[r.map(a).join(e)].concat(t.map(function(t){return r.map(function(e){return a(t[e])}).join(e)})).join("\n")},i.formatRows=function(e){return e.map(u).join("\n")},i},e.csv=e.dsv(",","text/csv"),e.tsv=e.dsv("	","text/tab-separated-values");var On,Mn,_n,Dn,Pn=this[H(this,"requestAnimationFrame")]||function(e){setTimeout(e,17)};e.timer=function(){Hn.apply(this,arguments)},e.timer.flush=function(){jn(),Fn()},e.round=function(e,t){return t?Math.round(e*(t=Math.pow(10,t)))/t:Math.round(e)};var qn=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(Rn);e.formatPrefix=function(t,n){var r=0;if(t=+t)t<0&&(t*=-1),n&&(t=e.round(t,In(t,n))),r=1+Math.floor(1e-12+Math.log(t)/Math.LN10),r=Math.max(-24,Math.min(24,Math.floor((r-1)/3)*3));return qn[8+r/3]};var zn=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Wn=e.map({b:function(e){return e.toString(2)},c:function(e){return String.fromCharCode(e)},o:function(e){return e.toString(8)},x:function(e){return e.toString(16)},X:function(e){return e.toString(16).toUpperCase()},g:function(e,t){return e.toPrecision(t)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},r:function(t,n){return(t=e.round(t,In(t,n))).toFixed(Math.max(0,Math.min(20,In(t*(1+1e-15),n))))}}),Vn=e.time={},$n=Date;Jn.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(){Kn.setUTCDate.apply(this._,arguments)},setDay:function(){Kn.setUTCDay.apply(this._,arguments)},setFullYear:function(){Kn.setUTCFullYear.apply(this._,arguments)},setHours:function(){Kn.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Kn.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Kn.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Kn.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Kn.setUTCSeconds.apply(this._,arguments)},setTime:function(){Kn.setTime.apply(this._,arguments)}};var Kn=Date.prototype;Vn.year=Qn(function(e){return e=Vn.day(e),e.setMonth(0,1),e},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e){return e.getFullYear()}),Vn.years=Vn.year.range,Vn.years.utc=Vn.year.utc.range,Vn.day=Qn(function(e){var t=new $n(2e3,0);return t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t},function(e,t){e.setDate(e.getDate()+t)},function(e){return e.getDate()-1}),Vn.days=Vn.day.range,Vn.days.utc=Vn.day.utc.range,Vn.dayOfYear=function(e){var t=Vn.year(e);return Math.floor((e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(e,t){t=7-t;var n=Vn[e]=Qn(function(e){return(e=Vn.day(e)).setDate(e.getDate()-(e.getDay()+t)%7),e},function(e,t){e.setDate(e.getDate()+Math.floor(t)*7)},function(e){var n=Vn.year(e).getDay();return Math.floor((Vn.dayOfYear(e)+(n+t)%7)/7)-(n!==t)});Vn[e+"s"]=n.range,Vn[e+"s"].utc=n.utc.range,Vn[e+"OfYear"]=function(e){var n=Vn.year(e).getDay();return Math.floor((Vn.dayOfYear(e)+(n+t)%7)/7)}}),Vn.week=Vn.sunday,Vn.weeks=Vn.sunday.range,Vn.weeks.utc=Vn.sunday.utc.range,Vn.weekOfYear=Vn.sundayOfYear;var Zn={"-":"",_:" ",0:"0"},er=/^\s*\d+/,tr=/^%/;e.locale=function(e){return{numberFormat:Un(e),timeFormat:Yn(e)}};var Sr=e.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"]});e.format=Sr.numberFormat,e.geo={},xr.prototype={s:0,t:0,add:function(e){Nr(e,this.t,Tr),Nr(Tr.s,this.s,this),this.s?this.t+=Tr.t:this.s=Tr.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var Tr=new xr;e.geo.stream=function(e,t){e&&kr.hasOwnProperty(e.type)?kr[e.type](e,t):Cr(e,t)};var kr={Feature:function(e,t){Cr(e.geometry,t)},FeatureCollection:function(e,t){var n=e.features,r=-1,i=n.length;while(++r<i)Cr(n[r].geometry,t)}},Lr={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){var n=e.coordinates,r=-1,i=n.length;while(++r<i)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){Ar(e.coordinates,t,0)},MultiLineString:function(e,t){var n=e.coordinates,r=-1,i=n.length;while(++r<i)Ar(n[r],t,0)},Polygon:function(e,t){Or(e.coordinates,t)},MultiPolygon:function(e,t){var n=e.coordinates,r=-1,i=n.length;while(++r<i)Or(n[r],t)},GeometryCollection:function(e,t){var n=e.geometries,r=-1,i=n.length;while(++r<i)Cr(n[r],t)}};e.geo.area=function(t){return Mr=0,e.geo.stream(t,Dr),Mr};var Mr,_r=new xr,Dr={sphere:function(){Mr+=4*At},point:j,lineStart:j,lineEnd:j,polygonStart:function(){_r.reset(),Dr.lineStart=Pr},polygonEnd:function(){var e=2*_r;Mr+=e<0?4*At+e:e,Dr.lineStart=Dr.lineEnd=Dr.point=j}};e.geo.bounds=function(){function p(e,s){l.push(c=[t=e,r=e]),s<n&&(n=s),s>i&&(i=s)}function d(e,o){var u=Hr([e*Dt,o*Dt]);if(a){var f=jr(a,u),l=[f[1],-f[0],0],c=jr(l,f);qr(c),c=Rr(c);var h=e-s,d=h>0?1:-1,v=c[0]*Pt*d,m=b(h)>180;if(m^(d*s<v&&v<d*e)){var g=c[1]*Pt;g>i&&(i=g)}else if(v=(v+360)%360-180,m^(d*s<v&&v<d*e)){var g=-c[1]*Pt;g<n&&(n=g)}else o<n&&(n=o),o>i&&(i=o);m?e<s?E(t,e)>E(t,r)&&(r=e):E(e,r)>E(t,r)&&(t=e):r>=t?(e<t&&(t=e),e>r&&(r=e)):e>s?E(t,e)>E(t,r)&&(r=e):E(e,r)>E(t,r)&&(t=e)}else p(e,o);a=u,s=e}function v(){h.point=d}function m(){c[0]=t,c[1]=r,h.point=p,a=null}function g(e,t){if(a){var n=e-s;f+=b(n)>180?n+(n>0?360:-360):n}else o=e,u=t;Dr.point(e,t),d(e,t)}function y(){Dr.lineStart()}function w(){g(o,u),Dr.lineEnd(),b(f)>kt&&(t=-(r=180)),c[0]=t,c[1]=r,a=null}function E(e,t){return(t-=e)<0?t+360:t}function S(e,t){return e[0]-t[0]}function x(e,t){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}var t,n,r,i,s,o,u,a,f,l,c,h={point:p,lineStart:v,lineEnd:m,polygonStart:function(){h.point=g,h.lineStart=y,h.lineEnd=w,f=0,Dr.polygonStart()},polygonEnd:function(){Dr.polygonEnd(),h.point=p,h.lineStart=v,h.lineEnd=m,_r<0?(t=-(r=180),n=-(i=90)):f>kt?i=90:f<-kt&&(n=-90),c[0]=t,c[1]=r}};return function(s){i=r=-(t=n=Infinity),l=[],e.geo.stream(s,h);var o=l.length;if(o){l.sort(S);for(var u=1,a=l[0],f,p=[a];u<o;++u)f=l[u],x(f[0],a)||x(f[1],a)?(E(a[0],f[1])>E(a[0],a[1])&&(a[1]=f[1]),E(f[0],a[1])>E(a[0],a[1])&&(a[0]=f[0])):p.push(a=f);var d=-Infinity,v;for(var o=p.length-1,u=0,a=p[o],f;u<=o;a=f,++u)f=p[u],(v=E(a[1],f[0]))>d&&(d=v,t=f[0],r=a[1])}return l=c=null,t===Infinity||n===Infinity?[[NaN,NaN],[NaN,NaN]]:[[t,n],[r,i]]}}(),e.geo.centroid=function(t){zr=Wr=Xr=Vr=$r=Jr=Kr=Qr=Gr=Yr=Zr=0,e.geo.stream(t,ei);var n=Gr,r=Yr,i=Zr,s=n*n+r*r+i*i;if(s<Lt){n=Jr,r=Kr,i=Qr,Wr<kt&&(n=Xr,r=Vr,i=$r),s=n*n+r*r+i*i;if(s<Lt)return[NaN,NaN]}return[Math.atan2(r,n)*Pt,Ft(i/Math.sqrt(s))*Pt]};var zr,Wr,Xr,Vr,$r,Jr,Kr,Qr,Gr,Yr,Zr,ei={sphere:j,point:ti,lineStart:ri,lineEnd:ii,polygonStart:function(){ei.lineStart=si},polygonEnd:function(){ei.lineStart=ri}},vi=ci(ui,mi,yi,[-At,-At/2]),Si=1e9;e.geo.clipExtent=function(){var e,t,n,r,i,s,o={stream:function(e){return i&&(i.valid=!1),i=s(e),i.valid=!0,i},extent:function(u){return arguments.length?(s=xi(e=+u[0][0],t=+u[0][1],n=+u[1][0],r=+u[1][1]),i&&(i.valid=!1,i=null),o):[[e,t],[n,r]]}};return o.extent([[0,0],[960,500]])},(e.geo.conicEqualArea=function(){return Ti(Ni)}).raw=Ni,e.geo.albers=function(){return e.geo.conicEqualArea().rotate([96,0]).center([-0.6,38.7]).parallels([29.5,45.5]).scale(1070)},e.geo.albersUsa=function(){function f(e){var t=e[0],n=e[1];return i=null,(o(t,n),i)||(u(t,n),i)||a(t,n),i}var t=e.geo.albers(),n=e.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),r=e.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),i,s={point:function(e,t){i=[e,t]}},o,u,a;return f.invert=function(e){var i=t.scale(),s=t.translate(),o=(e[0]-s[0])/i,u=(e[1]-s[1])/i;return(u>=.12&&u<.234&&o>=-0.425&&o<-0.214?n:u>=.166&&u<.234&&o>=-0.214&&o<-0.115?r:t).invert(e)},f.stream=function(e){var i=t.stream(e),s=n.stream(e),o=r.stream(e);return{point:function(e,t){i.point(e,t),s.point(e,t),o.point(e,t)},sphere:function(){i.sphere(),s.sphere(),o.sphere()},lineStart:function(){i.lineStart(),s.lineStart(),o.lineStart()},lineEnd:function(){i.lineEnd(),s.lineEnd(),o.lineEnd()},polygonStart:function(){i.polygonStart(),s.polygonStart(),o.polygonStart()},polygonEnd:function(){i.polygonEnd(),s.polygonEnd(),o.polygonEnd()}}},f.precision=function(e){return arguments.length?(t.precision(e),n.precision(e),r.precision(e),f):t.precision()},f.scale=function(e){return arguments.length?(t.scale(e),n.scale(e*.35),r.scale(e),f.translate(t.translate())):t.scale()},f.translate=function(e){if(!arguments.length)return t.translate();var i=t.scale(),l=+e[0],c=+e[1];return o=t.translate(e).clipExtent([[l-.455*i,c-.238*i],[l+.455*i,c+.238*i]]).stream(s).point,u=n.translate([l-.307*i,c+.201*i]).clipExtent([[l-.425*i+kt,c+.12*i+kt],[l-.214*i-kt,c+.234*i-kt]]).stream(s).point,a=r.translate([l-.205*i,c+.212*i]).clipExtent([[l-.214*i+kt,c+.166*i+kt],[l-.115*i-kt,c+.234*i-kt]]).stream(s).point,f},f.scale(1070)};var Ci,ki,Li={point:j,lineStart:j,lineEnd:j,polygonStart:function(){ki=0,Li.lineStart=Ai},polygonEnd:function(){Li.lineStart=Li.lineEnd=Li.point=j,Ci+=b(ki/2)}},Oi,Mi,_i,Di,Pi={point:Hi,lineStart:j,lineEnd:j,polygonStart:j,polygonEnd:j},Fi={point:Ii,lineStart:qi,lineEnd:Ri,polygonStart:function(){Fi.lineStart=Ui},polygonEnd:function(){Fi.point=Ii,Fi.lineStart=qi,Fi.lineEnd=Ri}};e.geo.path=function(){function u(n){if(n){typeof t=="function"&&s.pointRadius(+t.apply(this,arguments));if(!o||!o.valid)o=i(s);e.geo.stream(n,o)}return s.result()}function a(){return o=null,u}var t=4.5,n,r,i,s,o;return u.area=function(t){return Ci=0,e.geo.stream(t,i(Li)),Ci},u.centroid=function(t){return Xr=Vr=$r=Jr=Kr=Qr=Gr=Yr=Zr=0,e.geo.stream(t,i(Fi)),Zr?[Gr/Zr,Yr/Zr]:Qr?[Jr/Qr,Kr/Qr]:$r?[Xr/$r,Vr/$r]:[NaN,NaN]},u.bounds=function(t){return _i=Di=-(Oi=Mi=Infinity),e.geo.stream(t,i(Pi)),[[Oi,Mi],[_i,Di]]},u.projection=function(e){return arguments.length?(i=(n=e)?e.stream||Xi(e):D,a()):n},u.context=function(e){return arguments.length?(s=(r=e)==null?new Bi:new zi(e),typeof t!="function"&&s.pointRadius(t),a()):r},u.pointRadius=function(e){return arguments.length?(t=typeof e=="function"?e:(s.pointRadius(+e),+e),u):t},u.projection(e.geo.albersUsa()).context(null)},e.geo.transform=function(e){return{stream:function(t){var n=new Vi(t);for(var r in e)n[r]=e[r];return n}}},Vi.prototype={point:function(e,t){this.stream.point(e,t)},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()}},e.geo.projection=Ji,e.geo.projectionMutator=Ki,(e.geo.equirectangular=function(){return Ji(Gi)}).raw=Gi.invert=Gi,e.geo.rotation=function(e){function t(t){return t=e(t[0]*Dt,t[1]*Dt),t[0]*=Pt,t[1]*=Pt,t}return e=Zi(e[0]%360*Dt,e[1]*Dt,e.length>2?e[2]*Dt:0),t.invert=function(t){return t=e.invert(t[0]*Dt,t[1]*Dt),t[0]*=Pt,t[1]*=Pt,t},t},Yi.invert=Gi,e.geo.circle=function(){function i(){var t=typeof e=="function"?e.apply(this,arguments):e,n=Zi(-t[0]*Dt,-t[1]*Dt,0).invert,i=[];return r(null,null,1,{point:function(e,t){i.push(e=n(e,t)),e[0]*=Pt,e[1]*=Pt}}),{type:"Polygon",coordinates:[i]}}var e=[0,0],t,n=6,r;return i.origin=function(t){return arguments.length?(e=t,i):e},i.angle=function(e){return arguments.length?(r=rs((t=+e)*Dt,n*Dt),i):t},i.precision=function(e){return arguments.length?(r=rs(t*Dt,(n=+e)*Dt),i):n},i.angle(90)},e.geo.distance=function(e,t){var n=(t[0]-e[0])*Dt,r=e[1]*Dt,i=t[1]*Dt,s=Math.sin(n),o=Math.cos(n),u=Math.sin(r),a=Math.cos(r),f=Math.sin(i),l=Math.cos(i),c;return Math.atan2(Math.sqrt((c=l*s)*c+(c=a*f-u*l*o)*c),u*f+a*l*o)},e.geo.graticule=function(){function y(){return{type:"MultiLineString",coordinates:w()}}function w(){return e.range(Math.ceil(i/c)*c,r,c).map(v).concat(e.range(Math.ceil(a/h)*h,u,h).map(m)).concat(e.range(Math.ceil(n/f)*f,t,f).filter(function(e){return b(e%c)>kt}).map(p)).concat(e.range(Math.ceil(o/l)*l,s,l).filter(function(e){return b(e%h)>kt}).map(d))}var t,n,r,i,s,o,u,a,f=10,l=f,c=90,h=360,p,d,v,m,g=2.5;return y.lines=function(){return w().map(function(e){return{type:"LineString",coordinates:e}})},y.outline=function(){return{type:"Polygon",coordinates:[v(i).concat(m(u).slice(1),v(r).reverse().slice(1),m(a).reverse().slice(1))]}},y.extent=function(e){return arguments.length?y.majorExtent(e).minorExtent(e):y.minorExtent()},y.majorExtent=function(e){return arguments.length?(i=+e[0][0],r=+e[1][0],a=+e[0][1],u=+e[1][1],i>r&&(e=i,i=r,r=e),a>u&&(e=a,a=u,u=e),y.precision(g)):[[i,a],[r,u]]},y.minorExtent=function(e){return arguments.length?(n=+e[0][0],t=+e[1][0],o=+e[0][1],s=+e[1][1],n>t&&(e=n,n=t,t=e),o>s&&(e=o,o=s,s=e),y.precision(g)):[[n,o],[t,s]]},y.step=function(e){return arguments.length?y.majorStep(e).minorStep(e):y.minorStep()},y.majorStep=function(e){return arguments.length?(c=+e[0],h=+e[1],y):[c,h]},y.minorStep=function(e){return arguments.length?(f=+e[0],l=+e[1],y):[f,l]},y.precision=function(e){return arguments.length?(g=+e,p=ss(o,s,90),d=os(n,t,g),v=ss(a,u,90),m=os(i,r,g),y):g},y.majorExtent([[-180,-90+kt],[180,90-kt]]).minorExtent([[-180,-80-kt],[180,80+kt]])},e.geo.greatArc=function(){function s(){return{type:"LineString",coordinates:[n||t.apply(this,arguments),i||r.apply(this,arguments)]}}var t=us,n,r=as,i;return s.distance=function(){return e.geo.distance(n||t.apply(this,arguments),i||r.apply(this,arguments))},s.source=function(e){return arguments.length?(t=e,n=typeof e=="function"?null:e,s):t},s.target=function(e){return arguments.length?(r=e,i=typeof e=="function"?null:e,s):r},s.precision=function(){return arguments.length?s:0},s},e.geo.interpolate=function(e,t){return fs(e[0]*Dt,e[1]*Dt,t[0]*Dt,t[1]*Dt)},e.geo.length=function(t){return ls=0,e.geo.stream(t,cs),ls};var ls,cs={sphere:j,point:j,lineStart:hs,lineEnd:j,polygonStart:j,polygonEnd:j},ds=ps(function(e){return Math.sqrt(2/(1+e))},function(e){return 2*Math.asin(e/2)});(e.geo.azimuthalEqualArea=function(){return Ji(ds)}).raw=ds;var vs=ps(function(e){var t=Math.acos(e);return t&&t/Math.sin(t)},D);(e.geo.azimuthalEquidistant=function(){return Ji(vs)}).raw=vs,(e.geo.conicConformal=function(){return Ti(ms)}).raw=ms,(e.geo.conicEquidistant=function(){return Ti(gs)}).raw=gs;var ys=ps(function(e){return 1/e},Math.atan);(e.geo.gnomonic=function(){return Ji(ys)}).raw=ys,bs.invert=function(e,t){return[e,2*Math.atan(Math.exp(t))-_t]},(e.geo.mercator=function(){return ws(bs)}).raw=bs;var Es=ps(function(){return 1},Math.asin);(e.geo.orthographic=function(){return Ji(Es)}).raw=Es;var Ss=ps(function(e){return 1/(1+e)},function(e){return 2*Math.atan(e)});(e.geo.stereographic=function(){return Ji(Ss)}).raw=Ss,xs.invert=function(e,t){return[-t,2*Math.atan(Math.exp(e))-_t]},(e.geo.transverseMercator=function(){var e=ws(xs),t=e.center,n=e.rotate;return e.center=function(e){return e?t([-e[1],e[0]]):(e=t(),[e[1],-e[0]])},e.rotate=function(e){return e?n([e[0],e[1],e.length>2?e[2]+90:90]):(e=n(),[e[0],e[1],e[2]-90])},n([0,0,90])}).raw=xs,e.geom={},e.geom.hull=function(e){function r(e){if(e.length<3)return[];var r=Nn(t),i=Nn(n),s,o=e.length,u=[],a=[];for(s=0;s<o;s++)u.push([+r.call(this,e[s],s),+i.call(this,e[s],s),s]);u.sort(ks);for(s=0;s<o;s++)a.push([u[s][0],-u[s][1]]);var f=Cs(u),l=Cs(a),c=l[0]===f[0],h=l[l.length-1]===f[f.length-1],p=[];for(s=f.length-1;s>=0;--s)p.push(e[u[f[s]][2]]);for(s=+c;s<l.length-h;++s)p.push(e[u[l[s]][2]]);return p}var t=Ts,n=Ns;return arguments.length?r(e):(r.x=function(e){return arguments.length?(t=e,r):t},r.y=function(e){return arguments.length?(n=e,r):n},r)},e.geom.polygon=function(e){return W(e,Ls),e};var Ls=e.geom.polygon.prototype=[];Ls.area=function(){var e=-1,t=this.length,n,r=this[t-1],i=0;while(++e<t)n=r,r=this[e],i+=n[1]*r[0]-n[0]*r[1];return i*.5},Ls.centroid=function(e){var t=-1,n=this.length,r=0,i=0,s,o=this[n-1],u;arguments.length||(e=-1/(6*this.area()));while(++t<n)s=o,o=this[t],u=s[0]*o[1]-o[0]*s[1],r+=(s[0]+o[0])*u,i+=(s[1]+o[1])*u;return[r*e,i*e]},Ls.clip=function(e){var t,n=Ms(e),r=-1,i=this.length-Ms(this),s,o,u=this[i-1],a,f,l;while(++r<i){t=e.slice(),e.length=0,a=this[r],f=t[(o=t.length-n)-1],s=-1;while(++s<o)l=t[s],As(l,u,a)?(As(f,u,a)||e.push(Os(f,l,u,a)),e.push(l)):As(f,u,a)&&e.push(Os(f,l,u,a)),f=l;n&&e.push(e[0]),u=a}return e};var _s,Ds,Ps,Hs=[],Bs,js,Fs=[];Vs.prototype.prepare=function(){var e=this.edges,t=e.length,n;while(t--)n=e[t].edge,(!n.b||!n.a)&&e.splice(t,1);return e.sort(Js),e.length},io.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}},so.prototype={insert:function(e,t){var n,r,i;if(e){t.P=e,t.N=e.N,e.N&&(e.N.P=t),e.N=t;if(e.R){e=e.R;while(e.L)e=e.L;e.L=t}else e.R=t;n=e}else this._?(e=fo(this._),t.P=null,t.N=e,e.P=e.L=t,n=e):(t.P=t.N=null,this._=t,n=null);t.L=t.R=null,t.U=n,t.C=!0,e=t;while(n&&n.C)r=n.U,n===r.L?(i=r.R,i&&i.C?(n.C=i.C=!1,r.C=!0,e=r):(e===n.R&&(uo(this,n),e=n,n=e.U),n.C=!1,r.C=!0,ao(this,r))):(i=r.L,i&&i.C?(n.C=i.C=!1,r.C=!0,e=r):(e===n.L&&(ao(this,n),e=n,n=e.U),n.C=!1,r.C=!0,uo(this,r))),n=e.U;this._.C=!1},remove:function(e){e.N&&(e.N.P=e.P),e.P&&(e.P.N=e.N),e.N=e.P=null;var t=e.U,n,r=e.L,i=e.R,s,o;r?i?s=fo(i):s=r:s=i,t?t.L===e?t.L=s:t.R=s:this._=s,r&&i?(o=s.C,s.C=e.C,s.L=r,r.U=s,s!==i?(t=s.U,s.U=e.U,e=s.R,t.L=e,s.R=i,i.U=s):(s.U=t,t=s,e=s.R)):(o=e.C,e=s),e&&(e.U=t);if(o)return;if(e&&e.C){e.C=!1;return}do{if(e===this._)break;if(e===t.L){n=t.R,n.C&&(n.C=!1,t.C=!0,uo(this,t),n=t.R);if(n.L&&n.L.C||n.R&&n.R.C){if(!n.R||!n.R.C)n.L.C=!1,n.C=!0,ao(this,n),n=t.R;n.C=t.C,t.C=n.R.C=!1,uo(this,t),e=this._;break}}else{n=t.L,n.C&&(n.C=!1,t.C=!0,ao(this,t),n=t.L);if(n.L&&n.L.C||n.R&&n.R.C){if(!n.L||!n.L.C)n.R.C=!1,n.C=!0,uo(this,n),n=t.L;n.C=t.C,t.C=n.L.C=!1,ao(this,t),e=this._;break}}n.C=!0,e=t,t=t.U}while(!e.C);e&&(e.C=!1)}},e.geom.voronoi=function(e){function o(e){var t=new Array(e.length),n=s[0][0],r=s[0][1],i=s[1][0],o=s[1][1];return lo(u(e),s).cells.forEach(function(s,u){var a=s.edges,f=s.site,l=t[u]=a.length?a.map(function(e){var t=e.start();return[t.x,t.y]}):f.x>=n&&f.x<=i&&f.y>=r&&f.y<=o?[[n,o],[i,o],[i,r],[n,r]]:[];l.point=e[u]}),t}function u(e){return e.map(function(e,t){return{x:Math.round(r(e,t)/kt)*kt,y:Math.round(i(e,t)/kt)*kt,i:t}})}var t=Ts,n=Ns,r=t,i=n,s=ho;return e?o(e):(o.links=function(e){return lo(u(e)).edges.filter(function(e){return e.l&&e.r}).map(function(t){return{source:e[t.l.i],target:e[t.r.i]}})},o.triangles=function(e){var t=[];return lo(u(e)).cells.forEach(function(n,r){var i=n.site,s=n.edges.sort(Js),o=-1,u=s.length,a,f,l=s[u-1].edge,c=l.l===i?l.r:l.l;while(++o<u)a=l,f=c,l=s[o].edge,c=l.l===i?l.r:l.l,r<f.i&&r<c.i&&po(i,f,c)<0&&t.push([e[r],e[f.i],e[c.i]])}),t},o.x=function(e){return arguments.length?(r=Nn(t=e),o):t},o.y=function(e){return arguments.length?(i=Nn(n=e),o):n},o.clipExtent=function(e){return arguments.length?(s=e==null?ho:e,o):s===ho?null:s},o.size=function(e){return arguments.length?o.clipExtent(e&&[[0,0],e]):s===ho?null:s&&s[1]},o)};var ho=[[-1e6,-1e6],[1e6,1e6]];e.geom.delaunay=function(t){return e.geom.voronoi().triangles(t)},e.geom.quadtree=function(e,t,n,r,i){function a(e){function T(e,t,n,r,i,s,o,u){if(isNaN(n)||isNaN(r))return;if(e.leaf){var a=e.x,f=e.y;if(a!=null)if(b(a-n)+b(f-r)<.01)N(e,t,n,r,i,s,o,u);else{var l=e.point;e.x=e.y=e.point=null,N(e,l,a,f,i,s,o,u),N(e,t,n,r,i,s,o,u)}else e.x=n,e.y=r,e.point=t}else N(e,t,n,r,i,s,o,u)}function N(e,t,n,r,i,s,o,u){var a=(i+o)*.5,f=(s+u)*.5,l=n>=a,c=r>=f,h=c<<1|l;e.leaf=!1,e=e.nodes[h]||(e.nodes[h]=go()),l?i=a:o=a,c?s=f:u=f,T(e,t,n,r,i,s,o,u)}var a,f=Nn(s),l=Nn(o),c,h,p,d,v,m,g,y;if(t!=null)v=t,m=n,g=r,y=i;else{g=y=-(v=m=Infinity),c=[],h=[],d=e.length;if(u)for(p=0;p<d;++p)a=e[p],a.x<v&&(v=a.x),a.y<m&&(m=a.y),a.x>g&&(g=a.x),a.y>y&&(y=a.y),c.push(a.x),h.push(a.y);else for(p=0;p<d;++p){var w=+f(a=e[p],p),E=+l(a,p);w<v&&(v=w),E<m&&(m=E),w>g&&(g=w),E>y&&(y=E),c.push(w),h.push(E)}}var S=g-v,x=y-m;S>x?y=m+S:g=v+x;var C=go();C.add=function(e){T(C,e,+f(e,++p),+l(e,p),v,m,g,y)},C.visit=function(e){yo(e,C,v,m,g,y)},C.find=function(e){return bo(C,e[0],e[1],v,m,g,y)},p=-1;if(t==null){while(++p<d)T(C,e[p],c[p],h[p],v,m,g,y);--p}else e.forEach(C.add);return c=h=e=a=null,C}var s=Ts,o=Ns,u;return(u=arguments.length)?(s=vo,o=mo,u===3&&(i=n,r=t,n=t=0),a(e)):(a.x=function(e){return arguments.length?(s=e,a):s},a.y=function(e){return arguments.length?(o=e,a):o},a.extent=function(e){return arguments.length?(e==null?t=n=r=i=null:(t=+e[0][0],n=+e[0][1],r=+e[1][0],i=+e[1][1]),a):t==null?null:[[t,n],[r,i]]},a.size=function(e){return arguments.length?(e==null?t=n=r=i=null:(t=n=0,r=+e[0],i=+e[1]),a):t==null?null:[r-t,i-n]},a)},e.interpolateRgb=wo,e.interpolateObject=Eo,e.interpolateNumber=So,e.interpolateString=xo;var To=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,No=new RegExp(To.source,"g");e.interpolate=Co,e.interpolators=[function(e,t){var n=typeof t;return(n==="string"?Tn.has(t.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(t)?wo:xo:t instanceof Kt?wo:Array.isArray(t)?ko:n==="object"&&isNaN(t)?Eo:So)(e,t)}],e.interpolateArray=ko;var Lo=function(){return D},Ao=e.map({linear:Lo,poly:jo,quad:function(){return Po},cubic:function(){return Ho},sin:function(){return Fo},exp:function(){return Io},circle:function(){return qo},elastic:Ro,back:Uo,bounce:function(){return zo}}),Oo=e.map({"in":D,out:_o,"in-out":Do,"out-in":function(e){return Do(_o(e))}});e.ease=function(e){var n=e.indexOf("-"),r=n>=0?e.slice(0,n):e,i=n>=0?e.slice(n+1):"in";return r=Ao.get(r)||Lo,i=Oo.get(i)||D,Mo(i(r.apply(null,t.call(arguments,1))))},e.interpolateHcl=Wo,e.interpolateHsl=Xo,e.interpolateLab=Vo,e.interpolateRound=$o,e.transform=function(t){var n=r.createElementNS(e.ns.prefix.svg,"g");return(e.transform=function(e){if(e!=null){n.setAttribute("transform",e);var t=n.transform.baseVal.consolidate()}return new Jo(t?t.matrix:Yo)})(t)},Jo.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Yo={a:1,b:0,c:0,d:1,e:0,f:0};e.interpolateTransform=iu,e.layout={},e.layout.bundle=function(){return function(e){var t=[],n=-1,r=e.length;while(++n<r)t.push(uu(e[n]));return t}},e.layout.chord=function(){function l(){var t={},l=[],h=e.range(s),p=[],d,v,m,g,y;n=[],r=[],d=0,g=-1;while(++g<s){v=0,y=-1;while(++y<s)v+=i[g][y];l.push(v),p.push(e.range(s)),d+=v}u&&h.sort(function(e,t){return u(l[e],l[t])}),a&&p.forEach(function(e,t){e.sort(function(e,n){return a(i[t][e],i[t][n])})}),d=(Ot-o*s)/d,v=0,g=-1;while(++g<s){m=v,y=-1;while(++y<s){var b=h[g],w=p[b][y],E=i[b][w],S=v,x=v+=E*d;t[b+"-"+w]={index:b,subindex:w,startAngle:S,endAngle:x,value:E}}r[b]={index:b,startAngle:m,endAngle:v,value:l[b]},v+=o}g=-1;while(++g<s){y=g-1;while(++y<s){var T=t[g+"-"+y],N=t[y+"-"+g];(T.value||N.value)&&n.push(T.value<N.value?{source:N,target:T}:{source:T,target:N})}}f&&c()}function c(){n.sort(function(e,t){return f((e.source.value+e.target.value)/2,(t.source.value+t.target.value)/2)})}var t={},n,r,i,s,o=0,u,a,f;return t.matrix=function(e){return arguments.length?(s=(i=e)&&i.length,n=r=null,t):i},t.padding=function(e){return arguments.length?(o=e,n=r=null,t):o},t.sortGroups=function(e){return arguments.length?(u=e,n=r=null,t):u},t.sortSubgroups=function(e){return arguments.length?(a=e,n=null,t):a},t.sortChords=function(e){return arguments.length?(f=e,n&&c(),t):f},t.chords=function(){return n||l(),n},t.groups=function(){return r||l(),r},t},e.layout.force=function(){function b(e){return function(t,n,r,i){if(t.point!==e){var s=t.cx-e.x,o=t.cy-e.y,u=i-n,a=s*s+o*o;if(u*u/p<a){if(a<c){var f=t.charge/a;e.px-=s*f,e.py-=o*f}return!0}if(t.point&&a&&a<c){var f=t.pointCharge/a;e.px-=s*f,e.py-=o*f}}return!t.charge}}function w(n){n.px=e.event.x,n.py=e.event.y,t.resume()}var t={},n=e.dispatch("start","tick","end"),r,i=[1,1],s,o,u=.9,a=vu,f=mu,l=-30,c=gu,h=.1,p=.64,d=[],v=[],m,g,y;return t.tick=function(){if((o*=.99)<.005)return r=null,n.end({type:"end",alpha:o=0}),!0;var t=d.length,s=v.length,a,f,c,p,w,E,S,x,T;for(f=0;f<s;++f){c=v[f],p=c.source,w=c.target,x=w.x-p.x,T=w.y-p.y;if(E=x*x+T*T)E=o*g[f]*((E=Math.sqrt(E))-m[f])/E,x*=E,T*=E,w.x-=x*(S=p.weight+w.weight?p.weight/(p.weight+w.weight):.5),w.y-=T*S,p.x+=x*(S=1-S),p.y+=T*S}if(S=o*h){x=i[0]/2,T=i[1]/2,f=-1;if(S)while(++f<t)c=d[f],c.x+=(x-c.x)*S,c.y+=(T-c.y)*S}if(l){du(a=e.geom.quadtree(d),o,y),f=-1;while(++f<t)(c=d[f]).fixed||a.visit(b(c))}f=-1;while(++f<t)c=d[f],c.fixed?(c.x=c.px,c.y=c.py):(c.x-=(c.px-(c.px=c.x))*u,c.y-=(c.py-(c.py=c.y))*u);n.tick({type:"tick",alpha:o})},t.nodes=function(e){return arguments.length?(d=e,t):d},t.links=function(e){return arguments.length?(v=e,t):v},t.size=function(e){return arguments.length?(i=e,t):i},t.linkDistance=function(e){return arguments.length?(a=typeof e=="function"?e:+e,t):a},t.distance=t.linkDistance,t.linkStrength=function(e){return arguments.length?(f=typeof e=="function"?e:+e,t):f},t.friction=function(e){return arguments.length?(u=+e,t):u},t.charge=function(e){return arguments.length?(l=typeof e=="function"?e:+e,t):l},t.chargeDistance=function(e){return arguments.length?(c=e*e,t):Math.sqrt(c)},t.gravity=function(e){return arguments.length?(h=+e,t):h},t.theta=function(e){return arguments.length?(p=e*e,t):Math.sqrt(p)},t.alpha=function(e){return arguments.length?(e=+e,o?e>0?o=e:(r.c=null,r.t=NaN,r=null,n.end({type:"end",alpha:o=0})):e>0&&(n.start({type:"start",alpha:o=e}),r=Hn(t.tick)),t):o},t.start=function(){function h(t,i){if(!u){u=new Array(n);for(a=0;a<n;++a)u[a]=[];for(a=0;a<r;++a){var s=v[a];u[s.source.index].push(s.target),u[s.target.index].push(s.source)}}var o=u[e],a=-1,f=o.length,l;while(++a<f)if(!isNaN(l=o[a][t]))return l;return Math.random()*i}var e,n=d.length,r=v.length,s=i[0],o=i[1],u,c;for(e=0;e<n;++e)(c=d[e]).index=e,c.weight=0;for(e=0;e<r;++e)c=v[e],typeof c.source=="number"&&(c.source=d[c.source]),typeof c.target=="number"&&(c.target=d[c.target]),++c.source.weight,++c.target.weight;for(e=0;e<n;++e)c=d[e],isNaN(c.x)&&(c.x=h("x",s)),isNaN(c.y)&&(c.y=h("y",o)),isNaN(c.px)&&(c.px=c.x),isNaN(c.py)&&(c.py=c.y);m=[];if(typeof a=="function")for(e=0;e<r;++e)m[e]=+a.call(this,v[e],e);else for(e=0;e<r;++e)m[e]=a;g=[];if(typeof f=="function")for(e=0;e<r;++e)g[e]=+f.call(this,v[e],e);else for(e=0;e<r;++e)g[e]=f;y=[];if(typeof l=="function")for(e=0;e<n;++e)y[e]=+l.call(this,d[e],e);else for(e=0;e<n;++e)y[e]=l;return t.resume()},t.resume=function(){return t.alpha(.1)},t.stop=function(){return t.alpha(0)},t.drag=function(){s||(s=e.behavior.drag().origin(D).on("dragstart.force",lu).on("drag.force",w).on("dragend.force",cu));if(!arguments.length)return s;this.on("mouseover.force",hu).on("mouseout.force",pu).call(s)},e.rebind(t,n,"on")};var vu=20,mu=1,gu=Infinity;e.layout.hierarchy=function(){function r(i){var s=[i],o=[],u;i.depth=0;while((u=s.pop())!=null){o.push(u);if((f=t.call(r,u,u.depth))&&(a=f.length)){var a,f,l;while(--a>=0)s.push(l=f[a]),l.parent=u,l.depth=u.depth+1;n&&(u.value=0),u.children=f}else n&&(u.value=+n.call(r,u,u.depth)||0),delete u.children}return wu(i,function(t){var r,i;e&&(r=t.children)&&r.sort(e),n&&(i=t.parent)&&(i.value+=t.value)}),o}var e=xu,t=Eu,n=Su;return r.sort=function(t){return arguments.length?(e=t,r):e},r.children=function(e){return arguments.length?(t=e,r):t},r.value=function(e){return arguments.length?(n=e,r):n},r.revalue=function(e){return n&&(bu(e,function(e){e.children&&(e.value=0)}),wu(e,function(e){var t;e.children||(e.value=+n.call(r,e,e.depth)||0);if(t=e.parent)t.value+=e.value})),e},r},e.layout.partition=function(){function r(e,t,n,i){var s=e.children;e.x=t,e.y=e.depth*i,e.dx=n,e.dy=i;if(s&&(u=s.length)){var o=-1,u,a,f;n=e.value?n/e.value:0;while(++o<u)r(a=s[o],t,f=a.value*n,i),t+=f}}function i(e){var t=e.children,n=0;if(t&&(s=t.length)){var r=-1,s;while(++r<s)n=Math.max(n,i(t[r]))}return 1+n}function s(e,s){var o=t.call(this,e,s);return r(o[0],0,n[0],n[1]/i(o[0])),o}var t=e.layout.hierarchy(),n=[1,1];return s.size=function(e){return arguments.length?(n=e,s):n},yu(s,t)},e.layout.pie=function(){function o(u){var a=u.length,f=u.map(function(e,n){return+t.call(o,e,n)}),l=+(typeof r=="function"?r.apply(this,arguments):r),c=(typeof i=="function"?i.apply(this,arguments):i)-l,h=Math.min(Math.abs(c)/a,+(typeof s=="function"?s.apply(this,arguments):s)),p=h*(c<0?-1:1),d=e.sum(f),v=d?(c-a*p)/d:0,m=e.range(a),g=[],y;return n!=null&&m.sort(n===Nu?function(e,t){return f[t]-f[e]}:function(e,t){return n(u[e],u[t])}),m.forEach(function(e){g[e]={data:u[e],value:y=f[e],startAngle:l,endAngle:l+=y*v+p,padAngle:h}}),g}var t=Number,n=Nu,r=0,i=Ot,s=0;return o.value=function(e){return arguments.length?(t=e,o):t},o.sort=function(e){return arguments.length?(n=e,o):n},o.startAngle=function(e){return arguments.length?(r=e,o):r},o.endAngle=function(e){return arguments.length?(i=e,o):i},o.padAngle=function(e){return arguments.length?(s=e,o):s},o};var Nu={};e.layout.stack=function(){function u(a,f){if(!(v=a.length))return a;var l=a.map(function(e,n){return t.call(u,e,n)}),c=l.map(function(e){return e.map(function(e,t){return[s.call(u,e,t),o.call(u,e,t)]})}),h=n.call(u,c,f);l=e.permute(l,h),c=e.permute(c,h);var p=r.call(u,c,f),d=l[0].length,v,m,g,y;for(g=0;g<d;++g){i.call(u,l[0][g],y=p[g],c[0][g][1]);for(m=1;m<v;++m)i.call(u,l[m][g],y+=c[m-1][g][1],c[m][g][1])}return a}var t=D,n=Mu,r=_u,i=Lu,s=Cu,o=ku;return u.values=function(e){return arguments.length?(t=e,u):t},u.order=function(e){return arguments.length?(n=typeof e=="function"?e:Au.get(e)||Mu,u):n},u.offset=function(e){return arguments.length?(r=typeof e=="function"?e:Ou.get(e)||_u,u):r},u.x=function(e){return arguments.length?(s=e,u):s},u.y=function(e){return arguments.length?(o=e,u):o},u.out=function(e){return arguments.length?(i=e,u):i},u};var Au=e.map({"inside-out":function(t){var n=t.length,r,i,s=t.map(Du),o=t.map(Pu),u=e.range(n).sort(function(e,t){return s[e]-s[t]}),a=0,f=0,l=[],c=[];for(r=0;r<n;++r)i=u[r],a<f?(a+=o[i],l.push(i)):(f+=o[i],c.push(i));return c.reverse().concat(l)},reverse:function(t){return e.range(t.length).reverse()},"default":Mu}),Ou=e.map({silhouette:function(e){var t=e.length,n=e[0].length,r=[],i=0,s,o,u,a=[];for(o=0;o<n;++o){for(s=0,u=0;s<t;s++)u+=e[s][o][1];u>i&&(i=u),r.push(u)}for(o=0;o<n;++o)a[o]=(i-r[o])/2;return a},wiggle:function(e){var t=e.length,n=e[0],r=n.length,i,s,o,u,a,f,l,c,h,p=[];p[0]=c=h=0;for(s=1;s<r;++s){for(i=0,u=0;i<t;++i)u+=e[i][s][1];for(i=0,a=0,l=n[s][0]-n[s-1][0];i<t;++i){for(o=0,f=(e[i][s][1]-e[i][s-1][1])/(2*l);o<i;++o)f+=(e[o][s][1]-e[o][s-1][1])/l;a+=f*e[i][s][1]}p[s]=c-=u?a/u*l:0,c<h&&(h=c)}for(s=0;s<r;++s)p[s]-=h;return p},expand:function(e){var t=e.length,n=e[0].length,r=1/t,i,s,o,u=[];for(s=0;s<n;++s){for(i=0,o=0;i<t;i++)o+=e[i][s][1];if(o)for(i=0;i<t;i++)e[i][s][1]/=o;else for(i=0;i<t;i++)e[i][s][1]=r}for(s=0;s<n;++s)u[s]=0;return u},zero:_u});e.layout.histogram=function(){function s(s,o){var u=[],a=s.map(n,this),f=r.call(this,a,o),l=i.call(this,f,a,o),c,o=-1,h=a.length,p=l.length-1,d=t?1:1/h,v;while(++o<p)c=u[o]=[],c.dx=l[o+1]-(c.x=l[o]),c.y=0;if(p>0){o=-1;while(++o<h)v=a[o],v>=f[0]&&v<=f[1]&&(c=u[e.bisect(l,v,1,p)-1],c.y+=d,c.push(s[o]))}return u}var t=!0,n=Number,r=Fu,i=Bu;return s.value=function(e){return arguments.length?(n=e,s):n},s.range=function(e){return arguments.length?(r=Nn(e),s):r},s.bins=function(e){return arguments.length?(i=typeof e=="number"?function(t){return ju(t,e)}:Nn(e),s):i},s.frequency=function(e){return arguments.length?(t=!!e,s):t},s},e.layout.pack=function(){function s(e,s){var o=t.call(this,e,s),u=o[0],a=r[0],f=r[1],l=i==null?Math.sqrt:typeof i=="function"?i:function(){return i};u.x=u.y=0,wu(u,function(e){e.r=+l(e.value)}),wu(u,zu);if(n){var c=n*(i?1:Math.max(2*u.r/a,2*u.r/f))/2;wu(u,function(e){e.r+=c}),wu(u,zu),wu(u,function(e){e.r-=c})}return Vu(u,a/2,f/2,i?1:1/Math.max(2*u.r/a,2*u.r/f)),o}var t=e.layout.hierarchy().sort(Iu),n=0,r=[1,1],i;return s.size=function(e){return arguments.length?(r=e,s):r},s.radius=function(e){return arguments.length?(i=e==null||typeof e=="function"?e:+e,s):i},s.padding=function(e){return arguments.length?(n=+e,s):n},yu(s,t)},e.layout.tree=function(){function s(e,s){var f=t.call(this,e,s),c=f[0],h=o(c);wu(h,u),h.parent.m=-h.z,bu(h,a);if(i)bu(c,l);else{var p=c,d=c,v=c;bu(c,function(e){e.x<p.x&&(p=e),e.x>d.x&&(d=e),e.depth>v.depth&&(v=e)});var m=n(p,d)/2-p.x,g=r[0]/(d.x+n(d,p)/2+m),y=r[1]/(v.depth||1);bu(c,function(e){e.x=(e.x+m)*g,e.y=e.depth*y})}return f}function o(e){var t={A:null,children:[e]},n=[t],r;while((r=n.pop())!=null)for(var i=r.children,s,o=0,u=i.length;o<u;++o)n.push((i[o]=s={_:i[o],parent:r,children:(s=i[o].children)&&s.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=s);return t.children[0]}function u(e){var t=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(t.length){Yu(e);var s=(t[0].z+t[t.length-1].z)/2;i?(e.z=i.z+n(e._,i._),e.m=e.z-s):e.z=s}else i&&(e.z=i.z+n(e._,i._));e.parent.A=f(e,i,e.parent.A||r[0])}function a(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function f(e,t,r){if(t){var i=e,s=e,o=t,u=i.parent.children[0],a=i.m,f=s.m,l=o.m,c=u.m,h;while(o=Qu(o),i=Ku(i),o&&i)u=Ku(u),s=Qu(s),s.a=e,h=o.z+l-i.z-a+n(o._,i._),h>0&&(Gu(Zu(o,e,r),e,h),a+=h,f+=h),l+=o.m,a+=i.m,c+=u.m,f+=s.m;o&&!Qu(s)&&(s.t=o,s.m+=l-f),i&&!Ku(u)&&(u.t=i,u.m+=a-c,r=e)}return r}function l(e){e.x*=r[0],e.y=e.depth*r[1]}var t=e.layout.hierarchy().sort(null).value(null),n=Ju,r=[1,1],i=null;return s.separation=function(e){return arguments.length?(n=e,s):n},s.size=function(e){return arguments.length?(i=(r=e)==null?l:null,s):i?null:r},s.nodeSize=function(e){return arguments.length?(i=(r=e)==null?null:l,s):i?r:null},yu(s,t)},e.layout.cluster=function(){function s(e,s){var o=t.call(this,e,s),u=o[0],a,f=0;wu(u,function(e){var t=e.children;t&&t.length?(e.x=ta(t),e.y=ea(t)):(e.x=a?f+=n(e,a):0,e.y=0,a=e)});var l=na(u),c=ra(u),h=l.x-n(l,c)/2,p=c.x+n(c,l)/2;return wu(u,i?function(e){e.x=(e.x-u.x)*r[0],e.y=(u.y-e.y)*r[1]}:function(e){e.x=(e.x-h)/(p-h)*r[0],e.y=(1-(u.y?e.y/u.y:1))*r[1]}),o}var t=e.layout.hierarchy().sort(null).value(null),n=Ju,r=[1,1],i=!1;return s.separation=function(e){return arguments.length?(n=e,s):n},s.size=function(e){return arguments.length?(i=(r=e)==null,s):i?null:r},s.nodeSize=function(e){return arguments.length?(i=(r=e)!=null,s):i?r:null},yu(s,t)},e.layout.treemap=function(){function l(e,t){var n=-1,r=e.length,i,s;while(++n<r)s=(i=e[n]).value*(t<0?0:t),i.area=isNaN(s)||s<=0?0:s}function c(e){var t=e.children;if(t&&t.length){var n=s(e),r=[],i=t.slice(),o,u=Infinity,f,h=a==="slice"?n.dx:a==="dice"?n.dy:a==="slice-dice"?e.depth&1?n.dy:n.dx:Math.min(n.dx,n.dy),v;l(i,n.dx*n.dy/e.value),r.area=0;while((v=i.length)>0)r.push(o=i[v-1]),r.area+=o.area,a!=="squarify"||(f=p(r,h))<=u?(i.pop(),u=f):(r.area-=r.pop().area,d(r,h,n,!1),h=Math.min(n.dx,n.dy),r.length=r.area=0,u=Infinity);r.length&&(d(r,h,n,!0),r.length=r.area=0),t.forEach(c)}}function h(e){var t=e.children;if(t&&t.length){var n=s(e),r=t.slice(),i,o=[];l(r,n.dx*n.dy/e.value),o.area=0;while(i=r.pop())o.push(i),o.area+=i.area,i.z!=null&&(d(o,i.z?n.dx:n.dy,n,!r.length),o.length=o.area=0);t.forEach(h)}}function p(e,t){var n=e.area,r,i=0,s=Infinity,o=-1,u=e.length;while(++o<u){if(!(r=e[o].area))continue;r<s&&(s=r),r>i&&(i=r)}return n*=n,t*=t,n?Math.max(t*i*f/n,n/(t*s*f)):Infinity}function d(e,t,r,i){var s=-1,o=e.length,u=r.x,a=r.y,f=t?n(e.area/t):0,l;if(t==r.dx){if(i||f>r.dy)f=r.dy;while(++s<o)l=e[s],l.x=u,l.y=a,l.dy=f,u+=l.dx=Math.min(r.x+r.dx-u,f?n(l.area/f):0);l.z=!0,l.dx+=r.x+r.dx-u,r.y+=f,r.dy-=f}else{if(i||f>r.dx)f=r.dx;while(++s<o)l=e[s],l.x=u,l.y=a,l.dx=f,a+=l.dy=Math.min(r.y+r.dy-a,f?n(l.area/f):0);l.z=!1,l.dy+=r.y+r.dy-a,r.x+=f,r.dx-=f}}function v(e){var n=u||t(e),i=n[0];return i.x=i.y=0,i.value?(i.dx=r[0],i.dy=r[1]):i.dx=i.dy=0,u&&t.revalue(i),l([i],i.dx*i.dy/i.value),(u?h:c)(i),o&&(u=n),n}var t=e.layout.hierarchy(),n=Math.round,r=[1,1],i=null,s=ia,o=!1,u,a="squarify",f=.5*(1+Math.sqrt(5));return v.size=function(e){return arguments.length?(r=e,v):r},v.padding=function(e){function t(t){var n=e.call(v,t,t.depth);return n==null?ia(t):sa(t,typeof n=="number"?[n,n,n,n]:n)}function n(t){return sa(t,e)}if(!arguments.length)return i;var r;return s=(i=e)==null?ia:(r=typeof e)==="function"?t:r==="number"?(e=[e,e,e,e],n):n,v},v.round=function(e){return arguments.length?(n=e?Math.round:Number,v):n!=Number},v.sticky=function(e){return arguments.length?(o=e,u=null,v):o},v.ratio=function(e){return arguments.length?(f=e,v):f},v.mode=function(e){return arguments.length?(a=e+"",v):a},yu(v,t)},e.random={normal:function(e,t){var n=arguments.length;return n<2&&(t=1),n<1&&(e=0),function(){var n,r,i;do n=Math.random()*2-1,r=Math.random()*2-1,i=n*n+r*r;while(!i||i>1);return e+t*n*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=e.random.normal.apply(e,arguments);return function(){return Math.exp(t())}},bates:function(t){var n=e.random.irwinHall(t);return function(){return n()/t}},irwinHall:function(e){return function(){for(var t=0,n=0;n<e;n++)t+=Math.random();return t}}},e.scale={};var ca={floor:D,ceil:D};e.scale.linear=function(){return pa([0,1],[0,1],Co,!1)};var ba={s:1,g:1,p:1,r:1,e:1};e.scale.log=function(){return Sa(e.scale.linear().domain([0,1]),10,!0,[1,10])};var xa=e.format(".0e"),Ta={floor:function(e){return-Math.ceil(-e)},ceil:function(e){return-Math.floor(-e)}};e.scale.pow=function(){return Na(e.scale.linear(),1,[0,1])},e.scale.sqrt=function(){return e.scale.pow().exponent(.5)},e.scale.ordinal=function(){return ka([],{t:"range",a:[[]]})},e.scale.category10=function(){return e.scale.ordinal().range(La)},e.scale.category20=function(){return e.scale.ordinal().range(Aa)},e.scale.category20b=function(){return e.scale.ordinal().range(Oa)},e.scale.category20c=function(){return e.scale.ordinal().range(Ma)};var La=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(mn),Aa=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(mn),Oa=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(mn),Ma=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(mn);e.scale.quantile=function(){return _a([],[])},e.scale.quantize=function(){return Da(0,1,[0,1])},e.scale.threshold=function(){return Pa([.5],[0,1])},e.scale.identity=function(){return Ha([0,1])},e.svg={},e.svg.arc=function(){function u(){var u=Math.max(0,+e.apply(this,arguments)),f=Math.max(0,+t.apply(this,arguments)),l=i.apply(this,arguments)-_t,c=s.apply(this,arguments)-_t,h=Math.abs(c-l),p=l>c?0:1;f<u&&(d=f,f=u,u=d);if(h>=Mt)return a(f,p)+(u?a(u,1-p):"")+"Z";var d,v,m,g,y=0,b=0,w,E,S,x,T,N,C,k,L=[];if(g=(+o.apply(this,arguments)||0)/2)m=r===ja?Math.sqrt(u*u+f*f):+r.apply(this,arguments),p||(b*=-1),f&&(b=Ft(m/f*Math.sin(g))),u&&(y=Ft(m/u*Math.sin(g)));if(f){w=f*Math.cos(l+b),E=f*Math.sin(l+b),S=f*Math.cos(c-b),x=f*Math.sin(c-b);var A=Math.abs(c-l-2*b)<=At?0:1;if(b&&za(w,E,S,x)===p^A){var O=(l+c)/2;w=f*Math.cos(O),E=f*Math.sin(O),S=x=null}}else w=E=0;if(u){T=u*Math.cos(c-y),N=u*Math.sin(c-y),C=u*Math.cos(l+y),k=u*Math.sin(l+y);var M=Math.abs(l-c+2*y)<=At?0:1;if(y&&za(T,N,C,k)===1-p^M){var _=(l+c)/2;T=u*Math.cos(_),N=u*Math.sin(_),C=k=null}}else T=N=0;if(h>kt&&(d=Math.min(Math.abs(f-u)/2,+n.apply(this,arguments)))>.001){v=u<f^p?0:1;var D=d,P=d;if(h<At){var H=C==null?[T,N]:S==null?[w,E]:Os([w,E],[C,k],[S,x],[T,N]),B=w-H[0],j=E-H[1],F=S-H[0],I=x-H[1],q=1/Math.sin(Math.acos((B*F+j*I)/(Math.sqrt(B*B+j*j)*Math.sqrt(F*F+I*I)))/2),R=Math.sqrt(H[0]*H[0]+H[1]*H[1]);P=Math.min(d,(u-R)/(q-1)),D=Math.min(d,(f-R)/(q+1))}if(S!=null){var U=Wa(C==null?[T,N]:[C,k],[w,E],f,D,p),z=Wa([S,x],[T,N],f,D,p);d===D?L.push("M",U[0],"A",D,",",D," 0 0,",v," ",U[1],"A",f,",",f," 0 ",1-p^za(U[1][0],U[1][1],z[1][0],z[1][1]),",",p," ",z[1],"A",D,",",D," 0 0,",v," ",z[0]):L.push("M",U[0],"A",D,",",D," 0 1,",v," ",z[0])}else L.push("M",w,",",E);if(C!=null){var W=Wa([w,E],[C,k],u,-P,p),X=Wa([T,N],S==null?[w,E]:[S,x],u,-P,p);d===P?L.push("L",X[0],"A",P,",",P," 0 0,",v," ",X[1],"A",u,",",u," 0 ",p^za(X[1][0],X[1][1],W[1][0],W[1][1]),",",1-p," ",W[1],"A",P,",",P," 0 0,",v," ",W[0]):L.push("L",X[0],"A",P,",",P," 0 0,",v," ",W[0])}else L.push("L",T,",",N)}else L.push("M",w,",",E),S!=null&&L.push("A",f,",",f," 0 ",A,",",p," ",S,",",x),L.push("L",T,",",N),C!=null&&L.push("A",u,",",u," 0 ",M,",",1-p," ",C,",",k);return L.push("Z"),L.join("")}function a(e,t){return"M0,"+e+"A"+e+","+e+" 0 1,"+t+" 0,"+ -e+"A"+e+","+e+" 0 1,"+t+" 0,"+e}var e=Fa,t=Ia,n=Ba,r=ja,i=qa,s=Ra,o=Ua;return u.innerRadius=function(t){return arguments.length?(e=Nn(t),u):e},u.outerRadius=function(e){return arguments.length?(t=Nn(e),u):t},u.cornerRadius=function(e){return arguments.length?(n=Nn(e),u):n},u.padRadius=function(e){return arguments.length?(r=e==ja?ja:Nn(e),u):r},u.startAngle=function(e){return arguments.length?(i=Nn(e),u):i},u.endAngle=function(e){return arguments.length?(s=Nn(e),u):s},u.padAngle=function(e){return arguments.length?(o=Nn(e),u):o},u.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +s.apply(this,arguments))/2-_t;return[Math.cos(r)*n,Math.sin(r)*n]},u};var ja="auto";e.svg.line=function(){return Xa(D)};var Va=e.map({linear:$a,"linear-closed":Ja,step:Ka,"step-before":Qa,"step-after":Ga,basis:rf,"basis-open":sf,"basis-closed":of,bundle:uf,cardinal:ef,"cardinal-open":Ya,"cardinal-closed":Za,monotone:mf});Va.forEach(function(e,t){t.key=e,t.closed=/-closed$/.test(e)});var ff=[0,2/3,1/3,0],lf=[0,1/3,2/3,0],cf=[0,1/6,2/3,1/6];e.svg.line.radial=function(){var e=Xa(gf);return e.radius=e.x,delete e.x,e.angle=e.y,delete e.y,e},Qa.reverse=Ga,Ga.reverse=Qa,e.svg.area=function(){return yf(D)},e.svg.area.radial=function(){var e=yf(gf);return e.radius=e.x,delete e.x,e.innerRadius=e.x0,delete e.x0,e.outerRadius=e.x1,delete e.x1,e.angle=e.y,delete e.y,e.startAngle=e.y0,delete e.y0,e.endAngle=e.y1,delete e.y1,e},e.svg.chord=function(){function s(n,r){var i=o(this,e,n,r),s=o(this,t,n,r);return"M"+i.p0+a(i.r,i.p1,i.a1-i.a0)+(u(i,s)?f(i.r,i.p1,i.r,i.p0):f(i.r,i.p1,s.r,s.p0)+a(s.r,s.p1,s.a1-s.a0)+f(s.r,s.p1,i.r,i.p0))+"Z"}function o(e,t,s,o){var u=t.call(e,s,o),a=n.call(e,u,o),f=r.call(e,u,o)-_t,l=i.call(e,u,o)-_t;return{r:a,a0:f,a1:l,p0:[a*Math.cos(f),a*Math.sin(f)],p1:[a*Math.cos(l),a*Math.sin(l)]}}function u(e,t){return e.a0==t.a0&&e.a1==t.a1}function a(e,t,n){return"A"+e+","+e+" 0 "+ +(n>At)+",1 "+t}function f(e,t,n,r){return"Q 0,0 "+r}var e=us,t=as,n=bf,r=qa,i=Ra;return s.radius=function(e){return arguments.length?(n=Nn(e),s):n},s.source=function(t){return arguments.length?(e=Nn(t),s):e},s.target=function(e){return arguments.length?(t=Nn(e),s):t},s.startAngle=function(e){return arguments.length?(r=Nn(e),s):r},s.endAngle=function(e){return arguments.length?(i=Nn(e),s):i},s},e.svg.diagonal=function(){function r(r,i){var s=e.call(this,r,i),o=t.call(this,r,i),u=(s.y+o.y)/2,a=[s,{x:s.x,y:u},{x:o.x,y:u},o];return a=a.map(n),"M"+a[0]+"C"+a[1]+" "+a[2]+" "+a[3]}var e=us,t=as,n=wf;return r.source=function(t){return arguments.length?(e=Nn(t),r):e},r.target=function(e){return arguments.length?(t=Nn(e),r):t},r.projection=function(e){return arguments.length?(n=e,r):n},r},e.svg.diagonal.radial=function(){var t=e.svg.diagonal(),n=wf,r=t.projection;return t.projection=function(e){return arguments.length?r(Ef(n=e)):n},t},e.svg.symbol=function(){function n(n,r){return(Nf.get(e.call(this,n,r))||Tf)(t.call(this,n,r))}var e=xf,t=Sf;return n.type=function(t){return arguments.length?(e=Nn(t),n):e},n.size=function(e){return arguments.length?(t=Nn(e),n):t},n};var Nf=e.map({circle:Tf,cross:function(e){var t=Math.sqrt(e/5)/2;return"M"+ -3*t+","+ -t+"H"+ -t+"V"+ -3*t+"H"+t+"V"+ -t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+ -t+"V"+t+"H"+ -3*t+"Z"},diamond:function(e){var t=Math.sqrt(e/(2*kf)),n=t*kf;return"M0,"+ -t+"L"+n+",0"+" 0,"+t+" "+ -n+",0"+"Z"},square:function(e){var t=Math.sqrt(e)/2;return"M"+ -t+","+ -t+"L"+t+","+ -t+" "+t+","+t+" "+ -t+","+t+"Z"},"triangle-down":function(e){var t=Math.sqrt(e/Cf),n=t*Cf/2;return"M0,"+n+"L"+t+","+ -n+" "+ -t+","+ -n+"Z"},"triangle-up":function(e){var t=Math.sqrt(e/Cf),n=t*Cf/2;return"M0,"+ -n+"L"+t+","+n+" "+ -t+","+n+"Z"}});e.svg.symbolTypes=Nf.keys();var Cf=Math.sqrt(3),kf=Math.tan(30*Dt);K.transition=function(e){var t=Df||++_f,n=jf(e),r=[],i,s,o=Pf||{time:Date.now(),ease:Bo,delay:0,duration:250};for(var u=-1,a=this.length;++u<a;){r.push(i=[]);for(var f=this[u],l=-1,c=f.length;++l<c;)(s=f[l])&&Ff(s,l,n,t,o),i.push(s)}return Of(r,n,t)},K.interrupt=function(e){return this.each(e==null?Lf:Af(jf(e)))};var Lf=Af(jf()),Mf=[],_f=0,Df,Pf;Mf.call=K.call,Mf.empty=K.empty,Mf.node=K.node,Mf.size=K.size,e.transition=function(t,n){return t&&t.transition?Df?t.transition(n):t:e.selection().transition(t)},e.transition.prototype=Mf,Mf.select=function(e){var t=this.id,n=this.namespace,r=[],i,s,o;e=Q(e);for(var u=-1,a=this.length;++u<a;){r.push(i=[]);for(var f=this[u],l=-1,c=f.length;++l<c;)(o=f[l])&&(s=e.call(o,o.__data__,l,u))?("__data__"in o&&(s.__data__=o.__data__),Ff(s,l,n,t,o[n][t]),i.push(s)):i.push(null)}return Of(r,n,t)},Mf.selectAll=function(e){var t=this.id,n=this.namespace,r=[],i,s,o,u,a;e=G(e);for(var f=-1,l=this.length;++f<l;)for(var c=this[f],h=-1,p=c.length;++h<p;)if(o=c[h]){a=o[n][t],s=e.call(o,o.__data__,h,f),r.push(i=[]);for(var d=-1,v=s.length;++d<v;)(u=s[d])&&Ff(u,d,n,t,a),i.push(u)}return Of(r,n,t)},Mf.filter=function(e){var t=[],n,r,i;typeof e!="function"&&(e=ct(e));for(var s=0,o=this.length;s<o;s++){t.push(n=[]);for(var r=this[s],u=0,a=r.length;u<a;u++)(i=r[u])&&e.call(i,i.__data__,u,s)&&n.push(i)}return Of(t,this.namespace,this.id)},Mf.tween=function(e,t){var n=this.id,r=this.namespace;return arguments.length<2?this.node()[r][n].tween.get(e):pt(this,t==null?function(t){t[r][n].tween.remove(e)}:function(i){i[r][n].tween.set(e,t)})},Mf.attr=function(t,n){function s(){this.removeAttribute(i)}function o(){this.removeAttributeNS(i.space,i.local)}function u(e){return e==null?s:(e+="",function(){var t=this.getAttribute(i),n;return t!==e&&(n=r(t,e),function(e){this.setAttribute(i,n(e))})})}function a(e){return e==null?o:(e+="",function(){var t=this.getAttributeNS(i.space,i.local),n;return t!==e&&(n=r(t,e),function(e){this.setAttributeNS(i.space,i.local,n(e))})})}if(arguments.length<2){for(n in t)this.attr(n,t[n]);return this}var r=t=="transform"?iu:Co,i=e.ns.qualify(t);return Hf(this,"attr."+t,n,i.local?a:u)},Mf.attrTween=function(t,n){function i(e,t){var i=n.call(this,e,t,this.getAttribute(r));return i&&function(e){this.setAttribute(r,i(e))}}function s(e,t){var i=n.call(this,e,t,this.getAttributeNS(r.space,r.local));return i&&function(e){this.setAttributeNS(r.space,r.local,i(e))}}var r=e.ns.qualify(t);return this.tween("attr."+t,r.local?s:i)},Mf.style=function(e,t,n){function i(){this.style.removeProperty(e)}function o(t){return t==null?i:(t+="",function(){var r=s(this).getComputedStyle(this,null).getPropertyValue(e),i;return r!==t&&(i=Co(r,t),function(t){this.style.setProperty(e,i(t),n)})})}var r=arguments.length;if(r<3){if(typeof e!="string"){r<2&&(t="");for(n in e)this.style(n,e[n],t);return this}n=""}return Hf(this,"style."+e,t,o)},Mf.styleTween=function(e,t,n){function r(r,i){var o=t.call(this,r,i,s(this).getComputedStyle(this,null).getPropertyValue(e));return o&&function(t){this.style.setProperty(e,o(t),n)}}return arguments.length<3&&(n=""),this.tween("style."+e,r)},Mf.text=function(e){return Hf(this,"text",e,Bf)},Mf.remove=function(){var e=this.namespace;return this.each("end.transition",function(){var t;this[e].count<2&&(t=this.parentNode)&&t.removeChild(this)})},Mf.ease=function(t){var n=this.id,r=this.namespace;return arguments.length<1?this.node()[r][n].ease:(typeof t!="function"&&(t=e.ease.apply(e,arguments)),pt(this,function(e){e[r][n].ease=t}))},Mf.delay=function(e){var t=this.id,n=this.namespace;return arguments.length<1?this.node()[n][t].delay:pt(this,typeof e=="function"?function(r,i,s){r[n][t].delay=+e.call(r,r.__data__,i,s)}:(e=+e,function(r){r[n][t].delay=e}))},Mf.duration=function(e){var t=this.id,n=this.namespace;return arguments.length<1?this.node()[n][t].duration:pt(this,typeof e=="function"?function(r,i,s){r[n][t].duration=Math.max(1,e.call(r,r.__data__,i,s))}:(e=Math.max(1,e),function(r){r[n][t].duration=e}))},Mf.each=function(t,n){var r=this.id,i=this.namespace;if(arguments.length<2){var s=Pf,o=Df;try{Df=r,pt(this,function(e,n,s){Pf=e[i][r],t.call(e,e.__data__,n,s)})}finally{Pf=s,Df=o}}else pt(this,function(s){var o=s[i][r];(o.event||(o.event=e.dispatch("start","end","interrupt"))).on(t,n)});return this},Mf.transition=function(){var e=this.id,t=++_f,n=this.namespace,r=[],i,s,o,u;for(var a=0,f=this.length;a<f;a++){r.push(i=[]);for(var s=this[a],l=0,c=s.length;l<c;l++){if(o=s[l])u=o[n][e],Ff(o,l,n,t,{time:u.time,ease:u.ease,delay:u.delay+u.duration,duration:u.duration});i.push(o)}}return Of(r,n,t)},e.svg.axis=function(){function l(n){n.each(function(){var n=e.select(this),l=this.__chart__||t,c=this.__chart__=t.copy(),h=a==null?c.ticks?c.ticks.apply(c,u):c.domain():a,p=f==null?c.tickFormat?c.tickFormat.apply(c,u):D:f,d=n.selectAll(".tick").data(h,c),v=d.enter().insert("g",".domain").attr("class","tick").style("opacity",kt),m=e.transition(d.exit()).style("opacity",kt).remove(),g=e.transition(d.order()).style("opacity",1),y=Math.max(i,0)+o,b,w=ua(c),E=n.selectAll(".domain").data([0]),S=(E.enter().append("path").attr("class","domain"),e.transition(E));v.append("line"),v.append("text");var x=v.select("line"),T=g.select("line"),N=d.select("text").text(p),C=v.select("text"),k=g.select("text"),L=r==="top"||r==="left"?-1:1,A,O,M,_;r==="bottom"||r==="top"?(b=Rf,A="x",M="y",O="x2",_="y2",N.attr("dy",L<0?"0em":".71em").style("text-anchor","middle"),S.attr("d","M"+w[0]+","+L*s+"V0H"+w[1]+"V"+L*s)):(b=Uf,A="y",M="x",O="y2",_="x2",N.attr("dy",".32em").style("text-anchor",L<0?"end":"start"),S.attr("d","M"+L*s+","+w[0]+"H0V"+w[1]+"H"+L*s)),x.attr(_,L*i),C.attr(M,L*y),T.attr(O,0).attr(_,L*i),k.attr(A,0).attr(M,L*y);if(c.rangeBand){var P=c,H=P.rangeBand()/2;l=c=function(e){return P(e)+H}}else l.rangeBand?l=c:m.call(b,c,l);v.call(b,l,c),g.call(b,c,c)})}var t=e.scale.linear(),r=If,i=6,s=6,o=3,u=[10],a=null,f;return l.scale=function(e){return arguments.length?(t=e,l):t},l.orient=function(e){return arguments.length?(r=e in qf?e+"":If,l):r},l.ticks=function(){return arguments.length?(u=n(arguments),l):u},l.tickValues=function(e){return arguments.length?(a=e,l):a},l.tickFormat=function(e){return arguments.length?(f=e,l):f},l.tickSize=function(e){var t=arguments.length;return t?(i=+e,s=+arguments[t-1],l):i},l.innerTickSize=function(e){return arguments.length?(i=+e,l):i},l.outerTickSize=function(e){return arguments.length?(s=+e,l):s},l.tickPadding=function(e){return arguments.length?(o=+e,l):o},l.tickSubdivide=function(){return arguments.length&&l},l};var If="bottom",qf={top:1,right:1,bottom:1,left:1};e.svg.brush=function(){function h(t){t.each(function(){var t=e.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",m).on("touchstart.brush",m),i=t.selectAll(".background").data([0]);i.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),t.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var s=t.selectAll(".resize").data(c,D);s.exit().remove(),s.enter().append("g").attr("class",function(e){return"resize "+e}).style("cursor",function(e){return zf[e]}).append("rect").attr("x",function(e){return/[ew]$/.test(e)?-3:null}).attr("y",function(e){return/^[ns]/.test(e)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),s.style("display",h.empty()?"none":null);var o=e.transition(t),u=e.transition(i),a;n&&(a=ua(n),u.attr("x",a[0]).attr("width",a[1]-a[0]),d(o)),r&&(a=ua(r),u.attr("y",a[0]).attr("height",a[1]-a[0]),v(o)),p(o)})}function p(e){e.selectAll(".resize").attr("transform",function(e){return"translate("+i[+/e$/.test(e)]+","+o[+/^s/.test(e)]+")"})}function d(e){e.select(".extent").attr("x",i[0]),e.selectAll(".extent,.n>rect,.s>rect").attr("width",i[1]-i[0])}function v(e){e.select(".extent").attr("y",o[0]),e.selectAll(".extent,.e>rect,.w>rect").attr("height",o[1]-o[0])}function m(){function O(){e.event.keyCode==32&&(S||(T=null,N[0]-=i[1],N[1]-=o[1],S=2),q())}function M(){e.event.keyCode==32&&S==2&&(N[0]+=i[1],N[1]+=o[1],S=0,q())}function _(){var t=e.mouse(c),s=!1;C&&(t[0]+=C[0],t[1]+=C[1]),S||(e.event.altKey?(T||(T=[(i[0]+i[1])/2,(o[0]+o[1])/2]),N[0]=i[+(t[0]<T[0])],N[1]=o[+(t[1]<T[1])]):T=null),w&&D(t,n,0)&&(d(y),s=!0),E&&D(t,r,1)&&(v(y),s=!0),s&&(p(y),g({type:"brush",mode:S?"move":"resize"}))}function D(e,t,n){var r=ua(t),s=r[0],c=r[1],h=N[n],p=n?o:i,d=p[1]-p[0],v,m;S&&(s-=h,c-=d+h),v=(n?l:f)?Math.max(s,Math.min(c,e[n])):e[n],S?m=(v+=h)+d:(T&&(h=Math.max(s,Math.min(c,2*T[n]-v))),h<v?(m=v,v=h):m=h);if(p[0]!=v||p[1]!=m)return n?a=null:u=null,p[0]=v,p[1]=m,!0}function P(){_(),y.style("pointer-events","all").selectAll(".resize").style("display",h.empty()?"none":null),e.select("body").style("cursor",null),k.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),x(),g({type:"brushend"})}var c=this,m=e.select(e.event.target),g=t.of(c,arguments),y=e.select(c),b=m.datum(),w=!/^(n|s)$/.test(b)&&n,E=!/^(e|w)$/.test(b)&&r,S=m.classed("extent"),x=xt(c),T,N=e.mouse(c),C,k=e.select(s(c)).on("keydown.brush",O).on("keyup.brush",M);e.event.changedTouches?k.on("touchmove.brush",_).on("touchend.brush",P):k.on("mousemove.brush",_).on("mouseup.brush",P),y.interrupt().selectAll("*").interrupt();if(S)N[0]=i[0]-N[0],N[1]=o[0]-N[1];else if(b){var L=+/w$/.test(b),A=+/^n/.test(b);C=[i[1-L]-N[0],o[1-A]-N[1]],N[0]=i[L],N[1]=o[A]}else e.event.altKey&&(T=N.slice());y.style("pointer-events","none").selectAll(".resize").style("display",null),e.select("body").style("cursor",m.style("cursor")),g({type:"brushstart"}),_()}var t=U(h,"brushstart","brush","brushend"),n=null,r=null,i=[0,0],o=[0,0],u,a,f=!0,l=!0,c=Wf[0];return h.event=function(n){n.each(function(){var n=t.of(this,arguments),r={x:i,y:o,i:u,j:a},s=this.__chart__||r;this.__chart__=r,Df?e.select(this).transition().each("start.brush",function(){u=s.i,a=s.j,i=s.x,o=s.y,n({type:"brushstart"})}).tween("brush:brush",function(){var e=ko(i,r.x),t=ko(o,r.y);return u=a=null,function(s){i=r.x=e(s),o=r.y=t(s),n({type:"brush",mode:"resize"})}}).each("end.brush",function(){u=r.i,a=r.j,n({type:"brush",mode:"resize"}),n({type:"brushend"})}):(n({type:"brushstart"}),n({type:"brush",mode:"resize"}),n({type:"brushend"}))})},h.x=function(e){return arguments.length?(n=e,c=Wf[!n<<1|!r],h):n},h.y=function(e){return arguments.length?(r=e,c=Wf[!n<<1|!r],h):r},h.clamp=function(e){return arguments.length?(n&&r?(f=!!e[0],l=!!e[1]):n?f=!!e:r&&(l=!!e),h):n&&r?[f,l]:n?f:r?l:null},h.extent=function(e){var t,s,f,l,c;if(!arguments.length)return n&&(u?(t=u[0],s=u[1]):(t=i[0],s=i[1],n.invert&&(t=n.invert(t),s=n.invert(s)),s<t&&(c=t,t=s,s=c))),r&&(a?(f=a[0],l=a[1]):(f=o[0],l=o[1],r.invert&&(f=r.invert(f),l=r.invert(l)),l<f&&(c=f,f=l,l=c))),n&&r?[[t,f],[s,l]]:n?[t,s]:r&&[f,l];if(n){t=e[0],s=e[1],r&&(t=t[0],s=s[0]),u=[t,s],n.invert&&(t=n(t),s=n(s)),s<t&&(c=t,t=s,s=c);if(t!=i[0]||s!=i[1])i=[t,s]}if(r){f=e[0],l=e[1],n&&(f=f[1],l=l[1]),a=[f,l],r.invert&&(f=r(f),l=r(l)),l<f&&(c=f,f=l,l=c);if(f!=o[0]||l!=o[1])o=[f,l]}return h},h.clear=function(){return h.empty()||(i=[0,0],o=[0,0],u=a=null),h},h.empty=function(){return!!n&&i[0]==i[1]||!!r&&o[0]==o[1]},e.rebind(h,t,"on")};var zf={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Wf=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Xf=Vn.format=Sr.timeFormat,Vf=Xf.utc,$f=Vf("%Y-%m-%dT%H:%M:%S.%LZ");Xf.iso=Date.prototype.toISOString&&+(new Date("2000-01-01T00:00:00.000Z"))?Jf:$f,Jf.parse=function(e){var t=new Date(e);return isNaN(t)?null:t},Jf.toString=$f.toString,Vn.second=Qn(function(e){return new $n(Math.floor(e/1e3)*1e3)},function(e,t){e.setTime(e.getTime()+Math.floor(t)*1e3)},function(e){return e.getSeconds()}),Vn.seconds=Vn.second.range,Vn.seconds.utc=Vn.second.utc.range,Vn.minute=Qn(function(e){return new $n(Math.floor(e/6e4)*6e4)},function(e,t){e.setTime(e.getTime()+Math.floor(t)*6e4)},function(e){return e.getMinutes()}),Vn.minutes=Vn.minute.range,Vn.minutes.utc=Vn.minute.utc.range,Vn.hour=Qn(function(e){var t=e.getTimezoneOffset()/60;return new $n((Math.floor(e/36e5-t)+t)*36e5)},function(e,t){e.setTime(e.getTime()+Math.floor(t)*36e5)},function(e){return e.getHours()}),Vn.hours=Vn.hour.range,Vn.hours.utc=Vn.hour.utc.range,Vn.month=Qn(function(e){return e=Vn.day(e),e.setDate(1),e},function(e,t){e.setMonth(e.getMonth()+t)},function(e){return e.getMonth()}),Vn.months=Vn.month.range,Vn.months.utc=Vn.month.utc.range;var Gf=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Yf=[[Vn.second,1],[Vn.second,5],[Vn.second,15],[Vn.second,30],[Vn.minute,1],[Vn.minute,5],[Vn.minute,15],[Vn.minute,30],[Vn.hour,1],[Vn.hour,3],[Vn.hour,6],[Vn.hour,12],[Vn.day,1],[Vn.day,2],[Vn.week,1],[Vn.month,1],[Vn.month,3],[Vn.year,1]],Zf=Xf.multi([[".%L",function(e){return e.getMilliseconds()}],[":%S",function(e){return e.getSeconds()}],["%I:%M",function(e){return e.getMinutes()}],["%I %p",function(e){return e.getHours()}],["%a %d",function(e){return e.getDay()&&e.getDate()!=1}],["%b %d",function(e){return e.getDate()!=1}],["%B",function(e){return e.getMonth()}],["%Y",ui]]),el={range:function(t,n,r){return e.range(Math.ceil(t/r)*r,+n,r).map(Qf)},floor:D,ceil:D};Yf.year=Vn.year,Vn.scale=function(){return Kf(e.scale.linear(),Yf,Zf)};var tl=Yf.map(function(e){return[e[0].utc,e[1]]}),nl=Vf.multi([[".%L",function(e){return e.getUTCMilliseconds()}],[":%S",function(e){return e.getUTCSeconds()}],["%I:%M",function(e){return e.getUTCMinutes()}],["%I %p",function(e){return e.getUTCHours()}],["%a %d",function(e){return e.getUTCDay()&&e.getUTCDate()!=1}],["%b %d",function(e){return e.getUTCDate()!=1}],["%B",function(e){return e.getUTCMonth()}],["%Y",ui]]);tl.year=Vn.year.utc,Vn.scale.utc=function(){return Kf(e.scale.linear(),tl,nl)},e.text=Cn(function(e){return e.responseText}),e.json=function(e,t){return kn(e,"application/json",rl,t)},e.html=function(e,t){return kn(e,"text/html",il,t)},e.xml=Cn(function(e){return e.responseXML}),typeof define=="function"&&define.amd?(this.d3=e,define("d3",e)):typeof module=="object"&&module.exports?module.exports=e:this.d3=e}(),function(e){function s(e){this.owner=e}function o(e,t){if(Object.create)t.prototype=Object.create(e.prototype);else{var n=function(){};n.prototype=e.prototype,t.prototype=new n}return t.prototype.constructor=t,t}function u(e){var t=this.internal=new a(this);t.loadConfig(e),t.beforeInit(e),t.init(),t.afterInit(e),function r(e,t,n){Object.keys(e).forEach(function(i){t[i]=e[i].bind(n),Object.keys(e[i]).length>0&&r(e[i],t[i],n)})}(n,this,this)}function a(t){var n=this;n.d3=e.d3?e.d3:typeof require!="undefined"?require("d3"):undefined,n.api=t,n.config=n.getDefaultConfig(),n.data={},n.cache={},n.axes={}}function f(e){s.call(this,e)}function C(e,t){function p(e,t){e.attr("transform",function(e){return"translate("+Math.ceil(t(e)+l)+", 0)"})}function d(e,t){e.attr("transform",function(e){return"translate(0,"+Math.ceil(t(e))+")"})}function v(e){var t=e[0],n=e[e.length-1];return t<n?[t,n]:[n,t]}function m(e){var t,n,r=[];if(e.ticks)return e.ticks.apply(e,f);n=e.domain();for(t=Math.ceil(n[0]);t<n[1];t++)r.push(t);return r.length>0&&r[0]>0&&r.unshift(r[0]-(r[1]-r[0])),r}function g(){var e=n.copy(),r;return t.isCategory&&(r=n.domain(),e.domain([r[0],r[1]-1])),e}function y(e){var t=a?a(e):e;return typeof t!="undefined"?t:""}function b(e){if(N)return N;var t={h:11.5,w:5.5};return e.select("text").text(y).each(function(e){var n=this.getBoundingClientRect(),r=y(e),i=n.height,s=r?n.width/r.length:undefined;i&&s&&(t.h=i,t.w=s)}).text(""),N=t,t}function w(n){return t.withoutTransition?n:e.transition(n)}function E(a){a.each(function(){function z(e,n){function a(e,t){s=undefined;for(var r=1;r<t.length;r++){t.charAt(r)===" "&&(s=r),i=t.substr(0,r+1),o=I.w*i.length;if(n<o)return a(e.concat(t.substr(0,s?s:r)),t.slice(s?s+1:r))}return e.concat(t)}var r=y(e),i,s,o,u=[];if(Object.prototype.toString.call(r)==="[object Array]")return r;if(!n||n<=0)n=U?95:t.isCategory?Math.ceil(c(S[1])-c(S[0]))-12:110;return a(u,r+"")}function W(e,t){var n=I.h;return t===0&&(r==="left"||r==="right"?n=-((q[e.index]-1)*(I.h/2)-3):n=".71em"),n}function X(e){var t=n(e)+(h?0:l);return O[0]<t&&t<O[1]?i:0}function $(e){return e?e>0?"start":"end":"middle"}function J(e){return e?"rotate("+e+")":""}function K(e){return e?8*Math.sin(Math.PI*(e/180)):0}function Q(e){return e?11.5-2.5*(e/15)*(e>0?1:-1):R}var a=E.g=e.select(this),f=this.__chart__||n,c=this.__chart__=g(),S=u?u:m(c),x=a.selectAll(".tick").data(S,c),T=x.enter().insert("g",".domain").attr("class","tick").style("opacity",1e-6),N=x.exit().remove(),C=w(x).style("opacity",1),k,L,A,O=n.rangeExtent?n.rangeExtent():v(n.range()),M=a.selectAll(".domain").data([0]),_=(M.enter().append("path").attr("class","domain"),w(M));T.append("line"),T.append("text");var D=T.select("line"),P=C.select("line"),H=T.select("text"),B=C.select("text");t.isCategory?(l=Math.ceil((c(1)-c(0))/2),L=h?0:l,A=h?l:0):l=L=0;var j,F,I=b(a.select(".tick")),q=[],R=Math.max(i,0)+o,U=r==="left"||r==="right";j=x.select("text"),F=j.selectAll("tspan").data(function(e,n){var r=t.tickMultiline?z(e,t.tickWidth):[].concat(y(e));return q[n]=r.length,r.map(function(e){return{index:n,splitted:e}})}),F.enter().append("tspan"),F.exit().remove(),F.text(function(e){return e.splitted});var V=t.tickTextRotate;switch(r){case"bottom":k=p,D.attr("y2",i),H.attr("y",R),P.attr("x1",L).attr("x2",L).attr("y2",X),B.attr("x",0).attr("y",Q(V)).style("text-anchor",$(V)).attr("transform",J(V)),F.attr("x",0).attr("dy",W).attr("dx",K(V)),_.attr("d","M"+O[0]+","+s+"V0H"+O[1]+"V"+s);break;case"top":k=p,D.attr("y2",-i),H.attr("y",-R),P.attr("x2",0).attr("y2",-i),B.attr("x",0).attr("y",-R),j.style("text-anchor","middle"),F.attr("x",0).attr("dy","0em"),_.attr("d","M"+O[0]+","+ -s+"V0H"+O[1]+"V"+ -s);break;case"left":k=d,D.attr("x2",-i),H.attr("x",-R),P.attr("x2",-i).attr("y1",A).attr("y2",A),B.attr("x",-R).attr("y",l),j.style("text-anchor","end"),F.attr("x",-R).attr("dy",W),_.attr("d","M"+ -s+","+O[0]+"H0V"+O[1]+"H"+ -s);break;case"right":k=d,D.attr("x2",i),H.attr("x",R),P.attr("x2",i).attr("y2",0),B.attr("x",R).attr("y",0),j.style("text-anchor","start"),F.attr("x",R).attr("dy",W),_.attr("d","M"+s+","+O[0]+"H0V"+O[1]+"H"+s)}if(c.rangeBand){var G=c,Y=G.rangeBand()/2;f=c=function(e){return G(e)+Y}}else f.rangeBand?f=c:N.call(k,c);T.call(k,f),C.call(k,c)})}var n=e.scale.linear(),r="bottom",i=6,s,o=3,u=null,a,f,l=0,c=!0,h;return t=t||{},s=t.withOuterTick?6:0,E.scale=function(e){return arguments.length?(n=e,E):n},E.orient=function(e){return arguments.length?(r=e in{top:1,right:1,bottom:1,left:1}?e+"":"bottom",E):r},E.tickFormat=function(e){return arguments.length?(a=e,E):a},E.tickCentered=function(e){return arguments.length?(h=e,E):h},E.tickOffset=function(){return l},E.tickInterval=function(){var e,n;return t.isCategory?e=l*2:(n=E.g.select("path.domain").node().getTotalLength()-s*2,e=n/E.g.selectAll("line").size()),e===Infinity?0:e},E.ticks=function(){return arguments.length?(f=arguments,E):f},E.tickCulling=function(e){return arguments.length?(c=e,E):c},E.tickValues=function(e){if(typeof e=="function")u=function(){return e(n.domain())};else{if(!arguments.length)return u;u=e}return E},E}var t={version:"0.4.11"},n,r,i;t.generate=function(e){return new u(e)},t.chart={fn:u.prototype,internal:{fn:a.prototype,axis:{fn:f.prototype}}},n=t.chart.fn,r=t.chart.internal.fn,i=t.chart.internal.axis.fn,r.beforeInit=function(){},r.afterInit=function(){},r.init=function(){var e=this,t=e.config;e.initParams();if(t.data_url)e.convertUrlToData(t.data_url,t.data_mimeType,t.data_headers,t.data_keys,e.initWithData);else if(t.data_json)e.initWithData(e.convertJsonToData(t.data_json,t.data_keys));else if(t.data_rows)e.initWithData(e.convertRowsToData(t.data_rows));else{if(!t.data_columns)throw Error("url or json or rows or columns is required.");e.initWithData(e.convertColumnsToData(t.data_columns))}},r.initParams=function(){var e=this,t=e.d3,n=e.config;e.clipId="c3-"+ +(new Date)+"-clip",e.clipIdForXAxis=e.clipId+"-xaxis",e.clipIdForYAxis=e.clipId+"-yaxis",e.clipIdForGrid=e.clipId+"-grid",e.clipIdForSubchart=e.clipId+"-subchart",e.clipPath=e.getClipPath(e.clipId),e.clipPathForXAxis=e.getClipPath(e.clipIdForXAxis),e.clipPathForYAxis=e.getClipPath(e.clipIdForYAxis),e.clipPathForGrid=e.getClipPath(e.clipIdForGrid),e.clipPathForSubchart=e.getClipPath(e.clipIdForSubchart),e.dragStart=null,e.dragging=!1,e.flowing=!1,e.cancelClick=!1,e.mouseover=!1,e.transiting=!1,e.color=e.generateColor(),e.levelColor=e.generateLevelColor(),e.dataTimeFormat=n.data_xLocaltime?t.time.format:t.time.format.utc,e.axisTimeFormat=n.axis_x_localtime?t.time.format:t.time.format.utc,e.defaultAxisTimeFormat=e.axisTimeFormat.multi([[".%L",function(e){return e.getMilliseconds()}],[":%S",function(e){return e.getSeconds()}],["%I:%M",function(e){return e.getMinutes()}],["%I %p",function(e){return e.getHours()}],["%-m/%-d",function(e){return e.getDay()&&e.getDate()!==1}],["%-m/%-d",function(e){return e.getDate()!==1}],["%-m/%-d",function(e){return e.getMonth()}],["%Y/%-m/%-d",function(){return!0}]]),e.hiddenTargetIds=[],e.hiddenLegendIds=[],e.focusedTargetIds=[],e.defocusedTargetIds=[],e.xOrient=n.axis_rotated?"left":"bottom",e.yOrient=n.axis_rotated?n.axis_y_inner?"top":"bottom":n.axis_y_inner?"right":"left",e.y2Orient=n.axis_rotated?n.axis_y2_inner?"bottom":"top":n.axis_y2_inner?"left":"right",e.subXOrient=n.axis_rotated?"left":"bottom",e.isLegendRight=n.legend_position==="right",e.isLegendInset=n.legend_position==="inset",e.isLegendTop=n.legend_inset_anchor==="top-left"||n.legend_inset_anchor==="top-right",e.isLegendLeft=n.legend_inset_anchor==="top-left"||n.legend_inset_anchor==="bottom-left",e.legendStep=0,e.legendItemWidth=0,e.legendItemHeight=0,e.currentMaxTickWidths={x:0,y:0,y2:0},e.rotated_padding_left=30,e.rotated_padding_right=n.axis_rotated&&!n.axis_x_show?0:30,e.rotated_padding_top=5,e.withoutFadeIn={},e.intervalForObserveInserted=undefined,e.axes.subx=t.selectAll([])},r.initChartElements=function(){this.initBar&&this.initBar(),this.initLine&&this.initLine(),this.initArc&&this.initArc(),this.initGauge&&this.initGauge(),this.initText&&this.initText()},r.initWithData=function(e){var t=this,n=t.d3,r=t.config,i,s,o=!0;t.axis=new f(t),t.initPie&&t.initPie(),t.initBrush&&t.initBrush(),t.initZoom&&t.initZoom(),r.bindto?typeof r.bindto.node=="function"?t.selectChart=r.bindto:t.selectChart=n.select(r.bindto):t.selectChart=n.selectAll([]),t.selectChart.empty()&&(t.selectChart=n.select(document.createElement("div")).style("opacity",0),t.observeInserted(t.selectChart),o=!1),t.selectChart.html("").classed("c3",!0),t.data.xs={},t.data.targets=t.convertDataToTargets(e),r.data_filter&&(t.data.targets=t.data.targets.filter(r.data_filter)),r.data_hide&&t.addHiddenTargetIds(r.data_hide===!0?t.mapToIds(t.data.targets):r.data_hide),r.legend_hide&&t.addHiddenLegendIds(r.legend_hide===!0?t.mapToIds(t.data.targets):r.legend_hide),t.hasType("gauge")&&(r.legend_show=!1),t.updateSizes(),t.updateScales(),t.x.domain(n.extent(t.getXDomain(t.data.targets))),t.y.domain(t.getYDomain(t.data.targets,"y")),t.y2.domain(t.getYDomain(t.data.targets,"y2")),t.subX.domain(t.x.domain()),t.subY.domain(t.y.domain()),t.subY2.domain(t.y2.domain()),t.orgXDomain=t.x.domain(),t.brush&&t.brush.scale(t.subX),r.zoom_enabled&&t.zoom.scale(t.x),t.svg=t.selectChart.append("svg").style("overflow","hidden").on("mouseenter",function(){return r.onmouseover.call(t)}).on("mouseleave",function(){return r.onmouseout.call(t)}),t.config.svg_classname&&t.svg.attr("class",t.config.svg_classname),i=t.svg.append("defs"),t.clipChart=t.appendClip(i,t.clipId),t.clipXAxis=t.appendClip(i,t.clipIdForXAxis),t.clipYAxis=t.appendClip(i,t.clipIdForYAxis),t.clipGrid=t.appendClip(i,t.clipIdForGrid),t.clipSubchart=t.appendClip(i,t.clipIdForSubchart),t.updateSvgSize(),s=t.main=t.svg.append("g").attr("transform",t.getTranslate("main")),t.initSubchart&&t.initSubchart(),t.initTooltip&&t.initTooltip(),t.initLegend&&t.initLegend(),t.initTitle&&t.initTitle(),s.append("text").attr("class",l.text+" "+l.empty).attr("text-anchor","middle").attr("dominant-baseline","middle"),t.initRegion(),t.initGrid(),s.append("g").attr("clip-path",t.clipPath).attr("class",l.chart),r.grid_lines_front&&t.initGridLines(),t.initEventRect(),t.initChartElements(),s.insert("rect",r.zoom_privileged?null:"g."+l.regions).attr("class",l.zoomRect).attr("width",t.width).attr("height",t.height).style("opacity",0).on("dblclick.zoom",null),r.axis_x_extent&&t.brush.extent(t.getDefaultExtent()),t.axis.init(),t.updateTargets(t.data.targets),o&&(t.updateDimension(),t.config.oninit.call(t),t.redraw({withTransition:!1,withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransitionForAxis:!1})),t.bindResize(),t.api.element=t.selectChart.node()},r.smoothLines=function(e,t){var n=this;t==="grid"&&e.each(function(){var e=n.d3.select(this),t=e.attr("x1"),r=e.attr("x2"),i=e.attr("y1"),s=e.attr("y2");e.attr({x1:Math.ceil(t),x2:Math.ceil(r),y1:Math.ceil(i),y2:Math.ceil(s)})})},r.updateSizes=function(){var e=this,t=e.config,n=e.legend?e.getLegendHeight():0,r=e.legend?e.getLegendWidth():0,i=e.isLegendRight||e.isLegendInset?0:n,s=e.hasArcType(),o=t.axis_rotated||s?0:e.getHorizontalAxisHeight("x"),u=t.subchart_show&&!s?t.subchart_size_height+o:0;e.currentWidth=e.getCurrentWidth(),e.currentHeight=e.getCurrentHeight(),e.margin=t.axis_rotated?{top:e.getHorizontalAxisHeight("y2")+e.getCurrentPaddingTop(),right:s?0:e.getCurrentPaddingRight(),bottom:e.getHorizontalAxisHeight("y")+i+e.getCurrentPaddingBottom(),left:u+(s?0:e.getCurrentPaddingLeft())}:{top:4+e.getCurrentPaddingTop(),right:s?0:e.getCurrentPaddingRight(),bottom:o+u+i+e.getCurrentPaddingBottom(),left:s?0:e.getCurrentPaddingLeft()},e.margin2=t.axis_rotated?{top:e.margin.top,right:NaN,bottom:20+i,left:e.rotated_padding_left}:{top:e.currentHeight-u-i,right:NaN,bottom:o+i,left:e.margin.left},e.margin3={top:0,right:NaN,bottom:0,left:0},e.updateSizeForLegend&&e.updateSizeForLegend(n,r),e.width=e.currentWidth-e.margin.left-e.margin.right,e.height=e.currentHeight-e.margin.top-e.margin.bottom,e.width<0&&(e.width=0),e.height<0&&(e.height=0),e.width2=t.axis_rotated?e.margin.left-e.rotated_padding_left-e.rotated_padding_right:e.width,e.height2=t.axis_rotated?e.height:e.currentHeight-e.margin2.top-e.margin2.bottom,e.width2<0&&(e.width2=0),e.height2<0&&(e.height2=0),e.arcWidth=e.width-(e.isLegendRight?r+10:0),e.arcHeight=e.height-(e.isLegendRight?0:10),e.hasType("gauge")&&!t.gauge_fullCircle&&(e.arcHeight+=e.height-e.getGaugeLabelHeight()),e.updateRadius&&e.updateRadius(),e.isLegendRight&&s&&(e.margin3.left=e.arcWidth/2+e.radiusExpanded*1.1)},r.updateTargets=function(e){var t=this;t.updateTargetsForText(e),t.updateTargetsForBar(e),t.updateTargetsForLine(e),t.hasArcType()&&t.updateTargetsForArc&&t.updateTargetsForArc(e),t.updateTargetsForSubchart&&t.updateTargetsForSubchart(e),t.showTargets()},r.showTargets=function(){var e=this;e.svg.selectAll("."+l.target).filter(function(t){return e.isTargetToShow(t.id)}).transition().duration(e.config.transition_duration).style("opacity",1)},r.redraw=function(e,t){var n=this,r=n.main,i=n.d3,s=n.config,o=n.getShapeIndices(n.isAreaType),u=n.getShapeIndices(n.isBarType),a=n.getShapeIndices(n.isLineType),f,c,h,p,d,v,m,g,y,b,w,S,x,T=n.hasArcType(),N,C,k,L,A,O,M,_,D,P,H=n.filterTargetsToShow(n.data.targets),B,j,F,I,q=n.xv.bind(n),R,U;e=e||{},f=E(e,"withY",!0),c=E(e,"withSubchart",!0),h=E(e,"withTransition",!0),v=E(e,"withTransform",!1),m=E(e,"withUpdateXDomain",!1),g=E(e,"withUpdateOrgXDomain",!1),y=E(e,"withTrimXDomain",!0),x=E(e,"withUpdateXAxis",m),b=E(e,"withLegend",!1),w=E(e,"withEventRect",!0),S=E(e,"withDimension",!0),p=E(e,"withTransitionForExit",h),d=E(e,"withTransitionForAxis",h),O=h?s.transition_duration:0,M=p?O:0,_=d?O:0,t=t||n.axis.generateTransitions(_),b&&s.legend_show?n.updateLegend(n.mapToIds(n.data.targets),e,t):S&&n.updateDimension(!0),n.isCategorized()&&H.length===0&&n.x.domain([0,n.axes.x.selectAll(".tick").size()]),H.length?(n.updateXDomain(H,m,g,y),s.axis_x_tick_values||(B=n.axis.updateXAxisTickValues(H))):(n.xAxis.tickValues([]),n.subXAxis.tickValues([])),s.zoom_rescale&&!e.flow&&(I=n.x.orgDomain()),n.y.domain(n.getYDomain(H,"y",I)),n.y2.domain(n.getYDomain(H,"y2",I)),!s.axis_y_tick_values&&s.axis_y_tick_count&&n.yAxis.tickValues(n.axis.generateTickValues(n.y.domain(),s.axis_y_tick_count)),!s.axis_y2_tick_values&&s.axis_y2_tick_count&&n.y2Axis.tickValues(n.axis.generateTickValues(n.y2.domain(),s.axis_y2_tick_count)),n.axis.redraw(t,T),n.axis.updateLabels(h);if((m||x)&&H.length)if(s.axis_x_tick_culling&&B){for(j=1;j<B.length;j++)if(B.length/j<s.axis_x_tick_culling_max){F=j;break}n.svg.selectAll("."+l.axisX+" .tick text").each(function(e){var t=B.indexOf(e);t>=0&&i.select(this).style("display",t%F?"none":"block")})}else n.svg.selectAll("."+l.axisX+" .tick text").style("display","block");N=n.generateDrawArea?n.generateDrawArea(o,!1):undefined,C=n.generateDrawBar?n.generateDrawBar(u):undefined,k=n.generateDrawLine?n.generateDrawLine(a,!1):undefined,L=n.generateXYForText(o,u,a,!0),A=n.generateXYForText(o,u,a,!1),f&&(n.subY.domain(n.getYDomain(H,"y")),n.subY2.domain(n.getYDomain(H,"y2"))),n.updateXgridFocus(),r.select("text."+l.text+"."+l.empty).attr("x",n.width/2).attr("y",n.height/2).text(s.data_empty_label_text).transition().style("opacity",H.length?0:1),n.updateGrid(O),n.updateRegion(O),n.updateBar(M),n.updateLine(M),n.updateArea(M),n.updateCircle(),n.hasDataLabel()&&n.updateText(M),n.redrawTitle&&n.redrawTitle(),n.redrawArc&&n.redrawArc(O,M,v),n.redrawSubchart&&n.redrawSubchart(c,t,O,M,o,u,a),r.selectAll("."+l.selectedCircles).filter(n.isBarType.bind(n)).selectAll("circle").remove(),s.interaction_enabled&&!e.flow&&w&&(n.redrawEventRect(),n.updateZoom&&n.updateZoom()),n.updateCircleY(),R=(n.config.axis_rotated?n.circleY:n.circleX).bind(n),U=(n.config.axis_rotated?n.circleX:n.circleY).bind(n),e.flow&&(P=n.generateFlow({targets:H,flow:e.flow,duration:e.flow.duration,drawBar:C,drawLine:k,drawArea:N,cx:R,cy:U,xv:q,xForText:L,yForText:A})),(O||P)&&n.isTabVisible()?i.transition().duration(O).each(function(){var t=[];[n.redrawBar(C,!0),n.redrawLine(k,!0),n.redrawArea(N,!0),n.redrawCircle(R,U,!0),n.redrawText(L,A,e.flow,!0),n.redrawRegion(!0),n.redrawGrid(!0)].forEach(function(e){e.forEach(function(e){t.push(e)})}),D=n.generateWait(),t.forEach(function(e){D.add(e)})}).call(D,function(){P&&P(),s.onrendered&&s.onrendered.call(n)}):(n.redrawBar(C),n.redrawLine(k),n.redrawArea(N),n.redrawCircle(R,U),n.redrawText(L,A,e.flow),n.redrawRegion(),n.redrawGrid(),s.onrendered&&s.onrendered.call(n)),n.mapToIds(n.data.targets).forEach(function(e){n.withoutFadeIn[e]=!0})},r.updateAndRedraw=function(e){var t=this,n=t.config,r;e=e||{},e.withTransition=E(e,"withTransition",!0),e.withTransform=E(e,"withTransform",!1),e.withLegend=E(e,"withLegend",!1),e.withUpdateXDomain=!0,e.withUpdateOrgXDomain=!0,e.withTransitionForExit=!1,e.withTransitionForTransform=E(e,"withTransitionForTransform",e.withTransition),t.updateSizes();if(!e.withLegend||!n.legend_show)r=t.axis.generateTransitions(e.withTransitionForAxis?n.transition_duration:0),t.updateScales(),t.updateSvgSize(),t.transformAll(e.withTransitionForTransform,r);t.redraw(e,r)},r.redrawWithoutRescale=function(){this.redraw({withY:!1,withSubchart:!1,withEventRect:!1,withTransitionForAxis:!1})},r.isTimeSeries=function(){return this.config.axis_x_type==="timeseries"},r.isCategorized=function(){return this.config.axis_x_type.indexOf("categor")>=0},r.isCustomX=function(){var e=this,t=e.config;return!e.isTimeSeries()&&(t.data_x||w(t.data_xs))},r.isTimeSeriesY=function(){return this.config.axis_y_type==="timeseries"},r.getTranslate=function(e){var t=this,n=t.config,r,i;return e==="main"?(r=g(t.margin.left),i=g(t.margin.top)):e==="context"?(r=g(t.margin2.left),i=g(t.margin2.top)):e==="legend"?(r=t.margin3.left,i=t.margin3.top):e==="x"?(r=0,i=n.axis_rotated?0:t.height):e==="y"?(r=0,i=n.axis_rotated?t.height:0):e==="y2"?(r=n.axis_rotated?0:t.width,i=n.axis_rotated?1:0):e==="subx"?(r=0,i=n.axis_rotated?0:t.height2):e==="arc"&&(r=t.arcWidth/2,i=t.arcHeight/2),"translate("+r+","+i+")"},r.initialOpacity=function(e){return e.value!==null&&this.withoutFadeIn[e.id]?1:0},r.initialOpacityForCircle=function(e){return e.value!==null&&this.withoutFadeIn[e.id]?this.opacityForCircle(e):0},r.opacityForCircle=function(e){var t=this.config.point_show?1:0;return c(e.value)?this.isScatterType(e)?.5:t:0},r.opacityForText=function(){return this.hasDataLabel()?1:0},r.xx=function(e){return e?this.x(e.x):null},r.xv=function(e){var t=this,n=e.value;return t.isTimeSeries()?n=t.parseDate(e.value):t.isCategorized()&&typeof e.value=="string"&&(n=t.config.axis_x_categories.indexOf(e.value)),Math.ceil(t.x(n))},r.yv=function(e){var t=this,n=e.axis&&e.axis==="y2"?t.y2:t.y;return Math.ceil(n(e.value))},r.subxx=function(e){return e?this.subX(e.x):null},r.transformMain=function(e,t){var n=this,r,i,s;t&&t.axisX?r=t.axisX:(r=n.main.select("."+l.axisX),e&&(r=r.transition())),t&&t.axisY?i=t.axisY:(i=n.main.select("."+l.axisY),e&&(i=i.transition())),t&&t.axisY2?s=t.axisY2:(s=n.main.select("."+l.axisY2),e&&(s=s.transition())),(e?n.main.transition():n.main).attr("transform",n.getTranslate("main")),r.attr("transform",n.getTranslate("x")),i.attr("transform",n.getTranslate("y")),s.attr("transform",n.getTranslate("y2")),n.main.select("."+l.chartArcs).attr("transform",n.getTranslate("arc"))},r.transformAll=function(e,t){var n=this;n.transformMain(e,t),n.config.subchart_show&&n.transformContext(e,t),n.legend&&n.transformLegend(e)},r.updateSvgSize=function(){var e=this,t=e.svg.select(".c3-brush .background");e.svg.attr("width",e.currentWidth).attr("height",e.currentHeight),e.svg.selectAll(["#"+e.clipId,"#"+e.clipIdForGrid]).select("rect").attr("width",e.width).attr("height",e.height),e.svg.select("#"+e.clipIdForXAxis).select("rect").attr("x",e.getXAxisClipX.bind(e)).attr("y",e.getXAxisClipY.bind(e)).attr("width",e.getXAxisClipWidth.bind(e)).attr("height",e.getXAxisClipHeight.bind(e)),e.svg.select("#"+e.clipIdForYAxis).select("rect").attr("x",e.getYAxisClipX.bind(e)).attr("y",e.getYAxisClipY.bind(e)).attr("width",e.getYAxisClipWidth.bind(e)).attr("height",e.getYAxisClipHeight.bind(e)),e.svg.select("#"+e.clipIdForSubchart).select("rect").attr("width",e.width).attr("height",t.size()?t.attr("height"):0),e.svg.select("."+l.zoomRect).attr("width",e.width).attr("height",e.height),e.selectChart.style("max-height",e.currentHeight+"px")},r.updateDimension=function(e){var t=this;e||(t.config.axis_rotated?(t.axes.x.call(t.xAxis),t.axes.subx.call(t.subXAxis)):(t.axes.y.call(t.yAxis),t.axes.y2.call(t.y2Axis))),t.updateSizes(),t.updateScales(),t.updateSvgSize(),t.transformAll(!1)},r.observeInserted=function(t){var n=this,r;if(typeof MutationObserver=="undefined"){e.console.error("MutationObserver not defined.");return}r=new MutationObserver(function(i){i.forEach(function(i){i.type==="childList"&&i.previousSibling&&(r.disconnect(),n.intervalForObserveInserted=e.setInterval(function(){t.node().parentNode&&(e.clearInterval(n.intervalForObserveInserted),n.updateDimension(),n.brush&&n.brush.update(),n.config.oninit.call(n),n.redraw({withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransition:!1,withTransitionForTransform:!1,withLegend:!0}),t.transition().style("opacity",1))},10))})}),r.observe(t.node(),{attributes:!0,childList:!0,characterData:!0})},r.bindResize=function(){var t=this,n=t.config;t.resizeFunction=t.generateResize(),t.resizeFunction.add(function(){n.onresize.call(t)}),n.resize_auto&&t.resizeFunction.add(function(){t.resizeTimeout!==undefined&&e.clearTimeout(t.resizeTimeout),t.resizeTimeout=e.setTimeout(function(){delete t.resizeTimeout,t.api.flush()},100)}),t.resizeFunction.add(function(){n.onresized.call(t)});if(e.attachEvent)e.attachEvent("onresize",t.resizeFunction);else if(e.addEventListener)e.addEventListener("resize",t.resizeFunction,!1);else{var r=e.onresize;if(!r)r=t.generateResize();else if(!r.add||!r.remove)r=t.generateResize(),r.add(e.onresize);r.add(t.resizeFunction),e.onresize=r}},r.generateResize=function(){function t(){e.forEach(function(e){e()})}var e=[];return t.add=function(t){e.push(t)},t.remove=function(t){for(var n=0;n<e.length;n++)if(e[n]===t){e.splice(n,1);break}},t},r.endall=function(e,t){var n=0;e.each(function(){++n}).each("end",function(){--n||t.apply(this,arguments)})},r.generateWait=function(){var e=[],t=function(t,n){var r=setInterval(function(){var t=0;e.forEach(function(e){if(e.empty()){t+=1;return}try{e.transition()}catch(n){t+=1}}),t===e.length&&(clearInterval(r),n&&n())},10)};return t.add=function(t){e.push(t)},t},r.parseDate=function(t){var n=this,r;return t instanceof Date?r=t:typeof t=="string"?r=n.dataTimeFormat(n.config.data_xFormat).parse(t):typeof t=="number"&&!isNaN(t)&&(r=new Date(+t)),(!r||isNaN(+r))&&e.console.error("Failed to parse x '"+t+"' to Date object"),r},r.isTabVisible=function(){var e;return typeof document.hidden!="undefined"?e="hidden":typeof document.mozHidden!="undefined"?e="mozHidden":typeof document.msHidden!="undefined"?e="msHidden":typeof document.webkitHidden!="undefined"&&(e="webkitHidden"),document[e]?!1:!0},r.getDefaultConfig=function(){var e={bindto:"#chart",svg_classname:undefined,size_width:undefined,size_height:undefined,padding_left:undefined,padding_right:undefined,padding_top:undefined,padding_bottom:undefined,resize_auto:!0,zoom_enabled:!1,zoom_extent:undefined,zoom_privileged:!1,zoom_rescale:!1,zoom_onzoom:function(){},zoom_onzoomstart:function(){},zoom_onzoomend:function(){},zoom_x_min:undefined,zoom_x_max:undefined,interaction_brighten:!0,interaction_enabled:!0,onmouseover:function(){},onmouseout:function(){},onresize:function(){},onresized:function(){},oninit:function(){},onrendered:function(){},transition_duration:350,data_x:undefined,data_xs:{},data_xFormat:"%Y-%m-%d",data_xLocaltime:!0,data_xSort:!0,data_idConverter:function(e){return e},data_names:{},data_classes:{},data_groups:[],data_axes:{},data_type:undefined,data_types:{},data_labels:{},data_order:"desc",data_regions:{},data_color:undefined,data_colors:{},data_hide:!1,data_filter:undefined,data_selection_enabled:!1,data_selection_grouped:!1,data_selection_isselectable:function(){return!0},data_selection_multiple:!0,data_selection_draggable:!1,data_onclick:function(){},data_onmouseover:function(){},data_onmouseout:function(){},data_onselected:function(){},data_onunselected:function(){},data_url:undefined,data_headers:undefined,data_json:undefined,data_rows:undefined,data_columns:undefined,data_mimeType:undefined,data_keys:undefined,data_empty_label_text:"",subchart_show:!1,subchart_size_height:60,subchart_axis_x_show:!0,subchart_onbrush:function(){},color_pattern:[],color_threshold:{},legend_show:!0,legend_hide:!1,legend_position:"bottom",legend_inset_anchor:"top-left",legend_inset_x:10,legend_inset_y:0,legend_inset_step:undefined,legend_item_onclick:undefined,legend_item_onmouseover:undefined,legend_item_onmouseout:undefined,legend_equally:!1,legend_padding:0,legend_item_tile_width:10,legend_item_tile_height:10,axis_rotated:!1,axis_x_show:!0,axis_x_type:"indexed",axis_x_localtime:!0,axis_x_categories:[],axis_x_tick_centered:!1,axis_x_tick_format:undefined,axis_x_tick_culling:{},axis_x_tick_culling_max:10,axis_x_tick_count:undefined,axis_x_tick_fit:!0,axis_x_tick_values:null,axis_x_tick_rotate:0,axis_x_tick_outer:!0,axis_x_tick_multiline:!0,axis_x_tick_width:null,axis_x_max:undefined,axis_x_min:undefined,axis_x_padding:{},axis_x_height:undefined,axis_x_extent:undefined,axis_x_label:{},axis_y_show:!0,axis_y_type:undefined,axis_y_max:undefined,axis_y_min:undefined,axis_y_inverted:!1,axis_y_center:undefined,axis_y_inner:undefined,axis_y_label:{},axis_y_tick_format:undefined,axis_y_tick_outer:!0,axis_y_tick_values:null,axis_y_tick_rotate:0,axis_y_tick_count:undefined,axis_y_tick_time_value:undefined,axis_y_tick_time_interval:undefined,axis_y_padding:{},axis_y_default:undefined,axis_y2_show:!1,axis_y2_max:undefined,axis_y2_min:undefined,axis_y2_inverted:!1,axis_y2_center:undefined,axis_y2_inner:undefined,axis_y2_label:{},axis_y2_tick_format:undefined,axis_y2_tick_outer:!0,axis_y2_tick_values:null,axis_y2_tick_count:undefined,axis_y2_padding:{},axis_y2_default:undefined,grid_x_show:!1,grid_x_type:"tick",grid_x_lines:[],grid_y_show:!1,grid_y_lines:[],grid_y_ticks:10,grid_focus_show:!0,grid_lines_front:!0,point_show:!0,point_r:2.5,point_sensitivity:10,point_focus_expand_enabled:!0,point_focus_expand_r:undefined,point_select_r:undefined,line_connectNull:!1,line_step_type:"step",bar_width:undefined,bar_width_ratio:.6,bar_width_max:undefined,bar_zerobased:!0,area_zerobased:!0,area_above:!1,pie_label_show:!0,pie_label_format:undefined,pie_label_threshold:.05,pie_label_ratio:undefined,pie_expand:{},pie_expand_duration:50,gauge_fullCircle:!1,gauge_label_show:!0,gauge_label_format:undefined,gauge_min:0,gauge_max:100,gauge_startingAngle:-1*Math.PI/2,gauge_units:undefined,gauge_width:undefined,gauge_expand:{},gauge_expand_duration:50,donut_label_show:!0,donut_label_format:undefined,donut_label_threshold:.05,donut_label_ratio:undefined,donut_width:undefined,donut_title:"",donut_expand:{},donut_expand_duration:50,spline_interpolation_type:"cardinal",regions:[],tooltip_show:!0,tooltip_grouped:!0,tooltip_format_title:undefined,tooltip_format_name:undefined,tooltip_format_value:undefined,tooltip_position:undefined,tooltip_contents:function(e,t,n,r){return this.getTooltipContent?this.getTooltipContent(e,t,n,r):""},tooltip_init_show:!1,tooltip_init_x:0,tooltip_init_position:{top:"0px",left:"50px"},tooltip_onshow:function(){},tooltip_onhide:function(){},title_text:undefined,title_padding:{top:0,right:0,bottom:0,left:0},title_position:"top-center"};return Object.keys(this.additionalConfig).forEach(function(t){e[t]=this.additionalConfig[t]},this),e},r.additionalConfig={},r.loadConfig=function(e){function s(){var e=r.shift();return e&&n&&typeof n=="object"&&e in n?(n=n[e],s()):e?undefined:n}var t=this.config,n,r,i;Object.keys(t).forEach(function(o){n=e,r=o.split("_"),i=s(),v(i)&&(t[o]=i)})},r.getScale=function(e,t,n){return(n?this.d3.time.scale():this.d3.scale.linear()).range([e,t])},r.getX=function(e,t,n,r){var i=this,s=i.getScale(e,t,i.isTimeSeries()),o=n?s.domain(n):s,u;i.isCategorized()?(r=r||function(){return 0},s=function(e,t){var n=o(e)+r(e);return t?n:Math.ceil(n)}):s=function(e,t){var n=o(e);return t?n:Math.ceil(n)};for(u in o)s[u]=o[u];return s.orgDomain=function(){return o.domain()},i.isCategorized()&&(s.domain=function(e){return arguments.length?(o.domain(e),s):(e=this.orgDomain(),[e[0],e[1]+1])}),s},r.getY=function(e,t,n){var r=this.getScale(e,t,this.isTimeSeriesY());return n&&r.domain(n),r},r.getYScale=function(e){return this.axis.getId(e)==="y2"?this.y2:this.y},r.getSubYScale=function(e){return this.axis.getId(e)==="y2"?this.subY2:this.subY},r.updateScales=function(){var e=this,t=e.config,n=!e.x;e.xMin=t.axis_rotated?1:0,e.xMax=t.axis_rotated?e.height:e.width,e.yMin=t.axis_rotated?0:e.height,e.yMax=t.axis_rotated?e.width:1,e.subXMin=e.xMin,e.subXMax=e.xMax,e.subYMin=t.axis_rotated?0:e.height2,e.subYMax=t.axis_rotated?e.width2:1,e.x=e.getX(e.xMin,e.xMax,n?undefined:e.x.orgDomain(),function(){return e.xAxis.tickOffset()}),e.y=e.getY(e.yMin,e.yMax,n?t.axis_y_default:e.y.domain()),e.y2=e.getY(e.yMin,e.yMax,n?t.axis_y2_default:e.y2.domain()),e.subX=e.getX(e.xMin,e.xMax,e.orgXDomain,function(t){return t%1?0:e.subXAxis.tickOffset()}),e.subY=e.getY(e.subYMin,e.subYMax,n?t.axis_y_default:e.subY.domain()),e.subY2=e.getY(e.subYMin,e.subYMax,n?t.axis_y2_default:e.subY2.domain()),e.xAxisTickFormat=e.axis.getXAxisTickFormat(),e.xAxisTickValues=e.axis.getXAxisTickValues(),e.yAxisTickValues=e.axis.getYAxisTickValues(),e.y2AxisTickValues=e.axis.getY2AxisTickValues(),e.xAxis=e.axis.getXAxis(e.x,e.xOrient,e.xAxisTickFormat,e.xAxisTickValues,t.axis_x_tick_outer),e.subXAxis=e.axis.getXAxis(e.subX,e.subXOrient,e.xAxisTickFormat,e.xAxisTickValues,t.axis_x_tick_outer),e.yAxis=e.axis.getYAxis(e.y,e.yOrient,t.axis_y_tick_format,e.yAxisTickValues,t.axis_y_tick_outer),e.y2Axis=e.axis.getYAxis(e.y2,e.y2Orient,t.axis_y2_tick_format,e.y2AxisTickValues,t.axis_y2_tick_outer),n||(e.brush&&e.brush.scale(e.subX),t.zoom_enabled&&e.zoom.scale(e.x)),e.updateArc&&e.updateArc()},r.getYDomainMin=function(e){var t=this,n=t.config,r=t.mapToIds(e),i=t.getValuesAsIdKeyed(e),s,o,u,a,f,l;if(n.data_groups.length>0){l=t.hasNegativeValueInTargets(e);for(s=0;s<n.data_groups.length;s++){a=n.data_groups[s].filter(function(e){return r.indexOf(e)>=0});if(a.length===0)continue;u=a[0],l&&i[u]&&i[u].forEach(function(e,t){i[u][t]=e<0?e:0});for(o=1;o<a.length;o++){f=a[o];if(!i[f])continue;i[f].forEach(function(e,n){t.axis.getId(f)===t.axis.getId(u)&&i[u]&&!(l&&+e>0)&&(i[u][n]+=+e)})}}}return t.d3.min(Object.keys(i).map(function(e){return t.d3.min(i[e])}))},r.getYDomainMax=function(e){var t=this,n=t.config,r=t.mapToIds(e),i=t.getValuesAsIdKeyed(e),s,o,u,a,f,l;if(n.data_groups.length>0){l=t.hasPositiveValueInTargets(e);for(s=0;s<n.data_groups.length;s++){a=n.data_groups[s].filter(function(e){return r.indexOf(e)>=0});if(a.length===0)continue;u=a[0],l&&i[u]&&i[u].forEach(function(e,t){i[u][t]=e>0?e:0});for(o=1;o<a.length;o++){f=a[o];if(!i[f])continue;i[f].forEach(function(e,n){t.axis.getId(f)===t.axis.getId(u)&&i[u]&&!(l&&+e<0)&&(i[u][n]+=+e)})}}}return t.d3.max(Object.keys(i).map(function(e){return t.d3.max(i[e])}))},r.getYDomain=function(e,t,n){var r=this,i=r.config,s=e.filter(function(e){return r.axis.getId(e.id)===t}),o=n?r.filterByXDomain(s,n):s,u=t==="y2"?i.axis_y2_min:i.axis_y_min,a=t==="y2"?i.axis_y2_max:i.axis_y_max,f=r.getYDomainMin(o),l=r.getYDomainMax(o),h,p,d,v,m,g=t==="y2"?i.axis_y2_center:i.axis_y_center,b,E,S,x,T,N,C=r.hasType("bar",o)&&i.bar_zerobased||r.hasType("area",o)&&i.area_zerobased,k=t==="y2"?i.axis_y2_inverted:i.axis_y_inverted,L=r.hasDataLabel()&&i.axis_rotated,A=r.hasDataLabel()&&!i.axis_rotated;f=c(u)?u:c(a)?f<a?f:a-10:f,l=c(a)?a:c(u)?u<l?l:u+10:l;if(o.length===0)return t==="y2"?r.y2.domain():r.y.domain();isNaN(f)&&(f=0),isNaN(l)&&(l=f),f===l&&(f<0?l=0:f=0),T=f>=0&&l>=0,N=f<=0&&l<=0;if(c(u)&&T||c(a)&&N)C=!1;return C&&(T&&(f=0),N&&(l=0)),p=Math.abs(l-f),d=v=m=p*.1,typeof g!="undefined"&&(b=Math.max(Math.abs(f),Math.abs(l)),l=g+b,f=g-b),L?(E=r.getDataLabelLength(f,l,"width"),S=y(r.y.range()),x=[E[0]/S,E[1]/S],v+=p*(x[1]/(1-x[0]-x[1])),m+=p*(x[0]/(1-x[0]-x[1]))):A&&(E=r.getDataLabelLength(f,l,"height"),v+=r.axis.convertPixelsToAxisPadding(E[1],p),m+=r.axis.convertPixelsToAxisPadding(E[0],p)),t==="y"&&w(i.axis_y_padding)&&(v=r.axis.getPadding(i.axis_y_padding,"top",v,p),m=r.axis.getPadding(i.axis_y_padding,"bottom",m,p)),t==="y2"&&w(i.axis_y2_padding)&&(v=r.axis.getPadding(i.axis_y2_padding,"top",v,p),m=r.axis.getPadding(i.axis_y2_padding,"bottom",m,p)),C&&(T&&(m=f),N&&(v=-l)),h=[f-m,l+v],k?h.reverse():h},r.getXDomainMin=function(e){var t=this,n=t.config;return v(n.axis_x_min)?t.isTimeSeries()?this.parseDate(n.axis_x_min):n.axis_x_min:t.d3.min(e,function(e){return t.d3.min(e.values,function(e){return e.x})})},r.getXDomainMax=function(e){var t=this,n=t.config;return v(n.axis_x_max)?t.isTimeSeries()?this.parseDate(n.axis_x_max):n.axis_x_max:t.d3.max(e,function(e){return t.d3.max(e.values,function(e){return e.x})})},r.getXDomainPadding=function(e){var t=this,n=t.config,r=e[1]-e[0],i,s,o,u;return t.isCategorized()?s=0:t.hasType("bar")?(i=t.getMaxDataCount(),s=i>1?r/(i-1)/2:.5):s=r*.01,typeof n.axis_x_padding=="object"&&w(n.axis_x_padding)?(o=c(n.axis_x_padding.left)?n.axis_x_padding.left:s,u=c(n.axis_x_padding.right)?n.axis_x_padding.right:s):typeof n.axis_x_padding=="number"?o=u=n.axis_x_padding:o=u=s,{left:o,right:u}},r.getXDomain=function(e){var t=this,n=[t.getXDomainMin(e),t.getXDomainMax(e)],r=n[0],i=n[1],s=t.getXDomainPadding(n),o=0,u=0;r-i===0&&!t.isCategorized()&&(t.isTimeSeries()?(r=new Date(r.getTime()*.5),i=new Date(i.getTime()*1.5)):(r=r===0?1:r*.5,i=i===0?-1:i*1.5));if(r||r===0)o=t.isTimeSeries()?new Date(r.getTime()-s.left):r-s.left;if(i||i===0)u=t.isTimeSeries()?new Date(i.getTime()+s.right):i+s.right;return[o,u]},r.updateXDomain=function(e,t,n,r,i){var s=this,o=s.config;return n&&(s.x.domain(i?i:s.d3.extent(s.getXDomain(e))),s.orgXDomain=s.x.domain(),o.zoom_enabled&&s.zoom.scale(s.x).updateScaleExtent(),s.subX.domain(s.x.domain()),s.brush&&s.brush.scale(s.subX)),t&&(s.x.domain(i?i:!s.brush||s.brush.empty()?s.orgXDomain:s.brush.extent()),o.zoom_enabled&&s.zoom.scale(s.x).updateScaleExtent()),r&&s.x.domain(s.trimXDomain(s.x.orgDomain())),s.x.domain()},r.trimXDomain=function(e){var t=this.getZoomDomain(),n=t[0],r=t[1];return e[0]<=n&&(e[1]=+e[1]+(n-e[0]),e[0]=n),r<=e[1]&&(e[0]=+e[0]-(e[1]-r),e[1]=r),e},r.isX=function(e){var t=this,n=t.config;return n.data_x&&e===n.data_x||w(n.data_xs)&&S(n.data_xs,e)},r.isNotX=function(e){return!this.isX(e)},r.getXKey=function(e){var t=this,n=t.config;return n.data_x?n.data_x:w(n.data_xs)?n.data_xs[e]:null},r.getXValuesOfXKey=function(e,t){var n=this,r,i=t&&w(t)?n.mapToIds(t):[];return i.forEach(function(t){n.getXKey(t)===e&&(r=n.data.xs[t])}),r},r.getIndexByX=function(e){var t=this,n=t.filterByX(t.data.targets,e);return n.length?n[0].index:null},r.getXValue=function(e,t){var n=this;return e in n.data.xs&&n.data.xs[e]&&c(n.data.xs[e][t])?n.data.xs[e][t]:t},r.getOtherTargetXs=function(){var e=this,t=Object.keys(e.data.xs);return t.length?e.data.xs[t[0]]:null},r.getOtherTargetX=function(e){var t=this.getOtherTargetXs();return t&&e<t.length?t[e]:null},r.addXs=function(e){var t=this;Object.keys(e).forEach(function(n){t.config.data_xs[n]=e[n]})},r.hasMultipleX=function(e){return this.d3.set(Object.keys(e).map(function(t){return e[t]})).size()>1},r.isMultipleX=function(){return w(this.config.data_xs)||!this.config.data_xSort||this.hasType("scatter")},r.addName=function(e){var t=this,n;return e&&(n=t.config.data_names[e.id],e.name=n!==undefined?n:e.id),e},r.getValueOnIndex=function(e,t){var n=e.filter(function(e){return e.index===t});return n.length?n[0]:null},r.updateTargetX=function(e,t){var n=this;e.forEach(function(e){e.values.forEach(function(r,i){r.x=n.generateTargetX(t[i],e.id,i)}),n.data.xs[e.id]=t})},r.updateTargetXs=function(e,t){var n=this;e.forEach(function(e){t[e.id]&&n.updateTargetX([e],t[e.id])})},r.generateTargetX=function(e,t,n){var r=this,i;return r.isTimeSeries()?i=e?r.parseDate(e):r.parseDate(r.getXValue(t,n)):r.isCustomX()&&!r.isCategorized()?i=c(e)?+e:r.getXValue(t,n):i=n,i},r.cloneTarget=function(e){return{id:e.id,id_org:e.id_org,values:e.values.map(function(e){return{x:e.x,value:e.value,id:e.id}})}},r.updateXs=function(){var e=this;e.data.targets.length&&(e.xs=[],e.data.targets[0].values.forEach(function(t){e.xs[t.index]=t.x}))},r.getPrevX=function(e){var t=this.xs[e-1];return typeof t!="undefined"?t:null},r.getNextX=function(e){var t=this.xs[e+1];return typeof t!="undefined"?t:null},r.getMaxDataCount=function(){var e=this;return e.d3.max(e.data.targets,function(e){return e.values.length})},r.getMaxDataCountTarget=function(e){var t=e.length,n=0,r;return t>1?e.forEach(function(e){e.values.length>n&&(r=e,n=e.values.length)}):r=t?e[0]:null,r},r.getEdgeX=function(e){var t=this;return e.length?[t.d3.min(e,function(e){return e.values[0].x}),t.d3.max(e,function(e){return e.values[e.values.length-1].x})]:[0,0]},r.mapToIds=function(e){return e.map(function(e){return e.id})},r.mapToTargetIds=function(e){var t=this;return e?[].concat(e):t.mapToIds(t.data.targets)},r.hasTarget=function(e,t){var n=this.mapToIds(e),r;for(r=0;r<n.length;r++)if(n[r]===t)return!0;return!1},r.isTargetToShow=function(e){return this.hiddenTargetIds.indexOf(e)<0},r.isLegendToShow=function(e){return this.hiddenLegendIds.indexOf(e)<0},r.filterTargetsToShow=function(e){var t=this;return e.filter(function(e){return t.isTargetToShow(e.id)})},r.mapTargetsToUniqueXs=function(e){var t=this,n=t.d3.set(t.d3.merge(e.map(function(e){return e.values.map(function(e){return+e.x})}))).values();return n=t.isTimeSeries()?n.map(function(e){return new Date(+e)}):n.map(function(e){return+e}),n.sort(function(e,t){return e<t?-1:e>t?1:e>=t?0:NaN})},r.addHiddenTargetIds=function(e){this.hiddenTargetIds=this.hiddenTargetIds.concat(e)},r.removeHiddenTargetIds=function(e){this.hiddenTargetIds=this.hiddenTargetIds.filter(function(t){return e.indexOf(t)<0})},r.addHiddenLegendIds=function(e){this.hiddenLegendIds=this.hiddenLegendIds.concat(e)},r.removeHiddenLegendIds=function(e){this.hiddenLegendIds=this.hiddenLegendIds.filter(function(t){return e.indexOf(t)<0})},r.getValuesAsIdKeyed=function(e){var t={};return e.forEach(function(e){t[e.id]=[],e.values.forEach(function(n){t[e.id].push(n.value)})}),t},r.checkValueInTargets=function(e,t){var n=Object.keys(e),r,i,s;for(r=0;r<n.length;r++){s=e[n[r]].values;for(i=0;i<s.length;i++)if(t(s[i].value))return!0}return!1},r.hasNegativeValueInTargets=function(e){return this.checkValueInTargets(e,function(e){return e<0})},r.hasPositiveValueInTargets=function(e){return this.checkValueInTargets(e,function(e){return e>0})},r.isOrderDesc=function(){var e=this.config;return typeof e.data_order=="string"&&e.data_order.toLowerCase()==="desc"},r.isOrderAsc=function(){var e=this.config;return typeof e.data_order=="string"&&e.data_order.toLowerCase()==="asc"},r.orderTargets=function(e){var t=this,n=t.config,r=t.isOrderAsc(),i=t.isOrderDesc();return r||i?e.sort(function(e,t){var n=function(e,t){return e+Math.abs(t.value)},i=e.values.reduce(n,0),s=t.values.reduce(n,0);return r?s-i:i-s}):h(n.data_order)&&e.sort(n.data_order),e},r.filterByX=function(e,t){return this.d3.merge(e.map(function(e){return e.values})).filter(function(e){return e.x-t===0})},r.filterRemoveNull=function(e){return e.filter(function(e){return c(e.value)})},r.filterByXDomain=function(e,t){return e.map(function(e){return{id:e.id,id_org:e.id_org,values:e.values.filter(function(e){return t[0]<=e.x&&e.x<=t[1]})}})},r.hasDataLabel=function(){var e=this.config;return typeof e.data_labels=="boolean"&&e.data_labels?!0:typeof e.data_labels=="object"&&w(e.data_labels)?!0:!1},r.getDataLabelLength=function(e,t,n){var r=this,i=[0,0],s=1.3;return r.selectChart.select("svg").selectAll(".dummy").data([e,t]).enter().append("text").text(function(e){return r.dataLabelFormat(e.id)(e)}).each(function(e,t){i[t]=this.getBoundingClientRect()[n]*s}).remove(),i},r.isNoneArc=function(e){return this.hasTarget(this.data.targets,e.id)},r.isArc=function(e){return"data"in e&&this.hasTarget(this.data.targets,e.data.id)},r.findSameXOfValues=function(e,t){var n,r=e[t].x,i=[];for(n=t-1;n>=0;n--){if(r!==e[n].x)break;i.push(e[n])}for(n=t;n<e.length;n++){if(r!==e[n].x)break;i.push(e[n])}return i},r.findClosestFromTargets=function(e,t){var n=this,r;return r=e.map(function(e){return n.findClosest(e.values,t)}),n.findClosest(r,t)},r.findClosest=function(e,t){var n=this,r=n.config.point_sensitivity,i;return e.filter(function(e){return e&&n.isBarType(e.id)}).forEach(function(e){var t=n.main.select("."+l.bars+n.getTargetSelectorSuffix(e.id)+" ."+l.bar+"-"+e.index).node();!i&&n.isWithinBar(t)&&(i=e)}),e.filter(function(e){return e&&!n.isBarType(e.id)}).forEach(function(e){var s=n.dist(e,t);s<r&&(r=s,i=e)}),i},r.dist=function(e,t){var n=this,r=n.config,i=r.axis_rotated?1:0,s=r.axis_rotated?0:1,o=n.circleY(e,e.index),u=n.x(e.x);return Math.sqrt(Math.pow(u-t[i],2)+Math.pow(o-t[s],2))},r.convertValuesToStep=function(e){var t=[].concat(e),n;if(!this.isCategorized())return e;for(n=e.length+1;0<n;n--)t[n]=t[n-1];return t[0]={x:t[0].x-1,value:t[0].value,id:t[0].id},t[e.length+1]={x:t[e.length].x+1,value:t[e.length].value,id:t[e.length].id},t},r.updateDataAttributes=function(e,t){var n=this,r=n.config,i=r["data_"+e];return typeof t=="undefined"?i:(Object.keys(t).forEach(function(e){i[e]=t[e]}),n.redraw({withLegend:!0}),i)},r.convertUrlToData=function(e,t,n,r,i){var s=this,o=t?t:"csv",u=s.d3.xhr(e);n&&Object.keys(n).forEach(function(e){u.header(e,n[e])}),u.get(function(e,t){var n;if(!t)throw new Error(e.responseURL+" "+e.status+" ("+e.statusText+")");o==="json"?n=s.convertJsonToData(JSON.parse(t.response),r):o==="tsv"?n=s.convertTsvToData(t.response):n=s.convertCsvToData(t.response),i.call(s,n)})},r.convertXsvToData=function(e,t){var n=t.parseRows(e),r;return n.length===1?(r=[{}],n[0].forEach(function(e){r[0][e]=null})):r=t.parse(e),r},r.convertCsvToData=function(e){return this.convertXsvToData(e,this.d3.csv)},r.convertTsvToData=function(e){return this.convertXsvToData(e,this.d3.tsv)},r.convertJsonToData=function(e,t){var n=this,r=[],i,s;return t?(t.x?(i=t.value.concat(t.x),n.config.data_x=t.x):i=t.value,r.push(i),e.forEach(function(e){var t=[];i.forEach(function(r){var i=n.findValueInJson(e,r);d(i)&&(i=null),t.push(i)}),r.push(t)}),s=n.convertRowsToData(r)):(Object.keys(e).forEach(function(t){r.push([t].concat(e[t]))}),s=n.convertColumnsToData(r)),s},r.findValueInJson=function(e,t){t=t.replace(/\[(\w+)\]/g,".$1"),t=t.replace(/^\./,"");var n=t.split(".");for(var r=0;r<n.length;++r){var i=n[r];if(!(i in e))return;e=e[i]}return e},r.convertRowsToData=function(e){var t=e[0],n={},r=[],i,s;for(i=1;i<e.length;i++){n={};for(s=0;s<e[i].length;s++){if(d(e[i][s]))throw new Error("Source data is missing a component at ("+i+","+s+")!");n[t[s]]=e[i][s]}r.push(n)}return r},r.convertColumnsToData=function(e){var t=[],n,r,i;for(n=0;n<e.length;n++){i=e[n][0];for(r=1;r<e[n].length;r++){d(t[r-1])&&(t[r-1]={});if(d(e[n][r]))throw new Error("Source data is missing a component at ("+n+","+r+")!");t[r-1][i]=e[n][r]}}return t},r.convertDataToTargets=function(e,t){var n=this,r=n.config,i=n.d3.keys(e[0]).filter(n.isNotX,n),s=n.d3.keys(e[0]).filter(n.isX,n),o;return i.forEach(function(i){var o=n.getXKey(i);n.isCustomX()||n.isTimeSeries()?s.indexOf(o)>=0?n.data.xs[i]=(t&&n.data.xs[i]?n.data.xs[i]:[]).concat(e.map(function(e){return e[o]}).filter(c).map(function(e,t){return n.generateTargetX(e,i,t)})):r.data_x?n.data.xs[i]=n.getOtherTargetXs():w(r.data_xs)&&(n.data.xs[i]=n.getXValuesOfXKey(o,n.data.targets)):n.data.xs[i]=e.map(function(e,t){return t})}),i.forEach(function(e){if(!n.data.xs[e])throw new Error('x is not defined for id = "'+e+'".')}),o=i.map(function(t,i){var s=r.data_idConverter(t);return{id:s,id_org:t,values:e.map(function(e,o){var u=n.getXKey(t),a=e[u],f=e[t]!==null&&!isNaN(e[t])?+e[t]:null,l;n.isCustomX()&&n.isCategorized()&&i===0&&!d(a)?(i===0&&o===0&&(r.axis_x_categories=[]),l=r.axis_x_categories.indexOf(a),l===-1&&(l=r.axis_x_categories.length,r.axis_x_categories.push(a))):l=n.generateTargetX(a,t,o);if(d(e[t])||n.data.xs[t].length<=o)l=undefined;return{x:l,value:f,id:s}}).filter(function(e){return v(e.x)})}}),o.forEach(function(e){var t;r.data_xSort&&(e.values=e.values.sort(function(e,t){var n=e.x||e.x===0?e.x:Infinity,r=t.x||t.x===0?t.x:Infinity;return n-r})),t=0,e.values.forEach(function(e){e.index=t++}),n.data.xs[e.id].sort(function(e,t){return e-t})}),n.hasNegativeValue=n.hasNegativeValueInTargets(o),n.hasPositiveValue=n.hasPositiveValueInTargets(o),r.data_type&&n.setTargetType(n.mapToIds(o).filter(function(e){return!(e in r.data_types)}),r.data_type),o.forEach(function(e){n.addCache(e.id_org,e)}),o},r.load=function(e,t){var n=this;e&&(t.filter&&(e=e.filter(t.filter)),(t.type||t.types)&&e.forEach(function(e){var r=t.types&&t.types[e.id]?t.types[e.id]:t.type;n.setTargetType(e.id,r)}),n.data.targets.forEach(function(t){for(var n=0;n<e.length;n++)if(t.id===e[n].id){t.values=e[n].values,e.splice(n,1);break}}),n.data.targets=n.data.targets.concat(e)),n.updateTargets(n.data.targets),n.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),t.done&&t.done()},r.loadFromArgs=function(e){var t=this;e.data?t.load(t.convertDataToTargets(e.data),e):e.url?t.convertUrlToData(e.url,e.mimeType,e.headers,e.keys,function(n){t.load(t.convertDataToTargets(n),e)}):e.json?t.load(t.convertDataToTargets(t.convertJsonToData(e.json,e.keys)),e):e.rows?t.load(t.convertDataToTargets(t.convertRowsToData(e.rows)),e):e.columns?t.load(t.convertDataToTargets(t.convertColumnsToData(e.columns)),e):t.load(null,e)},r.unload=function(e,t){var n=this;t||(t=function(){}),e=e.filter(function(e){return n.hasTarget(n.data.targets,e)});if(!e||e.length===0){t();return}n.svg.selectAll(e.map(function(e){return n.selectorTarget(e)})).transition().style("opacity",0).remove().call(n.endall,t),e.forEach(function(e){n.withoutFadeIn[e]=!1,n.legend&&n.legend.selectAll("."+l.legendItem+n.getTargetSelectorSuffix(e)).remove(),n.data.targets=n.data.targets.filter(function(t){return t.id!==e})})},r.categoryName=function(e){var t=this.config;return e<t.axis_x_categories.length?t.axis_x_categories[e]:e},r.initEventRect=function(){var e=this;e.main.select("."+l.chart).append("g").attr("class",l.eventRects).style("fill-opacity",0)},r.redrawEventRect=function(){var e=this,t=e.config,n,r,i=e.isMultipleX(),s=e.main.select("."+l.eventRects).style("cursor",t.zoom_enabled?t.axis_rotated?"ns-resize":"ew-resize":null).classed(l.eventRectsMultiple,i).classed(l.eventRectsSingle,!i);s.selectAll("."+l.eventRect).remove(),e.eventRect=s.selectAll("."+l.eventRect),i?(n=e.eventRect.data([0]),e.generateEventRectsForMultipleXs(n.enter()),e.updateEventRect(n)):(r=e.getMaxDataCountTarget(e.data.targets),s.datum(r?r.values:[]),e.eventRect=s.selectAll("."+l.eventRect),n=e.eventRect.data(function(e){return e}),e.generateEventRectsForSingleX(n.enter()),e.updateEventRect(n),n.exit().remove())},r.updateEventRect=function(e){var t=this,n=t.config,r,i,s,o,u,a;e=e||t.eventRect.data(function(e){return e}),t.isMultipleX()?(r=0,i=0,s=t.width,o=t.height):((t.isCustomX()||t.isTimeSeries())&&!t.isCategorized()?(t.updateXs(),u=function(e){var r=t.getPrevX(e.index),i=t.getNextX(e.index);return r===null&&i===null?n.axis_rotated?t.height:t.width:(r===null&&(r=t.x.domain()[0]),i===null&&(i=t.x.domain()[1]),Math.max(0,(t.x(i)-t.x(r))/2))},a=function(e){var n=t.getPrevX(e.index),r=t.getNextX(e.index),i=t.data.xs[e.id][e.index];return n===null&&r===null?0:(n===null&&(n=t.x.domain()[0]),(t.x(i)+t.x(n))/2)}):(u=t.getEventRectWidth(),a=function(e){return t.x(e.x)-u/2}),r=n.axis_rotated?0:a,i=n.axis_rotated?a:0,s=n.axis_rotated?t.width:u,o=n.axis_rotated?u:t.height),e.attr("class",t.classEvent.bind(t)).attr("x",r).attr("y",i).attr("width",s).attr("height",o)},r.generateEventRectsForSingleX=function(e){var t=this,n=t.d3,r=t.config;e.append("rect").attr("class",t.classEvent.bind(t)).style("cursor",r.data_selection_enabled&&r.data_selection_grouped?"pointer":null).on("mouseover",function(e){var n=e.index;if(t.dragging||t.flowing)return;if(t.hasArcType())return;r.point_focus_expand_enabled&&t.expandCircles(n,null,!0),t.expandBars(n,null,!0),t.main.selectAll("."+l.shape+"-"+n).each(function(e){r.data_onmouseover.call(t.api,e)})}).on("mouseout",function(e){var n=e.index;if(!t.config)return;if(t.hasArcType())return;t.hideXGridFocus(),t.hideTooltip(),t.unexpandCircles(),t.unexpandBars(),t.main.selectAll("."+l.shape+"-"+n).each(function(e){r.data_onmouseout.call(t.api,e)})}).on("mousemove",function(e){var i,s=e.index,o=t.svg.select("."+l.eventRect+"-"+s);if(t.dragging||t.flowing)return;if(t.hasArcType())return;t.isStepType(e)&&t.config.line_step_type==="step-after"&&n.mouse(this)[0]<t.x(t.getXValue(e.id,s))&&(s-=1),i=t.filterTargetsToShow(t.data.targets).map(function(e){return t.addName(t.getValueOnIndex(e.values,s))}),r.tooltip_grouped&&(t.showTooltip(i,this),t.showXGridFocus(i));if(r.tooltip_grouped&&(!r.data_selection_enabled||r.data_selection_grouped))return;t.main.selectAll("."+l.shape+"-"+s).each(function(){n.select(this).classed(l.EXPANDED,!0),r.data_selection_enabled&&o.style("cursor",r.data_selection_grouped?"pointer":null),r.tooltip_grouped||(t.hideXGridFocus(),t.hideTooltip(),r.data_selection_grouped||(t.unexpandCircles(s),t.unexpandBars(s)))}).filter(function(e){return t.isWithinShape(this,e)}).each(function(e){r.data_selection_enabled&&(r.data_selection_grouped||r.data_selection_isselectable(e))&&o.style("cursor","pointer"),r.tooltip_grouped||(t.showTooltip([e],this),t.showXGridFocus([e]),r.point_focus_expand_enabled&&t.expandCircles(s,e.id,!0),t.expandBars(s,e.id,!0))})}).on("click",function(e){var i=e.index;if(t.hasArcType()||!t.toggleShape)return;if(t.cancelClick){t.cancelClick=!1;return}t.isStepType(e)&&r.line_step_type==="step-after"&&n.mouse(this)[0]<t.x(t.getXValue(e.id,i))&&(i-=1),t.main.selectAll("."+l.shape+"-"+i).each(function(e){if(r.data_selection_grouped||t.isWithinShape(this,e))t.toggleShape(this,e,i),t.config.data_onclick.call(t.api,e,this)})}).call(r.data_selection_draggable&&t.drag?n.behavior.drag().origin(Object).on("drag",function(){t.drag(n.mouse(this))}).on("dragstart",function(){t.dragstart(n.mouse(this))}).on("dragend",function(){t.dragend()}):function(){})},r.generateEventRectsForMultipleXs=function(e){function i(){t.svg.select("."+l.eventRect).style("cursor",null),t.hideXGridFocus(),t.hideTooltip(),t.unexpandCircles(),t.unexpandBars()}var t=this,n=t.d3,r=t.config;e.append("rect").attr("x",0).attr("y",0).attr("width",t.width).attr("height",t.height).attr("class",l.eventRect).on("mouseout",function(){if(!t.config)return;if(t.hasArcType())return;i()}).on("mousemove",function(){var e=t.filterTargetsToShow(t.data.targets),s,o,u,a;if(t.dragging)return;if(t.hasArcType(e))return;s=n.mouse(this),o=t.findClosestFromTargets(e,s),t.mouseover&&(!o||o.id!==t.mouseover.id)&&(r.data_onmouseout.call(t.api,t.mouseover),t.mouseover=undefined);if(!o){i();return}t.isScatterType(o)||!r.tooltip_grouped?u=[o]:u=t.filterByX(e,o.x),a=u.map(function(e){return t.addName(e)}),t.showTooltip(a,this),r.point_focus_expand_enabled&&t.expandCircles(o.index,o.id,!0),t.expandBars(o.index,o.id,!0),t.showXGridFocus(a);if(t.isBarType(o.id)||t.dist(o,s)<r.point_sensitivity)t.svg.select("."+l.eventRect).style("cursor","pointer"),t.mouseover||(r.data_onmouseover.call(t.api,o),t.mouseover=o)}).on("click",function(){var e=t.filterTargetsToShow(t.data.targets),i,s;if(t.hasArcType(e))return;i=n.mouse(this),s=t.findClosestFromTargets(e,i);if(!s)return;(t.isBarType(s.id)||t.dist(s,i)<r.point_sensitivity)&&t.main.selectAll("."+l.shapes+t.getTargetSelectorSuffix(s.id)).selectAll("."+l.shape+"-"+s.index).each(function(){if(r.data_selection_grouped||t.isWithinShape(this,s))t.toggleShape(this,s,s.index),t.config.data_onclick.call(t.api,s,this)})}).call(r.data_selection_draggable&&t.drag?n.behavior.drag().origin(Object).on("drag",function(){t.drag(n.mouse(this))}).on("dragstart",function(){t.dragstart(n.mouse(this))}).on("dragend",function(){t.dragend()}):function(){})},r.dispatchEvent=function(t,n,r){var i=this,s="."+l.eventRect+(i.isMultipleX()?"":"-"+n),o=i.main.select(s).node(),u=o.getBoundingClientRect(),a=u.left+(r?r[0]:0),f=u.top+(r?r[1]:0),c=document.createEvent("MouseEvents");c.initMouseEvent(t,!0,!0,e,0,a,f,a,f,!1,!1,!1,!1,0,null),o.dispatchEvent(c)},r.getCurrentWidth=function(){var e=this,t=e.config;return t.size_width?t.size_width:e.getParentWidth()},r.getCurrentHeight=function(){var e=this,t=e.config,n=t.size_height?t.size_height:e.getParentHeight();return n>0?n:320/(e.hasType("gauge")&&!t.gauge_fullCircle?2:1)},r.getCurrentPaddingTop=function(){var e=this,t=e.config,n=c(t.padding_top)?t.padding_top:0;return e.title&&e.title.node()&&(n+=e.getTitlePadding()),n},r.getCurrentPaddingBottom=function(){var e=this.config;return c(e.padding_bottom)?e.padding_bottom:0},r.getCurrentPaddingLeft=function(e){var t=this,n=t.config;return c(n.padding_left)?n.padding_left:n.axis_rotated?n.axis_x_show?Math.max(m(t.getAxisWidthByAxisId("x",e)),40):1:!n.axis_y_show||n.axis_y_inner?t.axis.getYAxisLabelPosition().isOuter?30:1:m(t.getAxisWidthByAxisId("y",e))},r.getCurrentPaddingRight=function(){var e=this,t=e.config,n=10,r=e.isLegendRight?e.getLegendWidth()+20:0;return c(t.padding_right)?t.padding_right+1:t.axis_rotated?n+r:!t.axis_y2_show||t.axis_y2_inner?2+r+(e.axis.getY2AxisLabelPosition().isOuter?20:0):m(e.getAxisWidthByAxisId("y2"))+r},r.getParentRectValue=function(e){var t=this.selectChart.node(),n;while(t&&t.tagName!=="BODY"){try{n=t.getBoundingClientRect()[e]}catch(r){e==="width"&&(n=t.offsetWidth)}if(n)break;t=t.parentNode}return n},r.getParentWidth=function(){return this.getParentRectValue("width")},r.getParentHeight=function(){var e=this.selectChart.style("height");return e.indexOf("px")>0?+e.replace("px",""):0},r.getSvgLeft=function(e){var t=this,n=t.config,r=n.axis_rotated||!n.axis_rotated&&!n.axis_y_inner,i=n.axis_rotated?l.axisX:l.axisY,s=t.main.select("."+i).node(),o=s&&r?s.getBoundingClientRect():{right:0},u=t.selectChart.node().getBoundingClientRect(),a=t.hasArcType(),f=o.right-u.left-(a?0:t.getCurrentPaddingLeft(e));return f>0?f:0},r.getAxisWidthByAxisId=function(e,t){var n=this,r=n.axis.getLabelPositionById(e);return n.axis.getMaxTickWidth(e,t)+(r.isInner?20:40)},r.getHorizontalAxisHeight=function(e){var t=this,n=t.config,r=30;return e==="x"&&!n.axis_x_show?8:e==="x"&&n.axis_x_height?n.axis_x_height:e==="y"&&!n.axis_y_show?n.legend_show&&!t.isLegendRight&&!t.isLegendInset?10:1:e==="y2"&&!n.axis_y2_show?t.rotated_padding_top:(e==="x"&&!n.axis_rotated&&n.axis_x_tick_rotate&&(r=30+t.axis.getMaxTickWidth(e)*Math.cos(Math.PI*(90-n.axis_x_tick_rotate)/180)),e==="y"&&n.axis_rotated&&n.axis_y_tick_rotate&&(r=30+t.axis.getMaxTickWidth(e)*Math.cos(Math.PI*(90-n.axis_y_tick_rotate)/180)),r+(t.axis.getLabelPositionById(e).isInner?0:10)+(e==="y2"?-10:0))},r.getEventRectWidth=function(){return Math.max(0,this.xAxis.tickInterval())},r.getShapeIndices=function(e){var t=this,n=t.config,r={},i=0,s,o;return t.filterTargetsToShow(t.data.targets.filter(e,t)).forEach(function(e){for(s=0;s<n.data_groups.length;s++){if(n.data_groups[s].indexOf(e.id)<0)continue;for(o=0;o<n.data_groups[s].length;o++)if(n.data_groups[s][o]in r){r[e.id]=r[n.data_groups[s][o]];break}}d(r[e.id])&&(r[e.id]=i++)}),r.__max__=i-1,r},r.getShapeX=function(e,t,n,r){var i=this,s=r?i.subX:i.x;return function(r){var i=r.id in n?n[r.id]:0;return r.x||r.x===0?s(r.x)-e*(t/2-i):0}},r.getShapeY=function(e){var t=this;return function(n){var r=e?t.getSubYScale(n.id):t.getYScale(n.id);return r(n.value)}},r.getShapeOffset=function(e,t,n){var r=this,i=r.orderTargets(r.filterTargetsToShow(r.data.targets.filter(e,r))),s=i.map(function(e){return e.id});return function(e,o){var u=n?r.getSubYScale(e.id):r.getYScale(e.id),a=u(0),f=a;return i.forEach(function(n){var i=r.isStepType(e)?r.convertValuesToStep(n.values):n.values;if(n.id===e.id||t[n.id]!==t[e.id])return;if(s.indexOf(n.id)<s.indexOf(e.id)){if(typeof i[o]=="undefined"||+i[o].x!==+e.x)o=-1,i.forEach(function(t,n){t.x===e.x&&(o=n)});o in i&&i[o].value*e.value>=0&&(f+=u(i[o].value)-a)}}),f}},r.isWithinShape=function(e,t){var n=this,r=n.d3.select(e),i;return n.isTargetToShow(t.id)?e.nodeName==="circle"?i=n.isStepType(t)?n.isWithinStep(e,n.getYScale(t.id)(t.value)):n.isWithinCircle(e,n.pointSelectR(t)*1.5):e.nodeName==="path"&&(i=r.classed(l.bar)?n.isWithinBar(e):!0):i=!1,i},r.getInterpolate=function(e){var t=this,n=t.isInterpolationType(t.config.spline_interpolation_type)?t.config.spline_interpolation_type:"cardinal";return t.isSplineType(e)?n:t.isStepType(e)?t.config.line_step_type:"linear"},r.initLine=function(){var e=this;e.main.select("."+l.chart).append("g").attr("class",l.chartLines)},r.updateTargetsForLine=function(e){var t=this,n=t.config,r,i,s=t.classChartLine.bind(t),o=t.classLines.bind(t),u=t.classAreas.bind(t),a=t.classCircles.bind(t),f=t.classFocus.bind(t);r=t.main.select("."+l.chartLines).selectAll("."+l.chartLine).data(e).attr("class",function(e){return s(e)+f(e)}),i=r.enter().append("g").attr("class",s).style("opacity",0).style("pointer-events","none"),i.append("g").attr("class",o),i.append("g").attr("class",u),i.append("g").attr("class",function(e){return t.generateClass(l.selectedCircles,e.id)}),i.append("g").attr("class",a).style("cursor",function(e){return n.data_selection_isselectable(e)?"pointer":null}),e.forEach(function(e){t.main.selectAll("."+l.selectedCircles+t.getTargetSelectorSuffix(e.id)).selectAll("."+l.selectedCircle).each(function(t){t.value=e.values[t.index].value})})},r.updateLine=function(e){var t=this;t.mainLine=t.main.selectAll("."+l.lines).selectAll("."+l.line).data(t.lineData.bind(t)),t.mainLine.enter().append("path").attr("class",t.classLine.bind(t)).style("stroke",t.color),t.mainLine.style("opacity",t.initialOpacity.bind(t)).style("shape-rendering",function(e){return t.isStepType(e)?"crispEdges":""}).attr("transform",null),t.mainLine.exit().transition().duration(e).style("opacity",0).remove()},r.redrawLine=function(e,t){return[(t?this.mainLine.transition(Math.random().toString()):this.mainLine).attr("d",e).style("stroke",this.color).style("opacity",1)]},r.generateDrawLine=function(e,t){var n=this,r=n.config,i=n.d3.svg.line(),s=n.generateGetLinePoints(e,t),o=t?n.getSubYScale:n.getYScale,u=function(e){return(t?n.subxx:n.xx).call(n,e)},a=function(e,t){return r.data_groups.length>0?s(e,t)[0][1]:o.call(n,e.id)(e.value)};return i=r.axis_rotated?i.x(a).y(u):i.x(u).y(a),r.line_connectNull||(i=i.defined(function(e){return e.value!=null})),function(e){var s=r.line_connectNull?n.filterRemoveNull(e.values):e.values,u=t?n.x:n.subX,a=o.call(n,e.id),f=0,l=0,c;return n.isLineType(e)?r.data_regions[e.id]?c=n.lineWithRegions(s,u,a,r.data_regions[e.id]):(n.isStepType(e)&&(s=n.convertValuesToStep(s)),c=i.interpolate(n.getInterpolate(e))(s)):(s[0]&&(f=u(s[0].x),l=a(s[0].value)),c=r.axis_rotated?"M "+l+" "+f:"M "+f+" "+l),c?c:"M 0 0"}},r.generateGetLinePoints=function(e,t){var n=this,r=n.config,i=e.__max__+1,s=n.getShapeX(0,i,e,!!t),o=n.getShapeY(!!t),u=n.getShapeOffset(n.isLineType,e,!!t),a=t?n.getSubYScale:n.getYScale;return function(e,t){var i=a.call(n,e.id)(0),f=u(e,t)||i,l=s(e),c=o(e);return r.axis_rotated&&(0<e.value&&c<i||e.value<0&&i<c)&&(c=i),[[l,c-(i-f)],[l,c-(i-f)],[l,c-(i-f)],[l,c-(i-f)]]}},r.lineWithRegions=function(e,t,n,r){function T(e,t){var n;for(n=0;n<t.length;n++)if(t[n].start<e&&e<=t[n].end)return!0;return!1}function N(e){return"M"+e[0][0]+" "+e[0][1]+" "+e[1][0]+" "+e[1][1]}var i=this,s=i.config,o=-1,u,a,f="M",l,c,h,p,m,g,y,b,w=i.isCategorized()?.5:0,E,S,x=[];if(v(r))for(u=0;u<r.length;u++)x[u]={},d(r[u].start)?x[u].start=e[0].x:x[u].start=i.isTimeSeries()?i.parseDate(r[u].start):r[u].start,d(r[u].end)?x[u].end=e[e.length-1].x:x[u].end=i.isTimeSeries()?i.parseDate(r[u].end):r[u].end;E=s.axis_rotated?function(e){return n(e.value)}:function(e){return t(e.x)},S=s.axis_rotated?function(e){return t(e.x)}:function(e){return n(e.value)},i.isTimeSeries()?l=function(e,r,i,o){var u=e.x.getTime(),a=r.x-e.x,f=new Date(u+a*i),l=new Date(u+a*(i+o)),c;return s.axis_rotated?c=[[n(h(i)),t(f)],[n(h(i+o)),t(l)]]:c=[[t(f),n(h(i))],[t(l),n(h(i+o))]],N(c)}:l=function(e,r,i,o){var u;return s.axis_rotated?u=[[n(h(i),!0),t(c(i))],[n(h(i+o),!0),t(c(i+o))]]:u=[[t(c(i),!0),n(h(i))],[t(c(i+o),!0),n(h(i+o))]],N(u)};for(u=0;u<e.length;u++){if(d(x)||!T(e[u].x,x))f+=" "+E(e[u])+" "+S(e[u]);else{c=i.getScale(e[u-1].x+w,e[u].x+w,i.isTimeSeries()),h=i.getScale(e[u-1].value,e[u].value),p=t(e[u].x)-t(e[u-1].x),m=n(e[u].value)-n(e[u-1].value),g=Math.sqrt(Math.pow(p,2)+Math.pow(m,2)),y=2/g,b=y*2;for(a=y;a<=1;a+=b)f+=l(e[u-1],e[u],a,y)}o=e[u].x}return f},r.updateArea=function(e){var t=this,n=t.d3;t.mainArea=t.main.selectAll("."+l.areas).selectAll("."+l.area).data(t.lineData.bind(t)),t.mainArea.enter().append("path").attr("class",t.classArea.bind(t)).style("fill",t.color).style("opacity",function(){return t.orgAreaOpacity=+n.select(this).style("opacity"),0}),t.mainArea.style("opacity",t.orgAreaOpacity),t.mainArea.exit().transition().duration(e).style("opacity",0).remove()},r.redrawArea=function(e,t){return[(t?this.mainArea.transition(Math.random().toString()):this.mainArea).attr("d",e).style("fill",this.color).style("opacity",this.orgAreaOpacity)]},r.generateDrawArea=function(e,t){var n=this,r=n.config,i=n.d3.svg.area(),s=n.generateGetAreaPoints(e,t),o=t?n.getSubYScale:n.getYScale,u=function(e){return(t?n.subxx:n.xx).call(n,e)},a=function(e,t){return r.data_groups.length>0?s(e,t)[0][1]:o.call(n,e.id)(n.getAreaBaseValue(e.id))},f=function(e,t){return r.data_groups.length>0?s(e,t)[1][1]:o.call(n,e.id)(e.value)};return i=r.axis_rotated?i.x0(a).x1(f).y(u):i.x(u).y0(r.area_above?0:a).y1(f),r.line_connectNull||(i=i.defined(function(e){return e.value!==null})),function(e){var t=r.line_connectNull?n.filterRemoveNull(e.values):e.values,s=0,o=0,u;return n.isAreaType(e)?(n.isStepType(e)&&(t=n.convertValuesToStep(t)),u=i.interpolate(n.getInterpolate(e))(t)):(t[0]&&(s=n.x(t[0].x),o=n.getYScale(e.id)(t[0].value)),u=r.axis_rotated?"M "+o+" "+s:"M "+s+" "+o),u?u:"M 0 0"}},r.getAreaBaseValue=function(){return 0},r.generateGetAreaPoints=function(e,t){var n=this,r=n.config,i=e.__max__+1,s=n.getShapeX(0,i,e,!!t),o=n.getShapeY(!!t),u=n.getShapeOffset(n.isAreaType,e,!!t),a=t?n.getSubYScale:n.getYScale;return function(e,t){var i=a.call(n,e.id)(0),f=u(e,t)||i,l=s(e),c=o(e);return r.axis_rotated&&(0<e.value&&c<i||e.value<0&&i<c)&&(c=i),[[l,f],[l,c-(i-f)],[l,c-(i-f)],[l,f]]}},r.updateCircle=function(){var e=this;e.mainCircle=e.main.selectAll("."+l.circles).selectAll("."+l.circle).data(e.lineOrScatterData.bind(e)),e.mainCircle.enter().append("circle").attr("class",e.classCircle.bind(e)).attr("r",e.pointR.bind(e)).style("fill",e.color),e.mainCircle.style("opacity",e.initialOpacityForCircle.bind(e)),e.mainCircle.exit().remove()},r.redrawCircle=function(e,t,n){var r=this.main.selectAll("."+l.selectedCircle);return[(n?this.mainCircle.transition(Math.random().toString()):this.mainCircle).style("opacity",this.opacityForCircle.bind(this)).style("fill",this.color).attr("cx",e).attr("cy",t),(n?r.transition(Math.random().toString()):r).attr("cx",e).attr("cy",t)]},r.circleX=function(e){return e.x||e.x===0?this.x(e.x):null},r.updateCircleY=function(){var e=this,t,n;e.config.data_groups.length>0?(t=e.getShapeIndices(e.isLineType),n=e.generateGetLinePoints(t),e.circleY=function(e,t){return n(e,t)[0][1]}):e.circleY=function(t){return e.getYScale(t.id)(t.value)}},r.getCircles=function(e,t){var n=this;return(t?n.main.selectAll("."+l.circles+n.getTargetSelectorSuffix(t)):n.main).selectAll("."+l.circle+(c(e)?"-"+e:""))},r.expandCircles=function(e,t,n){var r=this,i=r.pointExpandedR.bind(r);n&&r.unexpandCircles(),r.getCircles(e,t).classed(l.EXPANDED,!0).attr("r",i)},r.unexpandCircles=function(e){var t=this,n=t.pointR.bind(t);t.getCircles(e).filter(function(){return t.d3.select(this).classed(l.EXPANDED)}).classed(l.EXPANDED,!1).attr("r",n)},r.pointR=function(e){var t=this,n=t.config;return t.isStepType(e)?0:h(n.point_r)?n.point_r(e):n.point_r},r.pointExpandedR=function(e){var t=this,n=t.config;return n.point_focus_expand_enabled?n.point_focus_expand_r?n.point_focus_expand_r:t.pointR(e)*1.75:t.pointR(e)},r.pointSelectR=function(e){var t=this,n=t.config;return h(n.point_select_r)?n.point_select_r(e):n.point_select_r?n.point_select_r:t.pointR(e)*4},r.isWithinCircle=function(e,t){var n=this.d3,r=n.mouse(e),i=n.select(e),s=+i.attr("cx"),o=+i.attr("cy");return Math.sqrt(Math.pow(s-r[0],2)+Math.pow(o-r[1],2))<t},r.isWithinStep=function(e,t){return Math.abs(t-this.d3.mouse(e)[1])<30},r.initBar=function(){var e=this;e.main.select("."+l.chart).append("g").attr("class",l.chartBars)},r.updateTargetsForBar=function(e){var t=this,n=t.config,r,i,s=t.classChartBar.bind(t),o=t.classBars.bind(t),u=t.classFocus.bind(t);r=t.main.select("."+l.chartBars).selectAll("."+l.chartBar).data(e).attr("class",function(e){return s(e)+u(e)}),i=r.enter().append("g").attr("class",s).style("opacity",0).style("pointer-events","none"),i.append("g").attr("class",o).style("cursor",function(e){return n.data_selection_isselectable(e)?"pointer":null})},r.updateBar=function(e){var t=this,n=t.barData.bind(t),r=t.classBar.bind(t),i=t.initialOpacity.bind(t),s=function(e){return t.color(e.id)};t.mainBar=t.main.selectAll("."+l.bars).selectAll("."+l.bar).data(n),t.mainBar.enter().append("path").attr("class",r).style("stroke",s).style("fill",s),t.mainBar.style("opacity",i),t.mainBar.exit().transition().duration(e).style("opacity",0).remove()},r.redrawBar=function(e,t){return[(t?this.mainBar.transition(Math.random().toString()):this.mainBar).attr("d",e).style("fill",this.color).style("opacity",1)]},r.getBarW=function(e,t){var n=this,r=n.config,i=typeof r.bar_width=="number"?r.bar_width:t?e.tickInterval()*r.bar_width_ratio/t:0;return r.bar_width_max&&i>r.bar_width_max?r.bar_width_max:i},r.getBars=function(e,t){var n=this;return(t?n.main.selectAll("."+l.bars+n.getTargetSelectorSuffix(t)):n.main).selectAll("."+l.bar+(c(e)?"-"+e:""))},r.expandBars=function(e,t,n){var r=this;n&&r.unexpandBars(),r.getBars(e,t).classed(l.EXPANDED,!0)},r.unexpandBars=function(e){var t=this;t.getBars(e).classed(l.EXPANDED,!1)},r.generateDrawBar=function(e,t){var n=this,r=n.config,i=n.generateGetBarPoints(e,t);return function(e,t){var n=i(e,t),s=r.axis_rotated?1:0,o=r.axis_rotated?0:1,u="M "+n[0][s]+","+n[0][o]+" "+"L"+n[1][s]+","+n[1][o]+" "+"L"+n[2][s]+","+n[2][o]+" "+"L"+n[3][s]+","+n[3][o]+" "+"z";return u}},r.generateGetBarPoints=function(e,t){var n=this,r=t?n.subXAxis:n.xAxis,i=e.__max__+1,s=n.getBarW(r,i),o=n.getShapeX(s,i,e,!!t),u=n.getShapeY(!!t),a=n.getShapeOffset(n.isBarType,e,!!t),f=t?n.getSubYScale:n.getYScale;return function(e,t){var r=f.call(n,e.id)(0),i=a(e,t)||r,l=o(e),c=u(e);return n.config.axis_rotated&&(0<e.value&&c<r||e.value<0&&r<c)&&(c=r),[[l,i],[l,c-(r-i)],[l+s,c-(r-i)],[l+s,i]]}},r.isWithinBar=function(e){var t=this.d3.mouse(e),n=e.getBoundingClientRect(),r=e.pathSegList.getItem(0),i=e.pathSegList.getItem(1),s=Math.min(r.x,i.x),o=Math.min(r.y,i.y),u=n.width,a=n.height,f=2,l=s-f,c=s+u+f,h=o+a+f,p=o-f;return l<t[0]&&t[0]<c&&p<t[1]&&t[1]<h},r.initText=function(){var e=this;e.main.select("."+l.chart).append("g").attr("class",l.chartTexts),e.mainText=e.d3.selectAll([])},r.updateTargetsForText=function(e){var t=this,n,r,i=t.classChartText.bind(t),s=t.classTexts.bind(t),o=t.classFocus.bind(t);n=t.main.select("."+l.chartTexts).selectAll("."+l.chartText).data(e).attr("class",function(e){return i(e)+o(e)}),r=n.enter().append("g").attr("class",i).style("opacity",0).style("pointer-events","none"),r.append("g").attr("class",s)},r.updateText=function(e){var t=this,n=t.config,r=t.barOrLineData.bind(t),i=t.classText.bind(t);t.mainText=t.main.selectAll("."+l.texts).selectAll("."+l.text).data(r),t.mainText.enter().append("text").attr("class",i).attr("text-anchor",function(e){return n.axis_rotated?e.value<0?"end":"start":"middle"}).style("stroke","none").style("fill",function(e){return t.color(e)}).style("fill-opacity",0),t.mainText.text(function(e,n,r){return t.dataLabelFormat(e.id)(e.value,e.id,n,r)}),t.mainText.exit().transition().duration(e).style("fill-opacity",0).remove()},r.redrawText=function(e,t,n,r){return[(r?this.mainText.transition():this.mainText).attr("x",e).attr("y",t).style("fill",this.color).style("fill-opacity",n?0:this.opacityForText.bind(this))]},r.getTextRect=function(e,t,n){var r=this.d3.select("body").append("div").classed("c3",!0),i=r.append("svg").style("visibility","hidden").style("position","fixed").style("top",0).style("left",0),s=this.d3.select(n).style("font"),o;return i.selectAll(".dummy").data([e]).enter().append("text").classed(t?t:"",!0).style("font",s).text(e).each(function(){o=this.getBoundingClientRect()}),r.remove(),o},r.generateXYForText=function(e,t,n,r){var i=this,s=i.generateGetAreaPoints(e,!1),o=i.generateGetBarPoints(t,!1),u=i.generateGetLinePoints(n,!1),a=r?i.getXForText:i.getYForText;return function(e,t){var n=i.isAreaType(e)?s:i.isBarType(e)?o:u;return a.call(i,n(e,t),e,this)}},r.getXForText=function(e,t,n){var r=this,i=n.getBoundingClientRect(),s,o;return r.config.axis_rotated?(o=r.isBarType(t)?4:6,s=e[2][1]+o*(t.value<0?-1:1)):s=r.hasType("bar")?(e[2][0]+e[0][0])/2:e[0][0],t.value===null&&(s>r.width?s=r.width-i.width:s<0&&(s=4)),s},r.getYForText=function(e,t,n){var r=this,i=n.getBoundingClientRect(),s;return r.config.axis_rotated?s=(e[0][0]+e[2][0]+i.height*.6)/2:(s=e[2][1],t.value<0||t.value===0&&!r.hasPositiveValue?(s+=i.height,r.isBarType(t)&&r.isSafari()?s-=3:!r.isBarType(t)&&r.isChrome()&&(s+=3)):s+=r.isBarType(t)?-3:-6),t.value===null&&!r.config.axis_rotated&&(s<i.height?s=i.height:s>this.height&&(s=this.height-4)),s},r.setTargetType=function(e,t){var n=this,r=n.config;n.mapToTargetIds(e).forEach(function(e){n.withoutFadeIn[e]=t===r.data_types[e],r.data_types[e]=t}),e||(r.data_type=t)},r.hasType=function(e,t){var n=this,r=n.config.data_types,i=!1;return t=t||n.data.targets,t&&t.length?t.forEach(function(t){var n=r[t.id];if(n&&n.indexOf(e)>=0||!n&&e==="line")i=!0}):Object.keys(r).length?Object.keys(r).forEach(function(t){r[t]===e&&(i=!0)}):i=n.config.data_type===e,i},r.hasArcType=function(e){return this.hasType("pie",e)||this.hasType("donut",e)||this.hasType("gauge",e)},r.isLineType=function(e){var t=this.config,n=p(e)?e:e.id;return!t.data_types[n]||["line","spline","area","area-spline","step","area-step"].indexOf(t.data_types[n])>=0},r.isStepType=function(e){var t=p(e)?e:e.id;return["step","area-step"].indexOf(this.config.data_types[t])>=0},r.isSplineType=function(e){var t=p(e)?e:e.id;return["spline","area-spline"].indexOf(this.config.data_types[t])>=0},r.isAreaType=function(e){var t=p(e)?e:e.id;return["area","area-spline","area-step"].indexOf(this.config.data_types[t])>=0},r.isBarType=function(e){var t=p(e)?e:e.id;return this.config.data_types[t]==="bar"},r.isScatterType=function(e){var t=p(e)?e:e.id;return this.config.data_types[t]==="scatter"},r.isPieType=function(e){var t=p(e)?e:e.id;return this.config.data_types[t]==="pie"},r.isGaugeType=function(e){var t=p(e)?e:e.id;return this.config.data_types[t]==="gauge"},r.isDonutType=function(e){var t=p(e)?e:e.id;return this.config.data_types[t]==="donut"},r.isArcType=function(e){return this.isPieType(e)||this.isDonutType(e)||this.isGaugeType(e)},r.lineData=function(e){return this.isLineType(e)?[e]:[]},r.arcData=function(e){return this.isArcType(e.data)?[e]:[]},r.barData=function(e){return this.isBarType(e)?e.values:[]},r.lineOrScatterData=function(e){return this.isLineType(e)||this.isScatterType(e)?e.values:[]},r.barOrLineData=function(e){return this.isBarType(e)||this.isLineType(e)?e.values:[]},r.isInterpolationType=function(e){return["linear","linear-closed","basis","basis-open","basis-closed","bundle","cardinal","cardinal-open","cardinal-closed","monotone"].indexOf(e)>=0},r.initGrid=function(){var e=this,t=e.config,n=e.d3;e.grid=e.main.append("g").attr("clip-path",e.clipPathForGrid).attr("class",l.grid),t.grid_x_show&&e.grid.append("g").attr("class",l.xgrids),t.grid_y_show&&e.grid.append("g").attr("class",l.ygrids),t.grid_focus_show&&e.grid.append("g").attr("class",l.xgridFocus).append("line").attr("class",l.xgridFocus),e.xgrid=n.selectAll([]),t.grid_lines_front||e.initGridLines()},r.initGridLines=function(){var e=this,t=e.d3;e.gridLines=e.main.append("g").attr("clip-path",e.clipPathForGrid).attr("class",l.grid+" "+l.gridLines),e.gridLines.append("g").attr("class",l.xgridLines),e.gridLines.append("g").attr("class",l.ygridLines),e.xgridLines=t.selectAll([])},r.updateXGrid=function(e){var t=this,n=t.config,r=t.d3,i=t.generateGridData(n.grid_x_type,t.x),s=t.isCategorized()?t.xAxis.tickOffset():0;t.xgridAttr=n.axis_rotated?{x1:0,x2:t.width,y1:function(e){return t.x(e)-s},y2:function(e){return t.x(e)-s}}:{x1:function(e){return t.x(e)+s},x2:function(e){return t.x(e)+s},y1:0,y2:t.height},t.xgrid=t.main.select("."+l.xgrids).selectAll("."+l.xgrid).data(i),t.xgrid.enter().append("line").attr("class",l.xgrid),e||t.xgrid.attr(t.xgridAttr).style("opacity",function(){return+r.select(this).attr(n.axis_rotated?"y1":"x1")===(n.axis_rotated?t.height:0)?0:1}),t.xgrid.exit().remove()},r.updateYGrid=function(){var e=this,t=e.config,n=e.yAxis.tickValues()||e.y.ticks(t.grid_y_ticks);e.ygrid=e.main.select("."+l.ygrids).selectAll("."+l.ygrid).data(n),e.ygrid.enter().append("line").attr("class",l.ygrid),e.ygrid.attr("x1",t.axis_rotated?e.y:0).attr("x2",t.axis_rotated?e.y:e.width).attr("y1",t.axis_rotated?0:e.y).attr("y2",t.axis_rotated?e.height:e.y),e.ygrid.exit().remove(),e.smoothLines(e.ygrid,"grid")},r.gridTextAnchor=function(e){return e.position?e.position:"end"},r.gridTextDx=function(e){return e.position==="start"?4:e.position==="middle"?0:-4},r.xGridTextX=function(e){return e.position==="start"?-this.height:e.position==="middle"?-this.height/2:0},r.yGridTextX=function(e){return e.position==="start"?0:e.position==="middle"?this.width/2:this.width},r.updateGrid=function(e){var t=this,n=t.main,r=t.config,i,s,o;t.grid.style("visibility",t.hasArcType()?"hidden":"visible"),n.select("line."+l.xgridFocus).style("visibility","hidden"),r.grid_x_show&&t.updateXGrid(),t.xgridLines=n.select("."+l.xgridLines).selectAll("."+l.xgridLine).data(r.grid_x_lines),i=t.xgridLines.enter().append("g").attr("class",function(e){return l.xgridLine+(e["class"]?" "+e["class"]:"")}),i.append("line").style("opacity",0),i.append("text").attr("text-anchor",t.gridTextAnchor).attr("transform",r.axis_rotated?"":"rotate(-90)").attr("dx",t.gridTextDx).attr("dy",-5).style("opacity",0),t.xgridLines.exit().transition().duration(e).style("opacity",0).remove(),r.grid_y_show&&t.updateYGrid(),t.ygridLines=n.select("."+l.ygridLines).selectAll("."+l.ygridLine).data(r.grid_y_lines),s=t.ygridLines.enter().append("g").attr("class",function(e){return l.ygridLine+(e["class"]?" "+e["class"]:"")}),s.append("line").style("opacity",0),s.append("text").attr("text-anchor",t.gridTextAnchor).attr("transform",r.axis_rotated?"rotate(-90)":"").attr("dx",t.gridTextDx).attr("dy",-5).style("opacity",0),o=t.yv.bind(t),t.ygridLines.select("line").transition().duration(e).attr("x1",r.axis_rotated?o:0).attr("x2",r.axis_rotated?o:t.width).attr("y1",r.axis_rotated?0:o).attr("y2",r.axis_rotated?t.height:o).style("opacity",1),t.ygridLines.select("text").transition().duration(e).attr("x",r.axis_rotated?t.xGridTextX.bind(t):t.yGridTextX.bind(t)).attr("y",o).text(function(e){return e.text}).style("opacity",1),t.ygridLines.exit().transition().duration(e).style("opacity",0).remove()},r.redrawGrid=function(e){var t=this,n=t.config,r=t.xv.bind(t),i=t.xgridLines.select("line"),s=t.xgridLines.select("text");return[(e?i.transition():i).attr("x1",n.axis_rotated?0:r).attr("x2",n.axis_rotated?t.width:r).attr("y1",n.axis_rotated?r:0).attr("y2",n.axis_rotated?r:t.height).style("opacity",1),(e?s.transition():s).attr("x",n.axis_rotated?t.yGridTextX.bind(t):t.xGridTextX.bind(t)).attr("y",r).text(function(e){return e.text}).style("opacity",1)]},r.showXGridFocus=function(e){var t=this,n=t.config,r=e.filter(function(e){return e&&c(e.value)}),i=t.main.selectAll("line."+l.xgridFocus),s=t.xx.bind(t);if(!n.tooltip_show)return;if(t.hasType("scatter")||t.hasArcType())return;i.style("visibility","visible").data([r[0]]).attr(n.axis_rotated?"y1":"x1",s).attr(n.axis_rotated?"y2":"x2",s),t.smoothLines(i,"grid")},r.hideXGridFocus=function(){this.main.select("line."+l.xgridFocus).style("visibility","hidden")},r.updateXgridFocus=function(){var e=this,t=e.config;e.main.select("line."+l.xgridFocus).attr("x1",t.axis_rotated?0:-10).attr("x2",t.axis_rotated?e.width:-10).attr("y1",t.axis_rotated?-10:0).attr("y2",t.axis_rotated?-10:e.height)},r.generateGridData=function(e,t){var n=this,r=[],i,s,o,u,a=n.main.select("."+l.axisX).selectAll(".tick").size();if(e==="year"){i=n.getXDomain(),s=i[0].getFullYear(),o=i[1].getFullYear();for(u=s;u<=o;u++)r.push(new Date(u+"-01-01 00:00:00"))}else r=t.ticks(10),r.length>a&&(r=r.filter(function(e){return(""+e).indexOf(".")<0}));return r},r.getGridFilterToRemove=function(e){return e?function(t){var n=!1;return[].concat(e).forEach(function(e){if("value"in e&&t.value===e.value||"class"in e&&t["class"]===e["class"])n=!0}),n}:function(){return!0}},r.removeGridLines=function(e,t){var n=this,r=n.config,i=n.getGridFilterToRemove(e),s=function(e){return!i(e)},o=t?l.xgridLines:l.ygridLines,u=t?l.xgridLine:l.ygridLine;n.main.select("."+o).selectAll("."+u).filter(i).transition().duration(r.transition_duration).style("opacity",0).remove(),t?r.grid_x_lines=r.grid_x_lines.filter(s):r.grid_y_lines=r.grid_y_lines.filter(s)},r.initTooltip=function(){var e=this,t=e.config,n;e.tooltip=e.selectChart.style("position","relative").append("div").attr("class",l.tooltipContainer).style("position","absolute").style("pointer-events","none").style("display","none");if(t.tooltip_init_show){if(e.isTimeSeries()&&p(t.tooltip_init_x)){t.tooltip_init_x=e.parseDate(t.tooltip_init_x);for(n=0;n<e.data.targets[0].values.length;n++)if(e.data.targets[0].values[n].x-t.tooltip_init_x===0)break;t.tooltip_init_x=n}e.tooltip.html(t.tooltip_contents.call(e,e.data.targets.map(function(n){return e.addName(n.values[t.tooltip_init_x])}),e.axis.getXAxisTickFormat(),e.getYFormat(e.hasArcType()),e.color)),e.tooltip.style("top",t.tooltip_init_position.top).style("left",t.tooltip_init_position.left).style("display","block")}},r.getTooltipContent=function(e,t,n,r){var i=this,s=i.config,o=s.tooltip_format_title||t,u=s.tooltip_format_name||function(e){return e},a=s.tooltip_format_value||n,f,l,c,h,p,d,v=i.isOrderAsc();if(s.data_groups.length===0)e.sort(function(e,t){var n=e?e.value:null,r=t?t.value:null;return v?n-r:r-n});else{var m=i.orderTargets(i.data.targets).map(function(e){return e.id});e.sort(function(e,t){var n=e?e.value:null,r=t?t.value:null;return n>0&&r>0&&(n=e?m.indexOf(e.id):null,r=t?m.indexOf(t.id):null),v?n-r:r-n})}for(l=0;l<e.length;l++){if(!e[l]||!e[l].value&&e[l].value!==0)continue;f||(c=x(o?o(e[l].x):e[l].x),f="<table class='"+i.CLASS.tooltip+"'>"+(c||c===0?"<tr><th colspan='2'>"+c+"</th></tr>":"")),h=x(a(e[l].value,e[l].ratio,e[l].id,e[l].index,e));if(h!==undefined){if(e[l].name===null)continue;p=x(u(e[l].name,e[l].ratio,e[l].id,e[l].index)),d=i.levelColor?i.levelColor(e[l].value):r(e[l].id),f+="<tr class='"+i.CLASS.tooltipName+"-"+i.getTargetSelectorSuffix(e[l].id)+"'>",f+="<td class='name'><span style='background-color:"+d+"'></span>"+p+"</td>",f+="<td class='value'>"+h+"</td>",f+="</tr>"}}return f+"</table>"},r.tooltipPosition=function(e,t,n,r){var i=this,s=i.config,o=i.d3,u,a,f,l,c,h=i.hasArcType(),p=o.mouse(r);return h?(a=(i.width-(i.isLegendRight?i.getLegendWidth():0))/2+p[0],l=i.height/2+p[1]+20):(u=i.getSvgLeft(!0),s.axis_rotated?(a=u+p[0]+100,f=a+t,c=i.currentWidth-i.getCurrentPaddingRight(),l=i.x(e[0].x)+20):(a=u+i.getCurrentPaddingLeft(!0)+i.x(e[0].x)+20,f=a+t,c=u+i.currentWidth-i.getCurrentPaddingRight(),l=p[1]+15),f>c&&(a-=f-c+20),l+n>i.currentHeight&&(l-=n+30)),l<0&&(l=0),{top:l,left:a}},r.showTooltip=function(e,t){var n=this,i=n.config,s,o,u,a=n.hasArcType(),f=e.filter(function(e){return e&&c(e.value)}),l=i.tooltip_position||r.tooltipPosition;if(f.length===0||!i.tooltip_show)return;n.tooltip.html(i.tooltip_contents.call(n,e,n.axis.getXAxisTickFormat(),n.getYFormat(a),n.color)).style("display","block"),s=n.tooltip.property("offsetWidth"),o=n.tooltip.property("offsetHeight"),u=l.call(this,f,s,o,t),n.tooltip.style("top",u.top+"px").style("left",u.left+"px")},r.hideTooltip=function(){this.tooltip.style("display","none")},r.initLegend=function(){var e=this;e.legendItemTextBox={},e.legendHasRendered=!1,e.legend=e.svg.append("g").attr("transform",e.getTranslate("legend"));if(!e.config.legend_show){e.legend.style("visibility","hidden"),e.hiddenLegendIds=e.mapToIds(e.data.targets);return}e.updateLegendWithDefaults()},r.updateLegendWithDefaults=function(){var e=this;e.updateLegend(e.mapToIds(e.data.targets),{withTransform:!1,withTransitionForTransform:!1,withTransition:!1})},r.updateSizeForLegend=function(e,t){var n=this,r=n.config,i={top:n.isLegendTop?n.getCurrentPaddingTop()+r.legend_inset_y+5.5:n.currentHeight-e-n.getCurrentPaddingBottom()-r.legend_inset_y,left:n.isLegendLeft?n.getCurrentPaddingLeft()+r.legend_inset_x+.5:n.currentWidth-t-n.getCurrentPaddingRight()-r.legend_inset_x+.5};n.margin3={top:n.isLegendRight?0:n.isLegendInset?i.top:n.currentHeight-e,right:NaN,bottom:0,left:n.isLegendRight?n.currentWidth-t:n.isLegendInset?i.left:0}},r.transformLegend=function(e){var t=this;(e?t.legend.transition():t.legend).attr("transform",t.getTranslate("legend"))},r.updateLegendStep=function(e){this.legendStep=e},r.updateLegendItemWidth=function(e){this.legendItemWidth=e},r.updateLegendItemHeight=function(e){this.legendItemHeight=e},r.getLegendWidth=function(){var e=this;return e.config.legend_show?e.isLegendRight||e.isLegendInset?e.legendItemWidth*(e.legendStep+1):e.currentWidth:0},r.getLegendHeight=function(){var e=this,t=0;return e.config.legend_show&&(e.isLegendRight?t=e.currentHeight:t=Math.max(20,e.legendItemHeight)*(e.legendStep+1)),t},r.opacityForLegend=function(e){return e.classed(l.legendItemHidden)?null:1},r.opacityForUnfocusedLegend=function(e){return e.classed(l.legendItemHidden)?null:.3},r.toggleFocusLegend=function(e,t){var n=this;e=n.mapToTargetIds(e),n.legend.selectAll("."+l.legendItem).filter(function(t){return e.indexOf(t)>=0}).classed(l.legendItemFocused,t).transition().duration(100).style("opacity",function(){var e=t?n.opacityForLegend:n.opacityForUnfocusedLegend;return e.call(n,n.d3.select(this))})},r.revertLegend=function(){var e=this,t=e.d3;e.legend.selectAll("."+l.legendItem).classed(l.legendItemFocused,!1).transition().duration(100).style("opacity",function(){return e.opacityForLegend(t.select(this))})},r.showLegend=function(e){var t=this,n=t.config;n.legend_show||(n.legend_show=!0,t.legend.style("visibility","visible"),t.legendHasRendered||t.updateLegendWithDefaults()),t.removeHiddenLegendIds(e),t.legend.selectAll(t.selectorLegends(e)).style("visibility","visible").transition().style("opacity",function(){return t.opacityForLegend(t.d3.select(this))})},r.hideLegend=function(e){var t=this,n=t.config;n.legend_show&&b(e)&&(n.legend_show=!1,t.legend.style("visibility","hidden")),t.addHiddenLegendIds(e),t.legend.selectAll(t.selectorLegends(e)).style("opacity",0).style("visibility","hidden")},r.clearLegendItemTextBoxCache=function(){this.legendItemTextBox={}},r.updateLegend=function(e,t,n){function j(e,t){return r.legendItemTextBox[t]||(r.legendItemTextBox[t]=r.getTextRect(e.textContent,l.legendItem,e)),r.legendItemTextBox[t]}function F(t,n,s){function v(e,t){t||(p=(h-T-c)/2,p<w&&(p=(h-c)/2,T=0,O++)),A[e]=O,L[O]=r.isLegendInset?10:p,N[e]=T,T+=c}var o=s===0,u=s===e.length-1,a=j(t,n),f=a.width+S+(u&&!r.isLegendRight&&!r.isLegendInset?0:g)+i.legend_padding,l=a.height+m,c=r.isLegendRight||r.isLegendInset?l:f,h=r.isLegendRight||r.isLegendInset?r.getLegendHeight():r.getLegendWidth(),p,d;o&&(T=0,O=0,y=0,b=0);if(i.legend_show&&!r.isLegendToShow(n)){C[n]=k[n]=A[n]=N[n]=0;return}C[n]=f,k[n]=l;if(!y||f>=y)y=f;if(!b||l>=b)b=l;d=r.isLegendRight||r.isLegendInset?b:y,i.legend_equally?(Object.keys(C).forEach(function(e){C[e]=y}),Object.keys(k).forEach(function(e){k[e]=b}),p=(h-d*e.length)/2,p<w?(T=0,O=0,e.forEach(function(e){v(e)})):v(n,!0)):v(n)}var r=this,i=r.config,s,o,u,a,f,c,h,p,d,m=4,g=10,y=0,b=0,w=10,S=i.legend_item_tile_width+5,x,T=0,N={},C={},k={},L=[0],A={},O=0,M,_,D,P,H,B;e=e.filter(function(e){return!v(i.data_names[e])||i.data_names[e]!==null}),t=t||{},M=E(t,"withTransition",!0),_=E(t,"withTransitionForTransform",!0),r.isLegendInset&&(O=i.legend_inset_step?i.legend_inset_step:e.length,r.updateLegendStep(O)),r.isLegendRight?(s=function(e){return y*A[e]},a=function(e){return L[A[e]]+N[e]}):r.isLegendInset?(s=function(e){return y*A[e]+10},a=function(e){return L[A[e]]+N[e]}):(s=function(e){return L[A[e]]+N[e]},a=function(e){return b*A[e]}),o=function(e,t){return s(e,t)+4+i.legend_item_tile_width},f=function(e,t){return a(e,t)+9},u=function(e,t){return s(e,t)},c=function(e,t){return a(e,t)-5},h=function(e,t){return s(e,t)-2},p=function(e,t){return s(e,t)-2+i.legend_item_tile_width},d=function(e,t){return a(e,t)+4},x=r.legend.selectAll("."+l.legendItem).data(e).enter().append("g").attr("class",function(e){return r.generateClass(l.legendItem,e)}).style("visibility",function(e){return r.isLegendToShow(e)?"visible":"hidden"}).style("cursor","pointer").on("click",function(e){i.legend_item_onclick?i.legend_item_onclick.call(r,e):r.d3.event.altKey?(r.api.hide(),r.api.show(e)):(r.api.toggle(e),r.isTargetToShow(e)?r.api.focus(e):r.api.revert())}).on("mouseover",function(e){i.legend_item_onmouseover?i.legend_item_onmouseover.call(r,e):(r.d3.select(this).classed(l.legendItemFocused,!0),!r.transiting&&r.isTargetToShow(e)&&r.api.focus(e))}).on("mouseout",function(e){i.legend_item_onmouseout?i.legend_item_onmouseout.call(r,e):(r.d3.select(this).classed(l.legendItemFocused,!1),r.api.revert())}),x.append("text").text(function(e){return v(i.data_names[e])?i.data_names[e]:e}).each(function(e,t){F(this,e,t)}).style("pointer-events","none").attr("x",r.isLegendRight||r.isLegendInset?o:-200).attr("y",r.isLegendRight||r.isLegendInset?-200:f),x.append("rect").attr("class",l.legendItemEvent).style("fill-opacity",0).attr("x",r.isLegendRight||r.isLegendInset?u:-200).attr("y",r.isLegendRight||r.isLegendInset?-200:c),x.append("line").attr("class",l.legendItemTile).style("stroke",r.color).style("pointer-events","none").attr("x1",r.isLegendRight||r.isLegendInset?h:-200).attr("y1",r.isLegendRight||r.isLegendInset?-200:d).attr("x2",r.isLegendRight||r.isLegendInset?p:-200).attr("y2",r.isLegendRight||r.isLegendInset?-200:d).attr("stroke-width",i.legend_item_tile_height),B=r.legend.select("."+l.legendBackground+" rect"),r.isLegendInset&&y>0&&B.size()===0&&(B=r.legend.insert("g","."+l.legendItem).attr("class",l.legendBackground).append("rect")),D=r.legend.selectAll("text").data(e).text(function(e){return v(i.data_names[e])?i.data_names[e]:e}).each(function(e,t){F(this,e,t)}),(M?D.transition():D).attr("x",o).attr("y",f),P=r.legend.selectAll("rect."+l.legendItemEvent).data(e),(M?P.transition():P).attr("width",function(e){return C[e]}).attr("height",function(e){return k[e]}).attr("x",u).attr("y",c),H=r.legend.selectAll("line."+l.legendItemTile).data(e),(M?H.transition():H).style("stroke",r.color).attr("x1",h).attr("y1",d).attr("x2",p).attr("y2",d),B&&(M?B.transition():B).attr("height",r.getLegendHeight()-12).attr("width",y*(O+1)+10),r.legend.selectAll("."+l.legendItem).classed(l.legendItemHidden,function(e){return!r.isTargetToShow(e)}),r.updateLegendItemWidth(y),r.updateLegendItemHeight(b),r.updateLegendStep(O),r.updateSizes(),r.updateScales(),r.updateSvgSize(),r.transformAll(_,n),r.legendHasRendered=!0},r.initTitle=function(){var e=this;e.title=e.svg.append("text").text(e.config.title_text).attr("class",e.CLASS.title)},r.redrawTitle=function(){var e=this;e.title.attr("x",e.xForTitle.bind(e)).attr("y",e.yForTitle.bind(e))},r.xForTitle=function(){var e=this,t=e.config,n=t.title_position||"left",r;return n.indexOf("right")>=0?r=e.currentWidth-e.getTextRect(e.title.node().textContent,e.CLASS.title,e.title.node()).width-t.title_padding.right:n.indexOf("center")>=0?r=(e.currentWidth-e.getTextRect(e.title.node().textContent,e.CLASS.title,e.title.node()).width)/2:r=t.title_padding.left,r},r.yForTitle=function(){var e=this;return e.config.title_padding.top+e.getTextRect(e.title.node().textContent,e.CLASS.title,e.title.node()).height},r.getTitlePadding=function(){var e=this;return e.yForTitle()+e.config.title_padding.bottom},o(s,f),f.prototype.init=function(){var t=this.owner,n=t.config,r=t.main;t.axes.x=r.append("g").attr("class",l.axis+" "+l.axisX).attr("clip-path",t.clipPathForXAxis).attr("transform",t.getTranslate("x")).style("visibility",n.axis_x_show?"visible":"hidden"),t.axes.x.append("text").attr("class",l.axisXLabel).attr("transform",n.axis_rotated?"rotate(-90)":"").style("text-anchor",this.textAnchorForXAxisLabel.bind(this)),t.axes.y=r.append("g").attr("class",l.axis+" "+l.axisY).attr("clip-path",n.axis_y_inner?"":t.clipPathForYAxis).attr("transform",t.getTranslate("y")).style("visibility",n.axis_y_show?"visible":"hidden"),t.axes.y.append("text").attr("class",l.axisYLabel).attr("transform",n.axis_rotated?"":"rotate(-90)").style("text-anchor",this.textAnchorForYAxisLabel.bind(this)),t.axes.y2=r.append("g").attr("class",l.axis+" "+l.axisY2).attr("transform",t.getTranslate("y2")).style("visibility",n.axis_y2_show?"visible":"hidden"),t.axes.y2.append("text").attr("class",l.axisY2Label).attr("transform",n.axis_rotated?"":"rotate(-90)").style("text-anchor",this.textAnchorForY2AxisLabel.bind(this))},f.prototype.getXAxis=function(t,n,r,i,s,o,u){var a=this.owner,f=a.config,l={isCategory:a.isCategorized(),withOuterTick:s,tickMultiline:f.axis_x_tick_multiline,tickWidth:f.axis_x_tick_width,tickTextRotate:u?0:f.axis_x_tick_rotate,withoutTransition:o},c=C(a.d3,l).scale(t).orient(n);return a.isTimeSeries()&&i&&typeof i!="function"&&(i=i.map(function(e){return a.parseDate(e)})),c.tickFormat(r).tickValues(i),a.isCategorized()&&(c.tickCentered(f.axis_x_tick_centered),b(f.axis_x_tick_culling)&&(f.axis_x_tick_culling=!1)),c},f.prototype.updateXAxisTickValues=function(t,n){var r=this.owner,i=r.config,s;if(i.axis_x_tick_fit||i.axis_x_tick_count)s=this.generateTickValues(r.mapTargetsToUniqueXs(t),i.axis_x_tick_count,r.isTimeSeries());return n?n.tickValues(s):(r.xAxis.tickValues(s),r.subXAxis.tickValues(s)),s},f.prototype.getYAxis=function(t,n,r,i,s,o,u){var a=this.owner,f=a.config,l={withOuterTick:s,withoutTransition:o,tickTextRotate:u?0:f.axis_y_tick_rotate},c=C(a.d3,l).scale(t).orient(n).tickFormat(r);return a.isTimeSeriesY()?c.ticks(a.d3.time[f.axis_y_tick_time_value],f.axis_y_tick_time_interval):c.tickValues(i),c},f.prototype.getId=function(t){var n=this.owner.config;return t in n.data_axes?n.data_axes[t]:"y"},f.prototype.getXAxisTickFormat=function(){var t=this.owner,n=t.config,r=t.isTimeSeries()?t.defaultAxisTimeFormat:t.isCategorized()?t.categoryName:function(e){return e<0?e.toFixed(0):e};return n.axis_x_tick_format&&(h(n.axis_x_tick_format)?r=n.axis_x_tick_format:t.isTimeSeries()&&(r=function(e){return e?t.axisTimeFormat(n.axis_x_tick_format)(e):""})),h(r)?function(e){return r.call(t,e)}:r},f.prototype.getTickValues=function(t,n){return t?t:n?n.tickValues():undefined},f.prototype.getXAxisTickValues=function(){return this.getTickValues(this.owner.config.axis_x_tick_values,this.owner.xAxis)},f.prototype.getYAxisTickValues=function(){return this.getTickValues(this.owner.config.axis_y_tick_values,this.owner.yAxis)},f.prototype.getY2AxisTickValues=function(){return this.getTickValues(this.owner.config.axis_y2_tick_values,this.owner.y2Axis)},f.prototype.getLabelOptionByAxisId=function(t){var n=this.owner,r=n.config,i;return t==="y"?i=r.axis_y_label:t==="y2"?i=r.axis_y2_label:t==="x"&&(i=r.axis_x_label),i},f.prototype.getLabelText=function(t){var n=this.getLabelOptionByAxisId(t);return p(n)?n:n?n.text:null},f.prototype.setLabelText=function(t,n){var r=this.owner,i=r.config,s=this.getLabelOptionByAxisId(t);p(s)?t==="y"?i.axis_y_label=n:t==="y2"?i.axis_y2_label=n:t==="x"&&(i.axis_x_label=n):s&&(s.text=n)},f.prototype.getLabelPosition=function(t,n){var r=this.getLabelOptionByAxisId(t),i=r&&typeof r=="object"&&r.position?r.position:n;return{isInner:i.indexOf("inner")>=0,isOuter:i.indexOf("outer")>=0,isLeft:i.indexOf("left")>=0,isCenter:i.indexOf("center")>=0,isRight:i.indexOf("right")>=0,isTop:i.indexOf("top")>=0,isMiddle:i.indexOf("middle")>=0,isBottom:i.indexOf("bottom")>=0}},f.prototype.getXAxisLabelPosition=function(){return this.getLabelPosition("x",this.owner.config.axis_rotated?"inner-top":"inner-right")},f.prototype.getYAxisLabelPosition=function(){return this.getLabelPosition("y",this.owner.config.axis_rotated?"inner-right":"inner-top")},f.prototype.getY2AxisLabelPosition=function(){return this.getLabelPosition("y2",this.owner.config.axis_rotated?"inner-right":"inner-top")},f.prototype.getLabelPositionById=function(t){return t==="y2"?this.getY2AxisLabelPosition():t==="y"?this.getYAxisLabelPosition():this.getXAxisLabelPosition()},f.prototype.textForXAxisLabel=function(){return this.getLabelText("x")},f.prototype.textForYAxisLabel=function(){return this.getLabelText("y")},f.prototype.textForY2AxisLabel=function(){return this.getLabelText("y2")},f.prototype.xForAxisLabel=function(t,n){var r=this.owner;return t?n.isLeft?0:n.isCenter?r.width/2:r.width:n.isBottom?-r.height:n.isMiddle?-r.height/2:0},f.prototype.dxForAxisLabel=function(t,n){return t?n.isLeft?"0.5em":n.isRight?"-0.5em":"0":n.isTop?"-0.5em":n.isBottom?"0.5em":"0"},f.prototype.textAnchorForAxisLabel=function(t,n){return t?n.isLeft?"start":n.isCenter?"middle":"end":n.isBottom?"start":n.isMiddle?"middle":"end"},f.prototype.xForXAxisLabel=function(){return this.xForAxisLabel(!this.owner.config.axis_rotated,this.getXAxisLabelPosition())},f.prototype.xForYAxisLabel=function(){return this.xForAxisLabel(this.owner.config.axis_rotated,this.getYAxisLabelPosition())},f.prototype.xForY2AxisLabel=function(){return this.xForAxisLabel(this.owner.config.axis_rotated,this.getY2AxisLabelPosition())},f.prototype.dxForXAxisLabel=function(){return this.dxForAxisLabel(!this.owner.config.axis_rotated,this.getXAxisLabelPosition())},f.prototype.dxForYAxisLabel=function(){return this.dxForAxisLabel(this.owner.config.axis_rotated,this.getYAxisLabelPosition())},f.prototype.dxForY2AxisLabel=function(){return this.dxForAxisLabel(this.owner.config.axis_rotated,this.getY2AxisLabelPosition())},f.prototype.dyForXAxisLabel=function(){var t=this.owner,n=t.config,r=this.getXAxisLabelPosition();return n.axis_rotated?r.isInner?"1.2em":-25-this.getMaxTickWidth("x"):r.isInner?"-0.5em":n.axis_x_height?n.axis_x_height-10:"3em"},f.prototype.dyForYAxisLabel=function(){var t=this.owner,n=this.getYAxisLabelPosition();return t.config.axis_rotated?n.isInner?"-0.5em":"3em":n.isInner?"1.2em":-10-(t.config.axis_y_inner?0:this.getMaxTickWidth("y")+10)},f.prototype.dyForY2AxisLabel=function(){var t=this.owner,n=this.getY2AxisLabelPosition();return t.config.axis_rotated?n.isInner?"1.2em":"-2.2em":n.isInner?"-0.5em":15+(t.config.axis_y2_inner?0:this.getMaxTickWidth("y2")+15)},f.prototype.textAnchorForXAxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(!t.config.axis_rotated,this.getXAxisLabelPosition())},f.prototype.textAnchorForYAxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(t.config.axis_rotated,this.getYAxisLabelPosition())},f.prototype.textAnchorForY2AxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(t.config.axis_rotated,this.getY2AxisLabelPosition())},f.prototype.getMaxTickWidth=function(t,n){var r=this.owner,i=r.config,s=0,o,u,a,f,l;return n&&r.currentMaxTickWidths[t]?r.currentMaxTickWidths[t]:(r.svg&&(o=r.filterTargetsToShow(r.data.targets),t==="y"?(u=r.y.copy().domain(r.getYDomain(o,"y")),a=this.getYAxis(u,r.yOrient,i.axis_y_tick_format,r.yAxisTickValues,!1,!0,!0)):t==="y2"?(u=r.y2.copy().domain(r.getYDomain(o,"y2")),a=this.getYAxis(u,r.y2Orient,i.axis_y2_tick_format,r.y2AxisTickValues,!1,!0,!0)):(u=r.x.copy().domain(r.getXDomain(o)),a=this.getXAxis(u,r.xOrient,r.xAxisTickFormat,r.xAxisTickValues,!1,!0,!0),this.updateXAxisTickValues(o,a)),f=r.d3.select("body").append("div").classed("c3",!0),l=f.append("svg").style("visibility","hidden").style("position","fixed").style("top",0).style("left",0),l.append("g").call(a).each(function(){r.d3.select(this).selectAll("text").each(function(){var e=this.getBoundingClientRect();s<e.width&&(s=e.width)}),f.remove()})),r.currentMaxTickWidths[t]=s<=0?r.currentMaxTickWidths[t]:s,r.currentMaxTickWidths[t])},f.prototype.updateLabels=function(t){var n=this.owner,r=n.main.select("."+l.axisX+" ."+l.axisXLabel),i=n.main.select("."+l.axisY+" ."+l.axisYLabel),s=n.main.select("."+l.axisY2+" ."+l.axisY2Label);(t?r.transition():r).attr("x",this.xForXAxisLabel.bind(this)).attr("dx",this.dxForXAxisLabel.bind(this)).attr("dy",this.dyForXAxisLabel.bind(this)).text(this.textForXAxisLabel.bind(this)),(t?i.transition():i).attr("x",this.xForYAxisLabel.bind(this)).attr("dx",this.dxForYAxisLabel.bind(this)).attr("dy",this.dyForYAxisLabel.bind(this)).text(this.textForYAxisLabel.bind(this)),(t?s.transition():s).attr("x",this.xForY2AxisLabel.bind(this)).attr("dx",this.dxForY2AxisLabel.bind(this)).attr("dy",this.dyForY2AxisLabel.bind(this)).text(this.textForY2AxisLabel.bind(this))},f.prototype.getPadding=function(t,n,r,i){var s=typeof t=="number"?t:t[n];return c(s)?t.unit==="ratio"?t[n]*i:this.convertPixelsToAxisPadding(s,i):r},f.prototype.convertPixelsToAxisPadding=function(t,n){var r=this.owner,i=r.config.axis_rotated?r.width:r.height;return n*(t/i)},f.prototype.generateTickValues=function(t,n,r){var i=t,s,o,u,a,f,l,c;if(n){s=h(n)?n():n;if(s===1)i=[t[0]];else if(s===2)i=[t[0],t[t.length-1]];else if(s>2){a=s-2,o=t[0],u=t[t.length-1],f=(u-o)/(a+1),i=[o];for(l=0;l<a;l++)c=+o+f*(l+1),i.push(r?new Date(c):c);i.push(u)}}return r||(i=i.sort(function(e,t){return e-t})),i},f.prototype.generateTransitions=function(t){var n=this.owner,r=n.axes;return{axisX:t?r.x.transition().duration(t):r.x,axisY:t?r.y.transition().duration(t):r.y,axisY2:t?r.y2.transition().duration(t):r.y2,axisSubX:t?r.subx.transition().duration(t):r.subx}},f.prototype.redraw=function(t,n){var r=this.owner;r.axes.x.style("opacity",n?0:1),r.axes.y.style("opacity",n?0:1),r.axes.y2.style("opacity",n?0:1),r.axes.subx.style("opacity",n?0:1),t.axisX.call(r.xAxis),t.axisY.call(r.yAxis),t.axisY2.call(r.y2Axis),t.axisSubX.call(r.subXAxis)},r.getClipPath=function(t){var n=e.navigator.appVersion.toLowerCase().indexOf("msie 9.")>=0;return"url("+(n?"":document.URL.split("#")[0])+"#"+t+")"},r.appendClip=function(e,t){return e.append("clipPath").attr("id",t).append("rect")},r.getAxisClipX=function(e){var t=Math.max(30,this.margin.left);return e?-(1+t):-(t-1)},r.getAxisClipY=function(e){return e?-20:-this.margin.top},r.getXAxisClipX=function(){var e=this;return e.getAxisClipX(!e.config.axis_rotated)},r.getXAxisClipY=function(){var e=this;return e.getAxisClipY(!e.config.axis_rotated)},r.getYAxisClipX=function(){var e=this;return e.config.axis_y_inner?-1:e.getAxisClipX(e.config.axis_rotated)},r.getYAxisClipY=function(){var e=this;return e.getAxisClipY(e.config.axis_rotated)},r.getAxisClipWidth=function(e){var t=this,n=Math.max(30,t.margin.left),r=Math.max(30,t.margin.right);return e?t.width+2+n+r:t.margin.left+20},r.getAxisClipHeight=function(e){return(e?this.margin.bottom:this.margin.top+this.height)+20},r.getXAxisClipWidth=function(){var e=this;return e.getAxisClipWidth(!e.config.axis_rotated)},r.getXAxisClipHeight=function(){var e=this;return e.getAxisClipHeight(!e.config.axis_rotated)},r.getYAxisClipWidth=function(){var e=this;return e.getAxisClipWidth(e.config.axis_rotated)+(e.config.axis_y_inner?20:0)},r.getYAxisClipHeight=function(){var e=this;return e.getAxisClipHeight(e.config.axis_rotated)},r.initPie=function(){var e=this,t=e.d3,n=e.config;e.pie=t.layout.pie().value(function(e){return e.values.reduce(function(e,t){return e+t.value},0)}),n.data_order||e.pie.sort(null)},r.updateRadius=function(){var e=this,t=e.config,n=t.gauge_width||t.donut_width;e.radiusExpanded=Math.min(e.arcWidth,e.arcHeight)/2,e.radius=e.radiusExpanded*.95,e.innerRadiusRatio=n?(e.radius-n)/e.radius:.6,e.innerRadius=e.hasType("donut")||e.hasType("gauge")?e.radius*e.innerRadiusRatio:0},r.updateArc=function(){var e=this;e.svgArc=e.getSvgArc(),e.svgArcExpanded=e.getSvgArcExpanded(),e.svgArcExpandedSub=e.getSvgArcExpanded(.98)},r.updateAngle=function(e){var t=this,n=t.config,r=!1,i=0,s,o,u,a;return n?(t.pie(t.filterTargetsToShow(t.data.targets)).forEach(function(t){!r&&t.data.id===e.data.id&&(r=!0,e=t,e.index=i),i++}),isNaN(e.startAngle)&&(e.startAngle=0),isNaN(e.endAngle)&&(e.endAngle=e.startAngle),t.isGaugeType(e.data)&&(s=n.gauge_min,o=n.gauge_max,u=Math.PI*(n.gauge_fullCircle?2:1)/(o-s),a=e.value<s?0:e.value<o?e.value-s:o-s,e.startAngle=n.gauge_startingAngle,e.endAngle=e.startAngle+u*a),r?e:null):null},r.getSvgArc=function(){var e=this,t=e.d3.svg.arc().outerRadius(e.radius).innerRadius(e.innerRadius),n=function(n,r){var i;return r?t(n):(i=e.updateAngle(n),i?t(i):"M 0 0")};return n.centroid=t.centroid,n},r.getSvgArcExpanded=function(e){var t=this,n=t.d3.svg.arc().outerRadius(t.radiusExpanded*(e?e:1)).innerRadius(t.innerRadius);return function(e){var r=t.updateAngle(e);return r?n(r):"M 0 0"}},r.getArc=function(e,t,n){return n||this.isArcType(e.data)?this.svgArc(e,t):"M 0 0"},r.transformForArcLabel=function(e){var t=this,n=t.config,r=t.updateAngle(e),i,s,o,u,a,f="";return r&&!t.hasType("gauge")&&(i=this.svgArc.centroid(r),s=isNaN(i[0])?0:i[0],o=isNaN(i[1])?0:i[1],u=Math.sqrt(s*s+o*o),t.hasType("donut")&&n.donut_label_ratio?a=h(n.donut_label_ratio)?n.donut_label_ratio(e,t.radius,u):n.donut_label_ratio:t.hasType("pie")&&n.pie_label_ratio?a=h(n.pie_label_ratio)?n.pie_label_ratio(e,t.radius,u):n.pie_label_ratio:a=t.radius&&u?(36/t.radius>.375?1.175-36/t.radius:.8)*t.radius/u:0,f="translate("+s*a+","+o*a+")"),f},r.getArcRatio=function(e){var t=this,n=t.config,r=Math.PI*(t.hasType("gauge")&&!n.gauge_fullCircle?1:2);return e?(e.endAngle-e.startAngle)/r:null},r.convertToArcData=function(e){return this.addName({id:e.data.id,value:e.value,ratio:this.getArcRatio(e),index:e.index})},r.textForArcLabel=function(e){var t=this,n,r,i,s,o;return t.shouldShowArcLabel()?(n=t.updateAngle(e),r=n?n.value:null,i=t.getArcRatio(n),s=e.data.id,!t.hasType("gauge")&&!t.meetsArcLabelThreshold(i)?"":(o=t.getArcLabelFormat(),o?o(r,i,s):t.defaultArcValueFormat(r,i))):""},r.expandArc=function(t){var n=this,r;if(n.transiting){r=e.setInterval(function(){n.transiting||(e.clearInterval(r),n.legend.selectAll(".c3-legend-item-focused").size()>0&&n.expandArc(t))},10);return}t=n.mapToTargetIds(t),n.svg.selectAll(n.selectorTargets(t,"."+l.chartArc)).each(function(e){if(!n.shouldExpand(e.data.id))return;n.d3.select(this).selectAll("path").transition().duration(n.expandDuration(e.data.id)).attr("d",n.svgArcExpanded).transition().duration(n.expandDuration(e.data.id)*2).attr("d",n.svgArcExpandedSub).each(function(e){n.isDonutType(e.data)})})},r.unexpandArc=function(e){var t=this;if(t.transiting)return;e=t.mapToTargetIds(e),t.svg.selectAll(t.selectorTargets(e,"."+l.chartArc)).selectAll("path").transition().duration(function(e){return t.expandDuration(e.data.id)}).attr("d",t.svgArc),t.svg.selectAll("."+l.arc).style("opacity",1)},r.expandDuration=function(e){var t=this,n=t.config;return t.isDonutType(e)?n.donut_expand_duration:t.isGaugeType(e)?n.gauge_expand_duration:t.isPieType(e)?n.pie_expand_duration:50},r.shouldExpand=function(e){var t=this,n=t.config;return t.isDonutType(e)&&n.donut_expand||t.isGaugeType(e)&&n.gauge_expand||t.isPieType(e)&&n.pie_expand},r.shouldShowArcLabel=function(){var e=this,t=e.config,n=!0;return e.hasType("donut")?n=t.donut_label_show:e.hasType("pie")&&(n=t.pie_label_show),n},r.meetsArcLabelThreshold=function(e){var t=this,n=t.config,r=t.hasType("donut")?n.donut_label_threshold:n.pie_label_threshold;return e>=r},r.getArcLabelFormat=function(){var e=this,t=e.config,n=t.pie_label_format;return e.hasType("gauge")?n=t.gauge_label_format:e.hasType("donut")&&(n=t.donut_label_format),n},r.getArcTitle=function(){var e=this;return e.hasType("donut")?e.config.donut_title:""},r.updateTargetsForArc=function(e){var t=this,n=t.main,r,i,s=t.classChartArc.bind(t),o=t.classArcs.bind(t),u=t.classFocus.bind(t);r=n.select("."+l.chartArcs).selectAll("."+l.chartArc).data(t.pie(e)).attr("class",function(e){return s(e)+u(e.data)}),i=r.enter().append("g").attr("class",s),i.append("g").attr("class",o),i.append("text").attr("dy",t.hasType("gauge")?"-.1em":".35em").style("opacity",0).style("text-anchor","middle").style("pointer-events","none")},r.initArc=function(){var e=this;e.arcs=e.main.select("."+l.chart).append("g").attr("class",l.chartArcs).attr("transform",e.getTranslate("arc")),e.arcs.append("text").attr("class",l.chartArcsTitle).style("text-anchor","middle").text(e.getArcTitle())},r.redrawArc=function(e,t,n){var r=this,i=r.d3,s=r.config,o=r.main,u;u=o.selectAll("."+l.arcs).selectAll("."+l.arc).data(r.arcData.bind(r)),u.enter().append("path").attr("class",r.classArc.bind(r)).style("fill",function(e){return r.color(e.data)}).style("cursor",function(e){return s.interaction_enabled&&s.data_selection_isselectable(e)?"pointer":null}).style("opacity",0).each(function(e){r.isGaugeType(e.data)&&(e.startAngle=e.endAngle=s.gauge_startingAngle),this._current=e}),u.attr("transform",function(e){return!r.isGaugeType(e.data)&&n?"scale(0)":""}).style("opacity",function(e){return e===this._current?0:1}).on("mouseover",s.interaction_enabled?function(e){var t,n;if(r.transiting)return;t=r.updateAngle(e),t&&(n=r.convertToArcData(t),r.expandArc(t.data.id),r.api.focus(t.data.id),r.toggleFocusLegend(t.data.id,!0),r.config.data_onmouseover(n,this))}:null).on("mousemove",s.interaction_enabled?function(e){var t=r.updateAngle(e),n,i;t&&(n=r.convertToArcData(t),i=[n],r.showTooltip(i,this))}:null).on("mouseout",s.interaction_enabled?function(e){var t,n;if(r.transiting)return;t=r.updateAngle(e),t&&(n=r.convertToArcData(t),r.unexpandArc(t.data.id),r.api.revert(),r.revertLegend(),r.hideTooltip(),r.config.data_onmouseout(n,this))}:null).on("click",s.interaction_enabled?function(e,t){var n=r.updateAngle(e),i;n&&(i=r.convertToArcData(n),r.toggleShape&&r.toggleShape(this,i,t),r.config.data_onclick.call(r.api,i,this))}:null).each(function(){r.transiting=!0}).transition().duration(e).attrTween("d",function(e){var t=r.updateAngle(e),n;return t?(isNaN(this._current.startAngle)&&(this._current.startAngle=0),isNaN(this._current.endAngle)&&(this._current.endAngle=this._current.startAngle),n=i.interpolate(this._current,t),this._current=n(0),function(t){var i=n(t);return i.data=e.data,r.getArc(i,!0)}):function(){return"M 0 0"}}).attr("transform",n?"scale(1)":"").style("fill",function(e){return r.levelColor?r.levelColor(e.data.values[0].value):r.color(e.data.id)}).style("opacity",1).call(r.endall,function(){r.transiting=!1}),u.exit().transition().duration(t).style("opacity",0).remove(),o.selectAll("."+l.chartArc).select("text").style("opacity",0).attr("class",function(e){return r.isGaugeType(e.data)?l.gaugeValue:""}).text(r.textForArcLabel.bind(r)).attr("transform",r.transformForArcLabel.bind(r)).style("font-size",function(e){return r.isGaugeType(e.data)?Math.round(r.radius/5)+"px":""}).transition().duration(e).style("opacity",function(e){return r.isTargetToShow(e.data.id)&&r.isArcType(e.data)?1:0}),o.select("."+l.chartArcsTitle).style("opacity",r.hasType("donut")||r.hasType("gauge")?1:0),r.hasType("gauge")&&(r.arcs.select("."+l.chartArcsBackground).attr("d",function(){var e={data:[{value:s.gauge_max}],startAngle:s.gauge_startingAngle,endAngle:-1*s.gauge_startingAngle};return r.getArc(e,!0,!0)}),r.arcs.select("."+l.chartArcsGaugeUnit).attr("dy",".75em").text(s.gauge_label_show?s.gauge_units:""),r.arcs.select("."+l.chartArcsGaugeMin).attr("dx",-1*(r.innerRadius+(r.radius-r.innerRadius)/(s.gauge_fullCircle?1:2))+"px").attr("dy","1.2em").text(s.gauge_label_show?s.gauge_min:""),r.arcs.select("."+l.chartArcsGaugeMax).attr("dx",r.innerRadius+(r.radius-r.innerRadius)/(s.gauge_fullCircle?1:2)+"px").attr("dy","1.2em").text(s.gauge_label_show?s.gauge_max:""))},r.initGauge=function(){var e=this.arcs;this.hasType("gauge")&&(e.append("path").attr("class",l.chartArcsBackground),e.append("text").attr("class",l.chartArcsGaugeUnit).style("text-anchor","middle").style("pointer-events","none"),e.append("text").attr("class",l.chartArcsGaugeMin).style("text-anchor","middle").style("pointer-events","none"),e.append("text").attr("class",l.chartArcsGaugeMax).style("text-anchor","middle").style("pointer-events","none"))},r.getGaugeLabelHeight=function(){return this.config.gauge_label_show?20:0},r.initRegion=function(){var e=this;e.region=e.main.append("g").attr("clip-path",e.clipPath).attr("class",l.regions)},r.updateRegion=function(e){var t=this,n=t.config;t.region.style("visibility",t.hasArcType()?"hidden":"visible"),t.mainRegion=t.main.select("."+l.regions).selectAll("."+l.region).data(n.regions),t.mainRegion.enter().append("g").append("rect").style("fill-opacity",0),t.mainRegion.attr("class",t.classRegion.bind(t)),t.mainRegion.exit().transition().duration(e).style("opacity",0).remove()},r.redrawRegion=function(e){var t=this,n=t.mainRegion.selectAll("rect").each(function(){var e=t.d3.select(this.parentNode).datum();t.d3.select(this).datum(e)}),r=t.regionX.bind(t),i=t.regionY.bind(t),s=t.regionWidth.bind(t),o=t.regionHeight.bind(t);return[(e?n.transition():n).attr("x",r).attr("y",i).attr("width",s).attr("height",o).style("fill-opacity",function(e){return c(e.opacity)?e.opacity:.1})]},r.regionX=function(e){var t=this,n=t.config,r,i=e.axis==="y"?t.y:t.y2;return e.axis==="y"||e.axis==="y2"?r=n.axis_rotated?"start"in e?i(e.start):0:0:r=n.axis_rotated?0:"start"in e?t.x(t.isTimeSeries()?t.parseDate(e.start):e.start):0,r},r.regionY=function(e){var t=this,n=t.config,r,i=e.axis==="y"?t.y:t.y2;return e.axis==="y"||e.axis==="y2"?r=n.axis_rotated?0:"end"in e?i(e.end):0:r=n.axis_rotated?"start"in e?t.x(t.isTimeSeries()?t.parseDate(e.start):e.start):0:0,r},r.regionWidth=function(e){var t=this,n=t.config,r=t.regionX(e),i,s=e.axis==="y"?t.y:t.y2;return e.axis==="y"||e.axis==="y2"?i=n.axis_rotated?"end"in e?s(e.end):t.width:t.width:i=n.axis_rotated?t.width:"end"in e?t.x(t.isTimeSeries()?t.parseDate(e.end):e.end):t.width,i<r?0:i-r},r.regionHeight=function(e){var t=this,n=t.config,r=this.regionY(e),i,s=e.axis==="y"?t.y:t.y2;return e.axis==="y"||e.axis==="y2"?i=n.axis_rotated?t.height:"start"in e?s(e.start):t.height:i=n.axis_rotated?"end"in e?t.x(t.isTimeSeries()?t.parseDate(e.end):e.end):t.height:t.height,i<r?0:i-r},r.isRegionOnX=function(e){return!e.axis||e.axis==="x"},r.drag=function(e){var t=this,n=t.config,r=t.main,i=t.d3,s,o,u,a,f,c,h,p;if(t.hasArcType())return;if(!n.data_selection_enabled)return;if(n.zoom_enabled&&!t.zoom.altDomain)return;if(!n.data_selection_multiple)return;s=t.dragStart[0],o=t.dragStart[1],u=e[0],a=e[1],f=Math.min(s,u),c=Math.max(s,u),h=n.data_selection_grouped?t.margin.top:Math.min(o,a),p=n.data_selection_grouped?t.height:Math.max(o,a),r.select("."+l.dragarea).attr("x",f).attr("y",h).attr("width",c-f).attr("height",p-h),r.selectAll("."+l.shapes).selectAll("."+l.shape).filter(function(e){return n.data_selection_isselectable(e)}).each(function(e,n){var r=i.select(this),s=r.classed(l.SELECTED),o=r.classed(l.INCLUDED),u,a,d,v,m,g=!1,y;if(r.classed(l.circle))u=r.attr("cx")*1,a=r.attr("cy")*1,m=t.togglePoint,g=f<u&&u<c&&h<a&&a<p;else{if(!r.classed(l.bar))return;y=T(this),u=y.x,a=y.y,d=y.width,v=y.height,m=t.togglePath,g=!(c<u||u+d<f)&&!(p<a||a+v<h)}g^o&&(r.classed(l.INCLUDED,!o),r.classed(l.SELECTED,!s),m.call(t,!s,r,e,n))})},r.dragstart=function(e){var t=this,n=t.config;if(t.hasArcType())return;if(!n.data_selection_enabled)return;t.dragStart=e,t.main.select("."+l.chart).append("rect").attr("class",l.dragarea).style("opacity",.1),t.dragging=!0},r.dragend=function(){var e=this,t=e.config;if(e.hasArcType())return;if(!t.data_selection_enabled)return;e.main.select("."+l.dragarea).transition().duration(100).style("opacity",0).remove(),e.main.selectAll("."+l.shape).classed(l.INCLUDED,!1),e.dragging=!1},r.selectPoint=function(e,t,n){var r=this,i=r.config,s=(i.axis_rotated?r.circleY:r.circleX).bind(r),o=(i.axis_rotated?r.circleX:r.circleY).bind(r),u=r.pointSelectR.bind(r);i.data_onselected.call(r.api,t,e.node()),r.main.select("."+l.selectedCircles+r.getTargetSelectorSuffix(t.id)).selectAll("."+l.selectedCircle+"-"+n).data([t]).enter().append("circle").attr("class",function(){return r.generateClass(l.selectedCircle,n)}).attr("cx",s).attr("cy",o).attr("stroke",function(){return r.color(t)}).attr("r",function(e){return r.pointSelectR(e)*1.4}).transition().duration(100).attr("r",u)},r.unselectPoint=function(e,t,n){var r=this;r.config.data_onunselected.call(r.api,t,e.node()),r.main.select("."+l.selectedCircles+r.getTargetSelectorSuffix(t.id)).selectAll("."+l.selectedCircle+"-"+n).transition().duration(100).attr("r",0).remove()},r.togglePoint=function(e,t,n,r){e?this.selectPoint(t,n,r):this.unselectPoint(t,n,r)},r.selectPath=function(e,t){var n=this;n.config.data_onselected.call(n,t,e.node()),n.config.interaction_brighten&&e.transition().duration(100).style("fill",function(){return n.d3.rgb(n.color(t)).brighter(.75)})},r.unselectPath=function(e,t){var n=this;n.config.data_onunselected.call(n,t,e.node()),n.config.interaction_brighten&&e.transition().duration(100).style("fill",function(){return n.color(t)})},r.togglePath=function(e,t,n,r){e?this.selectPath(t,n,r):this.unselectPath(t,n,r)},r.getToggle=function(e,t){var n=this,r;return e.nodeName==="circle"?n.isStepType(t)?r=function(){}:r=n.togglePoint:e.nodeName==="path"&&(r=n.togglePath),r},r.toggleShape=function(e,t,n){var r=this,i=r.d3,s=r.config,o=i.select(e),u=o.classed(l.SELECTED),a=r.getToggle(e,t).bind(r);s.data_selection_enabled&&s.data_selection_isselectable(t)&&(s.data_selection_multiple||r.main.selectAll("."+l.shapes+(s.data_selection_grouped?r.getTargetSelectorSuffix(t.id):"")).selectAll("."+l.shape).each(function(e,t){var n=i.select(this);n.classed(l.SELECTED)&&a(!1,n.classed(l.SELECTED,!1),e,t)}),o.classed(l.SELECTED,!u),a(!u,o,t,n))},r.initBrush=function(){var e=this,t=e.d3;e.brush=t.svg.brush().on("brush",function(){e.redrawForBrush()}),e.brush.update=function(){return e.context&&e.context.select("."+l.brush).call(this),this},e.brush.scale=function(t){return e.config.axis_rotated?this.y(t):this.x(t)}},r.initSubchart=function(){var e=this,t=e.config,n=e.context=e.svg.append("g").attr("transform",e.getTranslate("context")),r=t.subchart_show?"visible":"hidden";n.style("visibility",r),n.append("g").attr("clip-path",e.clipPathForSubchart).attr("class",l.chart),n.select("."+l.chart).append("g").attr("class",l.chartBars),n.select("."+l.chart).append("g").attr("class",l.chartLines),n.append("g").attr("clip-path",e.clipPath).attr("class",l.brush).call(e.brush),e.axes.subx=n.append("g").attr("class",l.axisX).attr("transform",e.getTranslate("subx")).attr("clip-path",t.axis_rotated?"":e.clipPathForXAxis).style("visibility",t.subchart_axis_x_show?r:"hidden")},r.updateTargetsForSubchart=function(e){var t=this,n=t.context,r=t.config,i,s,o,u,a=t.classChartBar.bind(t),f=t.classBars.bind(t),c=t.classChartLine.bind(t),h=t.classLines.bind(t),p=t.classAreas.bind(t);r.subchart_show&&(u=n.select("."+l.chartBars).selectAll("."+l.chartBar).data(e).attr("class",a),o=u.enter().append("g").style("opacity",0).attr("class",a),o.append("g").attr("class",f),s=n.select("."+l.chartLines).selectAll("."+l.chartLine).data(e).attr("class",c),i=s.enter().append("g").style("opacity",0).attr("class",c),i.append("g").attr("class",h),i.append("g").attr("class",p),n.selectAll("."+l.brush+" rect").attr(r.axis_rotated?"width":"height",r.axis_rotated?t.width2:t.height2))},r.updateBarForSubchart=function(e){var t=this;t.contextBar=t.context.selectAll("."+l.bars).selectAll("."+l.bar).data(t.barData.bind(t)),t.contextBar.enter().append("path").attr("class",t.classBar.bind(t)).style("stroke","none").style("fill",t.color),t.contextBar.style("opacity",t.initialOpacity.bind(t)),t.contextBar.exit().transition().duration(e).style("opacity",0).remove()},r.redrawBarForSubchart=function(e,t,n){(t?this.contextBar.transition(Math.random().toString()).duration(n):this.contextBar).attr("d",e).style("opacity",1)},r.updateLineForSubchart=function(e){var t=this;t.contextLine=t.context.selectAll("."+l.lines).selectAll("."+l.line).data(t.lineData.bind(t)),t.contextLine.enter().append("path").attr("class",t.classLine.bind(t)).style("stroke",t.color),t.contextLine.style("opacity",t.initialOpacity.bind(t)),t.contextLine.exit().transition().duration(e).style("opacity",0).remove()},r.redrawLineForSubchart=function(e,t,n){(t?this.contextLine.transition(Math.random().toString()).duration(n):this.contextLine).attr("d",e).style("opacity",1)},r.updateAreaForSubchart=function(e){var t=this,n=t.d3;t.contextArea=t.context.selectAll("."+l.areas).selectAll("."+l.area).data(t.lineData.bind(t)),t.contextArea.enter().append("path").attr("class",t.classArea.bind(t)).style("fill",t.color).style("opacity",function(){return t.orgAreaOpacity=+n.select(this).style("opacity"),0}),t.contextArea.style("opacity",0),t.contextArea.exit().transition().duration(e).style("opacity",0).remove()},r.redrawAreaForSubchart=function(e,t,n){(t?this.contextArea.transition(Math.random().toString()).duration(n):this.contextArea).attr("d",e).style("fill",this.color).style("opacity",this.orgAreaOpacity)},r.redrawSubchart=function(e,t,n,r,i,s,o){var u=this,a=u.d3,f=u.config,l,c,h;u.context.style("visibility",f.subchart_show?"visible":"hidden"),f.subchart_show&&(a.event&&a.event.type==="zoom"&&u.brush.extent(u.x.orgDomain()).update(),e&&(u.brush.empty()||u.brush.extent(u.x.orgDomain()).update(),l=u.generateDrawArea(i,!0),c=u.generateDrawBar(s,!0),h=u.generateDrawLine(o,!0),u.updateBarForSubchart(n),u.updateLineForSubchart(n),u.updateAreaForSubchart(n),u.redrawBarForSubchart(c,n,n),u.redrawLineForSubchart(h,n,n),u.redrawAreaForSubchart(l,n,n)))},r.redrawForBrush=function(){var e=this,t=e.x;e.redraw({withTransition:!1,withY:e.config.zoom_rescale,withSubchart:!1,withUpdateXDomain:!0,withDimension:!1}),e.config.subchart_onbrush.call(e.api,t.orgDomain())},r.transformContext=function(e,t){var n=this,r;t&&t.axisSubX?r=t.axisSubX:(r=n.context.select("."+l.axisX),e&&(r=r.transition())),n.context.attr("transform",n.getTranslate("context")),r.attr("transform",n.getTranslate("subx"))},r.getDefaultExtent=function(){var e=this,t=e.config,n=h(t.axis_x_extent)?t.axis_x_extent(e.getXDomain(e.data.targets)):t.axis_x_extent;return e.isTimeSeries()&&(n=[e.parseDate(n[0]),e.parseDate(n[1])]),n},r.initZoom=function(){var e=this,t=e.d3,n=e.config,r;e.zoom=t.behavior.zoom().on("zoomstart",function(){r=t.event.sourceEvent,e.zoom.altDomain=t.event.sourceEvent.altKey?e.x.orgDomain():null,n.zoom_onzoomstart.call(e.api,t.event.sourceEvent)}).on("zoom",function(){e.redrawForZoom.call(e)}).on("zoomend",function(){var i=t.event.sourceEvent;if(i&&r.clientX===i.clientX&&r.clientY===i.clientY)return;e.redrawEventRect(),e.updateZoom(),n.zoom_onzoomend.call(e.api,e.x.orgDomain())}),e.zoom.scale=function(e){return n.axis_rotated?this.y(e):this.x(e)},e.zoom.orgScaleExtent=function(){var t=n.zoom_extent?n.zoom_extent:[1,10];return[t[0],Math.max(e.getMaxDataCount()/t[1],t[1])]},e.zoom.updateScaleExtent=function(){var t=y(e.x.orgDomain())/y(e.getZoomDomain()),n=this.orgScaleExtent();return this.scaleExtent([n[0]*t,n[1]*t]),this}},r.getZoomDomain=function(){var e=this,t=e.config,n=e.d3,r=n.min([e.orgXDomain[0],t.zoom_x_min]),i=n.max([e.orgXDomain[1],t.zoom_x_max]);return[r,i]},r.updateZoom=function(){var e=this,t=e.config.zoom_enabled?e.zoom:function(){};e.main.select("."+l.zoomRect).call(t).on("dblclick.zoom",null),e.main.selectAll("."+l.eventRect).call(t).on("dblclick.zoom",null)},r.redrawForZoom=function(){var e=this,t=e.d3,n=e.config,r=e.zoom,i=e.x;if(!n.zoom_enabled)return;if(e.filterTargetsToShow(e.data.targets).length===0)return;if(t.event.sourceEvent.type==="mousemove"&&r.altDomain){i.domain(r.altDomain),r.scale(i).updateScaleExtent();return}e.isCategorized()&&i.orgDomain()[0]===e.orgXDomain[0]&&i.domain([e.orgXDomain[0]-1e-10,i.orgDomain()[1]]),e.redraw({withTransition:!1,withY:n.zoom_rescale,withSubchart:!1,withEventRect:!1,withDimension:!1}),t.event.sourceEvent.type==="mousemove"&&(e.cancelClick=!0),n.zoom_onzoom.call(e.api,i.orgDomain())},r.generateColor=function(){var e=this,t=e.config,n=e.d3,r=t.data_colors,i=w(t.color_pattern)?t.color_pattern:n.scale.category10().range(),s=t.data_color,o=[];return function(e){var t=e.id||e.data&&e.data.id||e,n;return r[t]instanceof Function?n=r[t](e):r[t]?n=r[t]:(o.indexOf(t)<0&&o.push(t),n=i[o.indexOf(t)%i.length],r[t]=n),s instanceof Function?s(n,e):n}},r.generateLevelColor=function(){var e=this,t=e.config,n=t.color_pattern,r=t.color_threshold,i=r.unit==="value",s=r.values&&r.values.length?r.values:[],o=r.max||100;return w(t.color_threshold)?function(e){var t,r,u=n[n.length-1];for(t=0;t<s.length;t++){r=i?e:e*100/o;if(r<s[t]){u=n[t];break}}return u}:null},r.getYFormat=function(e){var t=this,n=e&&!t.hasType("gauge")?t.defaultArcValueFormat:t.yFormat,r=e&&!t.hasType("gauge")?t.defaultArcValueFormat:t.y2Format;return function(e,i,s){var o=t.axis.getId(s)==="y2"?r:n;return o.call(t,e,i)}},r.yFormat=function(e){var t=this,n=t.config,r=n.axis_y_tick_format?n.axis_y_tick_format:t.defaultValueFormat;return r(e)},r.y2Format=function(e){var t=this,n=t.config,r=n.axis_y2_tick_format?n.axis_y2_tick_format:t.defaultValueFormat;return r(e)},r.defaultValueFormat=function(e){return c(e)?+e:""},r.defaultArcValueFormat=function(e,t){return(t*100).toFixed(1)+"%"},r.dataLabelFormat=function(e){var t=this,n=t.config.data_labels,r,i=function(e){return c(e)?+e:""};return typeof n.format=="function"?r=n.format:typeof n.format=="object"?n.format[e]?r=n.format[e]===!0?i:n.format[e]:r=function(){return""}:r=i,r},r.hasCaches=function(e){for(var t=0;t<e.length;t++)if(!(e[t]in this.cache))return!1;return!0},r.addCache=function(e,t){this.cache[e]=this.cloneTarget(t)},r.getCaches=function(e){var t=[],n;for(n=0;n<e.length;n++)e[n]in this.cache&&t.push(this.cloneTarget(this.cache[e[n]]));return t};var l=r.CLASS={target:"c3-target",chart:"c3-chart",chartLine:"c3-chart-line",chartLines:"c3-chart-lines",chartBar:"c3-chart-bar",chartBars:"c3-chart-bars",chartText:"c3-chart-text",chartTexts:"c3-chart-texts",chartArc:"c3-chart-arc",chartArcs:"c3-chart-arcs",chartArcsTitle:"c3-chart-arcs-title",chartArcsBackground:"c3-chart-arcs-background",chartArcsGaugeUnit:"c3-chart-arcs-gauge-unit",chartArcsGaugeMax:"c3-chart-arcs-gauge-max",chartArcsGaugeMin:"c3-chart-arcs-gauge-min",selectedCircle:"c3-selected-circle",selectedCircles:"c3-selected-circles",eventRect:"c3-event-rect",eventRects:"c3-event-rects",eventRectsSingle:"c3-event-rects-single",eventRectsMultiple:"c3-event-rects-multiple",zoomRect:"c3-zoom-rect",brush:"c3-brush",focused:"c3-focused",defocused:"c3-defocused",region:"c3-region",regions:"c3-regions",title:"c3-title",tooltipContainer:"c3-tooltip-container",tooltip:"c3-tooltip",tooltipName:"c3-tooltip-name",shape:"c3-shape",shapes:"c3-shapes",line:"c3-line",lines:"c3-lines",bar:"c3-bar",bars:"c3-bars",circle:"c3-circle",circles:"c3-circles",arc:"c3-arc",arcs:"c3-arcs",area:"c3-area",areas:"c3-areas",empty:"c3-empty",text:"c3-text",texts:"c3-texts",gaugeValue:"c3-gauge-value",grid:"c3-grid",gridLines:"c3-grid-lines",xgrid:"c3-xgrid",xgrids:"c3-xgrids",xgridLine:"c3-xgrid-line",xgridLines:"c3-xgrid-lines",xgridFocus:"c3-xgrid-focus",ygrid:"c3-ygrid",ygrids:"c3-ygrids",ygridLine:"c3-ygrid-line",ygridLines:"c3-ygrid-lines",axis:"c3-axis",axisX:"c3-axis-x",axisXLabel:"c3-axis-x-label",axisY:"c3-axis-y",axisYLabel:"c3-axis-y-label",axisY2:"c3-axis-y2",axisY2Label:"c3-axis-y2-label",legendBackground:"c3-legend-background",legendItem:"c3-legend-item",legendItemEvent:"c3-legend-item-event",legendItemTile:"c3-legend-item-tile",legendItemHidden:"c3-legend-item-hidden",legendItemFocused:"c3-legend-item-focused",dragarea:"c3-dragarea",EXPANDED:"_expanded_",SELECTED:"_selected_",INCLUDED:"_included_"};r.generateClass=function(e,t){return" "+e+" "+e+this.getTargetSelectorSuffix(t)},r.classText=function(e){return this.generateClass(l.text,e.index)},r.classTexts=function(e){return this.generateClass(l.texts,e.id)},r.classShape=function(e){return this.generateClass(l.shape,e.index)},r.classShapes=function(e){return this.generateClass(l.shapes,e.id)},r.classLine=function(e){return this.classShape(e)+this.generateClass(l.line,e.id)},r.classLines=function(e){return this.classShapes(e)+this.generateClass(l.lines,e.id)},r.classCircle=function(e){return this.classShape(e)+this.generateClass(l.circle,e.index)},r.classCircles=function(e){return this.classShapes(e)+this.generateClass(l.circles,e.id)},r.classBar=function(e){return this.classShape(e)+this.generateClass(l.bar,e.index)},r.classBars=function(e){return this.classShapes(e)+this.generateClass(l.bars,e.id)},r.classArc=function(e){return this.classShape(e.data)+this.generateClass(l.arc,e.data.id)},r.classArcs=function(e){return this.classShapes(e.data)+this.generateClass(l.arcs,e.data.id)},r.classArea=function(e){return this.classShape(e)+this.generateClass(l.area,e.id)},r.classAreas=function(e){return this.classShapes(e)+this.generateClass(l.areas,e.id)},r.classRegion=function(e,t){return this.generateClass(l.region,t)+" "+("class"in e?e["class"]:"")},r.classEvent=function(e){return this.generateClass(l.eventRect,e.index)},r.classTarget=function(e){var t=this,n=t.config.data_classes[e],r="";return n&&(r=" "+l.target+"-"+n),t.generateClass(l.target,e)+r},r.classFocus=function(e){return this.classFocused(e)+this.classDefocused(e)},r.classFocused=function(e){return" "+(this.focusedTargetIds.indexOf(e.id)>=0?l.focused:"")},r.classDefocused=function(e){return" "+(this.defocusedTargetIds.indexOf(e.id)>=0?l.defocused:"")},r.classChartText=function(e){return l.chartText+this.classTarget(e.id)},r.classChartLine=function(e){return l.chartLine+this.classTarget(e.id)},r.classChartBar=function(e){return l.chartBar+this.classTarget(e.id)},r.classChartArc=function(e){return l.chartArc+this.classTarget(e.data.id)},r.getTargetSelectorSuffix=function(e){return e||e===0?("-"+e).replace(/[\s?!@#$%^&*()_=+,.<>'":;\[\]\/|~`{}\\]/g,"-"):""},r.selectorTarget=function(e,t){return(t||"")+"."+l.target+this.getTargetSelectorSuffix(e)},r.selectorTargets=function(e,t){var n=this;return e=e||[],e.length?e.map(function(e){return n.selectorTarget(e,t)}):null},r.selectorLegend=function(e){return"."+l.legendItem+this.getTargetSelectorSuffix(e)},r.selectorLegends=function(e){var t=this;return e&&e.length?e.map(function(e){return t.selectorLegend(e)}):null};var c=r.isValue=function(e){return e||e===0},h=r.isFunction=function(e){return typeof e=="function"},p=r.isString=function(e){return typeof e=="string"},d=r.isUndefined=function(e){return typeof e=="undefined"},v=r.isDefined=function(e){return typeof e!="undefined"},m=r.ceil10=function(e){return Math.ceil(e/10)*10},g=r.asHalfPixel=function(e){return Math.ceil(e)+.5},y=r.diffDomain=function(e){return e[1]-e[0]},b=r.isEmpty=function(e){return typeof e=="undefined"||e===null||p(e)&&e.length===0||typeof e=="object"&&Object.keys(e).length===0},w=r.notEmpty=function(e){return!r.isEmpty(e)},E=r.getOption=function(e,t,n){return v(e[t])?e[t]:n},S=r.hasValue=function(e,t){var n=!1;return Object.keys(e).forEach(function(r){e[r]===t&&(n=!0)}),n},x=r.sanitise=function(e){return typeof e=="string"?e.replace(/</g,"&lt;").replace(/>/g,"&gt;"):e},T=r.getPathBox=function(e){var t=e.getBoundingClientRect(),n=[e.pathSegList.getItem(0),e.pathSegList.getItem(1)],r=n[0].x,i=Math.min(n[0].y,n[1].y);return{x:r,y:i,width:t.width,height:t.height}};n.focus=function(e){var t=this.internal,n;e=t.mapToTargetIds(e),n=t.svg.selectAll(t.selectorTargets(e.filter(t.isTargetToShow,t))),this.revert(),this.defocus(),n.classed(l.focused,!0).classed(l.defocused,!1),t.hasArcType()&&t.expandArc(e),t.toggleFocusLegend(e,!0),t.focusedTargetIds=e,t.defocusedTargetIds=t.defocusedTargetIds.filter(function(t){return e.indexOf(t)<0})},n.defocus=function(e){var t=this.internal,n;e=t.mapToTargetIds(e),n=t.svg.selectAll(t.selectorTargets(e.filter(t.isTargetToShow,t))),n.classed(l.focused,!1).classed(l.defocused,!0),t.hasArcType()&&t.unexpandArc(e),t.toggleFocusLegend(e,!1),t.focusedTargetIds=t.focusedTargetIds.filter(function(t){return e.indexOf(t)<0}),t.defocusedTargetIds=e},n.revert=function(e){var t=this.internal,n;e=t.mapToTargetIds(e),n=t.svg.selectAll(t.selectorTargets(e)),n.classed(l.focused,!1).classed(l.defocused,!1),t.hasArcType()&&t.unexpandArc(e),t.config.legend_show&&(t.showLegend(e.filter(t.isLegendToShow.bind(t))),t.legend.selectAll(t.selectorLegends(e)).filter(function(){return t.d3.select(this).classed(l.legendItemFocused)}).classed(l.legendItemFocused,!1)),t.focusedTargetIds=[],t.defocusedTargetIds=[]},n.show=function(e,t){var n=this.internal,r;e=n.mapToTargetIds(e),t=t||{},n.removeHiddenTargetIds(e),r=n.svg.selectAll(n.selectorTargets(e)),r.transition().style("opacity",1,"important").call(n.endall,function(){r.style("opacity",null).style("opacity",1)}),t.withLegend&&n.showLegend(e),n.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},n.hide=function(e,t){var n=this.internal,r;e=n.mapToTargetIds(e),t=t||{},n.addHiddenTargetIds(e),r=n.svg.selectAll(n.selectorTargets(e)),r.transition().style("opacity",0,"important").call(n.endall,function(){r.style("opacity",null).style("opacity",0)}),t.withLegend&&n.hideLegend(e),n.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},n.toggle=function(e,t){var n=this,r=this.internal;r.mapToTargetIds(e).forEach(function(e){r.isTargetToShow(e)?n.hide(e,t):n.show(e,t)})},n.zoom=function(e){var t=this.internal;return e&&(t.isTimeSeries()&&(e=e.map(function(e){return t.parseDate(e)})),t.brush.extent(e),t.redraw({withUpdateXDomain:!0,withY:t.config.zoom_rescale}),t.config.zoom_onzoom.call(this,t.x.orgDomain())),t.brush.extent()},n.zoom.enable=function(e){var t=this.internal;t.config.zoom_enabled=e,t.updateAndRedraw()},n.unzoom=function(){var e=this.internal;e.brush.clear().update(),e.redraw({withUpdateXDomain:!0})},n.zoom.max=function(e){var t=this.internal,n=t.config,r=t.d3;if(e!==0&&!e)return n.zoom_x_max;n.zoom_x_max=r.max([t.orgXDomain[1],e])},n.zoom.min=function(e){var t=this.internal,n=t.config,r=t.d3;if(e!==0&&!e)return n.zoom_x_min;n.zoom_x_min=r.min([t.orgXDomain[0],e])},n.zoom.range=function(e){if(!arguments.length)return{max:this.domain.max(),min:this.domain.min()};v(e.max)&&this.domain.max(e.max),v(e.min)&&this.domain.min(e.min)},n.load=function(e){var t=this.internal,r=t.config;e.xs&&t.addXs(e.xs),"names"in e&&n.data.names.bind(this)(e.names),"classes"in e&&Object.keys(e.classes).forEach(function(t){r.data_classes[t]=e.classes[t]}),"categories"in e&&t.isCategorized()&&(r.axis_x_categories=e.categories),"axes"in e&&Object.keys(e.axes).forEach(function(t){r.data_axes[t]=e.axes[t]}),"colors"in e&&Object.keys(e.colors).forEach(function(t){r.data_colors[t]=e.colors[t]});if("cacheIds"in e&&t.hasCaches(e.cacheIds)){t.load(t.getCaches(e.cacheIds),e.done);return}"unload"in e?t.unload(t.mapToTargetIds(typeof e.unload=="boolean"&&e.unload?null:e.unload),function(){t.loadFromArgs(e)}):t.loadFromArgs(e)},n.unload=function(e){var t=this.internal;e=e||{},e instanceof Array?e={ids:e}:typeof e=="string"&&(e={ids:[e]}),t.unload(t.mapToTargetIds(e.ids),function(){t.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),e.done&&e.done()})},n.flow=function(e){var t=this.internal,n,r,i=[],s=t.getMaxDataCount(),o,u,a,f,l=0,h=0,p,d;if(e.json)r=t.convertJsonToData(e.json,e.keys);else if(e.rows)r=t.convertRowsToData(e.rows);else{if(!e.columns)return;r=t.convertColumnsToData(e.columns)}n=t.convertDataToTargets(r,!0),t.data.targets.forEach(function(e){var r=!1,s,o;for(s=0;s<n.length;s++)if(e.id===n[s].id){r=!0,e.values[e.values.length-1]&&(h=e.values[e.values.length-1].index+1),l=n[s].values.length;for(o=0;o<l;o++)n[s].values[o].index=h+o,t.isTimeSeries()||(n[s].values[o].x=h+o);e.values=e.values.concat(n[s].values),n.splice(s,1);break}r||i.push(e.id)}),t.data.targets.forEach(function(e){var n,r;for(n=0;n<i.length;n++)if(e.id===i[n]){h=e.values[e.values.length-1].index+1;for(r=0;r<l;r++)e.values.push({id:e.id,index:h+r,x:t.isTimeSeries()?t.getOtherTargetX(h+r):h+r,value:null})}}),t.data.targets.length&&n.forEach(function(e){var n,r=[];for(n=t.data.targets[0].values[0].index;n<h;n++)r.push({id:e.id,index:n,x:t.isTimeSeries()?t.getOtherTargetX(n):n,value:null});e.values.forEach(function(e){e.index+=h,t.isTimeSeries()||(e.x+=h)}),e.values=r.concat(e.values)}),t.data.targets=t.data.targets.concat(n),o=t.getMaxDataCount(),a=t.data.targets[0],f=a.values[0],v(e.to)?(l=0,d=t.isTimeSeries()?t.parseDate(e.to):e.to,a.values.forEach(function(e){e.x<d&&l++})):v(e.length)&&(l=e.length),s?s===1&&t.isTimeSeries()&&(p=(a.values[a.values.length-1].x-f.x)/2,u=[new Date(+f.x-p),new Date(+f.x+p)],t.updateXDomain(null,!0,!0,!1,u)):(t.isTimeSeries()?a.values.length>1?p=a.values[a.values.length-1].x-f.x:p=f.x-t.getXDomain(t.data.targets)[0]:p=1,u=[f.x-p,f.x],t.updateXDomain(null,!0,!0,!1,u)),t.updateTargets(t.data.targets),t.redraw({flow:{index:f.index,length:l,duration:c(e.duration)?e.duration:t.config.transition_duration,done:e.done,orgDataCount:s},withLegend:!0,withTransition:s>1,withTrimXDomain:!1,withUpdateXAxis:!0})},r.generateFlow=function(e){var t=this,n=t.config,r=t.d3;return function(){var i=e.targets,s=e.flow,o=e.drawBar,u=e.drawLine,a=e.drawArea,f=e.cx,c=e.cy,h=e.xv,p=e.xForText,d=e.yForText,v=e.duration,m,g=1,b,w=s.index,E=s.length,S=t.getValueOnIndex(t.data.targets[0].values,w),x=t.getValueOnIndex(t.data.targets[0].values,w+E),T=t.x.domain(),N,C=s.duration||v,k=s.done||function(){},L=t.generateWait(),A=t.xgrid||r.selectAll([]),O=t.xgridLines||r.selectAll([]),M=t.mainRegion||r.selectAll([]),_=t.mainText||r.selectAll([]),D=t.mainBar||r.selectAll([]),P=t.mainLine||r.selectAll([]),H=t.mainArea||r.selectAll([]),B=t.mainCircle||r.selectAll([]);t.flowing=!0,t.data.targets.forEach(function(e){e.values.splice(0,E)}),N=t.updateXDomain(i,!0,!0),t.updateXGrid&&t.updateXGrid(!0),s.orgDataCount?s.orgDataCount===1||(S&&S.x)===(x&&x.x)?m=t.x(T[0])-t.x(N[0]):t.isTimeSeries()?m=t.x(T[0])-t.x(N[0]):m=t.x(S.x)-t.x(x.x):t.data.targets[0].values.length!==1?m=t.x(T[0])-t.x(N[0]):t.isTimeSeries()?(S=t.getValueOnIndex(t.data.targets[0].values,0),x=t.getValueOnIndex(t.data.targets[0].values,t.data.targets[0].values.length-1),m=t.x(S.x)-t.x(x.x)):m=y(N)/2,g=y(T)/y(N),b="translate("+m+",0) scale("+g+",1)",t.hideXGridFocus(),r.transition().ease("linear").duration(C).each(function(){L.add(t.axes.x.transition().call(t.xAxis)),L.add(D.transition().attr("transform",b)),L.add(P.transition().attr("transform",b)),L.add(H.transition().attr("transform",b)),L.add(B.transition().attr("transform",b)),L.add(_.transition().attr("transform",b)),L.add(M.filter(t.isRegionOnX).transition().attr("transform",b)),L.add(A.transition().attr("transform",b)),L.add(O.transition().attr("transform",b))}).call(L,function(){var e,r=[],i=[],s=[];if(E){for(e=0;e<E;e++)r.push("."+l.shape+"-"+(w+e)),i.push("."+l.text+"-"+(w+e)),s.push("."+l.eventRect+"-"+(w+e));t.svg.selectAll("."+l.shapes).selectAll(r).remove(),t.svg.selectAll("."+l.texts).selectAll(i).remove(),t.svg.selectAll("."+l.eventRects).selectAll(s).remove(),t.svg.select("."+l.xgrid).remove()}A.attr("transform",null).attr(t.xgridAttr),O.attr("transform",null),O.select("line").attr("x1",n.axis_rotated?0:h).attr("x2",n.axis_rotated?t.width:h),O.select("text").attr("x",n.axis_rotated?t.width:0).attr("y",h),D.attr("transform",null).attr("d",o),P.attr("transform",null).attr("d",u),H.attr("transform",null).attr("d",a),B.attr("transform",null).attr("cx",f).attr("cy",c),_.attr("transform",null).attr("x",p).attr("y",d).style("fill-opacity",t.opacityForText.bind(t)),M.attr("transform",null),M.select("rect").filter(t.isRegionOnX).attr("x",t.regionX.bind(t)).attr("width",t.regionWidth.bind(t)),n.interaction_enabled&&t.redrawEventRect(),k(),t.flowing=!1})}},n.selected=function(e){var t=this.internal,n=t.d3;return n.merge(t.main.selectAll("."+l.shapes+t.getTargetSelectorSuffix(e)).selectAll("."+l.shape).filter(function(){return n.select(this).classed(l.SELECTED)}).map(function(e){return e.map(function(e){var t=e.__data__;return t.data?t.data:t})}))},n.select=function(e,t,n){var r=this.internal,i=r.d3,s=r.config;if(!s.data_selection_enabled)return;r.main.selectAll("."+l.shapes).selectAll("."+l.shape).each(function(o,u){var a=i.select(this),f=o.data?o.data.id:o.id,c=r.getToggle(this,o).bind(r),h=s.data_selection_grouped||!e||e.indexOf(f)>=0,p=!t||t.indexOf(u)>=0,d=a.classed(l.SELECTED);if(a.classed(l.line)||a.classed(l.area))return;h&&p?s.data_selection_isselectable(o)&&!d&&c(!0,a.classed(l.SELECTED,!0),o,u):v(n)&&n&&d&&c(!1,a.classed(l.SELECTED,!1),o,u)})},n.unselect=function(e,t){var n=this.internal,r=n.d3,i=n.config;if(!i.data_selection_enabled)return;n.main.selectAll("."+l.shapes).selectAll("."+l.shape).each(function(s,o){var u=r.select(this),a=s.data?s.data.id:s.id,f=n.getToggle(this,s).bind(n),c=i.data_selection_grouped||!e||e.indexOf(a)>=0,h=!t||t.indexOf(o)>=0,p=u.classed(l.SELECTED);if(u.classed(l.line)||u.classed(l.area))return;c&&h&&i.data_selection_isselectable(s)&&p&&f(!1,u.classed(l.SELECTED,!1),s,o)})},n.transform=function(e,t){var n=this.internal,r=["pie","donut"].indexOf(e)>=0?{withTransform:!0}:null;n.transformTo(t,e,r)},r.transformTo=function(e,t,n){var r=this,i=!r.hasArcType(),s=n||{withTransitionForAxis:i};s.withTransitionForTransform=!1,r.transiting=!1,r.setTargetType(e,t),r.updateTargets(r.data.targets),r.updateAndRedraw(s)},n.groups=function(e){var t=this.internal,n=t.config;return d(e)?n.data_groups:(n.data_groups=e,t.redraw(),n.data_groups)},n.xgrids=function(e){var t=this.internal,n=t.config;return e?(n.grid_x_lines=e,t.redrawWithoutRescale(),n.grid_x_lines):n.grid_x_lines},n.xgrids.add=function(e){var t=this.internal;return this.xgrids(t.config.grid_x_lines.concat(e?e:[]))},n.xgrids.remove=function(e){var t=this.internal;t.removeGridLines(e,!0)},n.ygrids=function(e){var t=this.internal,n=t.config;return e?(n.grid_y_lines=e,t.redrawWithoutRescale(),n.grid_y_lines):n.grid_y_lines},n.ygrids.add=function(e){var t=this.internal;return this.ygrids(t.config.grid_y_lines.concat(e?e:[]))},n.ygrids.remove=function(e){var t=this.internal;t.removeGridLines(e,!1)},n.regions=function(e){var t=this.internal,n=t.config;return e?(n.regions=e,t.redrawWithoutRescale(),n.regions):n.regions},n.regions.add=function(e){var t=this.internal,n=t.config;return e?(n.regions=n.regions.concat(e),t.redrawWithoutRescale(),n.regions):n.regions},n.regions.remove=function(e){var t=this.internal,n=t.config,r,i,s;return e=e||{},r=t.getOption(e,"duration",n.transition_duration),i=t.getOption(e,"classes",[l.region]),s=t.main.select("."+l.regions).selectAll(i.map(function(e){return"."+e})),(r?s.transition().duration(r):s).style("opacity",0).remove(),n.regions=n.regions.filter(function(e){var t=!1;return e["class"]?(e["class"].split(" ").forEach(function(e){i.indexOf(e)>=0&&(t=!0)}),!t):!0}),n.regions},n.data=function(e){var t=this.internal.data.targets;return typeof e=="undefined"?t:t.filter(function(t){return[].concat(e).indexOf(t.id)>=0})},n.data.shown=function(e){return this.internal.filterTargetsToShow(this.data(e))},n.data.values=function(e){var t,n=null;return e&&(t=this.data(e),n=t[0]?t[0].values.map(function(e){return e.value}):null),n},n.data.names=function(e){return this.internal.clearLegendItemTextBoxCache(),this.internal.updateDataAttributes("names",e)},n.data.colors=function(e){return this.internal.updateDataAttributes("colors",e)},n.data.axes=function(e){return this.internal.updateDataAttributes("axes",e)},n.category=function(e,t){var n=this.internal,r=n.config;return arguments.length>1&&(r.axis_x_categories[e]=t,n.redraw()),r.axis_x_categories[e]},n.categories=function(e){var t=this.internal,n=t.config;return arguments.length?(n.axis_x_categories=e,t.redraw(),n.axis_x_categories):n.axis_x_categories},n.color=function(e){var t=this.internal;return t.color(e)},n.x=function(e){var t=this.internal;return arguments.length&&(t.updateTargetX(t.data.targets,e),t.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),t.data.xs},n.xs=function(e){var t=this.internal;return arguments.length&&(t.updateTargetXs(t.data.targets,e),t.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),t.data.xs},n.axis=function(){},n.axis.labels=function(e){var t=this.internal;arguments.length&&(Object.keys(e).forEach(function(n){t.axis.setLabelText(n,e[n])}),t.axis.updateLabels())},n.axis.max=function(e){var t=this.internal,n=t.config;if(!arguments.length)return{x:n.axis_x_max,y:n.axis_y_max,y2:n.axis_y2_max};typeof e=="object"?(c(e.x)&&(n.axis_x_max=e.x),c(e.y)&&(n.axis_y_max=e.y),c(e.y2)&&(n.axis_y2_max=e.y2)):n.axis_y_max=n.axis_y2_max=e,t.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})},n.axis.min=function(e){var t=this.internal,n=t.config;if(!arguments.length)return{x:n.axis_x_min,y:n.axis_y_min,y2:n.axis_y2_min};typeof e=="object"?(c(e.x)&&(n.axis_x_min=e.x),c(e.y)&&(n.axis_y_min=e.y),c(e.y2)&&(n.axis_y2_min=e.y2)):n.axis_y_min=n.axis_y2_min=e,t.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})},n.axis.range=function(e){if(!arguments.length)return{max:this.axis.max(),min:this.axis.min()};v(e.max)&&this.axis.max(e.max),v(e.min)&&this.axis.min(e.min)},n.legend=function(){},n.legend.show=function(e){var t=this.internal;t.showLegend(t.mapToTargetIds(e)),t.updateAndRedraw({withLegend:!0})},n.legend.hide=function(e){var t=this.internal;t.hideLegend(t.mapToTargetIds(e)),t.updateAndRedraw({withLegend:!0})},n.resize=function(e){var t=this.internal,n=t.config;n.size_width=e?e.width:null,n.size_height=e?e.height:null,this.flush()},n.flush=function(){var e=this.internal;e.updateAndRedraw({withLegend:!0,withTransition:!1,withTransitionForTransform:!1})},n.destroy=function(){var t=this.internal;e.clearInterval(t.intervalForObserveInserted),t.resizeTimeout!==undefined&&e.clearTimeout(t.resizeTimeout);if(e.detachEvent)e.detachEvent("onresize",t.resizeFunction);else if(e.removeEventListener)e.removeEventListener("resize",t.resizeFunction);else{var n=e.onresize;n&&n.add&&n.remove&&n.remove(t.resizeFunction)}return t.selectChart.classed("c3",!1).html(""),Object.keys(t).forEach(function(e){t[e]=null}),null},n.tooltip=function(){},n.tooltip.show=function(e){var t=this.internal,n,r;e.mouse&&(r=e.mouse),e.data?t.isMultipleX()?(r=[t.x(e.data.x),t.getYScale(e.data.id)(e.data.value)],n=null):n=c(e.data.index)?e.data.index:t.getIndexByX(e.data.x):typeof e.x!="undefined"?n=t.getIndexByX(e.x):typeof e.index!="undefined"&&(n=e.index),t.dispatchEvent("mouseover",n,r),t.dispatchEvent("mousemove",n,r),t.config.tooltip_onshow.call(t,e.data)},n.tooltip.hide=function(){this.internal.dispatchEvent("mouseout",0),this.internal.config.tooltip_onhide.call(this)};var N;r.isSafari=function(){var t=e.navigator.userAgent;return t.indexOf("Safari")>=0&&t.indexOf("Chrome")<0},r.isChrome=function(){var t=e.navigator.userAgent;return t.indexOf("Chrome")>=0},Function.prototype.bind||(Function.prototype.bind=function(e){if(typeof this!="function")throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var t=Array.prototype.slice.call(arguments,1),n=this,r=function(){},i=function(){return n.apply(this instanceof r?this:e,t.concat(Array.prototype.slice.call(arguments)))};return r.prototype=this.prototype,i.prototype=new r,i}),function(){"SVGPathSeg"in e||(e.SVGPathSeg=function(e,t,n){this.pathSegType=e,this.pathSegTypeAsLetter=t,this._owningPathSegList=n},SVGPathSeg.PATHSEG_UNKNOWN=0,SVGPathSeg.PATHSEG_CLOSEPATH=1,SVGPathSeg.PATHSEG_MOVETO_ABS=2,SVGPathSeg.PATHSEG_MOVETO_REL=3,SVGPathSeg.PATHSEG_LINETO_ABS=4,SVGPathSeg.PATHSEG_LINETO_REL=5,SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS=6,SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL=7,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS=8,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL=9,SVGPathSeg.PATHSEG_ARC_ABS=10,SVGPathSeg.PATHSEG_ARC_REL=11,SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS=12,SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL=13,SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS=14,SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL=15,SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS=16,SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL=17,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS=18,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL=19,SVGPathSeg.prototype._segmentChanged=function(){this._owningPathSegList&&this._owningPathSegList.segmentChanged(this)},e.SVGPathSegClosePath=function(e){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CLOSEPATH,"z",e)},SVGPathSegClosePath.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegClosePath.prototype.toString=function(){return"[object SVGPathSegClosePath]"},SVGPathSegClosePath.prototype._asPathString=function(){return this.pathSegTypeAsLetter},SVGPathSegClosePath.prototype.clone=function(){return new SVGPathSegClosePath(undefined)},e.SVGPathSegMovetoAbs=function(e,t,n){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_MOVETO_ABS,"M",e),this._x=t,this._y=n},SVGPathSegMovetoAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegMovetoAbs.prototype.toString=function(){return"[object SVGPathSegMovetoAbs]"},SVGPathSegMovetoAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},SVGPathSegMovetoAbs.prototype.clone=function(){return new SVGPathSegMovetoAbs(undefined,this._x,this._y)},Object.defineProperty(SVGPathSegMovetoAbs.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegMovetoAbs.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}),e.SVGPathSegMovetoRel=function(e,t,n){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_MOVETO_REL,"m",e),this._x=t,this._y=n},SVGPathSegMovetoRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegMovetoRel.prototype.toString=function(){return"[object SVGPathSegMovetoRel]"},SVGPathSegMovetoRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},SVGPathSegMovetoRel.prototype.clone=function(){return new SVGPathSegMovetoRel(undefined,this._x,this._y)},Object.defineProperty(SVGPathSegMovetoRel.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegMovetoRel.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}),e.SVGPathSegLinetoAbs=function(e,t,n){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_ABS,"L",e),this._x=t,this._y=n},SVGPathSegLinetoAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegLinetoAbs.prototype.toString=function(){return"[object SVGPathSegLinetoAbs]"},SVGPathSegLinetoAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},SVGPathSegLinetoAbs.prototype.clone=function(){return new SVGPathSegLinetoAbs(undefined,this._x,this._y)},Object.defineProperty(SVGPathSegLinetoAbs.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegLinetoAbs.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}),e.SVGPathSegLinetoRel=function(e,t,n){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_REL,"l",e),this._x=t,this._y=n},SVGPathSegLinetoRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegLinetoRel.prototype.toString=function(){return"[object SVGPathSegLinetoRel]"},SVGPathSegLinetoRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},SVGPathSegLinetoRel.prototype.clone=function(){return new SVGPathSegLinetoRel(undefined,this._x,this._y)},Object.defineProperty(SVGPathSegLinetoRel.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegLinetoRel.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}),e.SVGPathSegCurvetoCubicAbs=function(e,t,n,r,i,s,o){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS,"C",e),this._x=t,this._y=n,this._x1=r,this._y1=i,this._x2=s,this._y2=o},SVGPathSegCurvetoCubicAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoCubicAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicAbs]"},SVGPathSegCurvetoCubicAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},SVGPathSegCurvetoCubicAbs.prototype.clone=function(){return new SVGPathSegCurvetoCubicAbs(undefined,this._x,this._y,this._x1,this._y1,this._x2,this._y2)},Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype,"x1",{get:function(){return this._x1},set:function(e){this._x1=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype,"y1",{get:function(){return this._y1},set:function(e){this._y1=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype,"x2",{get:function(){return this._x2},set:function(e){this._x2=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype,"y2",{get:function(){return this._y2},set:function(e){this._y2=e,this._segmentChanged()},enumerable:!0}),e.SVGPathSegCurvetoCubicRel=function(e,t,n,r,i,s,o){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL,"c",e),this._x=t,this._y=n,this._x1=r,this._y1=i,this._x2=s,this._y2=o},SVGPathSegCurvetoCubicRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoCubicRel.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicRel]"},SVGPathSegCurvetoCubicRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},SVGPathSegCurvetoCubicRel.prototype.clone=function(){return new SVGPathSegCurvetoCubicRel(undefined,this._x,this._y,this._x1,this._y1,this._x2,this._y2)},Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"x1",{get:function(){return this._x1},set:function(e){this._x1=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"y1",{get:function(){return this._y1},set:function(e){this._y1=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"x2",{get:function(){return this._x2},set:function(e){this._x2=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"y2",{get:function(){return this._y2},set:function(e){this._y2=e,this._segmentChanged()},enumerable:!0}),e.SVGPathSegCurvetoQuadraticAbs=function(e,t,n,r,i){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS,"Q",e),this._x=t,this._y=n,this._x1=r,this._y1=i},SVGPathSegCurvetoQuadraticAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoQuadraticAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticAbs]"},SVGPathSegCurvetoQuadraticAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x+" "+this._y},SVGPathSegCurvetoQuadraticAbs.prototype.clone=function(){return new SVGPathSegCurvetoQuadraticAbs(undefined,this._x,this._y,this._x1,this._y1)},Object.defineProperty(SVGPathSegCurvetoQuadraticAbs.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticAbs.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticAbs.prototype,"x1",{get:function(){return this._x1},set:function(e){this._x1=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticAbs.prototype,"y1",{get:function(){return this._y1},set:function(e){this._y1=e,this._segmentChanged()},enumerable:!0}),e.SVGPathSegCurvetoQuadraticRel=function(e,t,n,r,i){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL,"q",e),this._x=t,this._y=n,this._x1=r,this._y1=i},SVGPathSegCurvetoQuadraticRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoQuadraticRel.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticRel]"},SVGPathSegCurvetoQuadraticRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x+" "+this._y},SVGPathSegCurvetoQuadraticRel.prototype.clone=function(){return new SVGPathSegCurvetoQuadraticRel(undefined,this._x,this._y,this._x1,this._y1)},Object.defineProperty(SVGPathSegCurvetoQuadraticRel.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticRel.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticRel.prototype,"x1",{get:function(){return this._x1},set:function(e){this._x1=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticRel.prototype,"y1",{get:function(){return this._y1},set:function(e){this._y1=e,this._segmentChanged()},enumerable:!0}),e.SVGPathSegArcAbs=function(e,t,n,r,i,s,o,u){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_ARC_ABS,"A",e),this._x=t,this._y=n,this._r1=r,this._r2=i,this._angle=s,this._largeArcFlag=o,this._sweepFlag=u},SVGPathSegArcAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegArcAbs.prototype.toString=function(){return"[object SVGPathSegArcAbs]"},SVGPathSegArcAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._r1+" "+this._r2+" "+this._angle+" "+(this._largeArcFlag?"1":"0")+" "+(this._sweepFlag?"1":"0")+" "+this._x+" "+this._y},SVGPathSegArcAbs.prototype.clone=function(){return new SVGPathSegArcAbs(undefined,this._x,this._y,this._r1,this._r2,this._angle,this._largeArcFlag,this._sweepFlag)},Object.defineProperty(SVGPathSegArcAbs.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcAbs.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcAbs.prototype,"r1",{get:function(){return this._r1},set:function(e){this._r1=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcAbs.prototype,"r2",{get:function(){return this._r2},set:function(e){this._r2=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcAbs.prototype,"angle",{get:function(){return this._angle},set:function(e){this._angle=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcAbs.prototype,"largeArcFlag",{get:function(){return this._largeArcFlag},set:function(e){this._largeArcFlag=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcAbs.prototype,"sweepFlag",{get:function(){return this._sweepFlag},set:function(e){this._sweepFlag=e,this._segmentChanged()},enumerable:!0}),e.SVGPathSegArcRel=function(e,t,n,r,i,s,o,u){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_ARC_REL,"a",e),this._x=t,this._y=n,this._r1=r,this._r2=i,this._angle=s,this._largeArcFlag=o,this._sweepFlag=u},SVGPathSegArcRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegArcRel.prototype.toString=function(){return"[object SVGPathSegArcRel]"},SVGPathSegArcRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._r1+" "+this._r2+" "+this._angle+" "+(this._largeArcFlag?"1":"0")+" "+(this._sweepFlag?"1":"0")+" "+this._x+" "+this._y},SVGPathSegArcRel.prototype.clone=function(){return new SVGPathSegArcRel(undefined,this._x,this._y,this._r1,this._r2,this._angle,this._largeArcFlag,this._sweepFlag)},Object.defineProperty(SVGPathSegArcRel.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcRel.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcRel.prototype,"r1",{get:function(){return this._r1},set:function(e){this._r1=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcRel.prototype,"r2",{get:function(){return this._r2},set:function(e){this._r2=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcRel.prototype,"angle",{get:function(){return this._angle},set:function(e){this._angle=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcRel.prototype,"largeArcFlag",{get:function(){return this._largeArcFlag},set:function(e){this._largeArcFlag=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcRel.prototype,"sweepFlag",{get:function(){return this._sweepFlag},set:function(e){this._sweepFlag=e,this._segmentChanged()},enumerable:!0}),e.SVGPathSegLinetoHorizontalAbs=function(e,t){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS,"H",e),this._x=t},SVGPathSegLinetoHorizontalAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegLinetoHorizontalAbs.prototype.toString=function(){return"[object SVGPathSegLinetoHorizontalAbs]"},SVGPathSegLinetoHorizontalAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x},SVGPathSegLinetoHorizontalAbs.prototype.clone=function(){return new SVGPathSegLinetoHorizontalAbs(undefined,this._x)},Object.defineProperty(SVGPathSegLinetoHorizontalAbs.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0}),e.SVGPathSegLinetoHorizontalRel=function(e,t){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL,"h",e),this._x=t},SVGPathSegLinetoHorizontalRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegLinetoHorizontalRel.prototype.toString=function(){return"[object SVGPathSegLinetoHorizontalRel]"},SVGPathSegLinetoHorizontalRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x},SVGPathSegLinetoHorizontalRel.prototype.clone=function(){return new SVGPathSegLinetoHorizontalRel(undefined,this._x)},Object.defineProperty(SVGPathSegLinetoHorizontalRel.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0}),e.SVGPathSegLinetoVerticalAbs=function(e,t){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS,"V",e),this._y=t},SVGPathSegLinetoVerticalAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegLinetoVerticalAbs.prototype.toString=function(){return"[object SVGPathSegLinetoVerticalAbs]"},SVGPathSegLinetoVerticalAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._y},SVGPathSegLinetoVerticalAbs.prototype.clone=function(){return new SVGPathSegLinetoVerticalAbs(undefined,this._y)},Object.defineProperty(SVGPathSegLinetoVerticalAbs.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}),e.SVGPathSegLinetoVerticalRel=function(e,t){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL,"v",e),this._y=t},SVGPathSegLinetoVerticalRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegLinetoVerticalRel.prototype.toString=function(){return"[object SVGPathSegLinetoVerticalRel]"},SVGPathSegLinetoVerticalRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._y},SVGPathSegLinetoVerticalRel.prototype.clone=function(){return new SVGPathSegLinetoVerticalRel(undefined,this._y)},Object.defineProperty(SVGPathSegLinetoVerticalRel.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}),e.SVGPathSegCurvetoCubicSmoothAbs=function(e,t,n,r,i){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS,"S",e),this._x=t,this._y=n,this._x2=r,this._y2=i},SVGPathSegCurvetoCubicSmoothAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoCubicSmoothAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicSmoothAbs]"},SVGPathSegCurvetoCubicSmoothAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},SVGPathSegCurvetoCubicSmoothAbs.prototype.clone=function(){return new SVGPathSegCurvetoCubicSmoothAbs(undefined,this._x,this._y,this._x2,this._y2)},Object.defineProperty(SVGPathSegCurvetoCubicSmoothAbs.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicSmoothAbs.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicSmoothAbs.prototype,"x2",{get:function(){return this._x2},set:function(e){this._x2=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicSmoothAbs.prototype,"y2",{get:function(){return this._y2},set:function(e){this._y2=e,this._segmentChanged()},enumerable:!0}),e.SVGPathSegCurvetoCubicSmoothRel=function(e,t,n,r,i){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL,"s",e),this._x=t,this._y=n,this._x2=r,this._y2=i},SVGPathSegCurvetoCubicSmoothRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoCubicSmoothRel.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicSmoothRel]"},SVGPathSegCurvetoCubicSmoothRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},SVGPathSegCurvetoCubicSmoothRel.prototype.clone=function(){return new SVGPathSegCurvetoCubicSmoothRel(undefined,this._x,this._y,this._x2,this._y2)},Object.defineProperty(SVGPathSegCurvetoCubicSmoothRel.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicSmoothRel.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicSmoothRel.prototype,"x2",{get:function(){return this._x2},set:function(e){this._x2=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicSmoothRel.prototype,"y2",{get:function(){return this._y2},set:function(e){this._y2=e,this._segmentChanged()},enumerable:!0}),e.SVGPathSegCurvetoQuadraticSmoothAbs=function(e,t,n){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS,"T",e),this._x=t,this._y=n},SVGPathSegCurvetoQuadraticSmoothAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoQuadraticSmoothAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticSmoothAbs]"},SVGPathSegCurvetoQuadraticSmoothAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},SVGPathSegCurvetoQuadraticSmoothAbs.prototype.clone=function(){return new SVGPathSegCurvetoQuadraticSmoothAbs(undefined,this._x,this._y)},Object.defineProperty(SVGPathSegCurvetoQuadraticSmoothAbs.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticSmoothAbs.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}),e.SVGPathSegCurvetoQuadraticSmoothRel=function(e,t,n){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL,"t",e),this._x=t,this._y=n},SVGPathSegCurvetoQuadraticSmoothRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoQuadraticSmoothRel.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticSmoothRel]"},SVGPathSegCurvetoQuadraticSmoothRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},SVGPathSegCurvetoQuadraticSmoothRel.prototype.clone=function(){return new SVGPathSegCurvetoQuadraticSmoothRel(undefined,this._x,this._y)},Object.defineProperty(SVGPathSegCurvetoQuadraticSmoothRel.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticSmoothRel.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}),SVGPathElement.prototype.createSVGPathSegClosePath=function(){return new SVGPathSegClosePath(undefined)},SVGPathElement.prototype.createSVGPathSegMovetoAbs=function(e,t){return new SVGPathSegMovetoAbs(undefined,e,t)},SVGPathElement.prototype.createSVGPathSegMovetoRel=function(e,t){return new SVGPathSegMovetoRel(undefined,e,t)},SVGPathElement.prototype.createSVGPathSegLinetoAbs=function(e,t){return new SVGPathSegLinetoAbs(undefined,e,t)},SVGPathElement.prototype.createSVGPathSegLinetoRel=function(e,t){return new SVGPathSegLinetoRel(undefined,e,t)},SVGPathElement.prototype.createSVGPathSegCurvetoCubicAbs=function(e,t,n,r,i,s){return new SVGPathSegCurvetoCubicAbs(undefined,e,t,n,r,i,s)},SVGPathElement.prototype.createSVGPathSegCurvetoCubicRel=function(e,t,n,r,i,s){return new SVGPathSegCurvetoCubicRel(undefined,e,t,n,r,i,s)},SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticAbs=function(e,t,n,r){return new SVGPathSegCurvetoQuadraticAbs(undefined,e,t,n,r)},SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticRel=function(e,t,n,r){return new SVGPathSegCurvetoQuadraticRel(undefined,e,t,n,r)},SVGPathElement.prototype.createSVGPathSegArcAbs=function(e,t,n,r,i,s,o){return new SVGPathSegArcAbs(undefined,e,t,n,r,i,s,o)},SVGPathElement.prototype.createSVGPathSegArcRel=function(e,t,n,r,i,s,o){return new SVGPathSegArcRel(undefined,e,t,n,r,i,s,o)},SVGPathElement.prototype.createSVGPathSegLinetoHorizontalAbs=function(e){return new SVGPathSegLinetoHorizontalAbs(undefined,e)},SVGPathElement.prototype.createSVGPathSegLinetoHorizontalRel=function(e){return new SVGPathSegLinetoHorizontalRel(undefined,e)},SVGPathElement.prototype.createSVGPathSegLinetoVerticalAbs=function(e){return new SVGPathSegLinetoVerticalAbs(undefined,e)},SVGPathElement.prototype.createSVGPathSegLinetoVerticalRel=function(e){return new SVGPathSegLinetoVerticalRel(undefined,e)},SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothAbs=function(e,t,n,r){return new SVGPathSegCurvetoCubicSmoothAbs(undefined,e,t,n,r)},SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothRel=function(e,t,n,r){return new SVGPathSegCurvetoCubicSmoothRel(undefined,e,t,n,r)},SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothAbs=function(e,t){return new SVGPathSegCurvetoQuadraticSmoothAbs(undefined,e,t)},SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothRel=function(e,t){return new SVGPathSegCurvetoQuadraticSmoothRel(undefined,e,t)}),"SVGPathSegList"in e||(e.SVGPathSegList=function(e){this._pathElement=e,this._list=this._parsePath(this._pathElement.getAttribute("d")),this._mutationObserverConfig={attributes:!0,attributeFilter:["d"]},this._pathElementMutationObserver=new MutationObserver(this._updateListFromPathMutations.bind(this)),this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)},Object.defineProperty(SVGPathSegList.prototype,"numberOfItems",{get:function(){return this._checkPathSynchronizedToList(),this._list.length},enumerable:!0}),Object.defineProperty(SVGPathElement.prototype,"pathSegList",{get:function(){return this._pathSegList||(this._pathSegList=new SVGPathSegList(this)),this._pathSegList},enumerable:!0}),Object.defineProperty(SVGPathElement.prototype,"normalizedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),Object.defineProperty(SVGPathElement.prototype,"animatedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),Object.defineProperty(SVGPathElement.prototype,"animatedNormalizedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),SVGPathSegList.prototype._checkPathSynchronizedToList=function(){this._updateListFromPathMutations(this._pathElementMutationObserver.takeRecords())},SVGPathSegList.prototype._updateListFromPathMutations=function(e){if(!this._pathElement)return;var t=!1;e.forEach(function(e){e.attributeName=="d"&&(t=!0)}),t&&(this._list=this._parsePath(this._pathElement.getAttribute("d")))},SVGPathSegList.prototype._writeListToPath=function(){this._pathElementMutationObserver.disconnect(),this._pathElement.setAttribute("d",SVGPathSegList._pathSegArrayAsString(this._list)),this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)},SVGPathSegList.prototype.segmentChanged=function(e){this._writeListToPath()},SVGPathSegList.prototype.clear=function(){this._checkPathSynchronizedToList(),this._list.forEach(function(e){e._owningPathSegList=null}),this._list=[],this._writeListToPath()},SVGPathSegList.prototype.initialize=function(e){return this._checkPathSynchronizedToList(),this._list=[e],e._owningPathSegList=this,this._writeListToPath(),e},SVGPathSegList.prototype._checkValidIndex=function(e){if(isNaN(e)||e<0||e>=this.numberOfItems)throw"INDEX_SIZE_ERR"},SVGPathSegList.prototype.getItem=function(e){return this._checkPathSynchronizedToList(),this._checkValidIndex(e),this._list[e]},SVGPathSegList.prototype.insertItemBefore=function(e,t){return this._checkPathSynchronizedToList(),t>this.numberOfItems&&(t=this.numberOfItems),e._owningPathSegList&&(e=e.clone()),this._list.splice(t,0,e),e._owningPathSegList=this,this._writeListToPath(),e},SVGPathSegList.prototype.replaceItem=function(e,t){return this._checkPathSynchronizedToList(),e._owningPathSegList&&(e=e.clone()),this._checkValidIndex(t),this._list[t]=e,e._owningPathSegList=this,this._writeListToPath(),e},SVGPathSegList.prototype.removeItem=function(e){this._checkPathSynchronizedToList(),this._checkValidIndex(e);var t=this._list[e];return this._list.splice(e,1),this._writeListToPath(),t},SVGPathSegList.prototype.appendItem=function(e){return this._checkPathSynchronizedToList(),e._owningPathSegList&&(e=e.clone()),this._list.push(e),e._owningPathSegList=this,this._writeListToPath(),e},SVGPathSegList._pathSegArrayAsString=function(e){var t="",n=!0;return e.forEach(function(e){n?(n=!1,t+=e._asPathString()):t+=" "+e._asPathString()}),t},SVGPathSegList.prototype._parsePath=function(e){if(!e||e.length==0)return[];var t=this,n=function(){this.pathSegList=[]};n.prototype.appendSegment=function(e){this.pathSegList.push(e)};var r=function(e){this._string=e,this._currentIndex=0,this._endIndex=this._string.length,this._previousCommand=SVGPathSeg.PATHSEG_UNKNOWN,this._skipOptionalSpaces()};r.prototype._isCurrentSpace=function(){var e=this._string[this._currentIndex];return e<=" "&&(e==" "||e=="\n"||e=="	"||e=="\r"||e=="\f")},r.prototype._skipOptionalSpaces=function(){while(this._currentIndex<this._endIndex&&this._isCurrentSpace())this._currentIndex++;return this._currentIndex<this._endIndex},r.prototype._skipOptionalSpacesOrDelimiter=function(){return this._currentIndex<this._endIndex&&!this._isCurrentSpace()&&this._string.charAt(this._currentIndex)!=","?!1:(this._skipOptionalSpaces()&&this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)==","&&(this._currentIndex++,this._skipOptionalSpaces()),this._currentIndex<this._endIndex)},r.prototype.hasMoreData=function(){return this._currentIndex<this._endIndex},r.prototype.peekSegmentType=function(){var e=this._string[this._currentIndex];return this._pathSegTypeFromChar(e)},r.prototype._pathSegTypeFromChar=function(e){switch(e){case"Z":case"z":return SVGPathSeg.PATHSEG_CLOSEPATH;case"M":return SVGPathSeg.PATHSEG_MOVETO_ABS;case"m":return SVGPathSeg.PATHSEG_MOVETO_REL;case"L":return SVGPathSeg.PATHSEG_LINETO_ABS;case"l":return SVGPathSeg.PATHSEG_LINETO_REL;case"C":return SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS;case"c":return SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL;case"Q":return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS;case"q":return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL;case"A":return SVGPathSeg.PATHSEG_ARC_ABS;case"a":return SVGPathSeg.PATHSEG_ARC_REL;case"H":return SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS;case"h":return SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL;case"V":return SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS;case"v":return SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL;case"S":return SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS;case"s":return SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL;case"T":return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS;case"t":return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL;default:return SVGPathSeg.PATHSEG_UNKNOWN}},r.prototype._nextCommandHelper=function(e,t){return(e=="+"||e=="-"||e=="."||e>="0"&&e<="9")&&t!=SVGPathSeg.PATHSEG_CLOSEPATH?t==SVGPathSeg.PATHSEG_MOVETO_ABS?SVGPathSeg.PATHSEG_LINETO_ABS:t==SVGPathSeg.PATHSEG_MOVETO_REL?SVGPathSeg.PATHSEG_LINETO_REL:t:SVGPathSeg.PATHSEG_UNKNOWN},r.prototype.initialCommandIsMoveTo=function(){if(!this.hasMoreData())return!0;var e=this.peekSegmentType();return e==SVGPathSeg.PATHSEG_MOVETO_ABS||e==SVGPathSeg.PATHSEG_MOVETO_REL},r.prototype._parseNumber=function(){var e=0,t=0,n=1,r=0,i=1,s=1,o=this._currentIndex;this._skipOptionalSpaces(),this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)=="+"?this._currentIndex++:this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)=="-"&&(this._currentIndex++,i=-1);if(this._currentIndex==this._endIndex||(this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")&&this._string.charAt(this._currentIndex)!=".")return undefined;var u=this._currentIndex;while(this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)>="0"&&this._string.charAt(this._currentIndex)<="9")this._currentIndex++;if(this._currentIndex!=u){var a=this._currentIndex-1,f=1;while(a>=u)t+=f*(this._string.charAt(a--)-"0"),f*=10}if(this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)=="."){this._currentIndex++;if(this._currentIndex>=this._endIndex||this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")return undefined;while(this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)>="0"&&this._string.charAt(this._currentIndex)<="9")r+=(this._string.charAt(this._currentIndex++)-"0")*(n*=.1)}if(this._currentIndex!=o&&this._currentIndex+1<this._endIndex&&(this._string.charAt(this._currentIndex)=="e"||this._string.charAt(this._currentIndex)=="E")&&this._string.charAt(this._currentIndex+1)!="x"&&this._string.charAt(this._currentIndex+1)!="m"){this._currentIndex++,this._string.charAt(this._currentIndex)=="+"?this._currentIndex++:this._string.charAt(this._currentIndex)=="-"&&(this._currentIndex++,s=-1);if(this._currentIndex>=this._endIndex||this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")return undefined;while(this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)>="0"&&this._string.charAt(this._currentIndex)<="9")e*=10,e+=this._string.charAt(this._currentIndex)-"0",this._currentIndex++}var l=t+r;return l*=i,e&&(l*=Math.pow(10,s*e)),o==this._currentIndex?undefined:(this._skipOptionalSpacesOrDelimiter(),l)},r.prototype._parseArcFlag=function(){if(this._currentIndex>=this._endIndex)return undefined;var e=!1,t=this._string.charAt(this._currentIndex++);if(t=="0")e=!1;else{if(t!="1")return undefined;e=!0}return this._skipOptionalSpacesOrDelimiter(),e},r.prototype.parseSegment=function(){var e=this._string[this._currentIndex],n=this._pathSegTypeFromChar(e);if(n==SVGPathSeg.PATHSEG_UNKNOWN){if(this._previousCommand==SVGPathSeg.PATHSEG_UNKNOWN)return null;n=this._nextCommandHelper(e,this._previousCommand);if(n==SVGPathSeg.PATHSEG_UNKNOWN)return null}else this._currentIndex++;this._previousCommand=n;switch(n){case SVGPathSeg.PATHSEG_MOVETO_REL:return new SVGPathSegMovetoRel(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_MOVETO_ABS:return new SVGPathSegMovetoAbs(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_REL:return new SVGPathSegLinetoRel(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_ABS:return new SVGPathSegLinetoAbs(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL:return new SVGPathSegLinetoHorizontalRel(t,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS:return new SVGPathSegLinetoHorizontalAbs(t,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL:return new SVGPathSegLinetoVerticalRel(t,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS:return new SVGPathSegLinetoVerticalAbs(t,this._parseNumber());case SVGPathSeg.PATHSEG_CLOSEPATH:return this._skipOptionalSpaces(),new SVGPathSegClosePath(t);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL:var r={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicRel(t,r.x,r.y,r.x1,r.y1,r.x2,r.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS:var r={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicAbs(t,r.x,r.y,r.x1,r.y1,r.x2,r.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL:var r={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicSmoothRel(t,r.x,r.y,r.x2,r.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:var r={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicSmoothAbs(t,r.x,r.y,r.x2,r.y2);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL:var r={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoQuadraticRel(t,r.x,r.y,r.x1,r.y1);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS:var r={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoQuadraticAbs(t,r.x,r.y,r.x1,r.y1);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:return new SVGPathSegCurvetoQuadraticSmoothRel(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:return new SVGPathSegCurvetoQuadraticSmoothAbs(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_ARC_REL:var r={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegArcRel(t,r.x,r.y,r.x1,r.y1,r.arcAngle,r.arcLarge,r.arcSweep);case SVGPathSeg.PATHSEG_ARC_ABS:var r={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegArcAbs(t,r.x,r.y,r.x1,r.y1,r.arcAngle,r.arcLarge,r.arcSweep);default:throw"Unknown path seg type."}};var i=new n,s=new r(e);if(!s.initialCommandIsMoveTo())return[];while(s.hasMoreData()){var o=s.parseSegment();if(!o)return[];i.appendSegment(o)}return i.pathSegList})}(),typeof define=="function"&&define.amd?define("c3",["d3"],function(){return t}):"undefined"!=typeof exports&&"undefined"!=typeof module?module.exports=t:e.c3=t}(window),!function t(e,n,r){function i(o,u){if(!n[o]){if(!e[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(s)return s(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};e[o][0].call(l.exports,function(t){var n=e[o][1][t];return i(n?n:t)},l,l.exports,t,e,n,r)}return n[o].exports}for(var s="function"==typeof require&&require,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(e,t,n){var r=e("./svg-pan-zoom.js");!function(e,n){"function"==typeof define&&define.amd?define("svg-pan-zoom",[],function(){return r}):"undefined"!=typeof t&&t.exports&&(t.exports=r,e.svgPanZoom=r)}(window,document)},{"./svg-pan-zoom.js":4}],2:[function(e,t,n){var r=e("./svg-utilities");t.exports={enable:function(e){var t=e.svg.querySelector("defs");t||(t=document.createElementNS(r.svgNS,"defs"),e.svg.appendChild(t));var n=document.createElementNS(r.svgNS,"style");n.setAttribute("type","text/css"),n.textContent=".svg-pan-zoom-control { cursor: pointer; fill: black; fill-opacity: 0.333; } .svg-pan-zoom-control:hover { fill-opacity: 0.8; } .svg-pan-zoom-control-background { fill: white; fill-opacity: 0.5; } .svg-pan-zoom-control-background { fill-opacity: 0.8; }",t.appendChild(n);var i=document.createElementNS(r.svgNS,"g");i.setAttribute("id","svg-pan-zoom-controls"),i.setAttribute("transform","translate("+(e.width-70)+" "+(e.height-76)+") scale(0.75)"),i.setAttribute("class","svg-pan-zoom-control"),i.appendChild(this._createZoomIn(e)),i.appendChild(this._createZoomReset(e)),i.appendChild(this._createZoomOut(e)),e.svg.appendChild(i),e.controlIcons=i},_createZoomIn:function(e){var t=document.createElementNS(r.svgNS,"g");t.setAttribute("id","svg-pan-zoom-zoom-in"),t.setAttribute("transform","translate(30.5 5) scale(0.015)"),t.setAttribute("class","svg-pan-zoom-control"),t.addEventListener("click",function(){e.getPublicInstance().zoomIn()},!1),t.addEventListener("touchstart",function(){e.getPublicInstance().zoomIn()},!1);var n=document.createElementNS(r.svgNS,"rect");n.setAttribute("x","0"),n.setAttribute("y","0"),n.setAttribute("width","1500"),n.setAttribute("height","1400"),n.setAttribute("class","svg-pan-zoom-control-background"),t.appendChild(n);var i=document.createElementNS(r.svgNS,"path");return i.setAttribute("d","M1280 576v128q0 26 -19 45t-45 19h-320v320q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-320h-320q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h320v-320q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v320h320q26 0 45 19t19 45zM1536 1120v-960 q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z"),i.setAttribute("class","svg-pan-zoom-control-element"),t.appendChild(i),t},_createZoomReset:function(e){var t=document.createElementNS(r.svgNS,"g");t.setAttribute("id","svg-pan-zoom-reset-pan-zoom"),t.setAttribute("transform","translate(5 35) scale(0.4)"),t.setAttribute("class","svg-pan-zoom-control"),t.addEventListener("click",function(){e.getPublicInstance().reset()},!1),t.addEventListener("touchstart",function(){e.getPublicInstance().reset()},!1);var n=document.createElementNS(r.svgNS,"rect");n.setAttribute("x","2"),n.setAttribute("y","2"),n.setAttribute("width","182"),n.setAttribute("height","58"),n.setAttribute("class","svg-pan-zoom-control-background"),t.appendChild(n);var i=document.createElementNS(r.svgNS,"path");i.setAttribute("d","M33.051,20.632c-0.742-0.406-1.854-0.609-3.338-0.609h-7.969v9.281h7.769c1.543,0,2.701-0.188,3.473-0.562c1.365-0.656,2.048-1.953,2.048-3.891C35.032,22.757,34.372,21.351,33.051,20.632z"),i.setAttribute("class","svg-pan-zoom-control-element"),t.appendChild(i);var s=document.createElementNS(r.svgNS,"path");return s.setAttribute("d","M170.231,0.5H15.847C7.102,0.5,0.5,5.708,0.5,11.84v38.861C0.5,56.833,7.102,61.5,15.847,61.5h154.384c8.745,0,15.269-4.667,15.269-10.798V11.84C185.5,5.708,178.976,0.5,170.231,0.5z M42.837,48.569h-7.969c-0.219-0.766-0.375-1.383-0.469-1.852c-0.188-0.969-0.289-1.961-0.305-2.977l-0.047-3.211c-0.03-2.203-0.41-3.672-1.142-4.406c-0.732-0.734-2.103-1.102-4.113-1.102h-7.05v13.547h-7.055V14.022h16.524c2.361,0.047,4.178,0.344,5.45,0.891c1.272,0.547,2.351,1.352,3.234,2.414c0.731,0.875,1.31,1.844,1.737,2.906s0.64,2.273,0.64,3.633c0,1.641-0.414,3.254-1.242,4.84s-2.195,2.707-4.102,3.363c1.594,0.641,2.723,1.551,3.387,2.73s0.996,2.98,0.996,5.402v2.32c0,1.578,0.063,2.648,0.19,3.211c0.19,0.891,0.635,1.547,1.333,1.969V48.569z M75.579,48.569h-26.18V14.022h25.336v6.117H56.454v7.336h16.781v6H56.454v8.883h19.125V48.569z M104.497,46.331c-2.44,2.086-5.887,3.129-10.34,3.129c-4.548,0-8.125-1.027-10.731-3.082s-3.909-4.879-3.909-8.473h6.891c0.224,1.578,0.662,2.758,1.316,3.539c1.196,1.422,3.246,2.133,6.15,2.133c1.739,0,3.151-0.188,4.236-0.562c2.058-0.719,3.087-2.055,3.087-4.008c0-1.141-0.504-2.023-1.512-2.648c-1.008-0.609-2.607-1.148-4.796-1.617l-3.74-0.82c-3.676-0.812-6.201-1.695-7.576-2.648c-2.328-1.594-3.492-4.086-3.492-7.477c0-3.094,1.139-5.664,3.417-7.711s5.623-3.07,10.036-3.07c3.685,0,6.829,0.965,9.431,2.895c2.602,1.93,3.966,4.73,4.093,8.402h-6.938c-0.128-2.078-1.057-3.555-2.787-4.43c-1.154-0.578-2.587-0.867-4.301-0.867c-1.907,0-3.428,0.375-4.565,1.125c-1.138,0.75-1.706,1.797-1.706,3.141c0,1.234,0.561,2.156,1.682,2.766c0.721,0.406,2.25,0.883,4.589,1.43l6.063,1.43c2.657,0.625,4.648,1.461,5.975,2.508c2.059,1.625,3.089,3.977,3.089,7.055C108.157,41.624,106.937,44.245,104.497,46.331z M139.61,48.569h-26.18V14.022h25.336v6.117h-18.281v7.336h16.781v6h-16.781v8.883h19.125V48.569z M170.337,20.14h-10.336v28.43h-7.266V20.14h-10.383v-6.117h27.984V20.14z"),s.setAttribute("class","svg-pan-zoom-control-element"),t.appendChild(s),t},_createZoomOut:function(e){var t=document.createElementNS(r.svgNS,"g");t.setAttribute("id","svg-pan-zoom-zoom-out"),t.setAttribute("transform","translate(30.5 70) scale(0.015)"),t.setAttribute("class","svg-pan-zoom-control"),t.addEventListener("click",function(){e.getPublicInstance().zoomOut()},!1),t.addEventListener("touchstart",function(){e.getPublicInstance().zoomOut()},!1);var n=document.createElementNS(r.svgNS,"rect");n.setAttribute("x","0"),n.setAttribute("y","0"),n.setAttribute("width","1500"),n.setAttribute("height","1400"),n.setAttribute("class","svg-pan-zoom-control-background"),t.appendChild(n);var i=document.createElementNS(r.svgNS,"path");return i.setAttribute("d","M1280 576v128q0 26 -19 45t-45 19h-896q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h896q26 0 45 19t19 45zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5 t84.5 -203.5z"),i.setAttribute("class","svg-pan-zoom-control-element"),t.appendChild(i),t},disable:function(e){e.controlIcons&&(e.controlIcons.parentNode.removeChild(e.controlIcons),e.controlIcons=null)}}},{"./svg-utilities":5}],3:[function(e,t,n){var r=e("./svg-utilities"),i=e("./utilities"),s=function(e,t){this.init(e,t)};s.prototype.init=function(e,t){this.viewport=e,this.options=t,this.originalState={zoom:1,x:0,y:0},this.activeState={zoom:1,x:0,y:0},this.updateCTMCached=i.proxy(this.updateCTM,this),this.requestAnimationFrame=i.createRequestAnimationFrame(this.options.refreshRate),this.viewBox={x:0,y:0,width:0,height:0},this.cacheViewBox(),this.processCTM(),this.updateCTM()},s.prototype.cacheViewBox=function(){var e=this.options.svg.getAttribute("viewBox");if(e){var t=e.split(/[\s\,]/).filter(function(e){return e}).map(parseFloat);this.viewBox.x=t[0],this.viewBox.y=t[1],this.viewBox.width=t[2],this.viewBox.height=t[3];var n=Math.min(this.options.width/this.viewBox.width,this.options.height/this.viewBox.height);this.activeState.zoom=n,this.activeState.x=(this.options.width-this.viewBox.width*n)/2,this.activeState.y=(this.options.height-this.viewBox.height*n)/2,this.updateCTMOnNextFrame(),this.options.svg.removeAttribute("viewBox")}else{var r=this.viewport.getBBox();this.viewBox.x=r.x,this.viewBox.y=r.y,this.viewBox.width=r.width,this.viewBox.height=r.height}},s.prototype.recacheViewBox=function(){var e=this.viewport.getBoundingClientRect(),t=e.width/this.getZoom(),n=e.height/this.getZoom();this.viewBox.x=0,this.viewBox.y=0,this.viewBox.width=t,this.viewBox.height=n},s.prototype.getViewBox=function(){return i.extend({},this.viewBox)},s.prototype.processCTM=function(){var e=this.getCTM();if(this.options.fit||this.options.contain){var t;t=this.options.fit?Math.min(this.options.width/this.viewBox.width,this.options.height/this.viewBox.height):Math.max(this.options.width/this.viewBox.width,this.options.height/this.viewBox.height),e.a=t,e.d=t,e.e=-this.viewBox.x*t,e.f=-this.viewBox.y*t}if(this.options.center){var n=.5*(this.options.width-(this.viewBox.width+2*this.viewBox.x)*e.a),r=.5*(this.options.height-(this.viewBox.height+2*this.viewBox.y)*e.a);e.e=n,e.f=r}this.originalState.zoom=e.a,this.originalState.x=e.e,this.originalState.y=e.f,this.setCTM(e)},s.prototype.getOriginalState=function(){return i.extend({},this.originalState)},s.prototype.getState=function(){return i.extend({},this.activeState)},s.prototype.getZoom=function(){return this.activeState.zoom},s.prototype.getRelativeZoom=function(){return this.activeState.zoom/this.originalState.zoom},s.prototype.computeRelativeZoom=function(e){return e/this.originalState.zoom},s.prototype.getPan=function(){return{x:this.activeState.x,y:this.activeState.y}},s.prototype.getCTM=function(){var e=this.options.svg.createSVGMatrix();return e.a=this.activeState.zoom,e.b=0,e.c=0,e.d=this.activeState.zoom,e.e=this.activeState.x,e.f=this.activeState.y,e},s.prototype.setCTM=function(e){var t=this.isZoomDifferent(e),n=this.isPanDifferent(e);if(t||n){if(t&&this.options.beforeZoom(this.getRelativeZoom(),this.computeRelativeZoom(e.a))===!1&&(e.a=e.d=this.activeState.zoom,t=!1),n){var r=this.options.beforePan(this.getPan(),{x:e.e,y:e.f}),s=!1,o=!1;r===!1?(e.e=this.getPan().x,e.f=this.getPan().y,s=o=!0):i.isObject(r)&&(r.x===!1?(e.e=this.getPan().x,s=!0):i.isNumber(r.x)&&(e.e=r.x),r.y===!1?(e.f=this.getPan().y,o=!0):i.isNumber(r.y)&&(e.f=r.y)),s&&o&&(n=!1)}(t||n)&&(this.updateCache(e),this.updateCTMOnNextFrame(),t&&this.options.onZoom(this.getRelativeZoom()),n&&this.options.onPan(this.getPan()))}},s.prototype.isZoomDifferent=function(e){return this.activeState.zoom!==e.a},s.prototype.isPanDifferent=function(e){return this.activeState.x!==e.e||this.activeState.y!==e.f},s.prototype.updateCache=function(e){this.activeState.zoom=e.a,this.activeState.x=e.e,this.activeState.y=e.f},s.prototype.pendingUpdate=!1,s.prototype.updateCTMOnNextFrame=function(){this.pendingUpdate||(this.pendingUpdate=!0,this.requestAnimationFrame.call(window,this.updateCTMCached))},s.prototype.updateCTM=function(){r.setCTM(this.viewport,this.getCTM(),this.defs),this.pendingUpdate=!1},t.exports=function(e,t){return new s(e,t)}},{"./svg-utilities":5,"./utilities":7}],4:[function(e,t,n){var r=e("./uniwheel"),i=e("./control-icons"),s=e("./utilities"),o=e("./svg-utilities"),u=e("./shadow-viewport"),a=function(e,t){this.init(e,t)},f={viewportSelector:".svg-pan-zoom_viewport",panEnabled:!0,controlIconsEnabled:!1,zoomEnabled:!0,dblClickZoomEnabled:!0,mouseWheelZoomEnabled:!0,preventMouseEventsDefault:!0,zoomScaleSensitivity:.1,minZoom:.5,maxZoom:10,fit:!0,contain:!1,center:!0,refreshRate:"auto",beforeZoom:null,onZoom:null,beforePan:null,onPan:null,customEventsHandler:null,eventsListenerElement:null};a.prototype.init=function(e,t){var n=this;this.svg=e,this.defs=e.querySelector("defs"),o.setupSvgAttributes(this.svg),this.options=s.extend(s.extend({},f),t),this.state="none";var r=o.getBoundingClientRectNormalized(e);this.width=r.width,this.height=r.height,this.viewport=u(o.getOrCreateViewport(this.svg,this.options.viewportSelector),{svg:this.svg,width:this.width,height:this.height,fit:this.options.fit,contain:this.options.contain,center:this.options.center,refreshRate:this.options.refreshRate,beforeZoom:function(e,t){return n.viewport&&n.options.beforeZoom?n.options.beforeZoom(e,t):void 0},onZoom:function(e){return n.viewport&&n.options.onZoom?n.options.onZoom(e):void 0},beforePan:function(e,t){return n.viewport&&n.options.beforePan?n.options.beforePan(e,t):void 0},onPan:function(e){return n.viewport&&n.options.onPan?n.options.onPan(e):void 0}});var a=this.getPublicInstance();a.setBeforeZoom(this.options.beforeZoom),a.setOnZoom(this.options.onZoom),a.setBeforePan(this.options.beforePan),a.setOnPan(this.options.onPan),this.options.controlIconsEnabled&&i.enable(this),this.lastMouseWheelEventTime=Date.now(),this.setupHandlers()},a.prototype.setupHandlers=function(){var e=this,t=null;if(this.eventListeners={mousedown:function(n){var r=e.handleMouseDown(n,t);return t=n,r},touchstart:function(n){var r=e.handleMouseDown(n,t);return t=n,r},mouseup:function(t){return e.handleMouseUp(t)},touchend:function(t){return e.handleMouseUp(t)},mousemove:function(t){return e.handleMouseMove(t)},touchmove:function(t){return e.handleMouseMove(t)},mouseleave:function(t){return e.handleMouseUp(t)},touchleave:function(t){return e.handleMouseUp(t)},touchcancel:function(t){return e.handleMouseUp(t)}},null!=this.options.customEventsHandler){this.options.customEventsHandler.init({svgElement:this.svg,eventsListenerElement:this.options.eventsListenerElement,instance:this.getPublicInstance()});var n=this.options.customEventsHandler.haltEventListeners;if(n&&n.length)for(var r=n.length-1;r>=0;r--)this.eventListeners.hasOwnProperty(n[r])&&delete this.eventListeners[n[r]]}for(var i in this.eventListeners)(this.options.eventsListenerElement||this.svg).addEventListener(i,this.eventListeners[i],!1);this.options.mouseWheelZoomEnabled&&(this.options.mouseWheelZoomEnabled=!1,this.enableMouseWheelZoom())},a.prototype.enableMouseWheelZoom=function(){if(!this.options.mouseWheelZoomEnabled){var e=this;this.wheelListener=function(t){return e.handleMouseWheel(t)},r.on(this.options.eventsListenerElement||this.svg,this.wheelListener,!1),this.options.mouseWheelZoomEnabled=!0}},a.prototype.disableMouseWheelZoom=function(){this.options.mouseWheelZoomEnabled&&(r.off(this.options.eventsListenerElement||this.svg,this.wheelListener,!1),this.options.mouseWheelZoomEnabled=!1)},a.prototype.handleMouseWheel=function(e){if(this.options.zoomEnabled&&"none"===this.state){this.options.preventMouseEventsDefault&&(e.preventDefault?e.preventDefault():e.returnValue=!1);var t=e.deltaY||1,n=Date.now()-this.lastMouseWheelEventTime,r=3+Math.max(0,30-n);this.lastMouseWheelEventTime=Date.now(),"deltaMode"in e&&0===e.deltaMode&&e.wheelDelta&&(t=0===e.deltaY?0:Math.abs(e.wheelDelta)/e.deltaY),t=t>-0.3&&.3>t?t:(t>0?1:-1)*Math.log(Math.abs(t)+10)/r;var i=this.svg.getScreenCTM().inverse(),s=o.getEventPoint(e,this.svg).matrixTransform(i),u=Math.pow(1+this.options.zoomScaleSensitivity,-1*t);this.zoomAtPoint(u,s)}},a.prototype.zoomAtPoint=function(e,t,n){var r=this.viewport.getOriginalState();n?(e=Math.max(this.options.minZoom*r.zoom,Math.min(this.options.maxZoom*r.zoom,e)),e/=this.getZoom()):this.getZoom()*e<this.options.minZoom*r.zoom?e=this.options.minZoom*r.zoom/this.getZoom():this.getZoom()*e>this.options.maxZoom*r.zoom&&(e=this.options.maxZoom*r.zoom/this.getZoom());var i=this.viewport.getCTM(),s=t.matrixTransform(i.inverse()),o=this.svg.createSVGMatrix().translate(s.x,s.y).scale(e).translate(-s.x,-s.y),u=i.multiply(o);u.a!==i.a&&this.viewport.setCTM(u)},a.prototype.zoom=function(e,t){this.zoomAtPoint(e,o.getSvgCenterPoint(this.svg,this.width,this.height),t)},a.prototype.publicZoom=function(e,t){t&&(e=this.computeFromRelativeZoom(e)),this.zoom(e,t)},a.prototype.publicZoomAtPoint=function(e,t,n){if(n&&(e=this.computeFromRelativeZoom(e)),"SVGPoint"!==s.getType(t)){if(!("x"in t&&"y"in t))throw new Error("Given point is invalid");t=o.createSVGPoint(this.svg,t.x,t.y)}this.zoomAtPoint(e,t,n)},a.prototype.getZoom=function(){return this.viewport.getZoom()},a.prototype.getRelativeZoom=function(){return this.viewport.getRelativeZoom()},a.prototype.computeFromRelativeZoom=function(e){return e*this.viewport.getOriginalState().zoom},a.prototype.resetZoom=function(){var e=this.viewport.getOriginalState();this.zoom(e.zoom,!0)},a.prototype.resetPan=function(){this.pan(this.viewport.getOriginalState())},a.prototype.reset=function(){this.resetZoom(),this.resetPan()},a.prototype.handleDblClick=function(e){if(this.options.preventMouseEventsDefault&&(e.preventDefault?e.preventDefault():e.returnValue=!1),this.options.controlIconsEnabled){var t=e.target.getAttribute("class")||"";if(t.indexOf("svg-pan-zoom-control")>-1)return!1}var n;n=e.shiftKey?1/(2*(1+this.options.zoomScaleSensitivity)):2*(1+this.options.zoomScaleSensitivity);var r=o.getEventPoint(e,this.svg).matrixTransform(this.svg.getScreenCTM().inverse());this.zoomAtPoint(n,r)},a.prototype.handleMouseDown=function(e,t){this.options.preventMouseEventsDefault&&(e.preventDefault?e.preventDefault():e.returnValue=!1),s.mouseAndTouchNormalize(e,this.svg),this.options.dblClickZoomEnabled&&s.isDblClick(e,t)?this.handleDblClick(e):(this.state="pan",this.firstEventCTM=this.viewport.getCTM(),this.stateOrigin=o.getEventPoint(e,this.svg).matrixTransform(this.firstEventCTM.inverse()))},a.prototype.handleMouseMove=function(e){if(this.options.preventMouseEventsDefault&&(e.preventDefault?e.preventDefault():e.returnValue=!1),"pan"===this.state&&this.options.panEnabled){var t=o.getEventPoint(e,this.svg).matrixTransform(this.firstEventCTM.inverse()),n=this.firstEventCTM.translate(t.x-this.stateOrigin.x,t.y-this.stateOrigin.y);this.viewport.setCTM(n)}},a.prototype.handleMouseUp=function(e){this.options.preventMouseEventsDefault&&(e.preventDefault?e.preventDefault():e.returnValue=!1),"pan"===this.state&&(this.state="none")},a.prototype.fit=function(){var e=this.viewport.getViewBox(),t=Math.min(this.width/e.width,this.height/e.height);this.zoom(t,!0)},a.prototype.contain=function(){var e=this.viewport.getViewBox(),t=Math.max(this.width/e.width,this.height/e.height);this.zoom(t,!0)},a.prototype.center=function(){var e=this.viewport.getViewBox(),t=.5*(this.width-(e.width+2*e.x)*this.getZoom()),n=.5*(this.height-(e.height+2*e.y)*this.getZoom());this.getPublicInstance().pan({x:t,y:n})},a.prototype.updateBBox=function(){this.viewport.recacheViewBox()},a.prototype.pan=function(e){var t=this.viewport.getCTM();t.e=e.x,t.f=e.y,this.viewport.setCTM(t)},a.prototype.panBy=function(e){var t=this.viewport.getCTM();t.e+=e.x,t.f+=e.y,this.viewport.setCTM(t)},a.prototype.getPan=function(){var e=this.viewport.getState();return{x:e.x,y:e.y}},a.prototype.resize=function(){var e=o.getBoundingClientRectNormalized(this.svg);this.width=e.width,this.height=e.height,this.options.controlIconsEnabled&&(this.getPublicInstance().disableControlIcons(),this.getPublicInstance().enableControlIcons())},a.prototype.destroy=function(){var e=this;this.beforeZoom=null,this.onZoom=null,this.beforePan=null,this.onPan=null,null!=this.options.customEventsHandler&&this.options.customEventsHandler.destroy({svgElement:this.svg,eventsListenerElement:this.options.eventsListenerElement,instance:this.getPublicInstance()});for(var t in this.eventListeners)(this.options.eventsListenerElement||this.svg).removeEventListener(t,this.eventListeners[t],!1);this.disableMouseWheelZoom(),this.getPublicInstance().disableControlIcons(),this.reset(),l=l.filter(function(t){return t.svg!==e.svg}),delete this.options,delete this.publicInstance,delete this.pi,this.getPublicInstance=function(){return null}},a.prototype.getPublicInstance=function(){var e=this;return this.publicInstance||(this.publicInstance=this.pi={enablePan:function(){return e.options.panEnabled=!0,e.pi},disablePan:function(){return e.options.panEnabled=!1,e.pi},isPanEnabled:function(){return!!e.options.panEnabled},pan:function(t){return e.pan(t),e.pi},panBy:function(t){return e.panBy(t),e.pi},getPan:function(){return e.getPan()},setBeforePan:function(t){return e.options.beforePan=null===t?null:s.proxy(t,e.publicInstance),e.pi},setOnPan:function(t){return e.options.onPan=null===t?null:s.proxy(t,e.publicInstance),e.pi},enableZoom:function(){return e.options.zoomEnabled=!0,e.pi},disableZoom:function(){return e.options.zoomEnabled=!1,e.pi},isZoomEnabled:function(){return!!e.options.zoomEnabled},enableControlIcons:function(){return e.options.controlIconsEnabled||(e.options.controlIconsEnabled=!0,i.enable(e)),e.pi},disableControlIcons:function(){return e.options.controlIconsEnabled&&(e.options.controlIconsEnabled=!1,i.disable(e)),e.pi},isControlIconsEnabled:function(){return!!e.options.controlIconsEnabled},enableDblClickZoom:function(){return e.options.dblClickZoomEnabled=!0,e.pi},disableDblClickZoom:function(){return e.options.dblClickZoomEnabled=!1,e.pi},isDblClickZoomEnabled:function(){return!!e.options.dblClickZoomEnabled},enableMouseWheelZoom:function(){return e.enableMouseWheelZoom(),e.pi},disableMouseWheelZoom:function(){return e.disableMouseWheelZoom(),e.pi},isMouseWheelZoomEnabled:function(){return!!e.options.mouseWheelZoomEnabled},setZoomScaleSensitivity:function(t){return e.options.zoomScaleSensitivity=t,e.pi},setMinZoom:function(t){return e.options.minZoom=t,e.pi},setMaxZoom:function(t){return e.options.maxZoom=t,e.pi},setBeforeZoom:function(t){return e.options.beforeZoom=null===t?null:s.proxy(t,e.publicInstance),e.pi},setOnZoom:function(t){return e.options.onZoom=null===t?null:s.proxy(t,e.publicInstance),e.pi},zoom:function(t){return e.publicZoom(t,!0),e.pi},zoomBy:function(t){return e.publicZoom(t,!1),e.pi},zoomAtPoint:function(t,n){return e.publicZoomAtPoint(t,n,!0),e.pi},zoomAtPointBy:function(t,n){return e.publicZoomAtPoint(t,n,!1),e.pi},zoomIn:function(){return this.zoomBy(1+e.options.zoomScaleSensitivity),e.pi},zoomOut:function(){return this.zoomBy(1/(1+e.options.zoomScaleSensitivity)),e.pi},getZoom:function(){return e.getRelativeZoom()},resetZoom:function(){return e.resetZoom(),e.pi},resetPan:function(){return e.resetPan(),e.pi},reset:function(){return e.reset(),e.pi},fit:function(){return e.fit(),e.pi},contain:function(){return e.contain(),e.pi},center:function(){return e.center(),e.pi},updateBBox:function(){return e.updateBBox(),e.pi},resize:function(){return e.resize(),e.pi},getSizes:function(){return{width:e.width,height:e.height,realZoom:e.getZoom(),viewBox:e.viewport.getViewBox()}},destroy:function(){return e.destroy(),e.pi}}),this.publicInstance};var l=[],c=function(e,t){var n=s.getSvg(e);if(null===n)return null;for(var r=l.length-1;r>=0;r--)if(l[r].svg===n)return l[r].instance.getPublicInstance();return l.push({svg:n,instance:new a(n,t)}),l[l.length-1].instance.getPublicInstance()};t.exports=c},{"./control-icons":2,"./shadow-viewport":3,"./svg-utilities":5,"./uniwheel":6,"./utilities":7}],5:[function(e,t,n){var r=e("./utilities"),i="unknown";document.documentMode&&(i="ie"),t.exports={svgNS:"http://www.w3.org/2000/svg",xmlNS:"http://www.w3.org/XML/1998/namespace",xmlnsNS:"http://www.w3.org/2000/xmlns/",xlinkNS:"http://www.w3.org/1999/xlink",evNS:"http://www.w3.org/2001/xml-events",getBoundingClientRectNormalized:function(e){if(e.clientWidth&&e.clientHeight)return{width:e.clientWidth,height:e.clientHeight};if(e.getBoundingClientRect())return e.getBoundingClientRect();throw new Error("Cannot get BoundingClientRect for SVG.")},getOrCreateViewport:function(e,t){var n=null;if(n=r.isElement(t)?t:e.querySelector(t),!n){var i=Array.prototype.slice.call(e.childNodes||e.children).filter(function(e){return"defs"!==e.nodeName&&"#text"!==e.nodeName});1===i.length&&"g"===i[0].nodeName&&null===i[0].getAttribute("transform")&&(n=i[0])}if(!n){var s="viewport-"+(new Date).toISOString().replace(/\D/g,"");n=document.createElementNS(this.svgNS,"g"),n.setAttribute("id",s);var o=e.childNodes||e.children;if(o&&o.length>0)for(var u=o.length;u>0;u--)"defs"!==o[o.length-u].nodeName&&n.appendChild(o[o.length-u]);e.appendChild(n)}var a=[];return n.getAttribute("class")&&(a=n.getAttribute("class").split(" ")),~a.indexOf("svg-pan-zoom_viewport")||(a.push("svg-pan-zoom_viewport"),n.setAttribute("class",a.join(" "))),n},setupSvgAttributes:function(e){if(e.setAttribute("xmlns",this.svgNS),e.setAttributeNS(this.xmlnsNS,"xmlns:xlink",this.xlinkNS),e.setAttributeNS(this.xmlnsNS,"xmlns:ev",this.evNS),null!==e.parentNode){var t=e.getAttribute("style")||"";-1===t.toLowerCase().indexOf("overflow")&&e.setAttribute("style","overflow: hidden; "+t)}},internetExplorerRedisplayInterval:300,refreshDefsGlobal:r.throttle(function(){for(var e=document.querySelectorAll("defs"),t=e.length,n=0;t>n;n++){var r=e[n];r.parentNode.insertBefore(r,r)}},this.internetExplorerRedisplayInterval),setCTM:function(e,t,n){var r=this,s="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttributeNS(null,"transform",s),"transform"in e.style?e.style.transform=s:"-ms-transform"in e.style?e.style["-ms-transform"]=s:"-webkit-transform"in e.style&&(e.style["-webkit-transform"]=s),"ie"===i&&n&&(n.parentNode.insertBefore(n,n),window.setTimeout(function(){r.refreshDefsGlobal()},r.internetExplorerRedisplayInterval))},getEventPoint:function(e,t){var n=t.createSVGPoint();return r.mouseAndTouchNormalize(e,t),n.x=e.clientX,n.y=e.clientY,n},getSvgCenterPoint:function(e,t,n){return this.createSVGPoint(e,t/2,n/2)},createSVGPoint:function(e,t,n){var r=e.createSVGPoint();return r.x=t,r.y=n,r}}},{"./utilities":7}],6:[function(e,t,n){t.exports=function(){function e(e,t,n){var r=function(e){!e&&(e=window.event);var n={originalEvent:e,target:e.target||e.srcElement,type:"wheel",deltaMode:"MozMousePixelScroll"==e.type?0:1,deltaX:0,delatZ:0,preventDefault:function(){e.preventDefault?e.preventDefault():e.returnValue=!1}};return"mousewheel"==f?(n.deltaY=-1/40*e.wheelDelta,e.wheelDeltaX&&(n.deltaX=-1/40*e.wheelDeltaX)):n.deltaY=e.detail,t(n)};return c.push({element:e,fn:r,capture:n}),r}function t(e,t){for(var n=0;n<c.length;n++)if(c[n].element===e&&c[n].capture===t)return c[n].fn;return function(){}}function n(e,t){for(var n=0;n<c.length;n++)if(c[n].element===e&&c[n].capture===t)return c.splice(n,1)}function r(t,n,r,i){var s;s="wheel"===f?r:e(t,r,i),t[u](l+n,s,i||!1)}function i(e,r,i,s){"wheel"===f?cb=i:cb=t(e,s),e[a](l+r,cb,s||!1),n(e,s)}function s(e,t,n){r(e,f,t,n),"DOMMouseScroll"==f&&r(e,"MozMousePixelScroll",t,n)}function o(e,t,n){i(e,f,t,n),"DOMMouseScroll"==f&&i(e,"MozMousePixelScroll",t,n)}var u,a,f,l="",c=[];return window.addEventListener?(u="addEventListener",a="removeEventListener"):(u="attachEvent",a="detachEvent",l="on"),f="onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll",{on:s,off:o}}()},{}],7:[function(e,t,n){function r(e){return function(t){window.setTimeout(t,e)}}t.exports={extend:function(e,t){e=e||{};for(var n in t)this.isObject(t[n])?e[n]=this.extend(e[n],t[n]):e[n]=t[n];return e},isElement:function(e){return e instanceof HTMLElement||e instanceof SVGElement||e instanceof SVGSVGElement||e&&"object"==typeof e&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName},isObject:function(e){return"[object Object]"===Object.prototype.toString.call(e)},isNumber:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},getSvg:function(e){var t,n;if(this.isElement(e))t=e;else{if(!("string"==typeof e||e instanceof String))throw new Error("Provided selector is not an HTML object nor String");if(t=document.querySelector(e),!t)throw new Error("Provided selector did not find any elements. Selector: "+e)}if("svg"===t.tagName.toLowerCase())n=t;else if("object"===t.tagName.toLowerCase())n=t.contentDocument.documentElement;else{if("embed"!==t.tagName.toLowerCase())throw"img"===t.tagName.toLowerCase()?new Error('Cannot script an SVG in an "img" element. Please use an "object" element or an in-line SVG.'):new Error("Cannot get SVG.");n=t.getSVGDocument().documentElement}return n},proxy:function(e,t){return function(){return e.apply(t,arguments)}},getType:function(e){return Object.prototype.toString.apply(e).replace(/^\[object\s/,"").replace(/\]$/,"")},mouseAndTouchNormalize:function(e,t){if(void 0===e.clientX||null===e.clientX)if(e.clientX=0,e.clientY=0,void 0!==e.changedTouches&&e.changedTouches.length){if(void 0!==e.changedTouches[0].clientX)e.clientX=e.changedTouches[0].clientX,e.clientY=e.changedTouches[0].clientY;else if(void 0!==e.changedTouches[0].pageX){var n=t.getBoundingClientRect();e.clientX=e.changedTouches[0].pageX-n.left,e.clientY=e.changedTouches[0].pageY-n.top}}else void 0!==e.originalEvent&&void 0!==e.originalEvent.clientX&&(e.clientX=e.originalEvent.clientX,e.clientY=e.originalEvent.clientY)},isDblClick:function(e,t){if(2===e.detail)return!0;if(void 0!==t&&null!==t){var n=e.timeStamp-t.timeStamp,r=Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2));return 250>n&&10>r}return!1},now:Date.now||function(){return(new Date).getTime()},throttle:function(e,t,n){var r,i,s,o=this,u=null,a=0;n||(n={});var f=function(){a=n.leading===!1?0:o.now(),u=null,s=e.apply(r,i),u||(r=i=null)};return function(){var c=o.now();a||n.leading!==!1||(a=c);var h=t-(c-a);return r=this,i=arguments,0>=h||h>t?(clearTimeout(u),u=null,a=c,s=e.apply(r,i),u||(r=i=null)):u||n.trailing===!1||(u=setTimeout(f,h)),s}},createRequestAnimationFrame:function(e){var t=null;return"auto"!==e&&60>e&&e>1&&(t=Math.floor(1e3/e)),null===t?window.requestAnimationFrame||r(33):r(t)}}},{}]},{},[1]),define("jswish",["jquery","config","preferences","history","modal","jquery-ui","splitter","bootstrap","pane","tabbed","notebook","navbar","search","editor","query","runner","term","laconic","d3","c3","svg-pan-zoom"],function(e,t,n,r,i){n.setDefault("semantic-highlighting",!0),n.setDefault("emacs-keybinding",!1),function(e){function u(t,n){e(".swish-event-receiver").trigger(t,n)}function a(){e(".swish-logo").append(e.el.b(e.el.span({style:"color:darkblue"},"SWI"),e.el.span({style:"color:maroon"},"SH"))).css("margin-left","30px").css("font-size","24px").addClass("navbar-brand")}function f(){e("#modal").length==0&&(e("body").append(e.el.div({id:"modal"})),e("#modal").swishModal())}function l(){e(".tile").tile(),e(window).resize(function(){e(".tile").tile("resize")}),e("body").on("click","button.close-pane",function(){closePane(e(this).parent())}),e(".tabbed").tabbed()}function c(){e(window).resize(function(){e(".reactive-size").trigger("reactive-resize")})}var n="swish",s={menu:{File:{"Save ...":function(){u("save","as")},"Info & history ...":function(){u("fileInfo")},"Open recent":{type:"submenu",action:function(t){r.openRecent(t,e(this).data("document"))},update:r.updateRecentUL},Share:"--",Download:function(){u("download")},"Collaborate ...":function(){e("body").swish("collaborate")},"Print group":"--","Print ...":function(){u("print")}},Edit:{"Clear messages":function(){u("clearMessages")},Changes:"--","View changes":function(){u("diff")},Edit:"--","Find (Ctrl-F)":function(){u("edit-command","find")},"Find and replace (Shift-Ctrl-F)":function(){u("edit-command","replace")},"Jump to line (Alt-G)":function(){u("edit-command","jumpToLine")},Options:"--","Semantic highlighting":{preference:"semantic-highlighting",type:"checkbox"},"Emacs Keybinding":{preference:"emacs-keybinding",type:"checkbox",value:"false"}},Examples:function(t,n){e("body").swish("populateExamples",t,n)},Help:{"About ...":function(){u("help",{file:"about.html"})},Topics:"--","Help ...":function(){u("help",{file:"help.html"})},"Runner ...":function(){u("help",{file:"runner.html"})},"Debugging ...":function(){u("help",{file:"debug.html"})},"Notebook ...":function(){u("help",{file:"notebook.html"})},"Editor ...":function(){u("help",{file:"editor.html"})},Background:"--","Limitations ...":function(){u("help",{file:"beware.html"})},"Caveats ...":function(){u("help",{file:"caveats.html"})},"Background ...":function(){u("help",{file:"background.html"})}}}},o={_init:function(t){return a(),f(),l(),c(),e("#search").search(),t=t||{},this.addClass("swish"),this.each(function(){var r=e(this),i={};e("#navbar").navbar(s.menu);var o=e(".prolog-editor").prologEditor({save:!0});i.runner=e(".prolog-runners").prologRunners(),i.query=e(".prolog-query").queryEditor({source:function(){return r.swish("prologSource")},sourceID:function(){return o.prologEditor("getSourceID")},examples:r.swish("examples"),runner:i.runner,editor:o[0]}),e(".notebook").notebook(),t.show_beware&&u("help",{file:"beware.html",notagain:"beware"}),r.data(n,i)})},trigger:function(e,t){return u(e,t),this},playFile:function(n){var r=this;typeof n=="string"&&(n={file:n});var s=this.find(".storage").storage("match",n);if(s&&s.storage("expose","Already open"))return this;var o=t.http.locations.web_storage+n.file;return e.ajax({url:o,type:"GET",data:{format:"json"},success:function(e){function t(t){for(var r=0;r<t.length;r++){var i=t[r];n[i]&&(e[i]=n[i])}}e.url=o,e.st_type="gitty",t(["line","regex","showAllMatches","newTab","noHistory","prompt"]),r.swish("setSource",e)},error:function(e){i.ajaxError(e)}}),this},playURL:function(t){var n=this,r=this.find(".storage").storage("match",t);if(r&&r.storage("expose","Already open"))return this;e.ajax({url:t.url,type:"GET",data:{format:"json"},success:function(e){function i(e){for(var n=0;n<e.length;n++){var i=e[n];t[i]&&(r[i]=t[i])}}var r;if(typeof e=="string")r={data:e},r.st_type="external";else{if(typeof e!="object"||typeof e.data!="string"){alert("Invalid data");return}r=e,r.st_type="filesys"}r.url=t.url,i(["line","regex","showAllMatches","newTab","noHistory","prompt"]),n.swish("setSource",r)},error:function(e){i.ajaxError(e)}})},setSource:function(e){u("source",e),this.find(".storage").storage("match",e)||this.swish("exitFullscreen")&&u("source",e)},openExampleFunction:function(e){var t=this;return e.type=="divider"?"--":e.type=="store"?function(){o.playFile.call(t,e.file)}:function(){o.playURL.call(t,{url:e.href})}},populateExamples:function(n,r){var i=this;return i.off("examples-changed").on("examples-changed",function(){e("#navbar").navbar("clearDropdown",r),i.swish("populateExamples",n,r)}),e.ajax(t.http.locations.swish_examples,{dataType:"json",success:function(t){for(var n=0;n<t.length;n++){var s=t[n],o,u;if(s=="--"||s.type=="divider")o="--",u="--";else{var a=s.file||s.href;o=s.title,u=i.swish("openExampleFunction",s),a&&(u.typeIcon=a.split(".").pop())}e("#navbar").navbar("extendDropdown",r,o,u)}}}),this},prologSource:function(){var t=[],n;return(n=e(".prolog-editor").prologEditor("getSource","source"))&&t.push(n),(n=e(".background.prolog.source").text())&&t.push(n),t.join("\n\n")},breakpoints:function(e){return this.find(".prolog-editor").prologEditor("getBreakpoints",e)||[]},tabData:function(e){return e=e||{},e.active?this.find(".tab-pane.active .storage").storage("getData",e):this.find(".storage").storage("getData",e)},examples:function(t){var n=e(".examples.prolog").text();if(n)return e().prologEditor("getExamples",n,!1);if(t!=1)return function(){return e(".prolog-editor").prologEditor("getExamples")}},fullscreen:function(t){if(!t.hasClass("fullscreen")){var n=this.find(".container.swish");t.addClass("fullscreen hamburger"),t.data("fullscreen_origin",t.parent()[0]),e(n.children()[0]).hide(),n.append(t)}return this},exitFullscreen:function(){var t=this.find(".container.swish"),n=e(t.children()[1]);return n&&n.hasClass("fullscreen")?(n.removeClass("fullscreen hamburger"),e(n.data("fullscreen_origin")).append(n),e.removeData(n,"fullscreen_origin"),e(t.children()[0]).show(),!0):!1},collaborate:function(){var t=this;return e(this).attr("data-end-togetherjs-html","End collaboration"),require(["https://togetherjs.com/togetherjs-min.js"],function(){TogetherJS(t)}),this}};e.fn.swish=function(t){if(o[t])return o[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return o._init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery."+n)}}(jQuery)}),require.config({urlArgs:"ts="+(new Date).getTime(),waitSeconds:60,paths:{jquery:"../bower_components/jquery/dist/jquery.min","jquery-ui":"../bower_components/jquery-ui/jquery-ui.min",laconic:"../bower_components/laconic/laconic",bootstrap:"../bower_components/bootstrap/dist/js/bootstrap.min",typeahead:"../bower_components/typeahead.js/dist/typeahead.bundle.min",splitter:"../bower_components/jquery.splitter/js/jquery.splitter-0.15.0",tagmanager:"../bower_components/tagmanager/tagmanager",sha1:"../bower_components/js-sha1/src/sha1",c3:"../bower_components/c3/c3",d3:"../bower_components/d3/d3","svg-pan-zoom":"../bower_components/svg-pan-zoom/dist/svg-pan-zoom.min",sparkline:"../bower_components/sparkline/dist/jquery.sparkline","cm/mode/prolog":"codemirror/mode/prolog","cm/addon/hover/prolog-hover":"codemirror/addon/hover/prolog-hover","cm/addon/hover/text-hover":"codemirror/addon/hover/text-hover","cm/addon/hint/templates-hint":"codemirror/addon/hint/templates-hint","cm/addon/hint/show-context-info":"codemirror/addon/hint/show-context-info",cm:"../bower_components/codemirror"},shim:{bootstrap:{deps:["jquery"]},typeahead:{deps:["jquery"]},splitter:{deps:["jquery"]},laconic:{deps:["jquery"]},tagmanager:{deps:["jquery"]}}}),require(["jquery","config","jswish"],function(e,t,n){require([t.http.locations.pengines+"/pengines.js"],function(){e(function(){e("body").swish(t.swish||{})})})}),define("swish",function(){});
\ No newline at end of file
+!function(e,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){function v(e,t){t=t||r;var n=t.createElement("script");n.text=e,t.head.appendChild(n).parentNode.removeChild(n)}function S(e){var t=!!e&&"length"in e&&e.length,n=g.type(e);return"function"!==n&&!g.isWindow(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function A(e,t,n){return g.isFunction(t)?g.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?g.grep(e,function(e){return e===t!==n}):"string"!=typeof t?g.grep(e,function(e){return a.call(t,e)>-1!==n}):L.test(t)?g.filter(t,e,n):(t=g.filter(t,e),g.grep(e,function(e){return a.call(t,e)>-1!==n&&1===e.nodeType}))}function H(e,t){while((e=e[t])&&1!==e.nodeType);return e}function j(e){var t={};return g.each(e.match(B)||[],function(e,n){t[n]=!0}),t}function F(e){return e}function I(e){throw e}function q(e,t,n){var r;try{e&&g.isFunction(r=e.promise)?r.call(e).done(t).fail(n):e&&g.isFunction(r=e.then)?r.call(e,t,n):t.call(void 0,e)}catch(e){n.call(void 0,e)}}function z(){r.removeEventListener("DOMContentLoaded",z),e.removeEventListener("load",z),g.ready()}function V(){this.expando=g.expando+V.uid++}function G(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:K.test(e)?JSON.parse(e):e)}function Y(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(Q,"-$&").toLowerCase(),n=e.getAttribute(r),"string"==typeof n){try{n=G(n)}catch(i){}J.set(e,t,n)}else n=void 0;return n}function it(e,t,n,r){var i,s=1,o=20,u=r?function(){return r.cur()}:function(){return g.css(e,t,"")},a=u(),f=n&&n[3]||(g.cssNumber[t]?"":"px"),l=(g.cssNumber[t]||"px"!==f&&+a)&&et.exec(g.css(e,t));if(l&&l[3]!==f){f=f||l[3],n=n||[],l=+a||1;do s=s||".5",l/=s,g.style(e,t,l+f);while(s!==(s=u()/a)&&1!==s&&--o)}return n&&(l=+l||+a||0,i=n[1]?l+(n[1]+1)*n[2]:+n[2],r&&(r.unit=f,r.start=l,r.end=i)),i}function ot(e){var t,n=e.ownerDocument,r=e.nodeName,i=st[r];return i?i:(t=n.body.appendChild(n.createElement(r)),i=g.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),st[r]=i,i)}function ut(e,t){for(var n,r,i=[],s=0,o=e.length;s<o;s++)r=e[s],r.style&&(n=r.style.display,t?("none"===n&&(i[s]=$.get(r,"display")||null,i[s]||(r.style.display="")),""===r.style.display&&nt(r)&&(i[s]=ot(r))):"none"!==n&&(i[s]="none",$.set(r,"display",n)));for(s=0;s<o;s++)null!=i[s]&&(e[s].style.display=i[s]);return e}function ht(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&g.nodeName(e,t)?g.merge([e],n):n}function pt(e,t){for(var n=0,r=e.length;n<r;n++)$.set(e[n],"globalEval",!t||$.get(t[n],"globalEval"))}function vt(e,t,n,r,i){for(var s,o,u,a,f,l,c=t.createDocumentFragment(),h=[],p=0,d=e.length;p<d;p++)if(s=e[p],s||0===s)if("object"===g.type(s))g.merge(h,s.nodeType?[s]:s);else if(dt.test(s)){o=o||c.appendChild(t.createElement("div")),u=(ft.exec(s)||["",""])[1].toLowerCase(),a=ct[u]||ct._default,o.innerHTML=a[1]+g.htmlPrefilter(s)+a[2],l=a[0];while(l--)o=o.lastChild;g.merge(h,o.childNodes),o=c.firstChild,o.textContent=""}else h.push(t.createTextNode(s));c.textContent="",p=0;while(s=h[p++])if(r&&g.inArray(s,r)>-1)i&&i.push(s);else if(f=g.contains(s.ownerDocument,s),o=ht(c.appendChild(s),"script"),f&&pt(o),n){l=0;while(s=o[l++])lt.test(s.type||"")&&n.push(s)}return c}function wt(){return!0}function Et(){return!1}function St(){try{return r.activeElement}catch(e){}}function xt(e,t,n,r,i,s){var o,u;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(u in t)xt(e,u,n,r,t[u],s);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),i===!1)i=Et;else if(!i)return e;return 1===s&&(o=i,i=function(e){return g().off(e),o.apply(this,arguments)},i.guid=o.guid||(o.guid=g.guid++)),e.each(function(){g.event.add(this,t,i,r,n)})}function At(e,t){return g.nodeName(e,"table")&&g.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e:e}function Ot(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Mt(e){var t=kt.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function _t(e,t){var n,r,i,s,o,u,a,f;if(1===t.nodeType){if($.hasData(e)&&(s=$.access(e),o=$.set(t,s),f=s.events)){delete o.handle,o.events={};for(i in f)for(n=0,r=f[i].length;n<r;n++)g.event.add(t,i,f[i][n])}J.hasData(e)&&(u=J.access(e),a=g.extend({},u),J.set(t,a))}}function Dt(e,t){var n=t.nodeName.toLowerCase();"input"===n&&at.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function Pt(e,t,n,r){t=o.apply([],t);var i,s,u,a,f,l,c=0,h=e.length,p=h-1,m=t[0],y=g.isFunction(m);if(y||h>1&&"string"==typeof m&&!d.checkClone&&Ct.test(m))return e.each(function(i){var s=e.eq(i);y&&(t[0]=m.call(this,i,s.html())),Pt(s,t,n,r)});if(h&&(i=vt(t,e[0].ownerDocument,!1,e,r),s=i.firstChild,1===i.childNodes.length&&(i=s),s||r)){for(u=g.map(ht(i,"script"),Ot),a=u.length;c<h;c++)f=i,c!==p&&(f=g.clone(f,!0,!0),a&&g.merge(u,ht(f,"script"))),n.call(e[c],f,c);if(a)for(l=u[u.length-1].ownerDocument,g.map(u,Mt),c=0;c<a;c++)f=u[c],lt.test(f.type||"")&&!$.access(f,"globalEval")&&g.contains(l,f)&&(f.src?g._evalUrl&&g._evalUrl(f.src):v(f.textContent.replace(Lt,""),l))}return e}function Ht(e,t,n){for(var r,i=t?g.filter(t,e):e,s=0;null!=(r=i[s]);s++)n||1!==r.nodeType||g.cleanData(ht(r)),r.parentNode&&(n&&g.contains(r.ownerDocument,r)&&pt(ht(r,"script")),r.parentNode.removeChild(r));return e}function It(e,t,n){var r,i,s,o,u=e.style;return n=n||Ft(e),n&&(o=n.getPropertyValue(t)||n[t],""!==o||g.contains(e.ownerDocument,e)||(o=g.style(e,t)),!d.pixelMarginRight()&&jt.test(o)&&Bt.test(t)&&(r=u.width,i=u.minWidth,s=u.maxWidth,u.minWidth=u.maxWidth=u.width=o,o=n.width,u.width=r,u.minWidth=i,u.maxWidth=s)),void 0!==o?o+"":o}function qt(e,t){return{get:function(){return e()?void delete this.get:(this.get=t).apply(this,arguments)}}}function Vt(e){if(e in Xt)return e;var t=e[0].toUpperCase()+e.slice(1),n=Wt.length;while(n--)if(e=Wt[n]+t,e in Xt)return e}function $t(e,t,n){var r=et.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Jt(e,t,n,r,i){var s,o=0;for(s=n===(r?"border":"content")?4:"width"===t?1:0;s<4;s+=2)"margin"===n&&(o+=g.css(e,n+tt[s],!0,i)),r?("content"===n&&(o-=g.css(e,"padding"+tt[s],!0,i)),"margin"!==n&&(o-=g.css(e,"border"+tt[s]+"Width",!0,i))):(o+=g.css(e,"padding"+tt[s],!0,i),"padding"!==n&&(o+=g.css(e,"border"+tt[s]+"Width",!0,i)));return o}function Kt(e,t,n){var r,i=!0,s=Ft(e),o="border-box"===g.css(e,"boxSizing",!1,s);if(e.getClientRects().length&&(r=e.getBoundingClientRect()[t]),r<=0||null==r){if(r=It(e,t,s),(r<0||null==r)&&(r=e.style[t]),jt.test(r))return r;i=o&&(d.boxSizingReliable()||r===e.style[t]),r=parseFloat(r)||0}return r+Jt(e,t,n||(o?"border":"content"),i,s)+"px"}function Qt(e,t,n,r,i){return new Qt.prototype.init(e,t,n,r,i)}function tn(){Yt&&(e.requestAnimationFrame(tn),g.fx.tick())}function nn(){return e.setTimeout(function(){Gt=void 0}),Gt=g.now()}function rn(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)n=tt[r],i["margin"+n]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function sn(e,t,n){for(var r,i=(an.tweeners[t]||[]).concat(an.tweeners["*"]),s=0,o=i.length;s<o;s++)if(r=i[s].call(n,t,e))return r}function on(e,t,n){var r,i,s,o,u,a,f,l,c="width"in t||"height"in t,h=this,p={},d=e.style,v=e.nodeType&&nt(e),m=$.get(e,"fxshow");n.queue||(o=g._queueHooks(e,"fx"),null==o.unqueued&&(o.unqueued=0,u=o.empty.fire,o.empty.fire=function(){o.unqueued||u()}),o.unqueued++,h.always(function(){h.always(function(){o.unqueued--,g.queue(e,"fx").length||o.empty.fire()})}));for(r in t)if(i=t[r],Zt.test(i)){if(delete t[r],s=s||"toggle"===i,i===(v?"hide":"show")){if("show"!==i||!m||void 0===m[r])continue;v=!0}p[r]=m&&m[r]||g.style(e,r)}if(a=!g.isEmptyObject(t),a||!g.isEmptyObject(p)){c&&1===e.nodeType&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],f=m&&m.display,null==f&&(f=$.get(e,"display")),l=g.css(e,"display"),"none"===l&&(f?l=f:(ut([e],!0),f=e.style.display||f,l=g.css(e,"display"),ut([e]))),("inline"===l||"inline-block"===l&&null!=f)&&"none"===g.css(e,"float")&&(a||(h.done(function(){d.display=f}),null==f&&(l=d.display,f="none"===l?"":l)),d.display="inline-block")),n.overflow&&(d.overflow="hidden",h.always(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]})),a=!1;for(r in p)a||(m?"hidden"in m&&(v=m.hidden):m=$.access(e,"fxshow",{display:f}),s&&(m.hidden=!v),v&&ut([e],!0),h.done(function(){v||ut([e]),$.remove(e,"fxshow");for(r in p)g.style(e,r,p[r])})),a=sn(v?m[r]:0,r,h),r in m||(m[r]=a.start,v&&(a.end=a.start,a.start=0))}}function un(e,t){var n,r,i,s,o;for(n in e)if(r=g.camelCase(n),i=t[r],s=e[n],g.isArray(s)&&(i=s[1],s=e[n]=s[0]),n!==r&&(e[r]=s,delete e[n]),o=g.cssHooks[r],o&&"expand"in o){s=o.expand(s),delete e[r];for(n in s)n in e||(e[n]=s[n],t[n]=i)}else t[r]=i}function an(e,t,n){var r,i,s=0,o=an.prefilters.length,u=g.Deferred().always(function(){delete a.elem}),a=function(){if(i)return!1;for(var t=Gt||nn(),n=Math.max(0,f.startTime+f.duration-t),r=n/f.duration||0,s=1-r,o=0,a=f.tweens.length;o<a;o++)f.tweens[o].run(s);return u.notifyWith(e,[f,s,n]),s<1&&a?n:(u.resolveWith(e,[f]),!1)},f=u.promise({elem:e,props:g.extend({},t),opts:g.extend(!0,{specialEasing:{},easing:g.easing._default},n),originalProperties:t,originalOptions:n,startTime:Gt||nn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=g.Tween(e,f.opts,t,n,f.opts.specialEasing[t]||f.opts.easing);return f.tweens.push(r),r},stop:function(t){var n=0,r=t?f.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)f.tweens[n].run(1);return t?(u.notifyWith(e,[f,1,0]),u.resolveWith(e,[f,t])):u.rejectWith(e,[f,t]),this}}),l=f.props;for(un(l,f.opts.specialEasing);s<o;s++)if(r=an.prefilters[s].call(f,e,l,f.opts))return g.isFunction(r.stop)&&(g._queueHooks(f.elem,f.opts.queue).stop=g.proxy(r.stop,r)),r;return g.map(l,sn,f),g.isFunction(f.opts.start)&&f.opts.start.call(e,f),g.fx.timer(g.extend(a,{elem:e,anim:f,queue:f.opts.queue})),f.progress(f.opts.progress).done(f.opts.done,f.opts.complete).fail(f.opts.fail).always(f.opts.always)}function pn(e){var t=e.match(B)||[];return t.join(" ")}function dn(e){return e.getAttribute&&e.getAttribute("class")||""}function Tn(e,t,n,r){var i;if(g.isArray(t))g.each(t,function(t,i){n||wn.test(e)?r(e,i):Tn(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)});else if(n||"object"!==g.type(t))r(e,t);else for(i in t)Tn(e+"["+i+"]",t[i],n,r)}function Bn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,s=t.toLowerCase().match(B)||[];if(g.isFunction(n))while(r=s[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function jn(e,t,n,r){function o(u){var a;return i[u]=!0,g.each(e[u]||[],function(e,u){var f=u(t,n,r);return"string"!=typeof f||s||i[f]?s?!(a=f):void 0:(t.dataTypes.unshift(f),o(f),!1)}),a}var i={},s=e===Dn;return o(t.dataTypes[0])||!i["*"]&&o("*")}function Fn(e,t){var n,r,i=g.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&g.extend(!0,e,r),e}function In(e,t,n){var r,i,s,o,u=e.contents,a=e.dataTypes;while("*"===a[0])a.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in u)if(u[i]&&u[i].test(r)){a.unshift(i);break}if(a[0]in n)s=a[0];else{for(i in n){if(!a[0]||e.converters[i+" "+a[0]]){s=i;break}o||(o=i)}s=s||o}if(s)return s!==a[0]&&a.unshift(s),n[s]}function qn(e,t,n,r){var i,s,o,u,a,f={},l=e.dataTypes.slice();if(l[1])for(o in e.converters)f[o.toLowerCase()]=e.converters[o];s=l.shift();while(s)if(e.responseFields[s]&&(n[e.responseFields[s]]=t),!a&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),a=s,s=l.shift())if("*"===s)s=a;else if("*"!==a&&a!==s){if(o=f[a+" "+s]||f["* "+s],!o)for(i in f)if(u=i.split(" "),u[1]===s&&(o=f[a+" "+u[0]]||f["* "+u[0]])){o===!0?o=f[i]:f[i]!==!0&&(s=u[0],l.unshift(u[1]));break}if(o!==!0)if(o&&e["throws"])t=o(t);else try{t=o(t)}catch(c){return{state:"parsererror",error:o?c:"No conversion from "+a+" to "+s}}}return{state:"success",data:t}}function Xn(e){return g.isWindow(e)?e:9===e.nodeType&&e.defaultView}var n=[],r=e.document,i=Object.getPrototypeOf,s=n.slice,o=n.concat,u=n.push,a=n.indexOf,f={},l=f.toString,c=f.hasOwnProperty,h=c.toString,p=h.call(Object),d={},m="3.1.1",g=function(e,t){return new g.fn.init(e,t)},y=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,b=/^-ms-/,w=/-([a-z])/g,E=function(e,t){return t.toUpperCase()};g.fn=g.prototype={jquery:m,constructor:g,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=g.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return g.each(this,e)},map:function(e){return this.pushStack(g.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:n.sort,splice:n.splice},g.extend=g.fn.extend=function(){var e,t,n,r,i,s,o=arguments[0]||{},u=1,a=arguments.length,f=!1;for("boolean"==typeof o&&(f=o,o=arguments[u]||{},u++),"object"==typeof o||g.isFunction(o)||(o={}),u===a&&(o=this,u--);u<a;u++)if(null!=(e=arguments[u]))for(t in e)n=o[t],r=e[t],o!==r&&(f&&r&&(g.isPlainObject(r)||(i=g.isArray(r)))?(i?(i=!1,s=n&&g.isArray(n)?n:[]):s=n&&g.isPlainObject(n)?n:{},o[t]=g.extend(f,s,r)):void 0!==r&&(o[t]=r));return o},g.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return"function"===g.type(e)},isArray:Array.isArray,isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){var t=g.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},isPlainObject:function(e){var t,n;return!!e&&"[object Object]"===l.call(e)&&(!(t=i(e))||(n=c.call(t,"constructor")&&t.constructor,"function"==typeof n&&h.call(n)===p))},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?f[l.call(e)]||"object":typeof e},globalEval:function(e){v(e)},camelCase:function(e){return e.replace(b,"ms-").replace(w,E)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t){var n,r=0;if(S(e)){for(n=e.length;r<n;r++)if(t.call(e[r],r,e[r])===!1)break}else for(r in e)if(t.call(e[r],r,e[r])===!1)break;return e},trim:function(e){return null==e?"":(e+"").replace(y,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(S(Object(e))?g.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:a.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r,i=[],s=0,o=e.length,u=!n;s<o;s++)r=!t(e[s],s),r!==u&&i.push(e[s]);return i},map:function(e,t,n){var r,i,s=0,u=[];if(S(e))for(r=e.length;s<r;s++)i=t(e[s],s,n),null!=i&&u.push(i);else for(s in e)i=t(e[s],s,n),null!=i&&u.push(i);return o.apply([],u)},guid:1,proxy:function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),g.isFunction(e))return r=s.call(arguments,2),i=function(){return e.apply(t||this,r.concat(s.call(arguments)))},i.guid=e.guid=e.guid||g.guid++,i},now:Date.now,support:d}),"function"==typeof Symbol&&(g.fn[Symbol.iterator]=n[Symbol.iterator]),g.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){f["[object "+t+"]"]=t.toLowerCase()});var x=function(e){function ot(e,t,r,i){var s,u,f,l,c,d,g,y=t&&t.ownerDocument,S=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==S&&9!==S&&11!==S)return r;if(!i&&((t?t.ownerDocument||t:E)!==p&&h(t),t=t||p,v)){if(11!==S&&(c=G.exec(e)))if(s=c[1]){if(9===S){if(!(f=t.getElementById(s)))return r;if(f.id===s)return r.push(f),r}else if(y&&(f=y.getElementById(s))&&b(t,f)&&f.id===s)return r.push(f),r}else{if(c[2])return _.apply(r,t.getElementsByTagName(e)),r;if((s=c[3])&&n.getElementsByClassName&&t.getElementsByClassName)return _.apply(r,t.getElementsByClassName(s)),r}if(n.qsa&&!C[e+" "]&&(!m||!m.test(e))){if(1!==S)y=t,g=e;else if("object"!==t.nodeName.toLowerCase()){(l=t.getAttribute("id"))?l=l.replace(tt,nt):t.setAttribute("id",l=w),d=o(e),u=d.length;while(u--)d[u]="#"+l+" "+yt(d[u]);g=d.join(","),y=Y.test(e)&&mt(t.parentNode)||t}if(g)try{return _.apply(r,y.querySelectorAll(g)),r}catch(x){}finally{l===w&&t.removeAttribute("id")}}}return a(e.replace(R,"$1"),t,r,i)}function ut(){function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}var e=[];return t}function at(e){return e[w]=!0,e}function ft(e){var t=p.createElement("fieldset");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function lt(e,t){var n=e.split("|"),i=n.length;while(i--)r.attrHandle[n[i]]=t}function ct(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ht(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function pt(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function dt(e){return function(t){return"form"in t?t.parentNode&&t.disabled===!1?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&it(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function vt(e){return at(function(t){return t=+t,at(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function mt(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function gt(){}function yt(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function bt(e,t,n){var r=t.dir,i=t.next,s=i||r,o=n&&"parentNode"===s,u=x++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||o)return e(t,n,i);return!1}:function(t,n,a){var f,l,c,h=[S,u];if(a){while(t=t[r])if((1===t.nodeType||o)&&e(t,n,a))return!0}else while(t=t[r])if(1===t.nodeType||o)if(c=t[w]||(t[w]={}),l=c[t.uniqueID]||(c[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[r]||t;else{if((f=l[s])&&f[0]===S&&f[1]===u)return h[2]=f[2];if(l[s]=h,h[2]=e(t,n,a))return!0}return!1}}function wt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function Et(e,t,n){for(var r=0,i=t.length;r<i;r++)ot(e,t[r],n);return n}function St(e,t,n,r,i){for(var s,o=[],u=0,a=e.length,f=null!=t;u<a;u++)(s=e[u])&&(n&&!n(s,r,i)||(o.push(s),f&&t.push(u)));return o}function xt(e,t,n,r,i,s){return r&&!r[w]&&(r=xt(r)),i&&!i[w]&&(i=xt(i,s)),at(function(s,o,u,a){var f,l,c,h=[],p=[],d=o.length,v=s||Et(t||"*",u.nodeType?[u]:u,[]),m=!e||!s&&t?v:St(v,h,e,u,a),g=n?i||(s?e:d||r)?[]:o:m;if(n&&n(m,g,u,a),r){f=St(g,p),r(f,[],u,a),l=f.length;while(l--)(c=f[l])&&(g[p[l]]=!(m[p[l]]=c))}if(s){if(i||e){if(i){f=[],l=g.length;while(l--)(c=g[l])&&f.push(m[l]=c);i(null,g=[],f,a)}l=g.length;while(l--)(c=g[l])&&(f=i?P(s,c):h[l])>-1&&(s[f]=!(o[f]=c))}}else g=St(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):_.apply(o,g)})}function Tt(e){for(var t,n,i,s=e.length,o=r.relative[e[0].type],u=o||r.relative[" "],a=o?1:0,l=bt(function(e){return e===t},u,!0),c=bt(function(e){return P(t,e)>-1},u,!0),h=[function(e,n,r){var i=!o&&(r||n!==f)||((t=n).nodeType?l(e,n,r):c(e,n,r));return t=null,i}];a<s;a++)if(n=r.relative[e[a].type])h=[bt(wt(h),n)];else{if(n=r.filter[e[a].type].apply(null,e[a].matches),n[w]){for(i=++a;i<s;i++)if(r.relative[e[i].type])break;return xt(a>1&&wt(h),a>1&&yt(e.slice(0,a-1).concat({value:" "===e[a-2].type?"*":""})).replace(R,"$1"),n,a<i&&Tt(e.slice(a,i)),i<s&&Tt(e=e.slice(i)),i<s&&yt(e))}h.push(n)}return wt(h)}function Nt(e,t){var n=t.length>0,i=e.length>0,s=function(s,o,u,a,l){var c,d,m,g=0,y="0",b=s&&[],w=[],E=f,x=s||i&&r.find.TAG("*",l),T=S+=null==E?1:Math.random()||.1,N=x.length;for(l&&(f=o===p||o||l);y!==N&&null!=(c=x[y]);y++){if(i&&c){d=0,o||c.ownerDocument===p||(h(c),u=!v);while(m=e[d++])if(m(c,o||p,u)){a.push(c);break}l&&(S=T)}n&&((c=!m&&c)&&g--,s&&b.push(c))}if(g+=y,n&&y!==g){d=0;while(m=t[d++])m(b,w,o,u);if(s){if(g>0)while(y--)b[y]||w[y]||(w[y]=O.call(a));w=St(w)}_.apply(a,w),l&&!s&&w.length>0&&g+t.length>1&&ot.uniqueSort(a)}return l&&(S=T,f=E),b};return n?at(s):s}var t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w="sizzle"+1*new Date,E=e.document,S=0,x=0,T=ut(),N=ut(),C=ut(),k=function(e,t){return e===t&&(c=!0),0},L={}.hasOwnProperty,A=[],O=A.pop,M=A.push,_=A.push,D=A.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},H="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",B="[\\x20\\t\\r\\n\\f]",j="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",F="\\["+B+"*("+j+")(?:"+B+"*([*^$|!~]?=)"+B+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+j+"))|)"+B+"*\\]",I=":("+j+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+F+")*)|.*)\\)|)",q=new RegExp(B+"+","g"),R=new RegExp("^"+B+"+|((?:^|[^\\\\])(?:\\\\.)*)"+B+"+$","g"),U=new RegExp("^"+B+"*,"+B+"*"),z=new RegExp("^"+B+"*([>+~]|"+B+")"+B+"*"),W=new RegExp("="+B+"*([^\\]'\"]*?)"+B+"*\\]","g"),X=new RegExp(I),V=new RegExp("^"+j+"$"),$={ID:new RegExp("^#("+j+")"),CLASS:new RegExp("^\\.("+j+")"),TAG:new RegExp("^("+j+"|[*])"),ATTR:new RegExp("^"+F),PSEUDO:new RegExp("^"+I),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+B+"*(even|odd|(([+-]|)(\\d*)n|)"+B+"*(?:([+-]|)"+B+"*(\\d+)|))"+B+"*\\)|)","i"),bool:new RegExp("^(?:"+H+")$","i"),needsContext:new RegExp("^"+B+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+B+"*((?:-\\d)?\\d*)"+B+"*\\)|)(?=[^-]|$)","i")},J=/^(?:input|select|textarea|button)$/i,K=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,G=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Y=/[+~]/,Z=new RegExp("\\\\([\\da-f]{1,6}"+B+"?|("+B+")|.)","ig"),et=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},tt=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,nt=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},rt=function(){h()},it=bt(function(e){return e.disabled===!0&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{_.apply(A=D.call(E.childNodes),E.childNodes),A[E.childNodes.length].nodeType}catch(st){_={apply:A.length?function(e,t){M.apply(e,D.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}n=ot.support={},s=ot.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},h=ot.setDocument=function(e){var t,i,o=e?e.ownerDocument||e:E;return o!==p&&9===o.nodeType&&o.documentElement?(p=o,d=p.documentElement,v=!s(p),E!==p&&(i=p.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",rt,!1):i.attachEvent&&i.attachEvent("onunload",rt)),n.attributes=ft(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ft(function(e){return e.appendChild(p.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Q.test(p.getElementsByClassName),n.getById=ft(function(e){return d.appendChild(e).id=w,!p.getElementsByName||!p.getElementsByName(w).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(Z,et);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&v){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(Z,et);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&v){var n,r,i,s=t.getElementById(e);if(s){if(n=s.getAttributeNode("id"),n&&n.value===e)return[s];i=t.getElementsByName(e),r=0;while(s=i[r++])if(n=s.getAttributeNode("id"),n&&n.value===e)return[s]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,s=t.getElementsByTagName(e);if("*"===e){while(n=s[i++])1===n.nodeType&&r.push(n);return r}return s},r.find.CLASS=n.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&v)return t.getElementsByClassName(e)},g=[],m=[],(n.qsa=Q.test(p.querySelectorAll))&&(ft(function(e){d.appendChild(e).innerHTML="<a id='"+w+"'></a><select id='"+w+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+B+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||m.push("\\["+B+"*(?:value|"+H+")"),e.querySelectorAll("[id~="+w+"-]").length||m.push("~="),e.querySelectorAll(":checked").length||m.push(":checked"),e.querySelectorAll("a#"+w+"+*").length||m.push(".#.+[+~]")}),ft(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=p.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&m.push("name"+B+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&m.push(":enabled",":disabled"),d.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&m.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),m.push(",.*:")})),(n.matchesSelector=Q.test(y=d.matches||d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ft(function(e){n.disconnectedMatch=y.call(e,"*"),y.call(e,"[s!='']:x"),g.push("!=",I)}),m=m.length&&new RegExp(m.join("|")),g=g.length&&new RegExp(g.join("|")),t=Q.test(d.compareDocumentPosition),b=t||Q.test(d.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!!r&&1===r.nodeType&&!!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},k=t?function(e,t){if(e===t)return c=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r?r:(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&r||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===p||e.ownerDocument===E&&b(E,e)?-1:t===p||t.ownerDocument===E&&b(E,t)?1:l?P(l,e)-P(l,t):0:4&r?-1:1)}:function(e,t){if(e===t)return c=!0,0;var n,r=0,i=e.parentNode,s=t.parentNode,o=[e],u=[t];if(!i||!s)return e===p?-1:t===p?1:i?-1:s?1:l?P(l,e)-P(l,t):0;if(i===s)return ct(e,t);n=e;while(n=n.parentNode)o.unshift(n);n=t;while(n=n.parentNode)u.unshift(n);while(o[r]===u[r])r++;return r?ct(o[r],u[r]):o[r]===E?-1:u[r]===E?1:0},p):p},ot.matches=function(e,t){return ot(e,null,null,t)},ot.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&h(e),t=t.replace(W,"='$1']"),n.matchesSelector&&v&&!C[t+" "]&&(!g||!g.test(t))&&(!m||!m.test(t)))try{var r=y.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(i){}return ot(t,p,null,[e]).length>0},ot.contains=function(e,t){return(e.ownerDocument||e)!==p&&h(e),b(e,t)},ot.attr=function(e,t){(e.ownerDocument||e)!==p&&h(e);var i=r.attrHandle[t.toLowerCase()],s=i&&L.call(r.attrHandle,t.toLowerCase())?i(e,t,!v):void 0;return void 0!==s?s:n.attributes||!v?e.getAttribute(t):(s=e.getAttributeNode(t))&&s.specified?s.value:null},ot.escape=function(e){return(e+"").replace(tt,nt)},ot.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ot.uniqueSort=function(e){var t,r=[],i=0,s=0;if(c=!n.detectDuplicates,l=!n.sortStable&&e.slice(0),e.sort(k),c){while(t=e[s++])t===e[s]&&(i=r.push(s));while(i--)e.splice(r[i],1)}return l=null,e},i=ot.getText=function(e){var t,n="",r=0,s=e.nodeType;if(s){if(1===s||9===s||11===s){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===s||4===s)return e.nodeValue}else while(t=e[r++])n+=i(t);return n},r=ot.selectors={cacheLength:50,createPseudo:at,match:$,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Z,et),e[3]=(e[3]||e[4]||e[5]||"").replace(Z,et),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||ot.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&ot.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return $.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=o(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Z,et).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=T[e+" "];return t||(t=new RegExp("(^|"+B+")"+e+"("+B+"|$)"))&&T(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=ot.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(q," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var s="nth"!==e.slice(0,3),o="last"!==e.slice(-4),u="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,a){var f,l,c,h,p,d,v=s!==o?"nextSibling":"previousSibling",m=t.parentNode,g=u&&t.nodeName.toLowerCase(),y=!a&&!u,b=!1;if(m){if(s){while(v){h=t;while(h=h[v])if(u?h.nodeName.toLowerCase()===g:1===h.nodeType)return!1;d=v="only"===e&&!d&&"nextSibling"}return!0}if(d=[o?m.firstChild:m.lastChild],o&&y){h=m,c=h[w]||(h[w]={}),l=c[h.uniqueID]||(c[h.uniqueID]={}),f=l[e]||[],p=f[0]===S&&f[1],b=p&&f[2],h=p&&m.childNodes[p];while(h=++p&&h&&h[v]||(b=p=0)||d.pop())if(1===h.nodeType&&++b&&h===t){l[e]=[S,p,b];break}}else if(y&&(h=t,c=h[w]||(h[w]={}),l=c[h.uniqueID]||(c[h.uniqueID]={}),f=l[e]||[],p=f[0]===S&&f[1],b=p),b===!1)while(h=++p&&h&&h[v]||(b=p=0)||d.pop())if((u?h.nodeName.toLowerCase()===g:1===h.nodeType)&&++b&&(y&&(c=h[w]||(h[w]={}),l=c[h.uniqueID]||(c[h.uniqueID]={}),l[e]=[S,b]),h===t))break;return b-=i,b===r||b%r===0&&b/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||ot.error("unsupported pseudo: "+e);return i[w]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?at(function(e,n){var r,s=i(e,t),o=s.length;while(o--)r=P(e,s[o]),e[r]=!(n[r]=s[o])}):function(e){return i(e,0,n)}):i}},pseudos:{not:at(function(e){var t=[],n=[],r=u(e.replace(R,"$1"));return r[w]?at(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)(s=o[u])&&(e[u]=!(t[u]=s))}):function(e,i,s){return t[0]=e,r(t,null,s,n),t[0]=null,!n.pop()}}),has:at(function(e){return function(t){return ot(e,t).length>0}}),contains:at(function(e){return e=e.replace(Z,et),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:at(function(e){return V.test(e||"")||ot.error("unsupported lang: "+e),e=e.replace(Z,et).toLowerCase(),function(t){var n;do if(n=v?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:dt(!1),disabled:dt(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return K.test(e.nodeName)},input:function(e){return J.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:vt(function(){return[0]}),last:vt(function(e,t){return[t-1]}),eq:vt(function(e,t,n){return[n<0?n+t:n]}),even:vt(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:vt(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:vt(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:vt(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}},r.pseudos.nth=r.pseudos.eq;for(t in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=ht(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=pt(t);return gt.prototype=r.filters=r.pseudos,r.setFilters=new gt,o=ot.tokenize=function(e,t){var n,i,s,o,u,a,f,l=N[e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=r.preFilter;while(u){n&&!(i=U.exec(u))||(i&&(u=u.slice(i[0].length)||u),a.push(s=[])),n=!1,(i=z.exec(u))&&(n=i.shift(),s.push({value:n,type:i[0].replace(R," ")}),u=u.slice(n.length));for(o in r.filter)!(i=$[o].exec(u))||f[o]&&!(i=f[o](i))||(n=i.shift(),s.push({value:n,type:o,matches:i}),u=u.slice(n.length));if(!n)break}return t?u.length:u?ot.error(e):N(e,a).slice(0)},u=ot.compile=function(e,t){var n,r=[],i=[],s=C[e+" "];if(!s){t||(t=o(e)),n=t.length;while(n--)s=Tt(t[n]),s[w]?r.push(s):i.push(s);s=C(e,Nt(i,r)),s.selector=e}return s},a=ot.select=function(e,t,n,i){var s,a,f,l,c,h="function"==typeof e&&e,p=!i&&o(e=h.selector||e);if(n=n||[],1===p.length){if(a=p[0]=p[0].slice(0),a.length>2&&"ID"===(f=a[0]).type&&9===t.nodeType&&v&&r.relative[a[1].type]){if(t=(r.find.ID(f.matches[0].replace(Z,et),t)||[])[0],!t)return n;h&&(t=t.parentNode),e=e.slice(a.shift().value.length)}s=$.needsContext.test(e)?0:a.length;while(s--){if(f=a[s],r.relative[l=f.type])break;if((c=r.find[l])&&(i=c(f.matches[0].replace(Z,et),Y.test(a[0].type)&&mt(t.parentNode)||t))){if(a.splice(s,1),e=i.length&&yt(a),!e)return _.apply(n,i),n;break}}}return(h||u(e,p))(i,t,!v,n,!t||Y.test(e)&&mt(t.parentNode)||t),n},n.sortStable=w.split("").sort(k).join("")===w,n.detectDuplicates=!!c,h(),n.sortDetached=ft(function(e){return 1&e.compareDocumentPosition(p.createElement("fieldset"))}),ft(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||lt("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ft(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||lt("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ft(function(e){return null==e.getAttribute("disabled")})||lt(H,function(e,t,n){var r;if(!n)return e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),ot}(e);g.find=x,g.expr=x.selectors,g.expr[":"]=g.expr.pseudos,g.uniqueSort=g.unique=x.uniqueSort,g.text=x.getText,g.isXMLDoc=x.isXML,g.contains=x.contains,g.escapeSelector=x.escape;var T=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&g(e).is(n))break;r.push(e)}return r},N=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},C=g.expr.match.needsContext,k=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,L=/^.[^:#\[\.,]*$/;g.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?g.find.matchesSelector(r,e)?[r]:[]:g.find.matches(e,g.grep(t,function(e){return 1===e.nodeType}))},g.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(g(e).filter(function(){for(t=0;t<r;t++)if(g.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)g.find(e,i[t],n);return r>1?g.uniqueSort(n):n},filter:function(e){return this.pushStack(A(this,e||[],!1))},not:function(e){return this.pushStack(A(this,e||[],!0))},is:function(e){return!!A(this,"string"==typeof e&&C.test(e)?g(e):e||[],!1).length}});var O,M=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,_=g.fn.init=function(e,t,n){var i,s;if(!e)return this;if(n=n||O,"string"==typeof e){if(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:M.exec(e),!i||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof g?t[0]:t,g.merge(this,g.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:r,!0)),k.test(i[1])&&g.isPlainObject(t))for(i in t)g.isFunction(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return s=r.getElementById(i[2]),s&&(this[0]=s,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):g.isFunction(e)?void 0!==n.ready?n.ready(e):e(g):g.makeArray(e,this)};_.prototype=g.fn,O=g(r);var D=/^(?:parents|prev(?:Until|All))/,P={children:!0,contents:!0,next:!0,prev:!0};g.fn.extend({has:function(e){var t=g(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(g.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,s=[],o="string"!=typeof e&&g(e);if(!C.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(o?o.index(n)>-1:1===n.nodeType&&g.find.matchesSelector(n,e))){s.push(n);break}return this.pushStack(s.length>1?g.uniqueSort(s):s)},index:function(e){return e?"string"==typeof e?a.call(g(e),this[0]):a.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(g.uniqueSort(g.merge(this.get(),g(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),g.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return T(e,"parentNode")},parentsUntil:function(e,t,n){return T(e,"parentNode",n)},next:function(e){return H(e,"nextSibling")},prev:function(e){return H(e,"previousSibling")},nextAll:function(e){return T(e,"nextSibling")},prevAll:function(e){return T(e,"previousSibling")},nextUntil:function(e,t,n){return T(e,"nextSibling",n)},prevUntil:function(e,t,n){return T(e,"previousSibling",n)},siblings:function(e){return N((e.parentNode||{}).firstChild,e)},children:function(e){return N(e.firstChild)},contents:function(e){return e.contentDocument||g.merge([],e.childNodes)}},function(e,t){g.fn[e]=function(n,r){var i=g.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=g.filter(r,i)),this.length>1&&(P[e]||g.uniqueSort(i),D.test(e)&&i.reverse()),this.pushStack(i)}});var B=/[^\x20\t\r\n\f]+/g;g.Callbacks=function(e){e="string"==typeof e?j(e):g.extend({},e);var t,n,r,i,s=[],o=[],u=-1,a=function(){for(i=e.once,r=t=!0;o.length;u=-1){n=o.shift();while(++u<s.length)s[u].apply(n[0],n[1])===!1&&e.stopOnFalse&&(u=s.length,n=!1)}e.memory||(n=!1),t=!1,i&&(s=n?[]:"")},f={add:function(){return s&&(n&&!t&&(u=s.length-1,o.push(n)),function r(t){g.each(t,function(t,n){g.isFunction(n)?e.unique&&f.has(n)||s.push(n):n&&n.length&&"string"!==g.type(n)&&r(n)})}(arguments),n&&!t&&a()),this},remove:function(){return g.each(arguments,function(e,t){var n;while((n=g.inArray(t,s,n))>-1)s.splice(n,1),n<=u&&u--}),this},has:function(e){return e?g.inArray(e,s)>-1:s.length>0},empty:function(){return s&&(s=[]),this},disable:function(){return i=o=[],s=n="",this},disabled:function(){return!s},lock:function(){return i=o=[],n||t||(s=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=n||[],n=[e,n.slice?n.slice():n],o.push(n),t||a()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!r}};return f},g.extend({Deferred:function(t){var n=[["notify","progress",g.Callbacks("memory"),g.Callbacks("memory"),2],["resolve","done",g.Callbacks("once memory"),g.Callbacks("once memory"),0,"resolved"],["reject","fail",g.Callbacks("once memory"),g.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return i.then(null,e)},pipe:function(){var e=arguments;return g.Deferred(function(t){g.each(n,function(n,r){var i=g.isFunction(e[r[4]])&&e[r[4]];s[r[1]](function(){var e=i&&i.apply(this,arguments);e&&g.isFunction(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,r,i){function o(t,n,r,i){return function(){var u=this,a=arguments,f=function(){var e,f;if(!(t<s)){if(e=r.apply(u,a),e===n.promise())throw new TypeError("Thenable self-resolution");f=e&&("object"==typeof e||"function"==typeof e)&&e.then,g.isFunction(f)?i?f.call(e,o(s,n,F,i),o(s,n,I,i)):(s++,f.call(e,o(s,n,F,i),o(s,n,I,i),o(s,n,F,n.notifyWith))):(r!==F&&(u=void 0,a=[e]),(i||n.resolveWith)(u,a))}},l=i?f:function(){try{f()}catch(e){g.Deferred.exceptionHook&&g.Deferred.exceptionHook(e,l.stackTrace),t+1>=s&&(r!==I&&(u=void 0,a=[e]),n.rejectWith(u,a))}};t?l():(g.Deferred.getStackHook&&(l.stackTrace=g.Deferred.getStackHook()),e.setTimeout(l))}}var s=0;return g.Deferred(function(e){n[0][3].add(o(0,e,g.isFunction(i)?i:F,e.notifyWith)),n[1][3].add(o(0,e,g.isFunction(t)?t:F)),n[2][3].add(o(0,e,g.isFunction(r)?r:I))}).promise()},promise:function(e){return null!=e?g.extend(e,i):i}},s={};return g.each(n,function(e,t){var o=t[2],u=t[5];i[t[1]]=o.add,u&&o.add(function(){r=u},n[3-e][2].disable,n[0][2].lock),o.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=o.fireWith}),i.promise(s),t&&t.call(s,s),s},when:function(e){var t=arguments.length,n=t,r=Array(n),i=s.call(arguments),o=g.Deferred(),u=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?s.call(arguments):n,--t||o.resolveWith(r,i)}};if(t<=1&&(q(e,o.done(u(n)).resolve,o.reject),"pending"===o.state()||g.isFunction(i[n]&&i[n].then)))return o.then();while(n--)q(i[n],u(n),o.reject);return o.promise()}});var R=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;g.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&R.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},g.readyException=function(t){e.setTimeout(function(){throw t})};var U=g.Deferred();g.fn.ready=function(e){return U.then(e)["catch"](function(e){g.readyException(e)}),this},g.extend({isReady:!1,readyWait:1,holdReady:function(e){e?g.readyWait++:g.ready(!0)},ready:function(e){(e===!0?--g.readyWait:g.isReady)||(g.isReady=!0,e!==!0&&--g.readyWait>0||U.resolveWith(r,[g]))}}),g.ready.then=U.then,"complete"===r.readyState||"loading"!==r.readyState&&!r.documentElement.doScroll?e.setTimeout(g.ready):(r.addEventListener("DOMContentLoaded",z),e.addEventListener("load",z));var W=function(e,t,n,r,i,s,o){var u=0,a=e.length,f=null==n;if("object"===g.type(n)){i=!0;for(u in n)W(e,t,u,n[u],!0,s,o)}else if(void 0!==r&&(i=!0,g.isFunction(r)||(o=!0),f&&(o?(t.call(e,r),t=null):(f=t,t=function(e,t,n){return f.call(g(e),n)})),t))for(;u<a;u++)t(e[u],n,o?r:r.call(e[u],u,t(e[u],n)));return i?e:f?t.call(e):a?t(e[0],n):s},X=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};V.uid=1,V.prototype={cache:function(e){var t=e[this.expando];return t||(t={},X(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[g.camelCase(t)]=n;else for(r in t)i[g.camelCase(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][g.camelCase(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){g.isArray(t)?t=t.map(g.camelCase):(t=g.camelCase(t),t=t in r?[t]:t.match(B)||[]),n=t.length;while(n--)delete r[t[n]]}(void 0===t||g.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!g.isEmptyObject(t)}};var $=new V,J=new V,K=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Q=/[A-Z]/g;g.extend({hasData:function(e){return J.hasData(e)||$.hasData(e)},data:function(e,t,n){return J.access(e,t,n)},removeData:function(e,t){J.remove(e,t)},_data:function(e,t,n){return $.access(e,t,n)},_removeData:function(e,t){$.remove(e,t)}}),g.fn.extend({data:function(e,t){var n,r,i,s=this[0],o=s&&s.attributes;if(void 0===e){if(this.length&&(i=J.get(s),1===s.nodeType&&!$.get(s,"hasDataAttrs"))){n=o.length;while(n--)o[n]&&(r=o[n].name,0===r.indexOf("data-")&&(r=g.camelCase(r.slice(5)),Y(s,r,i[r])));$.set(s,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){J.set(this,e)}):W(this,function(t){var n;if(s&&void 0===t){if(n=J.get(s,e),void 0!==n)return n;if(n=Y(s,e),void 0!==n)return n}else this.each(function(){J.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){J.remove(this,e)})}}),g.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=$.get(e,t),n&&(!r||g.isArray(n)?r=$.access(e,t,g.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=g.queue(e,t),r=n.length,i=n.shift(),s=g._queueHooks(e,t),o=function(){g.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return $.get(e,n)||$.access(e,n,{empty:g.Callbacks("once memory").add(function(){$.remove(e,[t+"queue",n])})})}}),g.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?g.queue(this[0],e):void 0===t?this:this.each(function(){var n=g.queue(this,e,t);g._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&g.dequeue(this,e)})},dequeue:function(e){return this.each(function(){g.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=g.Deferred(),s=this,o=this.length,u=function(){--r||i.resolveWith(s,[s])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(o--)n=$.get(s[o],e+"queueHooks"),n&&n.empty&&(r++,n.empty.add(u));return u(),i.promise(t)}});var Z=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,et=new RegExp("^(?:([+-])=|)("+Z+")([a-z%]*)$","i"),tt=["Top","Right","Bottom","Left"],nt=function(e,t){return e=t||e,"none"===e.style.display||""===e.style.display&&g.contains(e.ownerDocument,e)&&"none"===g.css(e,"display")},rt=function(e,t,n,r){var i,s,o={};for(s in t)o[s]=e.style[s],e.style[s]=t[s];i=n.apply(e,r||[]);for(s in t)e.style[s]=o[s];return i},st={};g.fn.extend({show:function(){return ut(this,!0)},hide:function(){return ut(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){nt(this)?g(this).show():g(this).hide()})}});var at=/^(?:checkbox|radio)$/i,ft=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,lt=/^$|\/(?:java|ecma)script/i,ct={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,"",""]};ct.optgroup=ct.option,ct.tbody=ct.tfoot=ct.colgroup=ct.caption=ct.thead,ct.th=ct.td;var dt=/<|&#?\w+;/;!function(){var e=r.createDocumentFragment(),t=e.appendChild(r.createElement("div")),n=r.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),d.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="<textarea>x</textarea>",d.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var mt=r.documentElement,gt=/^key/,yt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,bt=/^([^.]*)(?:\.(.+)|)/;g.event={global:{},add:function(e,t,n,r,i){var s,o,u,a,f,l,c,h,p,d,v,m=$.get(e);if(m){n.handler&&(s=n,n=s.handler,i=s.selector),i&&g.find.matchesSelector(mt,i),n.guid||(n.guid=g.guid++),(a=m.events)||(a=m.events={}),(o=m.handle)||(o=m.handle=function(t){return"undefined"!=typeof g&&g.event.triggered!==t.type?g.event.dispatch.apply(e,arguments):void 0}),t=(t||"").match(B)||[""],f=t.length;while(f--)u=bt.exec(t[f])||[],p=v=u[1],d=(u[2]||"").split(".").sort(),p&&(c=g.event.special[p]||{},p=(i?c.delegateType:c.bindType)||p,c=g.event.special[p]||{},l=g.extend({type:p,origType:v,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&g.expr.match.needsContext.test(i),namespace:d.join(".")},s),(h=a[p])||(h=a[p]=[],h.delegateCount=0,c.setup&&c.setup.call(e,r,d,o)!==!1||e.addEventListener&&e.addEventListener(p,o)),c.add&&(c.add.call(e,l),l.handler.guid||(l.handler.guid=n.guid)),i?h.splice(h.delegateCount++,0,l):h.push(l),g.event.global[p]=!0)}},remove:function(e,t,n,r,i){var s,o,u,a,f,l,c,h,p,d,v,m=$.hasData(e)&&$.get(e);if(m&&(a=m.events)){t=(t||"").match(B)||[""],f=t.length;while(f--)if(u=bt.exec(t[f])||[],p=v=u[1],d=(u[2]||"").split(".").sort(),p){c=g.event.special[p]||{},p=(r?c.delegateType:c.bindType)||p,h=a[p]||[],u=u[2]&&new RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=s=h.length;while(s--)l=h[s],!i&&v!==l.origType||n&&n.guid!==l.guid||u&&!u.test(l.namespace)||r&&r!==l.selector&&("**"!==r||!l.selector)||(h.splice(s,1),l.selector&&h.delegateCount--,c.remove&&c.remove.call(e,l));o&&!h.length&&(c.teardown&&c.teardown.call(e,d,m.handle)!==!1||g.removeEvent(e,p,m.handle),delete a[p])}else for(p in a)g.event.remove(e,p+t[f],n,r,!0);g.isEmptyObject(a)&&$.remove(e,"handle events")}},dispatch:function(e){var t=g.event.fix(e),n,r,i,s,o,u,a=new Array(arguments.length),f=($.get(this,"events")||{})[t.type]||[],l=g.event.special[t.type]||{};for(a[0]=t,n=1;n<arguments.length;n++)a[n]=arguments[n];if(t.delegateTarget=this,!l.preDispatch||l.preDispatch.call(this,t)!==!1){u=g.event.handlers.call(this,t,f),n=0;while((s=u[n++])&&!t.isPropagationStopped()){t.currentTarget=s.elem,r=0;while((o=s.handlers[r++])&&!t.isImmediatePropagationStopped())t.rnamespace&&!t.rnamespace.test(o.namespace)||(t.handleObj=o,t.data=o.data,i=((g.event.special[o.origType]||{}).handle||o.handler).apply(s.elem,a),void 0!==i&&(t.result=i)===!1&&(t.preventDefault(),t.stopPropagation()))}return l.postDispatch&&l.postDispatch.call(this,t),t.result}},handlers:function(e,t){var n,r,i,s,o,u=[],a=t.delegateCount,f=e.target;if(a&&f.nodeType&&!("click"===e.type&&e.button>=1))for(;f!==this;f=f.parentNode||this)if(1===f.nodeType&&("click"!==e.type||f.disabled!==!0)){for(s=[],o={},n=0;n<a;n++)r=t[n],i=r.selector+" ",void 0===o[i]&&(o[i]=r.needsContext?g(i,this).index(f)>-1:g.find(i,this,null,[f]).length),o[i]&&s.push(r);s.length&&u.push({elem:f,handlers:s})}return f=this,a<t.length&&u.push({elem:f,handlers:t.slice(a)}),u},addProp:function(e,t){Object.defineProperty(g.Event.prototype,e,{enumerable:!0,configurable:!0,get:g.isFunction(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[g.expando]?e:new g.Event(e)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==St()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===St()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&g.nodeName(this,"input"))return this.click(),!1},_default:function(e){return g.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},g.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},g.Event=function(e,t){return this instanceof g.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&e.returnValue===!1?wt:Et,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&g.extend(this,t),this.timeStamp=e&&e.timeStamp||g.now(),void (this[g.expando]=!0)):new g.Event(e,t)},g.Event.prototype={constructor:g.Event,isDefaultPrevented:Et,isPropagationStopped:Et,isImmediatePropagationStopped:Et,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=wt,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=wt,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=wt,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},g.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&gt.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&yt.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},g.event.addProp),g.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){g.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,s=e.handleObj;return i&&(i===r||g.contains(r,i))||(e.type=s.origType,n=s.handler.apply(this,arguments),e.type=t),n}}}),g.fn.extend({on:function(e,t,n,r){return xt(this,e,t,n,r)},one:function(e,t,n,r){return xt(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,g(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return t!==!1&&"function"!=typeof t||(n=t,t=void 0),n===!1&&(n=Et),this.each(function(){g.event.remove(this,e,n,t)})}});var Tt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,Nt=/<script|<style|<link/i,Ct=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^true\/(.*)/,Lt=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;g.extend({htmlPrefilter:function(e){return e.replace(Tt,"<$1></$2>")},clone:function(e,t,n){var r,i,s,o,u=e.cloneNode(!0),a=g.contains(e.ownerDocument,e);if(!(d.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||g.isXMLDoc(e)))for(o=ht(u),s=ht(e),r=0,i=s.length;r<i;r++)Dt(s[r],o[r]);if(t)if(n)for(s=s||ht(e),o=o||ht(u),r=0,i=s.length;r<i;r++)_t(s[r],o[r]);else _t(e,u);return o=ht(u,"script"),o.length>0&&pt(o,!a&&ht(e,"script")),u},cleanData:function(e){for(var t,n,r,i=g.event.special,s=0;void 0!==(n=e[s]);s++)if(X(n)){if(t=n[$.expando]){if(t.events)for(r in t.events)i[r]?g.event.remove(n,r):g.removeEvent(n,r,t.handle);n[$.expando]=void 0}n[J.expando]&&(n[J.expando]=void 0)}}}),g.fn.extend({detach:function(e){return Ht(this,e,!0)},remove:function(e){return Ht(this,e)},text:function(e){return W(this,function(e){return void 0===e?g.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Pt(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=At(this,e);t.appendChild(e)}})},prepend:function(){return Pt(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=At(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Pt(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Pt(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(g.cleanData(ht(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return g.clone(this,e,t)})},html:function(e){return W(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Nt.test(e)&&!ct[(ft.exec(e)||["",""])[1].toLowerCase()]){e=g.htmlPrefilter(e);try{for(;n<r;n++)t=this[n]||{},1===t.nodeType&&(g.cleanData(ht(t,!1)),t.innerHTML=e);t=0}catch(i){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return Pt(this,arguments,function(t){var n=this.parentNode;g.inArray(this,e)<0&&(g.cleanData(ht(this)),n&&n.replaceChild(t,this))},e)}}),g.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){g.fn[e]=function(e){for(var n,r=[],i=g(e),s=i.length-1,o=0;o<=s;o++)n=o===s?this:this.clone(!0),g(i[o])[t](n),u.apply(r,n.get());return this.pushStack(r)}});var Bt=/^margin/,jt=new RegExp("^("+Z+")(?!px)[a-z%]+$","i"),Ft=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)};!function(){function t(){if(a){a.style.cssText="box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",a.innerHTML="",mt.appendChild(u);var t=e.getComputedStyle(a);n="1%"!==t.top,o="2px"===t.marginLeft,i="4px"===t.width,a.style.marginRight="50%",s="4px"===t.marginRight,mt.removeChild(u),a=null}}var n,i,s,o,u=r.createElement("div"),a=r.createElement("div");a.style&&(a.style.backgroundClip="content-box",a.cloneNode(!0).style.backgroundClip="",d.clearCloneStyle="content-box"===a.style.backgroundClip,u.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",u.appendChild(a),g.extend(d,{pixelPosition:function(){return t(),n},boxSizingReliable:function(){return t(),i},pixelMarginRight:function(){return t(),s},reliableMarginLeft:function(){return t(),o}}))}();var Rt=/^(none|table(?!-c[ea]).+)/,Ut={position:"absolute",visibility:"hidden",display:"block"},zt={letterSpacing:"0",fontWeight:"400"},Wt=["Webkit","Moz","ms"],Xt=r.createElement("div").style;g.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=It(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,s,o,u=g.camelCase(t),a=e.style;return t=g.cssProps[u]||(g.cssProps[u]=Vt(u)||u),o=g.cssHooks[t]||g.cssHooks[u],void 0===n?o&&"get"in o&&void 0!==(i=o.get(e,!1,r))?i:a[t]:(s=typeof n,"string"===s&&(i=et.exec(n))&&i[1]&&(n=it(e,t,i),s="number"),null!=n&&n===n&&("number"===s&&(n+=i&&i[3]||(g.cssNumber[u]?"":"px")),d.clearCloneStyle||""!==n||0!==t.indexOf("background")||(a[t]="inherit"),o&&"set"in o&&void 0===(n=o.set(e,n,r))||(a[t]=n)),void 0)}},css:function(e,t,n,r){var i,s,o,u=g.camelCase(t);return t=g.cssProps[u]||(g.cssProps[u]=Vt(u)||u),o=g.cssHooks[t]||g.cssHooks[u],o&&"get"in o&&(i=o.get(e,!0,n)),void 0===i&&(i=It(e,t,r)),"normal"===i&&t in zt&&(i=zt[t]),""===n||n?(s=parseFloat(i),n===!0||isFinite(s)?s||0:i):i}}),g.each(["height","width"],function(e,t){g.cssHooks[t]={get:function(e,n,r){if(n)return!Rt.test(g.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Kt(e,t,r):rt(e,Ut,function(){return Kt(e,t,r)})},set:function(e,n,r){var i,s=r&&Ft(e),o=r&&Jt(e,t,r,"border-box"===g.css(e,"boxSizing",!1,s),s);return o&&(i=et.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=g.css(e,t)),$t(e,n,o)}}}),g.cssHooks.marginLeft=qt(d.reliableMarginLeft,function(e,t){if(t)return(parseFloat(It(e,"marginLeft"))||e.getBoundingClientRect().left-rt(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),g.each({margin:"",padding:"",border:"Width"},function(e,t){g.cssHooks[e+t]={expand:function(n){for(var r=0,i={},s="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+tt[r]+t]=s[r]||s[r-2]||s[0];return i}},Bt.test(e)||(g.cssHooks[e+t].set=$t)}),g.fn.extend({css:function(e,t){return W(this,function(e,t,n){var r,i,s={},o=0;if(g.isArray(t)){for(r=Ft(e),i=t.length;o<i;o++)s[t[o]]=g.css(e,t[o],!1,r);return s}return void 0!==n?g.style(e,t,n):g.css(e,t)},e,t,arguments.length>1)}}),g.Tween=Qt,Qt.prototype={constructor:Qt,init:function(e,t,n,r,i,s){this.elem=e,this.prop=n,this.easing=i||g.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=s||(g.cssNumber[n]?"":"px")},cur:function(){var e=Qt.propHooks[this.prop];return e&&e.get?e.get(this):Qt.propHooks._default.get(this)},run:function(e){var t,n=Qt.propHooks[this.prop];return this.options.duration?this.pos=t=g.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Qt.propHooks._default.set(this),this}},Qt.prototype.init.prototype=Qt.prototype,Qt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=g.css(e.elem,e.prop,""),t&&"auto"!==t?t:0)},set:function(e){g.fx.step[e.prop]?g.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[g.cssProps[e.prop]]&&!g.cssHooks[e.prop]?e.elem[e.prop]=e.now:g.style(e.elem,e.prop,e.now+e.unit)}}},Qt.propHooks.scrollTop=Qt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},g.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},g.fx=Qt.prototype.init,g.fx.step={};var Gt,Yt,Zt=/^(?:toggle|show|hide)$/,en=/queueHooks$/;g.Animation=g.extend(an,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return it(n.elem,e,et.exec(t),n),n}]},tweener:function(e,t){g.isFunction(e)?(t=e,e=["*"]):e=e.match(B);for(var n,r=0,i=e.length;r<i;r++)n=e[r],an.tweeners[n]=an.tweeners[n]||[],an.tweeners[n].unshift(t)},prefilters:[on],prefilter:function(e,t){t?an.prefilters.unshift(e):an.prefilters.push(e)}}),g.speed=function(e,t,n){var i=e&&"object"==typeof e?g.extend({},e):{complete:n||!n&&t||g.isFunction(e)&&e,duration:e,easing:n&&t||t&&!g.isFunction(t)&&t};return g.fx.off||r.hidden?i.duration=0:"number"!=typeof i.duration&&(i.duration in g.fx.speeds?i.duration=g.fx.speeds[i.duration]:i.duration=g.fx.speeds._default),null!=i.queue&&i.queue!==!0||(i.queue="fx"),i.old=i.complete,i.complete=function(){g.isFunction(i.old)&&i.old.call(this),i.queue&&g.dequeue(this,i.queue)},i},g.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nt).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=g.isEmptyObject(e),s=g.speed(t,n,r),o=function(){var t=an(this,g.extend({},e),s);(i||$.get(this,"finish"))&&t.stop(!0)};return o.finish=o,i||s.queue===!1?this.each(o):this.queue(s.queue,o)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",s=g.timers,o=$.get(this);if(i)o[i]&&o[i].stop&&r(o[i]);else for(i in o)o[i]&&o[i].stop&&en.test(i)&&r(o[i]);for(i=s.length;i--;)s[i].elem!==this||null!=e&&s[i].queue!==e||(s[i].anim.stop(n),t=!1,s.splice(i,1));!t&&n||g.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=$.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],s=g.timers,o=r?r.length:0;for(n.finish=!0,g.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=s.length;t--;)s[t].elem===this&&s[t].queue===e&&(s[t].anim.stop(!0),s.splice(t,1));for(t=0;t<o;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),g.each(["toggle","show","hide"],function(e,t){var n=g.fn[t];g.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(rn(t,!0),e,r,i)}}),g.each({slideDown:rn("show"),slideUp:rn("hide"),slideToggle:rn("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){g.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),g.timers=[],g.fx.tick=function(){var e,t=0,n=g.timers;for(Gt=g.now();t<n.length;t++)e=n[t],e()||n[t]!==e||n.splice(t--,1);n.length||g.fx.stop(),Gt=void 0},g.fx.timer=function(e){g.timers.push(e),e()?g.fx.start():g.timers.pop()},g.fx.interval=13,g.fx.start=function(){Yt||(Yt=e.requestAnimationFrame?e.requestAnimationFrame(tn):e.setInterval(g.fx.tick,g.fx.interval))},g.fx.stop=function(){e.cancelAnimationFrame?e.cancelAnimationFrame(Yt):e.clearInterval(Yt),Yt=null},g.fx.speeds={slow:600,fast:200,_default:400},g.fn.delay=function(t,n){return t=g.fx?g.fx.speeds[t]||t:t,n=n||"fx",this.queue(n,function(n,r){var i=e.setTimeout(n,t);r.stop=function(){e.clearTimeout(i)}})},function(){var e=r.createElement("input"),t=r.createElement("select"),n=t.appendChild(r.createElement("option"));e.type="checkbox",d.checkOn=""!==e.value,d.optSelected=n.selected,e=r.createElement("input"),e.value="t",e.type="radio",d.radioValue="t"===e.value}();var fn,ln=g.expr.attrHandle;g.fn.extend({attr:function(e,t){return W(this,g.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){g.removeAttr(this,e)})}}),g.extend({attr:function(e,t,n){var r,i,s=e.nodeType;if(3!==s&&8!==s&&2!==s)return"undefined"==typeof e.getAttribute?g.prop(e,t,n):(1===s&&g.isXMLDoc(e)||(i=g.attrHooks[t.toLowerCase()]||(g.expr.match.bool.test(t)?fn:void 0)),void 0!==n?null===n?void g.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:(r=g.find.attr(e,t),null==r?void 0:r))},attrHooks:{type:{set:function(e,t){if(!d.radioValue&&"radio"===t&&g.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(B);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),fn={set:function(e,t,n){return t===!1?g.removeAttr(e,n):e.setAttribute(n,n),n}},g.each(g.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ln[t]||g.find.attr;ln[t]=function(e,t,r){var i,s,o=t.toLowerCase();return r||(s=ln[o],ln[o]=i,i=null!=n(e,t,r)?o:null,ln[o]=s),i}});var cn=/^(?:input|select|textarea|button)$/i,hn=/^(?:a|area)$/i;g.fn.extend({prop:function(e,t){return W(this,g.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[g.propFix[e]||e]})}}),g.extend({prop:function(e,t,n){var r,i,s=e.nodeType;if(3!==s&&8!==s&&2!==s)return 1===s&&g.isXMLDoc(e)||(t=g.propFix[t]||t,i=g.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=g.find.attr(e,"tabindex");return t?parseInt(t,10):cn.test(e.nodeName)||hn.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),d.optSelected||(g.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),g.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){g.propFix[this.toLowerCase()]=this}),g.fn.extend({addClass:function(e){var t,n,r,i,s,o,u,a=0;if(g.isFunction(e))return this.each(function(t){g(this).addClass(e.call(this,t,dn(this)))});if("string"==typeof e&&e){t=e.match(B)||[];while(n=this[a++])if(i=dn(n),r=1===n.nodeType&&" "+pn(i)+" "){o=0;while(s=t[o++])r.indexOf(" "+s+" ")<0&&(r+=s+" ");u=pn(r),i!==u&&n.setAttribute("class",u)}}return this},removeClass:function(e){var t,n,r,i,s,o,u,a=0;if(g.isFunction(e))return this.each(function(t){g(this).removeClass(e.call(this,t,dn(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e){t=e.match(B)||[];while(n=this[a++])if(i=dn(n),r=1===n.nodeType&&" "+pn(i)+" "){o=0;while(s=t[o++])while(r.indexOf(" "+s+" ")>-1)r=r.replace(" "+s+" "," ");u=pn(r),i!==u&&n.setAttribute("class",u)}}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):g.isFunction(e)?this.each(function(n){g(this).toggleClass(e.call(this,n,dn(this),t),t)}):this.each(function(){var t,r,i,s;if("string"===n){r=0,i=g(this),s=e.match(B)||[];while(t=s[r++])i.hasClass(t)?i.removeClass(t):i.addClass(t)}else void 0!==e&&"boolean"!==n||(t=dn(this),t&&$.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||e===!1?"":$.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&(" "+pn(dn(n))+" ").indexOf(t)>-1)return!0;return!1}});var vn=/\r/g;g.fn.extend({val:function(e){var t,n,r,i=this[0];if(arguments.length)return r=g.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(i=r?e.call(this,n,g(this).val()):e,null==i?i="":"number"==typeof i?i+="":g.isArray(i)&&(i=g.map(i,function(e){return null==e?"":e+""})),t=g.valHooks[this.type]||g.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return t=g.valHooks[i.type]||g.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(vn,""):null==n?"":n)}}),g.extend({valHooks:{option:{get:function(e){var t=g.find.attr(e,"value");return null!=t?t:pn(g.text(e))}},select:{get:function(e){var t,n,r,i=e.options,s=e.selectedIndex,o="select-one"===e.type,u=o?null:[],a=o?s+1:i.length;for(r=s<0?a:o?s:0;r<a;r++)if(n=i[r],(n.selected||r===s)&&!n.disabled&&(!n.parentNode.disabled||!g.nodeName(n.parentNode,"optgroup"))){if(t=g(n).val(),o)return t;u.push(t)}return u},set:function(e,t){var n,r,i=e.options,s=g.makeArray(t),o=i.length;while(o--)r=i[o],(r.selected=g.inArray(g.valHooks.option.get(r),s)>-1)&&(n=!0);return n||(e.selectedIndex=-1),s}}}}),g.each(["radio","checkbox"],function(){g.valHooks[this]={set:function(e,t){if(g.isArray(t))return e.checked=g.inArray(g(e).val(),t)>-1}},d.checkOn||(g.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var mn=/^(?:focusinfocus|focusoutblur)$/;g.extend(g.event,{trigger:function(t,n,i,s){var o,u,a,f,l,h,p,d=[i||r],v=c.call(t,"type")?t.type:t,m=c.call(t,"namespace")?t.namespace.split("."):[];if(u=a=i=i||r,3!==i.nodeType&&8!==i.nodeType&&!mn.test(v+g.event.triggered)&&(v.indexOf(".")>-1&&(m=v.split("."),v=m.shift(),m.sort()),l=v.indexOf(":")<0&&"on"+v,t=t[g.expando]?t:new g.Event(v,"object"==typeof t&&t),t.isTrigger=s?2:3,t.namespace=m.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),n=null==n?[t]:g.makeArray(n,[t]),p=g.event.special[v]||{},s||!p.trigger||p.trigger.apply(i,n)!==!1)){if(!s&&!p.noBubble&&!g.isWindow(i)){for(f=p.delegateType||v,mn.test(f+v)||(u=u.parentNode);u;u=u.parentNode)d.push(u),a=u;a===(i.ownerDocument||r)&&d.push(a.defaultView||a.parentWindow||e)}o=0;while((u=d[o++])&&!t.isPropagationStopped())t.type=o>1?f:p.bindType||v,h=($.get(u,"events")||{})[t.type]&&$.get(u,"handle"),h&&h.apply(u,n),h=l&&u[l],h&&h.apply&&X(u)&&(t.result=h.apply(u,n),t.result===!1&&t.preventDefault());return t.type=v,s||t.isDefaultPrevented()||p._default&&p._default.apply(d.pop(),n)!==!1||!X(i)||l&&g.isFunction(i[v])&&!g.isWindow(i)&&(a=i[l],a&&(i[l]=null),g.event.triggered=v,i[v](),g.event.triggered=void 0,a&&(i[l]=a)),t.result}},simulate:function(e,t,n){var r=g.extend(new g.Event,n,{type:e,isSimulated:!0});g.event.trigger(r,null,t)}}),g.fn.extend({trigger:function(e,t){return this.each(function(){g.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return g.event.trigger(e,t,n,!0)}}),g.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){g.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),g.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),d.focusin="onfocusin"in e,d.focusin||g.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){g.event.simulate(t,e.target,g.event.fix(e))};g.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=$.access(r,t);i||r.addEventListener(e,n,!0),$.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=$.access(r,t)-1;i?$.access(r,t,i):(r.removeEventListener(e,n,!0),$.remove(r,t))}}});var gn=e.location,yn=g.now(),bn=/\?/;g.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(r){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||g.error("Invalid XML: "+t),n};var wn=/\[\]$/,En=/\r?\n/g,Sn=/^(?:submit|button|image|reset|file)$/i,xn=/^(?:input|select|textarea|keygen)/i;g.param=function(e,t){var n,r=[],i=function(e,t){var n=g.isFunction(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(g.isArray(e)||e.jquery&&!g.isPlainObject(e))g.each(e,function(){i(this.name,this.value)});else for(n in e)Tn(n,e[n],t,i);return r.join("&")},g.fn.extend({serialize:function(){return g.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=g.prop(this,"elements");return e?g.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!g(this).is(":disabled")&&xn.test(this.nodeName)&&!Sn.test(e)&&(this.checked||!at.test(e))}).map(function(e,t){var n=g(this).val();return null==n?null:g.isArray(n)?g.map(n,function(e){return{name:t.name,value:e.replace(En,"\r\n")}}):{name:t.name,value:n.replace(En,"\r\n")}}).get()}});var Nn=/%20/g,Cn=/#.*$/,kn=/([?&])_=[^&]*/,Ln=/^(.*?):[ \t]*([^\r\n]*)$/gm,An=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,On=/^(?:GET|HEAD)$/,Mn=/^\/\//,_n={},Dn={},Pn="*/".concat("*"),Hn=r.createElement("a");Hn.href=gn.href,g.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:gn.href,type:"GET",isLocal:An.test(gn.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Pn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":g.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Fn(Fn(e,g.ajaxSettings),t):Fn(g.ajaxSettings,e)},ajaxPrefilter:Bn(_n),ajaxTransport:Bn(Dn),ajax:function(t,n){function C(t,n,r,u){var f,h,p,E,S,x=n;l||(l=!0,a&&e.clearTimeout(a),i=void 0,o=u||"",T.readyState=t>0?4:0,f=t>=200&&t<300||304===t,r&&(E=In(d,T,r)),E=qn(d,E,T,f),f?(d.ifModified&&(S=T.getResponseHeader("Last-Modified"),S&&(g.lastModified[s]=S),S=T.getResponseHeader("etag"),S&&(g.etag[s]=S)),204===t||"HEAD"===d.type?x="nocontent":304===t?x="notmodified":(x=E.state,h=E.data,p=E.error,f=!p)):(p=x,!t&&x||(x="error",t<0&&(t=0))),T.status=t,T.statusText=(n||x)+"",f?y.resolveWith(v,[h,x,T]):y.rejectWith(v,[T,x,p]),T.statusCode(w),w=void 0,c&&m.trigger(f?"ajaxSuccess":"ajaxError",[T,d,f?h:p]),b.fireWith(v,[T,x]),c&&(m.trigger("ajaxComplete",[T,d]),--g.active||g.event.trigger("ajaxStop")))}"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,s,o,u,a,f,l,c,h,p,d=g.ajaxSetup({},n),v=d.context||d,m=d.context&&(v.nodeType||v.jquery)?g(v):g.event,y=g.Deferred(),b=g.Callbacks("once memory"),w=d.statusCode||{},E={},S={},x="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(l){if(!u){u={};while(t=Ln.exec(o))u[t[1].toLowerCase()]=t[2]}t=u[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return l?o:null},setRequestHeader:function(e,t){return null==l&&(e=S[e.toLowerCase()]=S[e.toLowerCase()]||e,E[e]=t),this},overrideMimeType:function(e){return null==l&&(d.mimeType=e),this},statusCode:function(e){var t;if(e)if(l)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||x;return i&&i.abort(t),C(0,t),this}};if(y.promise(T),d.url=((t||d.url||gn.href)+"").replace(Mn,gn.protocol+"//"),d.type=n.method||n.type||d.method||d.type,d.dataTypes=(d.dataType||"*").toLowerCase().match(B)||[""],null==d.crossDomain){f=r.createElement("a");try{f.href=d.url,f.href=f.href,d.crossDomain=Hn.protocol+"//"+Hn.host!=f.protocol+"//"+f.host}catch(N){d.crossDomain=!0}}if(d.data&&d.processData&&"string"!=typeof d.data&&(d.data=g.param(d.data,d.traditional)),jn(_n,d,n,T),l)return T;c=g.event&&d.global,c&&0===g.active++&&g.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!On.test(d.type),s=d.url.replace(Cn,""),d.hasContent?d.data&&d.processData&&0===(d.contentType||"").indexOf("application/x-www-form-urlencoded")&&(d.data=d.data.replace(Nn,"+")):(p=d.url.slice(s.length),d.data&&(s+=(bn.test(s)?"&":"?")+d.data,delete d.data),d.cache===!1&&(s=s.replace(kn,"$1"),p=(bn.test(s)?"&":"?")+"_="+yn++ +p),d.url=s+p),d.ifModified&&(g.lastModified[s]&&T.setRequestHeader("If-Modified-Since",g.lastModified[s]),g.etag[s]&&T.setRequestHeader("If-None-Match",g.etag[s])),(d.data&&d.hasContent&&d.contentType!==!1||n.contentType)&&T.setRequestHeader("Content-Type",d.contentType),T.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+Pn+"; q=0.01":""):d.accepts["*"]);for(h in d.headers)T.setRequestHeader(h,d.headers[h]);if(d.beforeSend&&(d.beforeSend.call(v,T,d)===!1||l))return T.abort();if(x="abort",b.add(d.complete),T.done(d.success),T.fail(d.error),i=jn(Dn,d,n,T)){if(T.readyState=1,c&&m.trigger("ajaxSend",[T,d]),l)return T;d.async&&d.timeout>0&&(a=e.setTimeout(function(){T.abort("timeout")},d.timeout));try{l=!1,i.send(E,C)}catch(N){if(l)throw N;C(-1,N)}}else C(-1,"No Transport");return T},getJSON:function(e,t,n){return g.get(e,t,n,"json")},getScript:function(e,t){return g.get(e,void 0,t,"script")}}),g.each(["get","post"],function(e,t){g[t]=function(e,n,r,i){return g.isFunction(n)&&(i=i||r,r=n,n=void 0),g.ajax(g.extend({url:e,type:t,dataType:i,data:n,success:r},g.isPlainObject(e)&&e))}}),g._evalUrl=function(e){return g.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},g.fn.extend({wrapAll:function(e){var t;return this[0]&&(g.isFunction(e)&&(e=e.call(this[0])),t=g(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return g.isFunction(e)?this.each(function(t){g(this).wrapInner(e.call(this,t))}):this.each(function(){var t=g(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=g.isFunction(e);return this.each(function(n){g(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){g(this).replaceWith(this.childNodes)}),this}}),g.expr.pseudos.hidden=function(e){return!g.expr.pseudos.visible(e)},g.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},g.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(t){}};var Rn={0:200,1223:204},Un=g.ajaxSettings.xhr();d.cors=!!Un&&"withCredentials"in Un,d.ajax=Un=!!Un,g.ajaxTransport(function(t){var n,r;if(d.cors||Un&&!t.crossDomain)return{send:function(i,s){var o,u=t.xhr();if(u.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(o in t.xhrFields)u[o]=t.xhrFields[o];t.mimeType&&u.overrideMimeType&&u.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(o in i)u.setRequestHeader(o,i[o]);n=function(e){return function(){n&&(n=r=u.onload=u.onerror=u.onabort=u.onreadystatechange=null,"abort"===e?u.abort():"error"===e?"number"!=typeof u.status?s(0,"error"):s(u.status,u.statusText):s(Rn[u.status]||u.status,u.statusText,"text"!==(u.responseType||"text")||"string"!=typeof u.responseText?{binary:u.response}:{text:u.responseText},u.getAllResponseHeaders()))}},u.onload=n(),r=u.onerror=n("error"),void 0!==u.onabort?u.onabort=r:u.onreadystatechange=function(){4===u.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{u.send(t.hasContent&&t.data||null)}catch(a){if(n)throw a}},abort:function(){n&&n()}}}),g.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),g.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return g.globalEval(e),e}}}),g.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),g.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(i,s){t=g("<script>").prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&s("error"===e.type?404:200,e.type)}),r.head.appendChild(t[0])},abort:function(){n&&n()}}}});var zn=[],Wn=/(=)\?(?=&|$)|\?\?/;g.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zn.pop()||g.expando+"_"+yn++;return this[e]=!0,e}}),g.ajaxPrefilter("json jsonp",function(t,n,r){var i,s,o,u=t.jsonp!==!1&&(Wn.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Wn.test(t.data)&&"data");if(u||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=g.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,u?t[u]=t[u].replace(Wn,"$1"+i):t.jsonp!==!1&&(t.url+=(bn.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return o||g.error(i+" was not called"),o[0]},t.dataTypes[0]="json",s=e[i],e[i]=function(){o=arguments},r.always(function(){void 0===s?g(e).removeProp(i):e[i]=s,t[i]&&(t.jsonpCallback=n.jsonpCallback,zn.push(i)),o&&g.isFunction(s)&&s(o[0]),o=s=void 0}),"script"}),d.createHTMLDocument=function(){var e=r.implementation.createHTMLDocument("").body;return e.innerHTML="<form></form><form></form>",2===e.childNodes.length}(),g.parseHTML=function(e,t,n){if("string"!=typeof e)return[];"boolean"==typeof t&&(n=t,t=!1);var i,s,o;return t||(d.createHTMLDocument?(t=r.implementation.createHTMLDocument(""),i=t.createElement("base"),i.href=r.location.href,t.head.appendChild(i)):t=r),s=k.exec(e),o=!n&&[],s?[t.createElement(s[1])]:(s=vt([e],t,o),o&&o.length&&g(o).remove(),g.merge([],s.childNodes))},g.fn.load=function(e,t,n){var r,i,s,o=this,u=e.indexOf(" ");return u>-1&&(r=pn(e.slice(u)),e=e.slice(0,u)),g.isFunction(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),o.length>0&&g.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){s=arguments,o.html(r?g("<div>").append(g.parseHTML(e)).find(r):e)}).always(n&&function(e,t){o.each(function(){n.apply(this,s||[e.responseText,t,e])})}),this},g.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){g.fn[t]=function(e){return this.on(t,e)}}),g.expr.pseudos.animated=function(e){return g.grep(g.timers,function(t){return e===t.elem}).length},g.offset={setOffset:function(e,t,n){var r,i,s,o,u,a,f,l=g.css(e,"position"),c=g(e),h={};"static"===l&&(e.style.position="relative"),u=c.offset(),s=g.css(e,"top"),a=g.css(e,"left"),f=("absolute"===l||"fixed"===l)&&(s+a).indexOf("auto")>-1,f?(r=c.position(),o=r.top,i=r.left):(o=parseFloat(s)||0,i=parseFloat(a)||0),g.isFunction(t)&&(t=t.call(e,n,g.extend({},u))),null!=t.top&&(h.top=t.top-u.top+o),null!=t.left&&(h.left=t.left-u.left+i),"using"in t?t.using.call(e,h):c.css(h)}},g.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){g.offset.setOffset(this,e,t)});var t,n,r,i,s=this[0];if(s)return s.getClientRects().length?(r=s.getBoundingClientRect(),r.width||r.height?(i=s.ownerDocument,n=Xn(i),t=i.documentElement,{top:r.top+n.pageYOffset-t.clientTop,left:r.left+n.pageXOffset-t.clientLeft}):r):{top:0,left:0}},position:function(){if(this[0]){var e,t,n=this[0],r={top:0,left:0};return"fixed"===g.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),g.nodeName(e[0],"html")||(r=e.offset()),r={top:r.top+g.css(e[0],"borderTopWidth",!0),left:r.left+g.css(e[0],"borderLeftWidth",!0)}),{top:t.top-r.top-g.css(n,"marginTop",!0),left:t.left-r.left-g.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===g.css(e,"position"))e=e.offsetParent;return e||mt})}}),g.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;g.fn[e]=function(r){return W(this,function(e,r,i){var s=Xn(e);return void 0===i?s?s[t]:e[r]:void (s?s.scrollTo(n?s.pageXOffset:i,n?i:s.pageYOffset):e[r]=i)},e,r,arguments.length)}}),g.each(["top","left"],function(e,t){g.cssHooks[t]=qt(d.pixelPosition,function(e,n){if(n)return n=It(e,t),jt.test(n)?g(e).position()[t]+"px":n})}),g.each({Height:"height",Width:"width"},function(e,t){g.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){g.fn[r]=function(i,s){var o=arguments.length&&(n||"boolean"!=typeof i),u=n||(i===!0||s===!0?"margin":"border");return W(this,function(t,n,i){var s;return g.isWindow(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(s=t.documentElement,Math.max(t.body["scroll"+e],s["scroll"+e],t.body["offset"+e],s["offset"+e],s["client"+e])):void 0===i?g.css(t,n,u):g.style(t,n,i,u)},t,o?i:void 0,o)}})}),g.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),g.parseJSON=JSON.parse,"function"==typeof define&&define.amd&&define("jquery",[],function(){return g});var Vn=e.jQuery,$n=e.$;return g.noConflict=function(t){return e.$===g&&(e.$=$n),t&&e.jQuery===g&&(e.jQuery=Vn),g},t||(e.jQuery=e.$=g),g}),define("config",["jquery"],function(e){function r(){if(typeof Storage!="undefined"&&window.swish.config_hash){var e;if(e=localStorage.getItem(t)){value=JSON.parse(e);if(value.hash==window.swish.config_hash)return value.config}}}function i(e){typeof Storage!="undefined"&&window.swish.config_hash&&localStorage.setItem(t,JSON.stringify({hash:window.swish.config_hash,config:e}))}var t="SWISHCONFIG",n;return n||(n=r())||e.ajax("swish_config.json",{dataType:"json",async:!1,success:function(e){n=e,i(n)},error:function(){alert("Failed to fetch configuration from server")}}),n}),define("preferences",["jquery"],function(e){function i(){var e=localStorage.getItem("notagain")||"[]",t;try{data=JSON.parse(e),typeof data!="object"&&(data=[])}catch(n){data=[]}return data}var t=typeof Storage!="undefined",n={},r={persistent:function(){return t},setNotAgain:function(e){if(t){var n=i();n.indexOf(e)<0&&(n.push(e),localStorage.setItem("notagain",JSON.stringify(n)))}},notagain:function(e){if(t){var n=i();return n.indexOf(e)>=0}return!1},broadcast:function(t,n){e(".swish-event-receiver").trigger("preference",{name:t,value:n})},setVal:function(e,n){t&&localStorage.setItem(e,JSON.stringify(n)),this.broadcast(e,n)},setDefault:function(e,t){n[e]=t},getVal:function(e){if(t){var r;if(r=localStorage.getItem(e))return value=JSON.parse(r),value}return n[e]}};return r}),define("history",["jquery","preferences"],function(e,t){var n={push:function(e){var t=window.location.pathname;if(t!=e.url){var n={location:e.url};e.meta&&(n.meta=e.meta),window.history.pushState(n,"",e.url),document.title="SWISH -- "+(e.file?e.file:"SWI-Prolog for SHaring")}},pop:function(t){t.state&&(t.state.meta&&t.state.meta.name?e(".swish").swish("playFile",t.state.meta.name):t.state.location&&(window.location=t.state.location))},recentMaxLength:10,addRecent:function(e){function i(e,t){return e.type==t.type&&e.id==t.id}var r=t.getVal("recentDocuments")||[];for(var s=0;s<r.length;s++)if(i(e,r[s])){r.splice(s,1);break}while(r.length+1>n.recentMaxLength)r.pop();r.splice(0,0,e),t.setVal("recentDocuments",r)},openRecent:function(e,t){return n.openRecent[t.st_type](e,t)},updateRecentUL:function(){var n=e(this),r=t.getVal("recentDocuments")||[];n.html("");for(var i=0;i<r.length;i++){var s=r[i],o=e.el.a(s.label||s.id);e(o).data("document",s),n.append(e.el.li(o))}}};return n.openRecent.gitty=function(t,n){e(t.target).parents(".swish").swish("playFile",n.id)},window.onpopstate=n.pop,n}),define("links",["jquery","config","modal"],function(e,t,n){var r={PlDoc:function(t,n){function r(e){var t={},n;(n=e.indexOf(":"))>0&&(t.module=e.substring(0,n),e=e.slice(n+1));if((n=e.indexOf("/"))>0){t.name=e.substring(0,n),e.charAt(n+1)=="/"?t.arity=parseInt(e.slice(n+2))+2:t.arity=parseInt(e.slice(n+1));if(!isNaN(t.arity))return t}}if(t){var i=r(decodeURIComponent(t));if(i)return e(n.target).closest("#ajaxModal").modal("hide"),e(".swish-event-receiver").trigger("pldoc",i),n.preventDefault(),!0}return!1},runQueryLink:function(t,r){var i=t.closest(".notebook"),s=t.data("query"),o=i.find('.nb-cell[name="'+s+'"]');if(o){var u=e().prologEditor("variables",o.nbCell("text"),!0),a="",f={},l=[];function c(e){for(var t=0;t<u.length;t++)if(u[t].toLowerCase()==e.toLowerCase())return u[t];l.push(e)}e.each(t.data(),function(e,t){var n;e!=="query"&&(n=c(e))&&(a!=""&&(a+=", "),a+=n+" = ("+t+")")}),l.length>0&&n.feedback({owner:i,type:"warning",duration:3e3,html:"The variables <b>"+l.join(", ")+"</b> do not appear in "+"query <b>"+s+"</b>"}),a!=""&&(f.bindings=a),o.nbCell("run",f)}},followLink:function(n){function o(){s=!0,n.preventDefault(),e(n.target).closest("#ajaxModal").modal("hide")}var i=e(n.target).closest("a"),s=!1;if(i.attr("href")){var u=t.http.locations.swish+"p/",a=t.http.locations.swish+"example/",f=i.attr("href"),l;if(f.startsWith(u)&&!f.match(/#/))o(),file=f.slice(u.length),e(n.target).parents(".swish").swish("playFile",file);else if(i.hasClass("store"))o(),l.alert("File does not appear to come from gitty store?");else if(i.hasClass("file")||f.startsWith(a)&&!f.match(/#/))o(),e(n.target).parents(".swish").swish("playURL",{url:f});else if(i.hasClass("builtin")&&f.match(/predicate=/))s=r.PlDoc(f.split("predicate=").pop(),n);else if(f.match(/object=/))s=r.PlDoc(f.split("object=").pop(),n);else if((l=e(n.target).closest("#ajaxModal")).length==1&&f.match(/#/)){var c=f.split("#").pop(),h;(h=l.find("#"+c)).length==1&&(s=!0,n.preventDefault(),l.animate({scrollTop:h.position().top},2e3))}s||(n.preventDefault(),window.open(f,"_blank"))}else i.data("query")&&r.runQueryLink(i,n)}};return r}),function(e){function n(){var e=document.createElement(arguments[0]);for(var n=1;n<arguments.length;n++){var r=arguments[n];if(r===null||r===undefined)continue;if(r.nodeType===1)e.appendChild(r);else if(!(r===""||r&&r.charCodeAt&&r.substr)&&!(r===0||r&&r.toExponential&&r.toFixed)){if(n===1&&typeof r=="object"){for(var i in r)if(r.hasOwnProperty(i)){var s=r[i];if(s!==null&&s!==undefined){i=i.toLowerCase(),i=t[i]||i;var o=i.charAt(0)==="o"&&i.charAt(1)==="n";o?(r.href===undefined&&i==="onclick"&&e.setAttribute("href","#"),e[i]=s):i==="style"&&e.style.setAttribute?e.style.setAttribute("cssText",s):i==="className"||i==="htmlFor"?e[i]=s:e.setAttribute(i,s)}}}else if(Object.prototype.toString.call(r)==="[object Array]")for(var u=0;u<r.length;u++){var a=r[u];a.nodeType===1&&e.appendChild(a)}}else e.appendChild(document.createTextNode(r))}return e.appendTo=function(e){return e.nodeType===1&&this.nodeType===1&&e.appendChild(this),this},e}var t={acceptcharset:"acceptCharset",accesskey:"accessKey",allowtransparency:"allowTransparency",bgcolor:"bgColor",cellpadding:"cellPadding",cellspacing:"cellSpacing","class":"className",classname:"className",colspan:"colSpan",csstext:"style",defaultchecked:"defaultChecked",defaultselected:"defaultSelected",defaultvalue:"defaultValue","for":"htmlFor",frameborder:"frameBorder",hspace:"hSpace",htmlfor:"htmlFor",longdesc:"longDesc",maxlength:"maxLength",marginwidth:"marginWidth",marginheight:"marginHeight",noresize:"noResize",noshade:"noShade",readonly:"readOnly",rowspan:"rowSpan",tabindex:"tabIndex",valign:"vAlign",vspace:"vSpace"};n.registerElement=function(e,t){n[e]||(n[e]=function(){var r=n("div",{"class":e});return t.apply(r,Array.prototype.slice.call(arguments)),r})};var r=["acronym","applet","basefont","big","center","dir","font","frame","frameset","noframes","strike","tt","u","xmp"],i=["a","abbr","address","area","article","aside","audio","b","base","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","command","datalist","dd","del","details","dfn","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","keygen","kbd","label","legend","li","link","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","picture","param","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","ul","var","video","wbr"].concat(r),s=function(e){return function(){return n.apply(this,[e].concat(Array.prototype.slice.call(arguments)))}};for(var o=0;o<i.length;o++)n[i[o]]=s(i[o]);if(typeof module!="undefined"&&module.exports)module.exports=n;else{var u=e.$||{};u.el=n,e.$=u}}(this),define("laconic",["jquery"],function(){});if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(e){var t=e.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||1==t[0]&&9==t[1]&&t[2]<1||t[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(jQuery),+function(e){function t(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in t)if(void 0!==e.style[n])return{end:t[n]};return!1}e.fn.emulateTransitionEnd=function(t){var n=!1,r=this;e(this).one("bsTransitionEnd",function(){n=!0});var i=function(){n||e(r).trigger(e.support.transition.end)};return setTimeout(i,t),this},e(function(){e.support.transition=t(),e.support.transition&&(e.event.special.bsTransitionEnd={bindType:e.support.transition.end,delegateType:e.support.transition.end,handle:function(t){if(e(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}})})}(jQuery),+function(e){function t(t){return this.each(function(){var n=e(this),i=n.data("bs.alert");i||n.data("bs.alert",i=new r(this)),"string"==typeof t&&i[t].call(n)})}var n='[data-dismiss="alert"]',r=function(t){e(t).on("click",n,this.close)};r.VERSION="3.3.7",r.TRANSITION_DURATION=150,r.prototype.close=function(t){function n(){o.detach().trigger("closed.bs.alert").remove()}var i=e(this),s=i.attr("data-target");s||(s=i.attr("href"),s=s&&s.replace(/.*(?=#[^\s]*$)/,""));var o=e("#"===s?[]:s);t&&t.preventDefault(),o.length||(o=i.closest(".alert")),o.trigger(t=e.Event("close.bs.alert")),t.isDefaultPrevented()||(o.removeClass("in"),e.support.transition&&o.hasClass("fade")?o.one("bsTransitionEnd",n).emulateTransitionEnd(r.TRANSITION_DURATION):n())};var i=e.fn.alert;e.fn.alert=t,e.fn.alert.Constructor=r,e.fn.alert.noConflict=function(){return e.fn.alert=i,this},e(document).on("click.bs.alert.data-api",n,r.prototype.close)}(jQuery),+function(e){function t(t){return this.each(function(){var r=e(this),i=r.data("bs.button"),s="object"==typeof t&&t;i||r.data("bs.button",i=new n(this,s)),"toggle"==t?i.toggle():t&&i.setState(t)})}var n=function(t,r){this.$element=e(t),this.options=e.extend({},n.DEFAULTS,r),this.isLoading=!1};n.VERSION="3.3.7",n.DEFAULTS={loadingText:"loading..."},n.prototype.setState=function(t){var n="disabled",r=this.$element,i=r.is("input")?"val":"html",s=r.data();t+="Text",null==s.resetText&&r.data("resetText",r[i]()),setTimeout(e.proxy(function(){r[i](null==s[t]?this.options[t]:s[t]),"loadingText"==t?(this.isLoading=!0,r.addClass(n).attr(n,n).prop(n,!0)):this.isLoading&&(this.isLoading=!1,r.removeClass(n).removeAttr(n).prop(n,!1))},this),0)},n.prototype.toggle=function(){var e=!0,t=this.$element.closest('[data-toggle="buttons"]');if(t.length){var n=this.$element.find("input");"radio"==n.prop("type")?(n.prop("checked")&&(e=!1),t.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==n.prop("type")&&(n.prop("checked")!==this.$element.hasClass("active")&&(e=!1),this.$element.toggleClass("active")),n.prop("checked",this.$element.hasClass("active")),e&&n.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var r=e.fn.button;e.fn.button=t,e.fn.button.Constructor=n,e.fn.button.noConflict=function(){return e.fn.button=r,this},e(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(n){var r=e(n.target).closest(".btn");t.call(r,"toggle"),e(n.target).is('input[type="radio"], input[type="checkbox"]')||(n.preventDefault(),r.is("input,button")?r.trigger("focus"):r.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(t){e(t.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(t.type))})}(jQuery),+function(e){function t(t){return this.each(function(){var r=e(this),i=r.data("bs.carousel"),s=e.extend({},n.DEFAULTS,r.data(),"object"==typeof t&&t),o="string"==typeof t?t:s.slide;i||r.data("bs.carousel",i=new n(this,s)),"number"==typeof t?i.to(t):o?i[o]():s.interval&&i.pause().cycle()})}var n=function(t,n){this.$element=e(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=n,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",e.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",e.proxy(this.pause,this)).on("mouseleave.bs.carousel",e.proxy(this.cycle,this))};n.VERSION="3.3.7",n.TRANSITION_DURATION=600,n.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},n.prototype.keydown=function(e){if(!/input|textarea/i.test(e.target.tagName)){switch(e.which){case 37:this.prev();break;case 39:this.next();break;default:return}e.preventDefault()}},n.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},n.prototype.getItemIndex=function(e){return this.$items=e.parent().children(".item"),this.$items.index(e||this.$active)},n.prototype.getItemForDirection=function(e,t){var n=this.getItemIndex(t),r="prev"==e&&0===n||"next"==e&&n==this.$items.length-1;if(r&&!this.options.wrap)return t;var i="prev"==e?-1:1,s=(n+i)%this.$items.length;return this.$items.eq(s)},n.prototype.to=function(e){var t=this,n=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(e>this.$items.length-1||e<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){t.to(e)}):n==e?this.pause().cycle():this.slide(e>n?"next":"prev",this.$items.eq(e))},n.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition&&(this.$element.trigger(e.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},n.prototype.next=function(){if(!this.sliding)return this.slide("next")},n.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},n.prototype.slide=function(t,r){var i=this.$element.find(".item.active"),s=r||this.getItemForDirection(t,i),o=this.interval,u="next"==t?"left":"right",f=this;if(s.hasClass("active"))return this.sliding=!1;var l=s[0],h=e.Event("slide.bs.carousel",{relatedTarget:l,direction:u});if(this.$element.trigger(h),!h.isDefaultPrevented()){if(this.sliding=!0,o&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var p=e(this.$indicators.children()[this.getItemIndex(s)]);p&&p.addClass("active")}var d=e.Event("slid.bs.carousel",{relatedTarget:l,direction:u});return e.support.transition&&this.$element.hasClass("slide")?(s.addClass(t),s[0].offsetWidth,i.addClass(u),s.addClass(u),i.one("bsTransitionEnd",function(){s.removeClass([t,u].join(" ")).addClass("active"),i.removeClass(["active",u].join(" ")),f.sliding=!1,setTimeout(function(){f.$element.trigger(d)},0)}).emulateTransitionEnd(n.TRANSITION_DURATION)):(i.removeClass("active"),s.addClass("active"),this.sliding=!1,this.$element.trigger(d)),o&&this.cycle(),this}};var r=e.fn.carousel;e.fn.carousel=t,e.fn.carousel.Constructor=n,e.fn.carousel.noConflict=function(){return e.fn.carousel=r,this};var i=function(n){var r,i=e(this),s=e(i.attr("data-target")||(r=i.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""));if(s.hasClass("carousel")){var o=e.extend({},s.data(),i.data()),u=i.attr("data-slide-to");u&&(o.interval=!1),t.call(s,o),u&&s.data("bs.carousel").to(u),n.preventDefault()}};e(document).on("click.bs.carousel.data-api","[data-slide]",i).on("click.bs.carousel.data-api","[data-slide-to]",i),e(window).on("load",function(){e('[data-ride="carousel"]').each(function(){var n=e(this);t.call(n,n.data())})})}(jQuery),+function(e){function t(t){var n,r=t.attr("data-target")||(n=t.attr("href"))&&n.replace(/.*(?=#[^\s]+$)/,"");return e(r)}function n(t){return this.each(function(){var n=e(this),i=n.data("bs.collapse"),s=e.extend({},r.DEFAULTS,n.data(),"object"==typeof t&&t);!i&&s.toggle&&/show|hide/.test(t)&&(s.toggle=!1),i||n.data("bs.collapse",i=new r(this,s)),"string"==typeof t&&i[t]()})}var r=function(t,n){this.$element=e(t),this.options=e.extend({},r.DEFAULTS,n),this.$trigger=e('[data-toggle="collapse"][href="#'+t.id+'"],[data-toggle="collapse"][data-target="#'+t.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};r.VERSION="3.3.7",r.TRANSITION_DURATION=350,r.DEFAULTS={toggle:!0},r.prototype.dimension=function(){var e=this.$element.hasClass("width");return e?"width":"height"},r.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var t,i=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(i&&i.length&&(t=i.data("bs.collapse"),t&&t.transitioning))){var s=e.Event("show.bs.collapse");if(this.$element.trigger(s),!s.isDefaultPrevented()){i&&i.length&&(n.call(i,"hide"),t||i.data("bs.collapse",null));var o=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[o](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var u=function(){this.$element.removeClass("collapsing").addClass("collapse in")[o](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!e.support.transition)return u.call(this);var f=e.camelCase(["scroll",o].join("-"));this.$element.one("bsTransitionEnd",e.proxy(u,this)).emulateTransitionEnd(r.TRANSITION_DURATION)[o](this.$element[0][f])}}}},r.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var t=e.Event("hide.bs.collapse");if(this.$element.trigger(t),!t.isDefaultPrevented()){var n=this.dimension();this.$element[n](this.$element[n]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var i=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return e.support.transition?void this.$element[n](0).one("bsTransitionEnd",e.proxy(i,this)).emulateTransitionEnd(r.TRANSITION_DURATION):i.call(this)}}},r.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},r.prototype.getParent=function(){return e(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(e.proxy(function(n,r){var i=e(r);this.addAriaAndCollapsedClass(t(i),i)},this)).end()},r.prototype.addAriaAndCollapsedClass=function(e,t){var n=e.hasClass("in");e.attr("aria-expanded",n),t.toggleClass("collapsed",!n).attr("aria-expanded",n)};var i=e.fn.collapse;e.fn.collapse=n,e.fn.collapse.Constructor=r,e.fn.collapse.noConflict=function(){return e.fn.collapse=i,this},e(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(r){var i=e(this);i.attr("data-target")||r.preventDefault();var s=t(i),o=s.data("bs.collapse"),u=o?"toggle":i.data();n.call(s,u)})}(jQuery),+function(e){function t(t){var n=t.attr("data-target");n||(n=t.attr("href"),n=n&&/#[A-Za-z]/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,""));var r=n&&e(n);return r&&r.length?r:t.parent()}function n(n){n&&3===n.which||(e(i).remove(),e(s).each(function(){var r=e(this),i=t(r),s={relatedTarget:this};i.hasClass("open")&&(n&&"click"==n.type&&/input|textarea/i.test(n.target.tagName)&&e.contains(i[0],n.target)||(i.trigger(n=e.Event("hide.bs.dropdown",s)),n.isDefaultPrevented()||(r.attr("aria-expanded","false"),i.removeClass("open").trigger(e.Event("hidden.bs.dropdown",s)))))}))}function r(t){return this.each(function(){var n=e(this),r=n.data("bs.dropdown");r||n.data("bs.dropdown",r=new o(this)),"string"==typeof t&&r[t].call(n)})}var i=".dropdown-backdrop",s='[data-toggle="dropdown"]',o=function(t){e(t).on("click.bs.dropdown",this.toggle)};o.VERSION="3.3.7",o.prototype.toggle=function(r){var i=e(this);if(!i.is(".disabled, :disabled")){var s=t(i),o=s.hasClass("open");if(n(),!o){"ontouchstart"in document.documentElement&&!s.closest(".navbar-nav").length&&e(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(e(this)).on("click",n);var u={relatedTarget:this};if(s.trigger(r=e.Event("show.bs.dropdown",u)),r.isDefaultPrevented())return;i.trigger("focus").attr("aria-expanded","true"),s.toggleClass("open").trigger(e.Event("shown.bs.dropdown",u))}return!1}},o.prototype.keydown=function(n){if(/(38|40|27|32)/.test(n.which)&&!/input|textarea/i.test(n.target.tagName)){var r=e(this);if(n.preventDefault(),n.stopPropagation(),!r.is(".disabled, :disabled")){var i=t(r),o=i.hasClass("open");if(!o&&27!=n.which||o&&27==n.which)return 27==n.which&&i.find(s).trigger("focus"),r.trigger("click");var u=" li:not(.disabled):visible a",l=i.find(".dropdown-menu"+u);if(l.length){var c=l.index(n.target);38==n.which&&c>0&&c--,40==n.which&&c<l.length-1&&c++,~c||(c=0),l.eq(c).trigger("focus")}}}};var u=e.fn.dropdown;e.fn.dropdown=r,e.fn.dropdown.Constructor=o,e.fn.dropdown.noConflict=function(){return e.fn.dropdown=u,this},e(document).on("click.bs.dropdown.data-api",n).on("click.bs.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on("click.bs.dropdown.data-api",s,o.prototype.toggle).on("keydown.bs.dropdown.data-api",s,o.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",o.prototype.keydown)}(jQuery),+function(e){function t(t,r){return this.each(function(){var i=e(this),s=i.data("bs.modal"),o=e.extend({},n.DEFAULTS,i.data(),"object"==typeof t&&t);s||i.data("bs.modal",s=new n(this,o)),"string"==typeof t?s[t](r):o.show&&s.show(r)})}var n=function(t,n){this.options=n,this.$body=e(document.body),this.$element=e(t),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,e.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};n.VERSION="3.3.7",n.TRANSITION_DURATION=300,n.BACKDROP_TRANSITION_DURATION=150,n.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},n.prototype.toggle=function(e){return this.isShown?this.hide():this.show(e)},n.prototype.show=function(t){var r=this,i=e.Event("show.bs.modal",{relatedTarget:t});this.$element.trigger(i),this.isShown||i.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',e.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){r.$element.one("mouseup.dismiss.bs.modal",function(t){e(t.target).is(r.$element)&&(r.ignoreBackdropClick=!0)})}),this.backdrop(function(){var i=e.support.transition&&r.$element.hasClass("fade");r.$element.parent().length||r.$element.appendTo(r.$body),r.$element.show().scrollTop(0),r.adjustDialog(),i&&r.$element[0].offsetWidth,r.$element.addClass("in"),r.enforceFocus();var s=e.Event("shown.bs.modal",{relatedTarget:t});i?r.$dialog.one("bsTransitionEnd",function(){r.$element.trigger("focus").trigger(s)}).emulateTransitionEnd(n.TRANSITION_DURATION):r.$element.trigger("focus").trigger(s)}))},n.prototype.hide=function(t){t&&t.preventDefault(),t=e.Event("hide.bs.modal"),this.$element.trigger(t),this.isShown&&!t.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),e(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),e.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",e.proxy(this.hideModal,this)).emulateTransitionEnd(n.TRANSITION_DURATION):this.hideModal())},n.prototype.enforceFocus=function(){e(document).off("focusin.bs.modal").on("focusin.bs.modal",e.proxy(function(e){document===e.target||this.$element[0]===e.target||this.$element.has(e.target).length||this.$element.trigger("focus")},this))},n.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",e.proxy(function(e){27==e.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},n.prototype.resize=function(){this.isShown?e(window).on("resize.bs.modal",e.proxy(this.handleUpdate,this)):e(window).off("resize.bs.modal")},n.prototype.hideModal=function(){var e=this;this.$element.hide(),this.backdrop(function(){e.$body.removeClass("modal-open"),e.resetAdjustments(),e.resetScrollbar(),e.$element.trigger("hidden.bs.modal")})},n.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},n.prototype.backdrop=function(t){var r=this,i=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var s=e.support.transition&&i;if(this.$backdrop=e(document.createElement("div")).addClass("modal-backdrop "+i).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",e.proxy(function(e){return this.ignoreBackdropClick?void (this.ignoreBackdropClick=!1):void (e.target===e.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),s&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!t)return;s?this.$backdrop.one("bsTransitionEnd",t).emulateTransitionEnd(n.BACKDROP_TRANSITION_DURATION):t()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var o=function(){r.removeBackdrop(),t&&t()};e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",o).emulateTransitionEnd(n.BACKDROP_TRANSITION_DURATION):o()}else t&&t()},n.prototype.handleUpdate=function(){this.adjustDialog()},n.prototype.adjustDialog=function(){var e=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&e?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!e?this.scrollbarWidth:""})},n.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},n.prototype.checkScrollbar=function(){var e=window.innerWidth;if(!e){var t=document.documentElement.getBoundingClientRect();e=t.right-Math.abs(t.left)}this.bodyIsOverflowing=document.body.clientWidth<e,this.scrollbarWidth=this.measureScrollbar()},n.prototype.setScrollbar=function(){var e=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",e+this.scrollbarWidth)},n.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},n.prototype.measureScrollbar=function(){var e=document.createElement("div");e.className="modal-scrollbar-measure",this.$body.append(e);var t=e.offsetWidth-e.clientWidth;return this.$body[0].removeChild(e),t};var r=e.fn.modal;e.fn.modal=t,e.fn.modal.Constructor=n,e.fn.modal.noConflict=function(){return e.fn.modal=r,this},e(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(n){var r=e(this),i=r.attr("href"),s=e(r.attr("data-target")||i&&i.replace(/.*(?=#[^\s]+$)/,"")),o=s.data("bs.modal")?"toggle":e.extend({remote:!/#/.test(i)&&i},s.data(),r.data());r.is("a")&&n.preventDefault(),s.one("show.bs.modal",function(e){e.isDefaultPrevented()||s.one("hidden.bs.modal",function(){r.is(":visible")&&r.trigger("focus")})}),t.call(s,o,this)})}(jQuery),+function(e){function t(t){return this.each(function(){var r=e(this),i=r.data("bs.tooltip"),s="object"==typeof t&&t;!i&&/destroy|hide/.test(t)||(i||r.data("bs.tooltip",i=new n(this,s)),"string"==typeof t&&i[t]())})}var n=function(e,t){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",e,t)};n.VERSION="3.3.7",n.TRANSITION_DURATION=150,n.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},n.prototype.init=function(t,n,r){if(this.enabled=!0,this.type=t,this.$element=e(n),this.options=this.getOptions(r),this.$viewport=this.options.viewport&&e(e.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var i=this.options.trigger.split(" "),s=i.length;s--;){var o=i[s];if("click"==o)this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this));else if("manual"!=o){var u="hover"==o?"mouseenter":"focusin",f="hover"==o?"mouseleave":"focusout";this.$element.on(u+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(f+"."+this.type,this.options.selector,e.proxy(this.leave,this))}}this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},n.prototype.getDefaults=function(){return n.DEFAULTS},n.prototype.getOptions=function(t){return t=e.extend({},this.getDefaults(),this.$element.data(),t),t.delay&&"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),t},n.prototype.getDelegateOptions=function(){var t={},n=this.getDefaults();return this._options&&e.each(this._options,function(e,r){n[e]!=r&&(t[e]=r)}),t},n.prototype.enter=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget).data("bs."+this.type);return n||(n=new this.constructor(t.currentTarget,this.getDelegateOptions()),e(t.currentTarget).data("bs."+this.type,n)),t instanceof e.Event&&(n.inState["focusin"==t.type?"focus":"hover"]=!0),n.tip().hasClass("in")||"in"==n.hoverState?void (n.hoverState="in"):(clearTimeout(n.timeout),n.hoverState="in",n.options.delay&&n.options.delay.show?void (n.timeout=setTimeout(function(){"in"==n.hoverState&&n.show()},n.options.delay.show)):n.show())},n.prototype.isInStateTrue=function(){for(var e in this.inState)if(this.inState[e])return!0;return!1},n.prototype.leave=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget).data("bs."+this.type);if(n||(n=new this.constructor(t.currentTarget,this.getDelegateOptions()),e(t.currentTarget).data("bs."+this.type,n)),t instanceof e.Event&&(n.inState["focusout"==t.type?"focus":"hover"]=!1),!n.isInStateTrue())return clearTimeout(n.timeout),n.hoverState="out",n.options.delay&&n.options.delay.hide?void (n.timeout=setTimeout(function(){"out"==n.hoverState&&n.hide()},n.options.delay.hide)):n.hide()},n.prototype.show=function(){var t=e.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(t);var r=e.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(t.isDefaultPrevented()||!r)return;var i=this,s=this.tip(),o=this.getUID(this.type);this.setContent(),s.attr("id",o),this.$element.attr("aria-describedby",o),this.options.animation&&s.addClass("fade");var u="function"==typeof this.options.placement?this.options.placement.call(this,s[0],this.$element[0]):this.options.placement,f=/\s?auto?\s?/i,l=f.test(u);l&&(u=u.replace(f,"")||"top"),s.detach().css({top:0,left:0,display:"block"}).addClass(u).data("bs."+this.type,this),this.options.container?s.appendTo(this.options.container):s.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var h=this.getPosition(),p=s[0].offsetWidth,d=s[0].offsetHeight;if(l){var v=u,m=this.getPosition(this.$viewport);u="bottom"==u&&h.bottom+d>m.bottom?"top":"top"==u&&h.top-d<m.top?"bottom":"right"==u&&h.right+p>m.width?"left":"left"==u&&h.left-p<m.left?"right":u,s.removeClass(v).addClass(u)}var g=this.getCalculatedOffset(u,h,p,d);this.applyPlacement(g,u);var y=function(){var e=i.hoverState;i.$element.trigger("shown.bs."+i.type),i.hoverState=null,"out"==e&&i.leave(i)};e.support.transition&&this.$tip.hasClass("fade")?s.one("bsTransitionEnd",y).emulateTransitionEnd(n.TRANSITION_DURATION):y()}},n.prototype.applyPlacement=function(t,n){var r=this.tip(),i=r[0].offsetWidth,s=r[0].offsetHeight,o=parseInt(r.css("margin-top"),10),u=parseInt(r.css("margin-left"),10);isNaN(o)&&(o=0),isNaN(u)&&(u=0),t.top+=o,t.left+=u,e.offset.setOffset(r[0],e.extend({using:function(e){r.css({top:Math.round(e.top),left:Math.round(e.left)})}},t),0),r.addClass("in");var f=r[0].offsetWidth,l=r[0].offsetHeight;"top"==n&&l!=s&&(t.top=t.top+s-l);var c=this.getViewportAdjustedDelta(n,t,f,l);c.left?t.left+=c.left:t.top+=c.top;var h=/top|bottom/.test(n),p=h?2*c.left-i+f:2*c.top-s+l,d=h?"offsetWidth":"offsetHeight";r.offset(t),this.replaceArrow(p,r[0][d],h)},n.prototype.replaceArrow=function(e,t,n){this.arrow().css(n?"left":"top",50*(1-e/t)+"%").css(n?"top":"left","")},n.prototype.setContent=function(){var e=this.tip(),t=this.getTitle();e.find(".tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("fade in top bottom left right")},n.prototype.hide=function(t){function r(){"in"!=i.hoverState&&s.detach(),i.$element&&i.$element.removeAttr("aria-describedby").trigger("hidden.bs."+i.type),t&&t()}var i=this,s=e(this.$tip),o=e.Event("hide.bs."+this.type);if(this.$element.trigger(o),!o.isDefaultPrevented())return s.removeClass("in"),e.support.transition&&s.hasClass("fade")?s.one("bsTransitionEnd",r).emulateTransitionEnd(n.TRANSITION_DURATION):r(),this.hoverState=null,this},n.prototype.fixTitle=function(){var e=this.$element;(e.attr("title")||"string"!=typeof e.attr("data-original-title"))&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},n.prototype.hasContent=function(){return this.getTitle()},n.prototype.getPosition=function(t){t=t||this.$element;var n=t[0],r="BODY"==n.tagName,i=n.getBoundingClientRect();null==i.width&&(i=e.extend({},i,{width:i.right-i.left,height:i.bottom-i.top}));var s=window.SVGElement&&n instanceof window.SVGElement,o=r?{top:0,left:0}:s?null:t.offset(),u={scroll:r?document.documentElement.scrollTop||document.body.scrollTop:t.scrollTop()},f=r?{width:e(window).width(),height:e(window).height()}:null;return e.extend({},i,u,f,o)},n.prototype.getCalculatedOffset=function(e,t,n,r){return"bottom"==e?{top:t.top+t.height,left:t.left+t.width/2-n/2}:"top"==e?{top:t.top-r,left:t.left+t.width/2-n/2}:"left"==e?{top:t.top+t.height/2-r/2,left:t.left-n}:{top:t.top+t.height/2-r/2,left:t.left+t.width}},n.prototype.getViewportAdjustedDelta=function(e,t,n,r){var i={top:0,left:0};if(!this.$viewport)return i;var s=this.options.viewport&&this.options.viewport.padding||0,o=this.getPosition(this.$viewport);if(/right|left/.test(e)){var u=t.top-s-o.scroll,a=t.top+s-o.scroll+r;u<o.top?i.top=o.top-u:a>o.top+o.height&&(i.top=o.top+o.height-a)}else{var f=t.left-s,l=t.left+s+n;f<o.left?i.left=o.left-f:l>o.right&&(i.left=o.left+o.width-l)}return i},n.prototype.getTitle=function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||("function"==typeof n.title?n.title.call(t[0]):n.title)},n.prototype.getUID=function(e){do e+=~~(1e6*Math.random());while(document.getElementById(e));return e},n.prototype.tip=function(){if(!this.$tip&&(this.$tip=e(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},n.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},n.prototype.enable=function(){this.enabled=!0},n.prototype.disable=function(){this.enabled=!1},n.prototype.toggleEnabled=function(){this.enabled=!this.enabled},n.prototype.toggle=function(t){var n=this;t&&(n=e(t.currentTarget).data("bs."+this.type),n||(n=new this.constructor(t.currentTarget,this.getDelegateOptions()),e(t.currentTarget).data("bs."+this.type,n))),t?(n.inState.click=!n.inState.click,n.isInStateTrue()?n.enter(n):n.leave(n)):n.tip().hasClass("in")?n.leave(n):n.enter(n)},n.prototype.destroy=function(){var e=this;clearTimeout(this.timeout),this.hide(function(){e.$element.off("."+e.type).removeData("bs."+e.type),e.$tip&&e.$tip.detach(),e.$tip=null,e.$arrow=null,e.$viewport=null,e.$element=null})};var r=e.fn.tooltip;e.fn.tooltip=t,e.fn.tooltip.Constructor=n,e.fn.tooltip.noConflict=function(){return e.fn.tooltip=r,this}}(jQuery),+function(e){function t(t){return this.each(function(){var r=e(this),i=r.data("bs.popover"),s="object"==typeof t&&t;!i&&/destroy|hide/.test(t)||(i||r.data("bs.popover",i=new n(this,s)),"string"==typeof t&&i[t]())})}var n=function(e,t){this.init("popover",e,t)};if(!e.fn.tooltip)throw new Error("Popover requires tooltip.js");n.VERSION="3.3.7",n.DEFAULTS=e.extend({},e.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),n.prototype=e.extend({},e.fn.tooltip.Constructor.prototype),n.prototype.constructor=n,n.prototype.getDefaults=function(){return n.DEFAULTS},n.prototype.setContent=function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".popover-title")[this.options.html?"html":"text"](t),e.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof n?"html":"append":"text"](n),e.removeClass("fade top bottom left right in"),e.find(".popover-title").html()||e.find(".popover-title").hide()},n.prototype.hasContent=function(){return this.getTitle()||this.getContent()},n.prototype.getContent=function(){var e=this.$element,t=this.options;return e.attr("data-content")||("function"==typeof t.content?t.content.call(e[0]):t.content)},n.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var r=e.fn.popover;e.fn.popover=t,e.fn.popover.Constructor=n,e.fn.popover.noConflict=function(){return e.fn.popover=r,this}}(jQuery),+function(e){function t(n,r){this.$body=e(document.body),this.$scrollElement=e(e(n).is(document.body)?window:n),this.options=e.extend({},t.DEFAULTS,r),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",e.proxy(this.process,this)),this.refresh(),this.process()}function n(n){return this.each(function(){var r=e(this),i=r.data("bs.scrollspy"),s="object"==typeof n&&n;i||r.data("bs.scrollspy",i=new t(this,s)),"string"==typeof n&&i[n]()})}t.VERSION="3.3.7",t.DEFAULTS={offset:10},t.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},t.prototype.refresh=function(){var t=this,n="offset",r=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),e.isWindow(this.$scrollElement[0])||(n="position",r=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var t=e(this),i=t.data("target")||t.attr("href"),s=/^#./.test(i)&&e(i);return s&&s.length&&s.is(":visible")&&[[s[n]().top+r,i]]||null}).sort(function(e,t){return e[0]-t[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},t.prototype.process=function(){var e,t=this.$scrollElement.scrollTop()+this.options.offset,n=this.getScrollHeight(),r=this.options.offset+n-this.$scrollElement.height(),i=this.offsets,s=this.targets,o=this.activeTarget;if(this.scrollHeight!=n&&this.refresh(),t>=r)return o!=(e=s[s.length-1])&&this.activate(e);if(o&&t<i[0])return this.activeTarget=null,this.clear();for(e=i.length;e--;)o!=s[e]&&t>=i[e]&&(void 0===i[e+1]||t<i[e+1])&&this.activate(s[e])},t.prototype.activate=function(t){this.activeTarget=t,this.clear();var n=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',r=e(n).parents("li").addClass("active");r.parent(".dropdown-menu").length&&(r=r.closest("li.dropdown").addClass("active")),r.trigger("activate.bs.scrollspy")},t.prototype.clear=function(){e(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var r=e.fn.scrollspy;e.fn.scrollspy=n,e.fn.scrollspy.Constructor=t,e.fn.scrollspy.noConflict=function(){return e.fn.scrollspy=r,this},e(window).on("load.bs.scrollspy.data-api",function(){e('[data-spy="scroll"]').each(function(){var t=e(this);n.call(t,t.data())})})}(jQuery),+function(e){function t(t){return this.each(function(){var r=e(this),i=r.data("bs.tab");i||r.data("bs.tab",i=new n(this)),"string"==typeof t&&i[t]()})}var n=function(t){this.element=e(t)};n.VERSION="3.3.7",n.TRANSITION_DURATION=150,n.prototype.show=function(){var t=this.element,n=t.closest("ul:not(.dropdown-menu)"),r=t.data("target");if(r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,"")),!t.parent("li").hasClass("active")){var i=n.find(".active:last a"),s=e.Event("hide.bs.tab",{relatedTarget:t[0]}),o=e.Event("show.bs.tab",{relatedTarget:i[0]});if(i.trigger(s),t.trigger(o),!o.isDefaultPrevented()&&!s.isDefaultPrevented()){var u=e(r);this.activate(t.closest("li"),n),this.activate(u,u.parent(),function(){i.trigger({type:"hidden.bs.tab",relatedTarget:t[0]}),t.trigger({type:"shown.bs.tab",relatedTarget:i[0]})})}}},n.prototype.activate=function(t,r,i){function s(){o.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),t.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),u?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu").length&&t.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),i&&i()}var o=r.find("> .active"),u=i&&e.support.transition&&(o.length&&o.hasClass("fade")||!!r.find("> .fade").length);o.length&&u?o.one("bsTransitionEnd",s).emulateTransitionEnd(n.TRANSITION_DURATION):s(),o.removeClass("in")};var r=e.fn.tab;e.fn.tab=t,e.fn.tab.Constructor=n,e.fn.tab.noConflict=function(){return e.fn.tab=r,this};var i=function(n){n.preventDefault(),t.call(e(this),"show")};e(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',i).on("click.bs.tab.data-api",'[data-toggle="pill"]',i)}(jQuery),+function(e){function t(t){return this.each(function(){var r=e(this),i=r.data("bs.affix"),s="object"==typeof t&&t;i||r.data("bs.affix",i=new n(this,s)),"string"==typeof t&&i[t]()})}var n=function(t,r){this.options=e.extend({},n.DEFAULTS,r),this.$target=e(this.options.target).on("scroll.bs.affix.data-api",e.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",e.proxy(this.checkPositionWithEventLoop,this)),this.$element=e(t),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};n.VERSION="3.3.7",n.RESET="affix affix-top affix-bottom",n.DEFAULTS={offset:0,target:window},n.prototype.getState=function(e,t,n,r){var i=this.$target.scrollTop(),s=this.$element.offset(),o=this.$target.height();if(null!=n&&"top"==this.affixed)return i<n&&"top";if("bottom"==this.affixed)return null!=n?!(i+this.unpin<=s.top)&&"bottom":!(i+o<=e-r)&&"bottom";var u=null==this.affixed,a=u?i:s.top,f=u?o:t;return null!=n&&i<=n?"top":null!=r&&a+f>=e-r&&"bottom"},n.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(n.RESET).addClass("affix");var e=this.$target.scrollTop(),t=this.$element.offset();return this.pinnedOffset=t.top-e},n.prototype.checkPositionWithEventLoop=function(){setTimeout(e.proxy(this.checkPosition,this),1)},n.prototype.checkPosition=function(){if(this.$element.is(":visible")){var t=this.$element.height(),r=this.options.offset,i=r.top,s=r.bottom,o=Math.max(e(document).height(),e(document.body).height());"object"!=typeof r&&(s=i=r),"function"==typeof i&&(i=r.top(this.$element)),"function"==typeof s&&(s=r.bottom(this.$element));var u=this.getState(o,t,i,s);if(this.affixed!=u){null!=this.unpin&&this.$element.css("top","");var f="affix"+(u?"-"+u:""),l=e.Event(f+".bs.affix");if(this.$element.trigger(l),l.isDefaultPrevented())return;this.affixed=u,this.unpin="bottom"==u?this.getPinnedOffset():null,this.$element.removeClass(n.RESET).addClass(f).trigger(f.replace("affix","affixed")+".bs.affix")}"bottom"==u&&this.$element.offset({top:o-t-s})}};var r=e.fn.affix;e.fn.affix=t,e.fn.affix.Constructor=n,e.fn.affix.noConflict=function(){return e.fn.affix=r,this},e(window).on("load",function(){e('[data-spy="affix"]').each(function(){var n=e(this),r=n.data();r.offset=r.offset||{},null!=r.offsetBottom&&(r.offset.bottom=r.offsetBottom),null!=r.offsetTop&&(r.offset.top=r.offsetTop),t.call(n,r)})})}(jQuery),define("bootstrap",["jquery"],function(){}),define("modal",["config","preferences","links","jquery","laconic","bootstrap"],function(e,t,n){return function(r){function o(){var e=r.el.button({type:"button","class":"close","data-dismiss":"modal"});return r(e).html("&times;").on("click",function(e){var n=r(this).parents(".modal"),i=n.find("[data-notagain]");e.preventDefault();if(i&&i.prop("checked")){var s=i.attr("data-notagain");t.setNotAgain(s)}}),e}function u(e){return e.notagain&&t.persistent()?r.el.label(r.el.input({type:"checkbox","data-notagain":e.notagain,name:"dismiss"})," Don't show again!"):""}function a(){var e=r(this).find(".tm-input");e.each(function(){var e=r(this),t=e.data("prefilled"),n={};t&&(n.prefilled=t),e.tagsManager(n)})}var i="swishModal",s={_init:function(e){return this.each(function(){var e=r(this);e.addClass("swish-event-receiver"),e.on("help",function(t,n){e.swishModal("showHelp",n)}),e.on("pldoc",function(t,n){e.swishModal("showPlDoc",n)}),e.on("form",function(t,n){e.swishModal("showForm",n)}),e.on("dialog",function(t,n){e.swishModal("show",n)}),e.on("error",function(t,n){e.swishModal("show",n)}),e.on("alert",function(t,n){var r="<span class='glyphicon glyphicon-warning-sign'></span>";e.swishModal("show",{title:r,body:n})}),e.on("ajaxError",function(t,n){e.swishModal("showAjaxError",n)}),e.on("feedback",function(t,n){e.swishModal("feedback",n)})})},showHelp:function(n){var i=this;if(n.notagain&&t.notagain(n.notagain))return;r.ajax({url:e.http.locations.help+"/"+n.file,dataType:"html",success:function(e){var t=r("<div>");t.html(e),i.swishModal("show",r.extend({title:t.find("title").text(),body:t},n))}})},showForm:function(t){var n=this;r.ajax({url:e.http.locations.form+"/"+t.file,dataType:"html",success:function(e){var i=r("<div>");i.html(e),n.swishModal("show",r.extend({title:i.find("legend").text(),body:i},t))}})},showPlDoc:function(t){function n(t){var n="("+t.name+")/"+t.arity;return t.module&&(n=t.module+":"+n),e.http.locations.pldoc_doc_for+"?header=false&object="+encodeURIComponent(n)}function r(e,t){return e.parents("div.modal-dialog").addClass("swish-embedded-manual"),"<iframe class='swish-embedded-manual' onload='javascript:resizeIframe(this);' src='"+t+"'>"+"</iframe>"}var i={title:"SWI-Prolog manual",body:function(){return r(this,n(t))}};return this.swishModal("show",i)},show:function(e){var i=r.el.div({"class":"modal-body"}),s=r.el.h2(),f=r.el.div({"class":"modal-content"},r.el.div({"class":"modal-header"},u(e),o(),s),i),l=r.el.div({"class":"modal fade",id:"ajaxModal",tabindex:-1,role:"dialog"},r.el.div({"class":"modal-dialog"},f));e.notagain&&t.persistent()&&r(f).append(r.el.div({"class":"modal-footer"},u(e))),i=r(i);if(typeof e.body=="function"){var c=e.body.call(i);c&&i.append(c)}else i.html(e.body);return r(s).html(e.title),r(l).modal({show:!0}).on("click","a",n.followLink).on("shown.bs.modal",a).on("hidden.bs.modal",function(){r(this).remove()}),this},showAjaxError:function(e){var t=r.el.div();r(t).html(e.responseText);var n=r(t).find("h1"),i=n.text()||"Server error";n.remove();var s={title:i,body:t};this.swishModal("show",s)},feedback:function(e){var t=r.el.div({"class":"feedback "+e.type||""});return r(t).html(e.html),r(e.owner||"body").append(t),setTimeout(function(){r(t).hide(400,function(){r(t).remove()})},e.duration||1500),this}};window.resizeIframe=function(e){e.style.height=0,e.style.height=e.contentWindow.document.body.scrollHeight+20+"px"},r.fn.swishModal=function(e){if(s[e])return s[e].apply(this,Array.prototype.slice.call(arguments,1));if(typeof e=="object"||!e)return s._init.apply(this,arguments);r.error("Method "+e+" does not exist on jQuery."+i)}}(jQuery),{ajaxError:function(e){$(".swish-event-receiver").trigger("ajaxError",e)},feedback:function(e){$(".swish-event-receiver").trigger("feedback",e)},alert:function(e){$(".swish-event-receiver").trigger("alert",e)}}}),function(e){"function"==typeof define&&define.amd?define("jquery-ui",["jquery"],e):e(jQuery)}(function(e){function t(e){for(var t=e.css("visibility");"inherit"===t;)e=e.parent(),t=e.css("visibility");return"hidden"!==t}function n(e){for(var t,n;e.length&&e[0]!==document;){if(t=e.css("position"),("absolute"===t||"relative"===t||"fixed"===t)&&(n=parseInt(e.css("zIndex"),10),!isNaN(n)&&0!==n))return n;e=e.parent()}return 0}function r(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[""]),this.regional.en=e.extend(!0,{},this.regional[""]),this.regional["en-US"]=e.extend(!0,{},this.regional.en),this.dpDiv=i(e("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function i(t){var n="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.on("mouseout",n,function(){e(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).on("mouseover",n,s)}function s(){e.datepicker._isDisabledDatepicker(m.inline?m.dpDiv.parent()[0]:m.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover"))}function o(t,n){e.extend(t,n);for(var r in n)null==n[r]&&(t[r]=n[r]);return t}function u(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}e.ui=e.ui||{},e.ui.version="1.12.1";var a=0,f=Array.prototype.slice;e.cleanData=function(t){return function(n){var r,i,s;for(s=0;null!=(i=n[s]);s++)try{r=e._data(i,"events"),r&&r.remove&&e(i).triggerHandler("remove")}catch(o){}t(n)}}(e.cleanData),e.widget=function(t,n,r){var i,s,o,u={},a=t.split(".")[0];t=t.split(".")[1];var f=a+"-"+t;return r||(r=n,n=e.Widget),e.isArray(r)&&(r=e.extend.apply(null,[{}].concat(r))),e.expr[":"][f.toLowerCase()]=function(t){return!!e.data(t,f)},e[a]=e[a]||{},i=e[a][t],s=e[a][t]=function(e,t){return this._createWidget?(arguments.length&&this._createWidget(e,t),void 0):new s(e,t)},e.extend(s,i,{version:r.version,_proto:e.extend({},r),_childConstructors:[]}),o=new n,o.options=e.widget.extend({},o.options),e.each(r,function(t,r){return e.isFunction(r)?(u[t]=function(){function e(){return n.prototype[t].apply(this,arguments)}function i(e){return n.prototype[t].apply(this,e)}return function(){var t,n=this._super,s=this._superApply;return this._super=e,this._superApply=i,t=r.apply(this,arguments),this._super=n,this._superApply=s,t}}(),void 0):(u[t]=r,void 0)}),s.prototype=e.widget.extend(o,{widgetEventPrefix:i?o.widgetEventPrefix||t:t},u,{constructor:s,namespace:a,widgetName:t,widgetFullName:f}),i?(e.each(i._childConstructors,function(t,n){var r=n.prototype;e.widget(r.namespace+"."+r.widgetName,s,n._proto)}),delete i._childConstructors):n._childConstructors.push(s),e.widget.bridge(t,s),s},e.widget.extend=function(t){for(var n,r,i=f.call(arguments,1),s=0,o=i.length;o>s;s++)for(n in i[s])r=i[s][n],i[s].hasOwnProperty(n)&&void 0!==r&&(t[n]=e.isPlainObject(r)?e.isPlainObject(t[n])?e.widget.extend({},t[n],r):e.widget.extend({},r):r);return t},e.widget.bridge=function(t,n){var r=n.prototype.widgetFullName||t;e.fn[t]=function(i){var s="string"==typeof i,o=f.call(arguments,1),u=this;return s?this.length||"instance"!==i?this.each(function(){var n,s=e.data(this,r);return"instance"===i?(u=s,!1):s?e.isFunction(s[i])&&"_"!==i.charAt(0)?(n=s[i].apply(s,o),n!==s&&void 0!==n?(u=n&&n.jquery?u.pushStack(n.get()):n,!1):void 0):e.error("no such method '"+i+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; "+"attempted to call method '"+i+"'")}):u=void 0:(o.length&&(i=e.widget.extend.apply(null,[i].concat(o))),this.each(function(){var t=e.data(this,r);t?(t.option(i||{}),t._init&&t._init()):e.data(this,r,new n(i,this))})),u}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,n){n=e(n||this.defaultElement||this)[0],this.element=e(n),this.uuid=a++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),this.classesElementLookup={},n!==this&&(e.data(n,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===n&&this.destroy()}}),this.document=e(n.style?n.ownerDocument:n.document||n),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){var t=this;this._destroy(),e.each(this.classesElementLookup,function(e,n){t._removeClass(n,e)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:e.noop,widget:function(){return this.element},option:function(t,n){var r,i,s,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},r=t.split("."),t=r.shift(),r.length){for(i=o[t]=e.widget.extend({},this.options[t]),s=0;r.length-1>s;s++)i[r[s]]=i[r[s]]||{},i=i[r[s]];if(t=r.pop(),1===arguments.length)return void 0===i[t]?null:i[t];i[t]=n}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=n}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return"classes"===e&&this._setOptionClasses(t),this.options[e]=t,"disabled"===e&&this._setOptionDisabled(t),this},_setOptionClasses:function(t){var n,r,i;for(n in t)i=this.classesElementLookup[n],t[n]!==this.options.classes[n]&&i&&i.length&&(r=e(i.get()),this._removeClass(i,n),r.addClass(this._classes({element:r,keys:n,classes:t,add:!0})))},_setOptionDisabled:function(e){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!e),e&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(t){function n(n,s){var o,u;for(u=0;n.length>u;u++)o=i.classesElementLookup[n[u]]||e(),o=t.add?e(e.unique(o.get().concat(t.element.get()))):e(o.not(t.element).get()),i.classesElementLookup[n[u]]=o,r.push(n[u]),s&&t.classes[n[u]]&&r.push(t.classes[n[u]])}var r=[],i=this;return t=e.extend({element:this.element,classes:this.options.classes||{}},t),this._on(t.element,{remove:"_untrackClassesElement"}),t.keys&&n(t.keys.match(/\S+/g)||[],!0),t.extra&&n(t.extra.match(/\S+/g)||[]),r.join(" ")},_untrackClassesElement:function(t){var n=this;e.each(n.classesElementLookup,function(r,i){-1!==e.inArray(t.target,i)&&(n.classesElementLookup[r]=e(i.not(t.target).get()))})},_removeClass:function(e,t,n){return this._toggleClass(e,t,n,!1)},_addClass:function(e,t,n){return this._toggleClass(e,t,n,!0)},_toggleClass:function(e,t,n,r){r="boolean"==typeof r?r:n;var i="string"==typeof e||null===e,s={extra:i?t:n,keys:i?e:t,element:i?this.element:e,add:r};return s.element.toggleClass(this._classes(s),r),this},_on:function(t,n,r){var i,s=this;"boolean"!=typeof t&&(r=n,n=t,t=!1),r?(n=i=e(n),this.bindings=this.bindings.add(n)):(r=n,n=this.element,i=this.widget()),e.each(r,function(r,o){function u(){return t||s.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?s[o]:o).apply(s,arguments):void 0}"string"!=typeof o&&(u.guid=o.guid=o.guid||u.guid||e.guid++);var a=r.match(/^([\w:-]*)\s*(.*)$/),f=a[1]+s.eventNamespace,l=a[2];l?i.on(f,l,u):n.on(f,u)})},_off:function(t,n){n=(n||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(n).off(n),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function n(){return("string"==typeof e?r[e]:e).apply(r,arguments)}var r=this;return setTimeout(n,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(e(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(e(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(e(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(e(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,n,r){var i,s,o=this.options[t];if(r=r||{},n=e.Event(n),n.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),n.target=this.element[0],s=n.originalEvent)for(i in s)i in n||(n[i]=s[i]);return this.element.trigger(n,r),!(e.isFunction(o)&&o.apply(this.element[0],[n].concat(r))===!1||n.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,n){e.Widget.prototype["_"+t]=function(r,i,s){"string"==typeof i&&(i={effect:i});var o,u=i?i===!0||"number"==typeof i?n:i.effect||n:t;i=i||{},"number"==typeof i&&(i={duration:i}),o=!e.isEmptyObject(i),i.complete=s,i.delay&&r.delay(i.delay),o&&e.effects&&e.effects.effect[u]?r[t](i):u!==t&&r[u]?r[u](i.duration,i.easing,s):r.queue(function(n){e(this)[t](),s&&s.call(r[0]),n()})}}),e.widget,function(){function t(e,t,n){return[parseFloat(e[0])*(c.test(e[0])?t/100:1),parseFloat(e[1])*(c.test(e[1])?n/100:1)]}function n(t,n){return parseInt(e.css(t,n),10)||0}function r(t){var n=t[0];return 9===n.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(n)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:n.preventDefault?{width:0,height:0,offset:{top:n.pageY,left:n.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}var i,s=Math.max,o=Math.abs,u=/left|center|right/,a=/top|center|bottom/,f=/[\+\-]\d+(\.[\d]+)?%?/,l=/^\w+/,c=/%$/,h=e.fn.position;e.position={scrollbarWidth:function(){if(void 0!==i)return i;var t,n,r=e("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),s=r.children()[0];return e("body").append(r),t=s.offsetWidth,r.css("overflow","scroll"),n=s.offsetWidth,t===n&&(n=r[0].clientWidth),r.remove(),i=t-n},getScrollInfo:function(t){var n=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),r=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),i="scroll"===n||"auto"===n&&t.width<t.element[0].scrollWidth,s="scroll"===r||"auto"===r&&t.height<t.element[0].scrollHeight;return{width:s?e.position.scrollbarWidth():0,height:i?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var n=e(t||window),r=e.isWindow(n[0]),i=!!n[0]&&9===n[0].nodeType,s=!r&&!i;return{element:n,isWindow:r,isDocument:i,offset:s?e(t).offset():{left:0,top:0},scrollLeft:n.scrollLeft(),scrollTop:n.scrollTop(),width:n.outerWidth(),height:n.outerHeight()}}},e.fn.position=function(i){if(!i||!i.of)return h.apply(this,arguments);i=e.extend({},i);var c,p,d,v,m,g,y=e(i.of),b=e.position.getWithinInfo(i.within),w=e.position.getScrollInfo(b),E=(i.collision||"flip").split(" "),S={};return g=r(y),y[0].preventDefault&&(i.at="left top"),p=g.width,d=g.height,v=g.offset,m=e.extend({},v),e.each(["my","at"],function(){var e,t,n=(i[this]||"").split(" ");1===n.length&&(n=u.test(n[0])?n.concat(["center"]):a.test(n[0])?["center"].concat(n):["center","center"]),n[0]=u.test(n[0])?n[0]:"center",n[1]=a.test(n[1])?n[1]:"center",e=f.exec(n[0]),t=f.exec(n[1]),S[this]=[e?e[0]:0,t?t[0]:0],i[this]=[l.exec(n[0])[0],l.exec(n[1])[0]]}),1===E.length&&(E[1]=E[0]),"right"===i.at[0]?m.left+=p:"center"===i.at[0]&&(m.left+=p/2),"bottom"===i.at[1]?m.top+=d:"center"===i.at[1]&&(m.top+=d/2),c=t(S.at,p,d),m.left+=c[0],m.top+=c[1],this.each(function(){var r,u,a=e(this),f=a.outerWidth(),l=a.outerHeight(),h=n(this,"marginLeft"),g=n(this,"marginTop"),x=f+h+n(this,"marginRight")+w.width,T=l+g+n(this,"marginBottom")+w.height,N=e.extend({},m),C=t(S.my,a.outerWidth(),a.outerHeight());"right"===i.my[0]?N.left-=f:"center"===i.my[0]&&(N.left-=f/2),"bottom"===i.my[1]?N.top-=l:"center"===i.my[1]&&(N.top-=l/2),N.left+=C[0],N.top+=C[1],r={marginLeft:h,marginTop:g},e.each(["left","top"],function(t,n){e.ui.position[E[t]]&&e.ui.position[E[t]][n](N,{targetWidth:p,targetHeight:d,elemWidth:f,elemHeight:l,collisionPosition:r,collisionWidth:x,collisionHeight:T,offset:[c[0]+C[0],c[1]+C[1]],my:i.my,at:i.at,within:b,elem:a})}),i.using&&(u=function(e){var t=v.left-N.left,n=t+p-f,r=v.top-N.top,u=r+d-l,c={target:{element:y,left:v.left,top:v.top,width:p,height:d},element:{element:a,left:N.left,top:N.top,width:f,height:l},horizontal:0>n?"left":t>0?"right":"center",vertical:0>u?"top":r>0?"bottom":"middle"};f>p&&p>o(t+n)&&(c.horizontal="center"),l>d&&d>o(r+u)&&(c.vertical="middle"),c.important=s(o(t),o(n))>s(o(r),o(u))?"horizontal":"vertical",i.using.call(this,e,c)}),a.offset(e.extend(N,{using:u}))})},e.ui.position={fit:{left:function(e,t){var n,r=t.within,i=r.isWindow?r.scrollLeft:r.offset.left,o=r.width,u=e.left-t.collisionPosition.marginLeft,a=i-u,f=u+t.collisionWidth-o-i;t.collisionWidth>o?a>0&&0>=f?(n=e.left+a+t.collisionWidth-o-i,e.left+=a-n):e.left=f>0&&0>=a?i:a>f?i+o-t.collisionWidth:i:a>0?e.left+=a:f>0?e.left-=f:e.left=s(e.left-u,e.left)},top:function(e,t){var n,r=t.within,i=r.isWindow?r.scrollTop:r.offset.top,o=t.within.height,u=e.top-t.collisionPosition.marginTop,a=i-u,f=u+t.collisionHeight-o-i;t.collisionHeight>o?a>0&&0>=f?(n=e.top+a+t.collisionHeight-o-i,e.top+=a-n):e.top=f>0&&0>=a?i:a>f?i+o-t.collisionHeight:i:a>0?e.top+=a:f>0?e.top-=f:e.top=s(e.top-u,e.top)}},flip:{left:function(e,t){var n,r,i=t.within,s=i.offset.left+i.scrollLeft,u=i.width,a=i.isWindow?i.scrollLeft:i.offset.left,f=e.left-t.collisionPosition.marginLeft,l=f-a,c=f+t.collisionWidth-u-a,h="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,p="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,d=-2*t.offset[0];0>l?(n=e.left+h+p+d+t.collisionWidth-u-s,(0>n||o(l)>n)&&(e.left+=h+p+d)):c>0&&(r=e.left-t.collisionPosition.marginLeft+h+p+d-a,(r>0||c>o(r))&&(e.left+=h+p+d))},top:function(e,t){var n,r,i=t.within,s=i.offset.top+i.scrollTop,u=i.height,a=i.isWindow?i.scrollTop:i.offset.top,f=e.top-t.collisionPosition.marginTop,l=f-a,c=f+t.collisionHeight-u-a,h="top"===t.my[1],p=h?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,d="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,v=-2*t.offset[1];0>l?(r=e.top+p+d+v+t.collisionHeight-u-s,(0>r||o(l)>r)&&(e.top+=p+d+v)):c>0&&(n=e.top-t.collisionPosition.marginTop+p+d+v-a,(n>0||c>o(n))&&(e.top+=p+d+v))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}}}(),e.ui.position,e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(n){return!!e.data(n,t)}}):function(t,n,r){return!!e.data(t,r[3])}}),e.fn.extend({disableSelection:function(){var e="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(e+".ui-disableSelection",function(e){e.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}});var l="ui-effects-",c="ui-effects-style",h="ui-effects-animated",p=e;e.effects={effect:{}},function(e,t){function n(e,t,n){var r=c[t.type]||{};return null==e?n||!t.def?null:t.def:(e=r.floor?~~e:parseFloat(e),isNaN(e)?t.def:r.mod?(e+r.mod)%r.mod:0>e?0:e>r.max?r.max:e)}function r(n){var r=f(),i=r._rgba=[];return n=n.toLowerCase(),d(a,function(e,s){var o,u=s.re.exec(n),a=u&&s.parse(u),f=s.space||"rgba";return a?(o=r[f](a),r[l[f].cache]=o[l[f].cache],i=r._rgba=o._rgba,!1):t}),i.length?("0,0,0,0"===i.join()&&e.extend(i,s.transparent),r):s[n]}function i(e,t,n){return n=(n+1)%1,1>6*n?e+6*(t-e)*n:1>2*n?t:2>3*n?e+6*(t-e)*(2/3-n):e}var s,o="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",u=/^([\-+])=\s*(\d+\.?\d*)/,a=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[2.55*e[1],2.55*e[2],2.55*e[3],e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],f=e.Color=function(t,n,r,i){return new e.Color.fn.parse(t,n,r,i)},l={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},c={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},h=f.support={},p=e("<p>")[0],d=e.each;p.style.cssText="background-color:rgba(1,1,1,.5)",h.rgba=p.style.backgroundColor.indexOf("rgba")>-1,d(l,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),f.fn=e.extend(f.prototype,{parse:function(i,o,u,a){if(i===t)return this._rgba=[null,null,null,null],this;(i.jquery||i.nodeType)&&(i=e(i).css(o),o=t);var c=this,h=e.type(i),p=this._rgba=[];return o!==t&&(i=[i,o,u,a],h="array"),"string"===h?this.parse(r(i)||s._default):"array"===h?(d(l.rgba.props,function(e,t){p[t.idx]=n(i[t.idx],t)}),this):"object"===h?(i instanceof f?d(l,function(e,t){i[t.cache]&&(c[t.cache]=i[t.cache].slice())}):d(l,function(t,r){var s=r.cache;d(r.props,function(e,t){if(!c[s]&&r.to){if("alpha"===e||null==i[e])return;c[s]=r.to(c._rgba)}c[s][t.idx]=n(i[e],t,!0)}),c[s]&&0>e.inArray(null,c[s].slice(0,3))&&(c[s][3]=1,r.from&&(c._rgba=r.from(c[s])))}),this):t},is:function(e){var n=f(e),r=!0,i=this;return d(l,function(e,s){var o,u=n[s.cache];return u&&(o=i[s.cache]||s.to&&s.to(i._rgba)||[],d(s.props,function(e,n){return null!=u[n.idx]?r=u[n.idx]===o[n.idx]:t})),r}),r},_space:function(){var e=[],t=this;return d(l,function(n,r){t[r.cache]&&e.push(n)}),e.pop()},transition:function(e,t){var r=f(e),i=r._space(),s=l[i],o=0===this.alpha()?f("transparent"):this,u=o[s.cache]||s.to(o._rgba),a=u.slice();return r=r[s.cache],d(s.props,function(e,i){var s=i.idx,o=u[s],f=r[s],l=c[i.type]||{};null!==f&&(null===o?a[s]=f:(l.mod&&(f-o>l.mod/2?o+=l.mod:o-f>l.mod/2&&(o-=l.mod)),a[s]=n((f-o)*t+o,i)))}),this[i](a)},blend:function(t){if(1===this._rgba[3])return this;var n=this._rgba.slice(),r=n.pop(),i=f(t)._rgba;return f(e.map(n,function(e,t){return(1-r)*i[t]+r*e}))},toRgbaString:function(){var t="rgba(",n=e.map(this._rgba,function(e,t){return null==e?t>2?1:0:e});return 1===n[3]&&(n.pop(),t="rgb("),t+n.join()+")"},toHslaString:function(){var t="hsla(",n=e.map(this.hsla(),function(e,t){return null==e&&(e=t>2?1:0),t&&3>t&&(e=Math.round(100*e)+"%"),e});return 1===n[3]&&(n.pop(),t="hsl("),t+n.join()+")"},toHexString:function(t){var n=this._rgba.slice(),r=n.pop();return t&&n.push(~~(255*r)),"#"+e.map(n,function(e){return e=(e||0).toString(16),1===e.length?"0"+e:e}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),f.fn.parse.prototype=f.fn,l.hsla.to=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t,n,r=e[0]/255,i=e[1]/255,s=e[2]/255,o=e[3],u=Math.max(r,i,s),a=Math.min(r,i,s),f=u-a,l=u+a,c=.5*l;return t=a===u?0:r===u?60*(i-s)/f+360:i===u?60*(s-r)/f+120:60*(r-i)/f+240,n=0===f?0:.5>=c?f/l:f/(2-l),[Math.round(t)%360,n,c,null==o?1:o]},l.hsla.from=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t=e[0]/360,n=e[1],r=e[2],s=e[3],o=.5>=r?r*(1+n):r+n-r*n,u=2*r-o;return[Math.round(255*i(u,o,t+1/3)),Math.round(255*i(u,o,t)),Math.round(255*i(u,o,t-1/3)),s]},d(l,function(r,i){var s=i.props,o=i.cache,a=i.to,l=i.from;f.fn[r]=function(r){if(a&&!this[o]&&(this[o]=a(this._rgba)),r===t)return this[o].slice();var i,u=e.type(r),c="array"===u||"object"===u?r:arguments,h=this[o].slice();return d(s,function(e,t){var r=c["object"===u?e:t.idx];null==r&&(r=h[t.idx]),h[t.idx]=n(r,t)}),l?(i=f(l(h)),i[o]=h,i):f(h)},d(s,function(t,n){f.fn[t]||(f.fn[t]=function(i){var s,o=e.type(i),a="alpha"===t?this._hsla?"hsla":"rgba":r,f=this[a](),l=f[n.idx];return"undefined"===o?l:("function"===o&&(i=i.call(this,l),o=e.type(i)),null==i&&n.empty?this:("string"===o&&(s=u.exec(i),s&&(i=l+parseFloat(s[2])*("+"===s[1]?1:-1))),f[n.idx]=i,this[a](f)))})})}),f.hook=function(t){var n=t.split(" ");d(n,function(t,n){e.cssHooks[n]={set:function(t,i){var s,o,u="";if("transparent"!==i&&("string"!==e.type(i)||(s=r(i)))){if(i=f(s||i),!h.rgba&&1!==i._rgba[3]){for(o="backgroundColor"===n?t.parentNode:t;(""===u||"transparent"===u)&&o&&o.style;)try{u=e.css(o,"backgroundColor"),o=o.parentNode}catch(a){}i=i.blend(u&&"transparent"!==u?u:"_default")}i=i.toRgbaString()}try{t.style[n]=i}catch(a){}}},e.fx.step[n]=function(t){t.colorInit||(t.start=f(t.elem,n),t.end=f(t.end),t.colorInit=!0),e.cssHooks[n].set(t.elem,t.start.transition(t.end,t.pos))}})},f.hook(o),e.cssHooks.borderColor={expand:function(e){var t={};return d(["Top","Right","Bottom","Left"],function(n,r){t["border"+r+"Color"]=e}),t}},s=e.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(p),function(){function t(t){var n,r,i=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,s={};if(i&&i.length&&i[0]&&i[i[0]])for(r=i.length;r--;)n=i[r],"string"==typeof i[n]&&(s[e.camelCase(n)]=i[n]);else for(n in i)"string"==typeof i[n]&&(s[n]=i[n]);return s}function n(t,n){var r,s,o={};for(r in n)s=n[r],t[r]!==s&&(i[r]||(e.fx.step[r]||!isNaN(parseFloat(s)))&&(o[r]=s));return o}var r=["add","remove","toggle"],i={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,n){e.fx.step[n]=function(e){("none"!==e.end&&!e.setAttr||1===e.pos&&!e.setAttr)&&(p.style(e.elem,n,e.end),e.setAttr=!0)}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e.effects.animateClass=function(i,s,o,u){var a=e.speed(s,o,u);return this.queue(function(){var s,o=e(this),u=o.attr("class")||"",f=a.children?o.find("*").addBack():o;f=f.map(function(){var n=e(this);return{el:n,start:t(this)}}),s=function(){e.each(r,function(e,t){i[t]&&o[t+"Class"](i[t])})},s(),f=f.map(function(){return this.end=t(this.el[0]),this.diff=n(this.start,this.end),this}),o.attr("class",u),f=f.map(function(){var t=this,n=e.Deferred(),r=e.extend({},a,{queue:!1,complete:function(){n.resolve(t)}});return this.el.animate(this.diff,r),n.promise()}),e.when.apply(e,f.get()).done(function(){s(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),a.complete.call(o[0])})})},e.fn.extend({addClass:function(t){return function(n,r,i,s){return r?e.effects.animateClass.call(this,{add:n},r,i,s):t.apply(this,arguments)}}(e.fn.addClass),removeClass:function(t){return function(n,r,i,s){return arguments.length>1?e.effects.animateClass.call(this,{remove:n},r,i,s):t.apply(this,arguments)}}(e.fn.removeClass),toggleClass:function(t){return function(n,r,i,s,o){return"boolean"==typeof r||void 0===r?i?e.effects.animateClass.call(this,r?{add:n}:{remove:n},i,s,o):t.apply(this,arguments):e.effects.animateClass.call(this,{toggle:n},r,i,s)}}(e.fn.toggleClass),switchClass:function(t,n,r,i,s){return e.effects.animateClass.call(this,{add:n,remove:t},r,i,s)}})}(),function(){function t(t,n,r,i){return e.isPlainObject(t)&&(n=t,t=t.effect),t={effect:t},null==n&&(n={}),e.isFunction(n)&&(i=n,r=null,n={}),("number"==typeof n||e.fx.speeds[n])&&(i=r,r=n,n={}),e.isFunction(r)&&(i=r,r=null),n&&e.extend(t,n),r=r||n.duration,t.duration=e.fx.off?0:"number"==typeof r?r:r in e.fx.speeds?e.fx.speeds[r]:e.fx.speeds._default,t.complete=i||n.complete,t}function n(t){return!t||"number"==typeof t||e.fx.speeds[t]?!0:"string"!=typeof t||e.effects.effect[t]?e.isFunction(t)?!0:"object"!=typeof t||t.effect?!1:!0:!0}function r(e,t){var n=t.outerWidth(),r=t.outerHeight(),i=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/,s=i.exec(e)||["",0,n,r,0];return{top:parseFloat(s[1])||0,right:"auto"===s[2]?n:parseFloat(s[2]),bottom:"auto"===s[3]?r:parseFloat(s[3]),left:parseFloat(s[4])||0}}e.expr&&e.expr.filters&&e.expr.filters.animated&&(e.expr.filters.animated=function(t){return function(n){return!!e(n).data(h)||t(n)}}(e.expr.filters.animated)),e.uiBackCompat!==!1&&e.extend(e.effects,{save:function(e,t){for(var n=0,r=t.length;r>n;n++)null!==t[n]&&e.data(l+t[n],e[0].style[t[n]])},restore:function(e,t){for(var n,r=0,i=t.length;i>r;r++)null!==t[r]&&(n=e.data(l+t[r]),e.css(t[r],n))},setMode:function(e,t){return"toggle"===t&&(t=e.is(":hidden")?"show":"hide"),t},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var n={width:t.outerWidth(!0),height:t.outerHeight(!0),"float":t.css("float")},r=e("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),i={width:t.width(),height:t.height()},s=document.activeElement;try{s.id}catch(o){s=document.body}return t.wrap(r),(t[0]===s||e.contains(t[0],s))&&e(s).trigger("focus"),r=t.parent(),"static"===t.css("position")?(r.css({position:"relative"}),t.css({position:"relative"})):(e.extend(n,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,r){n[r]=t.css(r),isNaN(parseInt(n[r],10))&&(n[r]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(i),r.css(n).show()},removeWrapper:function(t){var n=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===n||e.contains(t[0],n))&&e(n).trigger("focus")),t}}),e.extend(e.effects,{version:"1.12.1",define:function(t,n,r){return r||(r=n,n="effect"),e.effects.effect[t]=r,e.effects.effect[t].mode=n,r},scaledDimensions:function(e,t,n){if(0===t)return{height:0,width:0,outerHeight:0,outerWidth:0};var r="horizontal"!==n?(t||100)/100:1,i="vertical"!==n?(t||100)/100:1;return{height:e.height()*i,width:e.width()*r,outerHeight:e.outerHeight()*i,outerWidth:e.outerWidth()*r}},clipToBox:function(e){return{width:e.clip.right-e.clip.left,height:e.clip.bottom-e.clip.top,left:e.clip.left,top:e.clip.top}},unshift:function(e,t,n){var r=e.queue();t>1&&r.splice.apply(r,[1,0].concat(r.splice(t,n))),e.dequeue()},saveStyle:function(e){e.data(c,e[0].style.cssText)},restoreStyle:function(e){e[0].style.cssText=e.data(c)||"",e.removeData(c)},mode:function(e,t){var n=e.is(":hidden");return"toggle"===t&&(t=n?"show":"hide"),(n?"hide"===t:"show"===t)&&(t="none"),t},getBaseline:function(e,t){var n,r;switch(e[0]){case"top":n=0;break;case"middle":n=.5;break;case"bottom":n=1;break;default:n=e[0]/t.height}switch(e[1]){case"left":r=0;break;case"center":r=.5;break;case"right":r=1;break;default:r=e[1]/t.width}return{x:r,y:n}},createPlaceholder:function(t){var n,r=t.css("position"),i=t.position();return t.css({marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()),/^(static|relative)/.test(r)&&(r="absolute",n=e("<"+t[0].nodeName+">").insertAfter(t).css({display:/^(inline|ruby)/.test(t.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight"),"float":t.css("float")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).addClass("ui-effects-placeholder"),t.data(l+"placeholder",n)),t.css({position:r,left:i.left,top:i.top}),n},removePlaceholder:function(e){var t=l+"placeholder",n=e.data(t);n&&(n.remove(),e.removeData(t))},cleanUp:function(t){e.effects.restoreStyle(t),e.effects.removePlaceholder(t)},setTransition:function(t,n,r,i){return i=i||{},e.each(n,function(e,n){var s=t.cssUnit(n);s[0]>0&&(i[n]=s[0]*r+s[1])}),i}}),e.fn.extend({effect:function(){function n(t){function n(){u.removeData(h),e.effects.cleanUp(u),"hide"===r.mode&&u.hide(),o()}function o(){e.isFunction(a)&&a.call(u[0]),e.isFunction(t)&&t()}var u=e(this);r.mode=l.shift(),e.uiBackCompat===!1||s?"none"===r.mode?(u[f](),o()):i.call(u[0],r,n):(u.is(":hidden")?"hide"===f:"show"===f)?(u[f](),o()):i.call(u[0],r,o)}var r=t.apply(this,arguments),i=e.effects.effect[r.effect],s=i.mode,o=r.queue,u=o||"fx",a=r.complete,f=r.mode,l=[],c=function(t){var n=e(this),r=e.effects.mode(n,f)||s;n.data(h,!0),l.push(r),s&&("show"===r||r===s&&"hide"===r)&&n.show(),s&&"none"===r||e.effects.saveStyle(n),e.isFunction(t)&&t()};return e.fx.off||!i?f?this[f](r.duration,a):this.each(function(){a&&a.call(this)}):o===!1?this.each(c).each(n):this.queue(u,c).queue(u,n)},show:function(e){return function(r){if(n(r))return e.apply(this,arguments);var i=t.apply(this,arguments);return i.mode="show",this.effect.call(this,i)}}(e.fn.show),hide:function(e){return function(r){if(n(r))return e.apply(this,arguments);var i=t.apply(this,arguments);return i.mode="hide",this.effect.call(this,i)}}(e.fn.hide),toggle:function(e){return function(r){if(n(r)||"boolean"==typeof r)return e.apply(this,arguments);var i=t.apply(this,arguments);return i.mode="toggle",this.effect.call(this,i)}}(e.fn.toggle),cssUnit:function(t){var n=this.css(t),r=[];return e.each(["em","px","%","pt"],function(e,t){n.indexOf(t)>0&&(r=[parseFloat(n),t])}),r},cssClip:function(e){return e?this.css("clip","rect("+e.top+"px "+e.right+"px "+e.bottom+"px "+e.left+"px)"):r(this.css("clip"),this)},transfer:function(t,n){var r=e(this),i=e(t.to),s="fixed"===i.css("position"),o=e("body"),u=s?o.scrollTop():0,a=s?o.scrollLeft():0,f=i.offset(),l={top:f.top-u,left:f.left-a,height:i.innerHeight(),width:i.innerWidth()},c=r.offset(),h=e("<div class='ui-effects-transfer'></div>").appendTo("body").addClass(t.className).css({top:c.top-u,left:c.left-a,height:r.innerHeight(),width:r.innerWidth(),position:s?"fixed":"absolute"}).animate(l,t.duration,t.easing,function(){h.remove(),e.isFunction(n)&&n()})}}),e.fx.step.clip=function(t){t.clipInit||(t.start=e(t.elem).cssClip(),"string"==typeof t.end&&(t.end=r(t.end,t.elem)),t.clipInit=!0),e(t.elem).cssClip({top:t.pos*(t.end.top-t.start.top)+t.start.top,right:t.pos*(t.end.right-t.start.right)+t.start.right,bottom:t.pos*(t.end.bottom-t.start.bottom)+t.start.bottom,left:t.pos*(t.end.left-t.start.left)+t.start.left})}}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,n){t[n]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return 0===e||1===e?e:-Math.pow(2,8*(e-1))*Math.sin((80*(e-1)-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){for(var t,n=4;((t=Math.pow(2,--n))-1)/11>e;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*t-2)/22-e,2)}}),e.each(t,function(t,n){e.easing["easeIn"+t]=n,e.easing["easeOut"+t]=function(e){return 1-n(1-e)},e.easing["easeInOut"+t]=function(e){return.5>e?n(2*e)/2:1-n(-2*e+2)/2}})}();var d=e.effects;e.effects.define("blind","hide",function(t,n){var r={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},i=e(this),s=t.direction||"up",o=i.cssClip(),u={clip:e.extend({},o)},a=e.effects.createPlaceholder(i);u.clip[r[s][0]]=u.clip[r[s][1]],"show"===t.mode&&(i.cssClip(u.clip),a&&a.css(e.effects.clipToBox(u)),u.clip=o),a&&a.animate(e.effects.clipToBox(u),t.duration,t.easing),i.animate(u,{queue:!1,duration:t.duration,easing:t.easing,complete:n})}),e.effects.define("bounce",function(t,n){var r,i,s,o=e(this),u=t.mode,a="hide"===u,f="show"===u,l=t.direction||"up",c=t.distance,h=t.times||5,p=2*h+(f||a?1:0),d=t.duration/p,v=t.easing,m="up"===l||"down"===l?"top":"left",g="up"===l||"left"===l,y=0,b=o.queue().length;for(e.effects.createPlaceholder(o),s=o.css(m),c||(c=o["top"===m?"outerHeight":"outerWidth"]()/3),f&&(i={opacity:1},i[m]=s,o.css("opacity",0).css(m,g?2*-c:2*c).animate(i,d,v)),a&&(c/=Math.pow(2,h-1)),i={},i[m]=s;h>y;y++)r={},r[m]=(g?"-=":"+=")+c,o.animate(r,d,v).animate(i,d,v),c=a?2*c:c/2;a&&(r={opacity:0},r[m]=(g?"-=":"+=")+c,o.animate(r,d,v)),o.queue(n),e.effects.unshift(o,b,p+1)}),e.effects.define("clip","hide",function(t,n){var r,i={},s=e(this),o=t.direction||"vertical",u="both"===o,a=u||"horizontal"===o,f=u||"vertical"===o;r=s.cssClip(),i.clip={top:f?(r.bottom-r.top)/2:r.top,right:a?(r.right-r.left)/2:r.right,bottom:f?(r.bottom-r.top)/2:r.bottom,left:a?(r.right-r.left)/2:r.left},e.effects.createPlaceholder(s),"show"===t.mode&&(s.cssClip(i.clip),i.clip=r),s.animate(i,{queue:!1,duration:t.duration,easing:t.easing,complete:n})}),e.effects.define("drop","hide",function(t,n){var r,i=e(this),s=t.mode,o="show"===s,u=t.direction||"left",a="up"===u||"down"===u?"top":"left",f="up"===u||"left"===u?"-=":"+=",l="+="===f?"-=":"+=",c={opacity:0};e.effects.createPlaceholder(i),r=t.distance||i["top"===a?"outerHeight":"outerWidth"](!0)/2,c[a]=f+r,o&&(i.css(c),c[a]=l+r,c.opacity=1),i.animate(c,{queue:!1,duration:t.duration,easing:t.easing,complete:n})}),e.effects.define("explode","hide",function(t,n){function r(){b.push(this),b.length===c*h&&i()}function i(){p.css({visibility:"visible"}),e(b).remove(),n()}var s,o,u,a,f,l,c=t.pieces?Math.round(Math.sqrt(t.pieces)):3,h=c,p=e(this),d=t.mode,v="show"===d,m=p.show().css("visibility","hidden").offset(),g=Math.ceil(p.outerWidth()/h),y=Math.ceil(p.outerHeight()/c),b=[];for(s=0;c>s;s++)for(a=m.top+s*y,l=s-(c-1)/2,o=0;h>o;o++)u=m.left+o*g,f=o-(h-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-o*g,top:-s*y}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g,height:y,left:u+(v?f*g:0),top:a+(v?l*y:0),opacity:v?0:1}).animate({left:u+(v?0:f*g),top:a+(v?0:l*y),opacity:v?1:0},t.duration||500,t.easing,r)}),e.effects.define("fade","toggle",function(t,n){var r="show"===t.mode;e(this).css("opacity",r?0:1).animate({opacity:r?1:0},{queue:!1,duration:t.duration,easing:t.easing,complete:n})}),e.effects.define("fold","hide",function(t,n){var r=e(this),i=t.mode,s="show"===i,o="hide"===i,u=t.size||15,a=/([0-9]+)%/.exec(u),f=!!t.horizFirst,l=f?["right","bottom"]:["bottom","right"],c=t.duration/2,h=e.effects.createPlaceholder(r),p=r.cssClip(),d={clip:e.extend({},p)},v={clip:e.extend({},p)},m=[p[l[0]],p[l[1]]],g=r.queue().length;a&&(u=parseInt(a[1],10)/100*m[o?0:1]),d.clip[l[0]]=u,v.clip[l[0]]=u,v.clip[l[1]]=0,s&&(r.cssClip(v.clip),h&&h.css(e.effects.clipToBox(v)),v.clip=p),r.queue(function(n){h&&h.animate(e.effects.clipToBox(d),c,t.easing).animate(e.effects.clipToBox(v),c,t.easing),n()}).animate(d,c,t.easing).animate(v,c,t.easing).queue(n),e.effects.unshift(r,g,4)}),e.effects.define("highlight","show",function(t,n){var r=e(this),i={backgroundColor:r.css("backgroundColor")};"hide"===t.mode&&(i.opacity=0),e.effects.saveStyle(r),r.css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(i,{queue:!1,duration:t.duration,easing:t.easing,complete:n})}),e.effects.define("size",function(t,n){var r,i,s,o=e(this),u=["fontSize"],a=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],f=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],l=t.mode,c="effect"!==l,h=t.scale||"both",p=t.origin||["middle","center"],d=o.css("position"),v=o.position(),m=e.effects.scaledDimensions(o),g=t.from||m,y=t.to||e.effects.scaledDimensions(o,0);e.effects.createPlaceholder(o),"show"===l&&(s=g,g=y,y=s),i={from:{y:g.height/m.height,x:g.width/m.width},to:{y:y.height/m.height,x:y.width/m.width}},("box"===h||"both"===h)&&(i.from.y!==i.to.y&&(g=e.effects.setTransition(o,a,i.from.y,g),y=e.effects.setTransition(o,a,i.to.y,y)),i.from.x!==i.to.x&&(g=e.effects.setTransition(o,f,i.from.x,g),y=e.effects.setTransition(o,f,i.to.x,y))),("content"===h||"both"===h)&&i.from.y!==i.to.y&&(g=e.effects.setTransition(o,u,i.from.y,g),y=e.effects.setTransition(o,u,i.to.y,y)),p&&(r=e.effects.getBaseline(p,m),g.top=(m.outerHeight-g.outerHeight)*r.y+v.top,g.left=(m.outerWidth-g.outerWidth)*r.x+v.left,y.top=(m.outerHeight-y.outerHeight)*r.y+v.top,y.left=(m.outerWidth-y.outerWidth)*r.x+v.left),o.css(g),("content"===h||"both"===h)&&(a=a.concat(["marginTop","marginBottom"]).concat(u),f=f.concat(["marginLeft","marginRight"]),o.find("*[width]").each(function(){var n=e(this),r=e.effects.scaledDimensions(n),s={height:r.height*i.from.y,width:r.width*i.from.x,outerHeight:r.outerHeight*i.from.y,outerWidth:r.outerWidth*i.from.x},o={height:r.height*i.to.y,width:r.width*i.to.x,outerHeight:r.height*i.to.y,outerWidth:r.width*i.to.x};i.from.y!==i.to.y&&(s=e.effects.setTransition(n,a,i.from.y,s),o=e.effects.setTransition(n,a,i.to.y,o)),i.from.x!==i.to.x&&(s=e.effects.setTransition(n,f,i.from.x,s),o=e.effects.setTransition(n,f,i.to.x,o)),c&&e.effects.saveStyle(n),n.css(s),n.animate(o,t.duration,t.easing,function(){c&&e.effects.restoreStyle(n)})})),o.animate(y,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){var t=o.offset();0===y.opacity&&o.css("opacity",g.opacity),c||(o.css("position","static"===d?"relative":d).offset(t),e.effects.saveStyle(o)),n()}})}),e.effects.define("scale",function(t,n){var r=e(this),i=t.mode,s=parseInt(t.percent,10)||(0===parseInt(t.percent,10)?0:"effect"!==i?0:100),o=e.extend(!0,{from:e.effects.scaledDimensions(r),to:e.effects.scaledDimensions(r,s,t.direction||"both"),origin:t.origin||["middle","center"]},t);t.fade&&(o.from.opacity=1,o.to.opacity=0),e.effects.effect.size.call(this,o,n)}),e.effects.define("puff","hide",function(t,n){var r=e.extend(!0,{},t,{fade:!0,percent:parseInt(t.percent,10)||150});e.effects.effect.scale.call(this,r,n)}),e.effects.define("pulsate","show",function(t,n){var r=e(this),i=t.mode,s="show"===i,o="hide"===i,u=s||o,a=2*(t.times||5)+(u?1:0),f=t.duration/a,l=0,c=1,h=r.queue().length;for((s||!r.is(":visible"))&&(r.css("opacity",0).show(),l=1);a>c;c++)r.animate({opacity:l},f,t.easing),l=1-l;r.animate({opacity:l},f,t.easing),r.queue(n),e.effects.unshift(r,h,a+1)}),e.effects.define("shake",function(t,n){var r=1,i=e(this),s=t.direction||"left",o=t.distance||20,u=t.times||3,a=2*u+1,f=Math.round(t.duration/a),l="up"===s||"down"===s?"top":"left",c="up"===s||"left"===s,h={},p={},d={},v=i.queue().length;for(e.effects.createPlaceholder(i),h[l]=(c?"-=":"+=")+o,p[l]=(c?"+=":"-=")+2*o,d[l]=(c?"-=":"+=")+2*o,i.animate(h,f,t.easing);u>r;r++)i.animate(p,f,t.easing).animate(d,f,t.easing);i.animate(p,f,t.easing).animate(h,f/2,t.easing).queue(n),e.effects.unshift(i,v,a+1)}),e.effects.define("slide","show",function(t,n){var r,i,s=e(this),o={up:["bottom","top"],down:["top","bottom"],left:["right","left"],right:["left","right"]},u=t.mode,a=t.direction||"left",f="up"===a||"down"===a?"top":"left",l="up"===a||"left"===a,c=t.distance||s["top"===f?"outerHeight":"outerWidth"](!0),h={};e.effects.createPlaceholder(s),r=s.cssClip(),i=s.position()[f],h[f]=(l?-1:1)*c+i,h.clip=s.cssClip(),h.clip[o[a][1]]=h.clip[o[a][0]],"show"===u&&(s.cssClip(h.clip),s.css(f,h[f]),h.clip=r,h[f]=i),s.animate(h,{queue:!1,duration:t.duration,easing:t.easing,complete:n})});var d;e.uiBackCompat!==!1&&(d=e.effects.define("transfer",function(t,n){e(this).transfer(t,n)})),e.ui.focusable=function(n,r){var i,s,o,u,a,f=n.nodeName.toLowerCase();return"area"===f?(i=n.parentNode,s=i.name,n.href&&s&&"map"===i.nodeName.toLowerCase()?(o=e("img[usemap='#"+s+"']"),o.length>0&&o.is(":visible")):!1):(/^(input|select|textarea|button|object)$/.test(f)?(u=!n.disabled,u&&(a=e(n).closest("fieldset")[0],a&&(u=!a.disabled))):u="a"===f?n.href||r:r,u&&e(n).is(":visible")&&t(e(n)))},e.extend(e.expr[":"],{focusable:function(t){return e.ui.focusable(t,null!=e.attr(t,"tabindex"))}}),e.ui.focusable,e.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):e(this[0].form)},e.ui.formResetMixin={_formResetHandler:function(){var t=e(this);setTimeout(function(){var n=t.data("ui-form-reset-instances");e.each(n,function(){this.refresh()})})},_bindFormResetHandler:function(){if(this.form=this.element.form(),this.form.length){var e=this.form.data("ui-form-reset-instances")||[];e.length||this.form.on("reset.ui-form-reset",this._formResetHandler),e.push(this),this.form.data("ui-form-reset-instances",e)}},_unbindFormResetHandler:function(){if(this.form.length){var t=this.form.data("ui-form-reset-instances");t.splice(e.inArray(this,t),1),t.length?this.form.data("ui-form-reset-instances",t):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}},"1.7"===e.fn.jquery.substring(0,3)&&(e.each(["Width","Height"],function(t,n){function r(t,n,r,s){return e.each(i,function(){n-=parseFloat(e.css(t,"padding"+this))||0,r&&(n-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(n-=parseFloat(e.css(t,"margin"+this))||0)}),n}var i="Width"===n?["Left","Right"]:["Top","Bottom"],s=n.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+n]=function(t){return void 0===t?o["inner"+n].call(this):this.each(function(){e(this).css(s,r(this,t)+"px")})},e.fn["outer"+n]=function(t,i){return"number"!=typeof t?o["outer"+n].call(this,t):this.each(function(){e(this).css(s,r(this,t,!0,i)+"px")})}}),e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},e.ui.escapeSelector=function(){var e=/([!"#$%&'()*+,.\/:;<=>?@[\]^`{|}~])/g;return function(t){return t.replace(e,"\\$1")}}(),e.fn.labels=function(){var t,n,r,i,s;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(i=this.eq(0).parents("label"),r=this.attr("id"),r&&(t=this.eq(0).parents().last(),s=t.add(t.length?t.siblings():this.siblings()),n="label[for='"+e.ui.escapeSelector(r)+"']",i=i.add(s.find(n).addBack(n))),this.pushStack(i))},e.fn.scrollParent=function(t){var n=this.css("position"),r="absolute"===n,i=t?/(auto|scroll|hidden)/:/(auto|scroll)/,s=this.parents().filter(function(){var t=e(this);return r&&"static"===t.css("position")?!1:i.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==n&&s.length?s:e(this[0].ownerDocument||document)},e.extend(e.expr[":"],{tabbable:function(t){var n=e.attr(t,"tabindex"),r=null!=n;return(!r||n>=0)&&e.ui.focusable(t,r)}}),e.fn.extend({uniqueId:function(){var e=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&e(this).removeAttr("id")})}}),e.widget("ui.accordion",{version:"1.12.1",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:!1,event:"click",header:"> li > :first-child, > :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=e(),this._addClass("ui-accordion","ui-widget ui-helper-reset"),this.element.attr("role","tablist"),t.collapsible||t.active!==!1&&null!=t.active||(t.active=0),this._processPanels(),0>t.active&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():e()}},_createIcons:function(){var t,n,r=this.options.icons;r&&(t=e("<span>"),this._addClass(t,"ui-accordion-header-icon","ui-icon "+r.header),t.prependTo(this.headers),n=this.active.children(".ui-accordion-header-icon"),this._removeClass(n,r.header)._addClass(n,null,r.activeHeader)._addClass(this.headers,"ui-accordion-icons"))},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons"),this.headers.children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeAttr("role"),this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId(),this._destroyIcons(),e=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||this.options.active!==!1||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons()),void 0)},_setOptionDisabled:function(e){this._super(e),this.element.attr("aria-disabled",e),this._toggleClass(null,"ui-state-disabled",!!e),this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!e)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var n=e.ui.keyCode,r=this.headers.length,i=this.headers.index(t.target),s=!1;switch(t.keyCode){case n.RIGHT:case n.DOWN:s=this.headers[(i+1)%r];break;case n.LEFT:case n.UP:s=this.headers[(i-1+r)%r];break;case n.SPACE:case n.ENTER:this._eventHandler(t);break;case n.HOME:s=this.headers[0];break;case n.END:s=this.headers[r-1]}s&&(e(t.target).attr("tabIndex",-1),e(s).attr("tabIndex",0),e(s).trigger("focus"),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().trigger("focus")},refresh:function(){var t=this.options;this._processPanels(),t.active===!1&&t.collapsible===!0||!this.headers.length?(t.active=!1,this.active=e()):t.active===!1?this._activate(0):this.active.length&&!e.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=e()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var e=this.headers,t=this.panels;this.headers=this.element.find(this.options.header),this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default"),this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide(),this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content"),t&&(this._off(e.not(this.headers)),this._off(t.not(this.panels)))},_refresh:function(){var t,n=this.options,r=n.heightStyle,i=this.element.parent();this.active=this._findActive(n.active),this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed"),this._addClass(this.active.next(),"ui-accordion-content-active"),this.active.next().show(),this.headers.attr("role","tab").each(function(){var t=e(this),n=t.uniqueId().attr("id"),r=t.next(),i=r.uniqueId().attr("id");t.attr("aria-controls",i),r.attr("aria-labelledby",n)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(n.event),"fill"===r?(t=i.height(),this.element.siblings(":visible").each(function(){var n=e(this),r=n.css("position");"absolute"!==r&&"fixed"!==r&&(t-=n.outerHeight(!0))}),this.headers.each(function(){t-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,t-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===r&&(t=0,this.headers.next().each(function(){var n=e(this).is(":visible");n||e(this).show(),t=Math.max(t,e(this).css("height","").height()),n||e(this).hide()}).height(t))},_activate:function(t){var n=this._findActive(t)[0];n!==this.active[0]&&(n=n||this.active[0],this._eventHandler({target:n,currentTarget:n,preventDefault:e.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):e()},_setupEvents:function(t){var n={keydown:"_keydown"};t&&e.each(t.split(" "),function(e,t){n[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,n),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var n,r,i=this.options,s=this.active,o=e(t.currentTarget),u=o[0]===s[0],a=u&&i.collapsible,f=a?e():o.next(),l=s.next(),c={oldHeader:s,oldPanel:l,newHeader:a?e():o,newPanel:f};t.preventDefault(),u&&!i.collapsible||this._trigger("beforeActivate",t,c)===!1||(i.active=a?!1:this.headers.index(o),this.active=u?e():o,this._toggle(c),this._removeClass(s,"ui-accordion-header-active","ui-state-active"),i.icons&&(n=s.children(".ui-accordion-header-icon"),this._removeClass(n,null,i.icons.activeHeader)._addClass(n,null,i.icons.header)),u||(this._removeClass(o,"ui-accordion-header-collapsed")._addClass(o,"ui-accordion-header-active","ui-state-active"),i.icons&&(r=o.children(".ui-accordion-header-icon"),this._removeClass(r,null,i.icons.header)._addClass(r,null,i.icons.activeHeader)),this._addClass(o.next(),"ui-accordion-content-active")))},_toggle:function(t){var n=t.newPanel,r=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=n,this.prevHide=r,this.options.animate?this._animate(n,r,t):(r.hide(),n.show(),this._toggleComplete(t)),r.attr({"aria-hidden":"true"}),r.prev().attr({"aria-selected":"false","aria-expanded":"false"}),n.length&&r.length?r.prev().attr({tabIndex:-1,"aria-expanded":"false"}):n.length&&this.headers.filter(function(){return 0===parseInt(e(this).attr("tabIndex"),10)}).attr("tabIndex",-1),n.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(e,t,n){var r,i,s,o=this,u=0,a=e.css("box-sizing"),f=e.length&&(!t.length||e.index()<t.index()),l=this.options.animate||{},c=f&&l.down||l,h=function(){o._toggleComplete(n)};return"number"==typeof c&&(s=c),"string"==typeof c&&(i=c),i=i||c.easing||l.easing,s=s||c.duration||l.duration,t.length?e.length?(r=e.show().outerHeight(),t.animate(this.hideProps,{duration:s,easing:i,step:function(e,t){t.now=Math.round(e)}}),e.hide().animate(this.showProps,{duration:s,easing:i,complete:h,step:function(e,n){n.now=Math.round(e),"height"!==n.prop?"content-box"===a&&(u+=n.now):"content"!==o.options.heightStyle&&(n.now=Math.round(r-t.outerHeight()-u),u=0)}}),void 0):t.animate(this.hideProps,s,i,h):e.animate(this.showProps,s,i,h)},_toggleComplete:function(e){var t=e.oldPanel,n=t.prev();this._removeClass(t,"ui-accordion-content-active"),this._removeClass(n,"ui-accordion-header-active")._addClass(n,"ui-accordion-header-collapsed"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}}),e.ui.safeActiveElement=function(e){var t;try{t=e.activeElement}catch(n){t=e.body}return t||(t=e.body),t.nodeName||(t=e.body),t},e.widget("ui.menu",{version:"1.12.1",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(e){e.preventDefault()},"click .ui-menu-item":function(t){var n=e(t.target),r=e(e.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&n.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),n.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&r.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){if(!this.previousFilter){var n=e(t.target).closest(".ui-menu-item"),r=e(t.currentTarget);n[0]===r[0]&&(this._removeClass(r.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(t,r))}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var n=this.active||this.element.find(this.options.items).eq(0);t||this.focus(e,n)},blur:function(t){this._delay(function(){var n=!e.contains(this.element[0],e.ui.safeActiveElement(this.document[0]));n&&this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){this._closeOnDocumentClick(e)&&this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){var t=this.element.find(".ui-menu-item").removeAttr("role aria-disabled"),n=t.children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),n.children().each(function(){var t=e(this);t.data("ui-menu-submenu-caret")&&t.remove()})},_keydown:function(t){var n,r,i,s,o=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:o=!1,r=this.previousFilter||"",s=!1,i=t.keyCode>=96&&105>=t.keyCode?""+(t.keyCode-96):String.fromCharCode(t.keyCode),clearTimeout(this.filterTimer),i===r?s=!0:i=r+i,n=this._filterMenuItems(i),n=s&&-1!==n.index(this.active.next())?this.active.nextAll(".ui-menu-item"):n,n.length||(i=String.fromCharCode(t.keyCode),n=this._filterMenuItems(i)),n.length?(this.focus(t,n),this.previousFilter=i,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}o&&t.preventDefault()},_activate:function(e){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(e):this.select(e))},refresh:function(){var t,n,r,i,s,o=this,u=this.options.icons.submenu,a=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),r=a.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),n=t.prev(),r=e("<span>").data("ui-menu-submenu-caret",!0);o._addClass(r,"ui-menu-icon","ui-icon "+u),n.attr("aria-haspopup","true").prepend(r),t.attr("aria-labelledby",n.attr("id"))}),this._addClass(r,"ui-menu","ui-widget ui-widget-content ui-front"),t=a.add(this.element),n=t.find(this.options.items),n.not(".ui-menu-item").each(function(){var t=e(this);o._isDivider(t)&&o._addClass(t,"ui-menu-divider","ui-widget-content")}),i=n.not(".ui-menu-item, .ui-menu-divider"),s=i.children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(i,"ui-menu-item")._addClass(s,"ui-menu-item-wrapper"),n.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(e,t){if("icons"===e){var n=this.element.find(".ui-menu-icon");this._removeClass(n,null,this.options.icons.submenu)._addClass(n,null,t.submenu)}this._super(e,t)},_setOptionDisabled:function(e){this._super(e),this.element.attr("aria-disabled",e+""),this._toggleClass(null,"ui-state-disabled",!!e)},focus:function(e,t){var n,r,i;this.blur(e,e&&"focus"===e.type),this._scrollIntoView(t),this.active=t.first(),r=this.active.children(".ui-menu-item-wrapper"),this._addClass(r,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",r.attr("id")),i=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),e&&"keydown"===e.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),n=t.children(".ui-menu"),n.length&&e&&/^mouse/.test(e.type)&&this._startOpening(n),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var n,r,i,s,o,u;this._hasScroll()&&(n=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,r=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,i=t.offset().top-this.activeMenu.offset().top-n-r,s=this.activeMenu.scrollTop(),o=this.activeMenu.height(),u=t.outerHeight(),0>i?this.activeMenu.scrollTop(s+i):i+u>o&&this.activeMenu.scrollTop(s+i-o+u))},blur:function(e,t){t||clearTimeout(this.timer),this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",e,{item:this.active}),this.active=null)},_startOpening:function(e){clearTimeout(this.timer),"true"===e.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(e)},this.delay))},_open:function(t){var n=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(n)},collapseAll:function(t,n){clearTimeout(this.timer),this.timer=this._delay(function(){var r=n?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));r.length||(r=this.element),this._close(r),this.blur(t),this._removeClass(r.find(".ui-state-active"),null,"ui-state-active"),this.activeMenu=r},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false")},_closeOnDocumentClick:function(t){return!e(t.target).closest(".ui-menu").length},_isDivider:function(e){return!/[^\-\u2014\u2013\s]/.test(e.text())},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,n){var r;this.active&&(r="first"===e||"last"===e?this.active["first"===e?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[e+"All"](".ui-menu-item").eq(0)),r&&r.length&&this.active||(r=this.activeMenu.find(this.options.items)[t]()),this.focus(n,r)},nextPage:function(t){var n,r,i;return this.active?(this.isLastItem()||(this._hasScroll()?(r=this.active.offset().top,i=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return n=e(this),0>n.offset().top-r-i}),this.focus(t,n)):this.focus(t,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())),void 0):(this.next(t),void 0)},previousPage:function(t){var n,r,i;return this.active?(this.isFirstItem()||(this._hasScroll()?(r=this.active.offset().top,i=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return n=e(this),n.offset().top-r+i>0}),this.focus(t,n)):this.focus(t,this.activeMenu.find(this.options.items).first())),void 0):(this.next(t),void 0)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||e(t.target).closest(".ui-menu-item");var n={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,n)},_filterMenuItems:function(t){var n=t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),r=RegExp("^"+n,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return r.test(e.trim(e(this).children(".ui-menu-item-wrapper").text()))})}}),e.widget("ui.autocomplete",{version:"1.12.1",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var t,n,r,i=this.element[0].nodeName.toLowerCase(),s="textarea"===i,o="input"===i;this.isMultiLine=s||!o&&this._isContentEditable(this.element),this.valueMethod=this.element[s||o?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(i){if(this.element.prop("readOnly"))return t=!0,r=!0,n=!0,void 0;t=!1,r=!1,n=!1;var s=e.ui.keyCode;switch(i.keyCode){case s.PAGE_UP:t=!0,this._move("previousPage",i);break;case s.PAGE_DOWN:t=!0,this._move("nextPage",i);break;case s.UP:t=!0,this._keyEvent("previous",i);break;case s.DOWN:t=!0,this._keyEvent("next",i);break;case s.ENTER:this.menu.active&&(t=!0,i.preventDefault(),this.menu.select(i));break;case s.TAB:this.menu.active&&this.menu.select(i);break;case s.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(i),i.preventDefault());break;default:n=!0,this._searchTimeout(i)}},keypress:function(r){if(t)return t=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&r.preventDefault(),void 0;if(!n){var i=e.ui.keyCode;switch(r.keyCode){case i.PAGE_UP:this._move("previousPage",r);break;case i.PAGE_DOWN:this._move("nextPage",r);break;case i.UP:this._keyEvent("previous",r);break;case i.DOWN:this._keyEvent("next",r)}}},input:function(e){return r?(r=!1,e.preventDefault(),void 0):(this._searchTimeout(e),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(e),this._change(e),void 0)}}),this._initSource(),this.menu=e("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,this.element[0]!==e.ui.safeActiveElement(this.document[0])&&this.element.trigger("focus")})},menufocus:function(t,n){var r,i;return this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type))?(this.menu.blur(),this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)}),void 0):(i=n.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:i})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(i.value),r=n.item.attr("aria-label")||i.value,r&&e.trim(r).length&&(this.liveRegion.children().hide(),e("<div>").text(r).appendTo(this.liveRegion)),void 0)},menuselect:function(t,n){var r=n.item.data("ui-autocomplete-item"),i=this.previous;this.element[0]!==e.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=i,this._delay(function(){this.previous=i,this.selectedItem=r})),!1!==this._trigger("select",t,{item:r})&&this._value(r.value),this.term=this._value(),this.close(t),this.selectedItem=r}}),this.liveRegion=e("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(t){var n=this.menu.element[0];return t.target===this.element[0]||t.target===n||e.contains(n,t.target)},_closeOnClickOutside:function(e){this._isEventTargetInWidget(e)||this.close()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front, dialog")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,n,r=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(n,r){r(e.ui.autocomplete.filter(t,n.term))}):"string"==typeof this.options.source?(n=this.options.source,this.source=function(t,i){r.xhr&&r.xhr.abort(),r.xhr=e.ajax({url:n,data:t,dataType:"json",success:function(e){i(e)},error:function(){i([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),n=this.menu.element.is(":visible"),r=e.altKey||e.ctrlKey||e.metaKey||e.shiftKey;(!t||t&&!n&&!r)&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):this._trigger("search",t)!==!1?this._search(e):void 0},_search:function(e){this.pending++,this._addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var t=++this.requestIndex;return e.proxy(function(e){t===this.requestIndex&&this.__response(e),this.pending--,this.pending||this._removeClass("ui-autocomplete-loading")},this)},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this._off(this.document,"mousedown"),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return"string"==typeof t?{label:t,value:t}:e.extend({},t,{label:t.label||t.value,value:t.value||t.label})})},_suggest:function(t){var n=this.menu.element.empty();this._renderMenu(n,t),this.isNewMenu=!0,this.menu.refresh(),n.show(),this._resizeMenu(),n.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(),this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,n){var r=this;e.each(n,function(e,n){r._renderItemData(t,n)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,n){return e("<li>").append(e("<div>").text(n.label)).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this.isMultiLine||this._value(this.term),this.menu.blur(),void 0):(this.menu[e](t),void 0):(this.search(null,t),void 0)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(e,t),t.preventDefault())},_isContentEditable:function(e){if(!e.length)return!1;var t=e.prop("contentEditable");return"inherit"===t?this._isContentEditable(e.parent()):"true"===t}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,n){var r=RegExp(e.ui.autocomplete.escapeRegex(n),"i");return e.grep(t,function(e){return r.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var n;this._superApply(arguments),this.options.disabled||this.cancelSearch||(n=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.children().hide(),e("<div>").text(n).appendTo(this.liveRegion))}}),e.ui.autocomplete;var v=/ui-corner-([a-z]){2,6}/g;e.widget("ui.controlgroup",{version:"1.12.1",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var t=this,n=[];e.each(this.options.items,function(r,i){var s,o={};return i?"controlgroupLabel"===r?(s=t.element.find(i),s.each(function(){var t=e(this);t.children(".ui-controlgroup-label-contents").length||t.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")}),t._addClass(s,null,"ui-widget ui-widget-content ui-state-default"),n=n.concat(s.get()),void 0):(e.fn[r]&&(o=t["_"+r+"Options"]?t["_"+r+"Options"]("middle"):{classes:{}},t.element.find(i).each(function(){var i=e(this),s=i[r]("instance"),u=e.widget.extend({},o);if("button"!==r||!i.parent(".ui-spinner").length){s||(s=i[r]()[r]("instance")),s&&(u.classes=t._resolveClassesValues(u.classes,s)),i[r](u);var a=i[r]("widget");e.data(a[0],"ui-controlgroup-data",s?s:i[r]("instance")),n.push(a[0])}})),void 0):void 0}),this.childWidgets=e(e.unique(n)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(t){this.childWidgets.each(function(){var n=e(this),r=n.data("ui-controlgroup-data");r&&r[t]&&r[t]()})},_updateCornerClass:function(e,t){var n="ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all",r=this._buildSimpleOptions(t,"label").classes.label;this._removeClass(e,null,n),this._addClass(e,null,r)},_buildSimpleOptions:function(e,t){var n="vertical"===this.options.direction,r={classes:{}};return r.classes[t]={middle:"",first:"ui-corner-"+(n?"top":"left"),last:"ui-corner-"+(n?"bottom":"right"),only:"ui-corner-all"}[e],r},_spinnerOptions:function(e){var t=this._buildSimpleOptions(e,"ui-spinner");return t.classes["ui-spinner-up"]="",t.classes["ui-spinner-down"]="",t},_buttonOptions:function(e){return this._buildSimpleOptions(e,"ui-button")},_checkboxradioOptions:function(e){return this._buildSimpleOptions(e,"ui-checkboxradio-label")},_selectmenuOptions:function(e){var t="vertical"===this.options.direction;return{width:t?"auto":!1,classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(t?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(t?"top":"left")},last:{"ui-selectmenu-button-open":t?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(t?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[e]}},_resolveClassesValues:function(t,n){var r={};return e.each(t,function(i){var s=n.options.classes[i]||"";s=e.trim(s.replace(v,"")),r[i]=(s+" "+t[i]).replace(/\s+/g," ")}),r},_setOption:function(e,t){return"direction"===e&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(e,t),"disabled"===e?(this._callChildMethod(t?"disable":"enable"),void 0):(this.refresh(),void 0)},refresh:function(){var t,n=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),t=this.childWidgets,this.options.onlyVisible&&(t=t.filter(":visible")),t.length&&(e.each(["first","last"],function(e,r){var i=t[r]().data("ui-controlgroup-data");if(i&&n["_"+i.widgetName+"Options"]){var s=n["_"+i.widgetName+"Options"](1===t.length?"only":r);s.classes=n._resolveClassesValues(s.classes,i),i.element[i.widgetName](s)}else n._updateCornerClass(t[r](),r)}),this._callChildMethod("refresh"))}}),e.widget("ui.checkboxradio",[e.ui.formResetMixin,{version:"1.12.1",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var t,n,r=this,i=this._super()||{};return this._readType(),n=this.element.labels(),this.label=e(n[n.length-1]),this.label.length||e.error("No label found for checkboxradio widget"),this.originalLabel="",this.label.contents().not(this.element[0]).each(function(){r.originalLabel+=3===this.nodeType?e(this).text():this.outerHTML}),this.originalLabel&&(i.label=this.originalLabel),t=this.element[0].disabled,null!=t&&(i.disabled=t),i},_create:function(){var e=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),e&&(this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this.icon&&this._addClass(this.icon,null,"ui-state-hover")),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var t=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===t&&/radio|checkbox/.test(this.type)||e.error("Can't create checkboxradio on element.nodeName="+t+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var t,n=this.element[0].name,r="input[name='"+e.ui.escapeSelector(n)+"']";return n?(t=this.form.length?e(this.form[0].elements).filter(r):e(r).filter(function(){return 0===e(this).form().length}),t.not(this.element)):e([])},_toggleClasses:function(){var t=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",t)._toggleClass(this.icon,null,"ui-icon-blank",!t),"radio"===this.type&&this._getRadioGroup().each(function(){var t=e(this).checkboxradio("instance");t&&t._removeClass(t.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(e,t){return"label"!==e||t?(this._super(e,t),"disabled"===e?(this._toggleClass(this.label,null,"ui-state-disabled",t),this.element[0].disabled=t,void 0):(this.refresh(),void 0)):void 0},_updateIcon:function(t){var n="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=e("<span>"),this.iconSpace=e("<span> </span>"),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(n+=t?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,t?"ui-icon-blank":"ui-icon-check")):n+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",n),t||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var e=this.label.contents().not(this.element[0]);this.icon&&(e=e.not(this.icon[0])),this.iconSpace&&(e=e.not(this.iconSpace[0])),e.remove(),this.label.append(this.options.label)},refresh:function(){var e=this.element[0].checked,t=this.element[0].disabled;this._updateIcon(e),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",e),null!==this.options.label&&this._updateLabel(),t!==this.options.disabled&&this._setOptions({disabled:t})}}]),e.ui.checkboxradio,e.widget("ui.button",{version:"1.12.1",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var e,t=this._super()||{};return this.isInput=this.element.is("input"),e=this.element[0].disabled,null!=e&&(t.disabled=e),this.originalLabel=this.isInput?this.element.val():this.element.html(),this.originalLabel&&(t.label=this.originalLabel),t},_create:function(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1),this.hasTitle=!!this.element.attr("title"),this.options.label&&this.options.label!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this.element.html(this.options.label)),this._addClass("ui-button","ui-widget"),this._setOption("disabled",this.options.disabled),this._enhance(),this.element.is("a")&&this._on({keyup:function(t){t.keyCode===e.ui.keyCode.SPACE&&(t.preventDefault(),this.element[0].click?this.element[0].click():this.element.trigger("click"))}})},_enhance:function(){this.element.is("button")||this.element.attr("role","button"),this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updateTooltip())},_updateTooltip:function(){this.title=this.element.attr("title"),this.options.showLabel||this.title||this.element.attr("title",this.options.label)},_updateIcon:function(t,n){var r="iconPosition"!==t,i=r?this.options.iconPosition:n,s="top"===i||"bottom"===i;this.icon?r&&this._removeClass(this.icon,null,this.options.icon):(this.icon=e("<span>"),this._addClass(this.icon,"ui-button-icon","ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only")),r&&this._addClass(this.icon,null,n),this._attachIcon(i),s?(this._addClass(this.icon,null,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconSpace||(this.iconSpace=e("<span> </span>"),this._addClass(this.iconSpace,"ui-button-icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._attachIconSpace(i))},_destroy:function(){this.element.removeAttr("role"),this.icon&&this.icon.remove(),this.iconSpace&&this.iconSpace.remove(),this.hasTitle||this.element.removeAttr("title")},_attachIconSpace:function(e){this.icon[/^(?:end|bottom)/.test(e)?"before":"after"](this.iconSpace)},_attachIcon:function(e){this.element[/^(?:end|bottom)/.test(e)?"append":"prepend"](this.icon)},_setOptions:function(e){var t=void 0===e.showLabel?this.options.showLabel:e.showLabel,n=void 0===e.icon?this.options.icon:e.icon;t||n||(e.showLabel=!0),this._super(e)},_setOption:function(e,t){"icon"===e&&(t?this._updateIcon(e,t):this.icon&&(this.icon.remove(),this.iconSpace&&this.iconSpace.remove())),"iconPosition"===e&&this._updateIcon(e,t),"showLabel"===e&&(this._toggleClass("ui-button-icon-only",null,!t),this._updateTooltip()),"label"===e&&(this.isInput?this.element.val(t):(this.element.html(t),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIconSpace(this.options.iconPosition)))),this._super(e,t),"disabled"===e&&(this._toggleClass(null,"ui-state-disabled",t),this.element[0].disabled=t,t&&this.element.blur())},refresh:function(){var e=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");e!==this.options.disabled&&this._setOptions({disabled:e}),this._updateTooltip()}}),e.uiBackCompat!==!1&&(e.widget("ui.button",e.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.options.showLabel=this.options.text),!this.options.showLabel&&this.options.text&&(this.options.text=this.options.showLabel),this.options.icon||!this.options.icons.primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.primary=this.options.icon):this.options.icons.primary?this.options.icon=this.options.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.iconPosition="end"),this._super()},_setOption:function(e,t){return"text"===e?(this._super("showLabel",t),void 0):("showLabel"===e&&(this.options.text=t),"icon"===e&&(this.options.icons.primary=t),"icons"===e&&(t.primary?(this._super("icon",t.primary),this._super("iconPosition","beginning")):t.secondary&&(this._super("icon",t.secondary),this._super("iconPosition","end"))),this._superApply(arguments),void 0)}}),e.fn.button=function(t){return function(){return!this.length||this.length&&"INPUT"!==this[0].tagName||this.length&&"INPUT"===this[0].tagName&&"checkbox"!==this.attr("type")&&"radio"!==this.attr("type")?t.apply(this,arguments):(e.ui.checkboxradio||e.error("Checkboxradio widget missing"),0===arguments.length?this.checkboxradio({icon:!1}):this.checkboxradio.apply(this,arguments))}}(e.fn.button),e.fn.buttonset=function(){return e.ui.controlgroup||e.error("Controlgroup widget missing"),"option"===arguments[0]&&"items"===arguments[1]&&arguments[2]?this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]):"option"===arguments[0]&&"items"===arguments[1]?this.controlgroup.apply(this,[arguments[0],"items.button"]):("object"==typeof arguments[0]&&arguments[0].items&&(arguments[0].items={button:arguments[0].items}),this.controlgroup.apply(this,arguments))}),e.ui.button,e.extend(e.ui,{datepicker:{version:"1.12.1"}});var m;e.extend(r.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return o(this._defaults,e||{}),this},_attachDatepicker:function(t,n){var r,i,s;r=t.nodeName.toLowerCase(),i="div"===r||"span"===r,t.id||(this.uuid+=1,t.id="dp"+this.uuid),s=this._newInst(e(t),i),s.settings=e.extend({},n||{}),"input"===r?this._connectDatepicker(t,s):i&&this._inlineDatepicker(t,s)},_newInst:function(t,n){var r=t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:r,input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:n,dpDiv:n?i(e("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,n){var r=e(t);n.append=e([]),n.trigger=e([]),r.hasClass(this.markerClassName)||(this._attachments(r,n),r.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp),this._autoSize(n),e.data(t,"datepicker",n),n.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,n){var r,i,s,o=this._get(n,"appendText"),u=this._get(n,"isRTL");n.append&&n.append.remove(),o&&(n.append=e("<span class='"+this._appendClass+"'>"+o+"</span>"),t[u?"before":"after"](n.append)),t.off("focus",this._showDatepicker),n.trigger&&n.trigger.remove(),r=this._get(n,"showOn"),("focus"===r||"both"===r)&&t.on("focus",this._showDatepicker),("button"===r||"both"===r)&&(i=this._get(n,"buttonText"),s=this._get(n,"buttonImage"),n.trigger=e(this._get(n,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:s,alt:i,title:i}):e("<button type='button'></button>").addClass(this._triggerClass).html(s?e("<img/>").attr({src:s,alt:i,title:i}):i)),t[u?"before":"after"](n.trigger),n.trigger.on("click",function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,n,r,i,s=new Date(2009,11,20),o=this._get(e,"dateFormat");o.match(/[DM]/)&&(t=function(e){for(n=0,r=0,i=0;e.length>i;i++)e[i].length>n&&(n=e[i].length,r=i);return r},s.setMonth(t(this._get(e,o.match(/MM/)?"monthNames":"monthNamesShort"))),s.setDate(t(this._get(e,o.match(/DD/)?"dayNames":"dayNamesShort"))+20-s.getDay())),e.input.attr("size",this._formatDate(e,s).length)}},_inlineDatepicker:function(t,n){var r=e(t);r.hasClass(this.markerClassName)||(r.addClass(this.markerClassName).append(n.dpDiv),e.data(t,"datepicker",n),this._setDate(n,this._getDefaultDate(n),!0),this._updateDatepicker(n),this._updateAlternate(n),n.settings.disabled&&this._disableDatepicker(t),n.dpDiv.css("display","block"))},_dialogDatepicker:function(t,n,r,i,s){var u,a,f,l,c,h=this._dialogInst;return h||(this.uuid+=1,u="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+u+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.on("keydown",this._doKeyDown),e("body").append(this._dialogInput),h=this._dialogInst=this._newInst(this._dialogInput,!1),h.settings={},e.data(this._dialogInput[0],"datepicker",h)),o(h.settings,i||{}),n=n&&n.constructor===Date?this._formatDate(h,n):n,this._dialogInput.val(n),this._pos=s?s.length?s:[s.pageX,s.pageY]:null,this._pos||(a=document.documentElement.clientWidth,f=document.documentElement.clientHeight,l=document.documentElement.scrollLeft||document.body.scrollLeft,c=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[a/2-100+l,f/2-150+c]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),h.settings.onSelect=r,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],"datepicker",h),this},_destroyDatepicker:function(t){var n,r=e(t),i=e.data(t,"datepicker");r.hasClass(this.markerClassName)&&(n=t.nodeName.toLowerCase(),e.removeData(t,"datepicker"),"input"===n?(i.append.remove(),i.trigger.remove(),r.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):("div"===n||"span"===n)&&r.removeClass(this.markerClassName).empty(),m===i&&(m=null))},_enableDatepicker:function(t){var n,r,i=e(t),s=e.data(t,"datepicker");i.hasClass(this.markerClassName)&&(n=t.nodeName.toLowerCase(),"input"===n?(t.disabled=!1,s.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===n||"span"===n)&&(r=i.children("."+this._inlineClass),r.children().removeClass("ui-state-disabled"),r.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var n,r,i=e(t),s=e.data(t,"datepicker");i.hasClass(this.markerClassName)&&(n=t.nodeName.toLowerCase(),"input"===n?(t.disabled=!0,s.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===n||"span"===n)&&(r=i.children("."+this._inlineClass),r.children().addClass("ui-state-disabled"),r.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;this._disabledInputs.length>t;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,"datepicker")}catch(n){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,n,r){var i,s,u,a,f=this._getInst(t);return 2===arguments.length&&"string"==typeof n?"defaults"===n?e.extend({},e.datepicker._defaults):f?"all"===n?e.extend({},f.settings):this._get(f,n):null:(i=n||{},"string"==typeof n&&(i={},i[n]=r),f&&(this._curInst===f&&this._hideDatepicker(),s=this._getDateDatepicker(t,!0),u=this._getMinMaxDate(f,"min"),a=this._getMinMaxDate(f,"max"),o(f.settings,i),null!==u&&void 0!==i.dateFormat&&void 0===i.minDate&&(f.settings.minDate=this._formatDate(f,u)),null!==a&&void 0!==i.dateFormat&&void 0===i.maxDate&&(f.settings.maxDate=this._formatDate(f,a)),"disabled"in i&&(i.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(e(t),f),this._autoSize(f),this._setDate(f,s),this._updateAlternate(f),this._updateDatepicker(f)),void 0)},_changeDatepicker:function(e,t,n){this._optionDatepicker(e,t,n)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var n=this._getInst(e);n&&(this._setDate(n,t),this._updateDatepicker(n),this._updateAlternate(n))},_getDateDatepicker:function(e,t){var n=this._getInst(e);return n&&!n.inline&&this._setDateFromField(n,t),n?this._getDate(n):null},_doKeyDown:function(t){var n,r,i,s=e.datepicker._getInst(t.target),o=!0,u=s.dpDiv.is(".ui-datepicker-rtl");if(s._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),o=!1;break;case 13:return i=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",s.dpDiv),i[0]&&e.datepicker._selectDay(t.target,s.selectedMonth,s.selectedYear,i[0]),n=e.datepicker._get(s,"onSelect"),n?(r=e.datepicker._formatDate(s),n.apply(s.input?s.input[0]:null,[r,s])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(s,"stepBigMonths"):-e.datepicker._get(s,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(s,"stepBigMonths"):+e.datepicker._get(s,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),o=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),o=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,u?1:-1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(s,"stepBigMonths"):-e.datepicker._get(s,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),o=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,u?-1:1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(s,"stepBigMonths"):+e.datepicker._get(s,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),o=t.ctrlKey||t.metaKey;break;default:o=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):o=!1;o&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var n,r,i=e.datepicker._getInst(t.target);return e.datepicker._get(i,"constrainInput")?(n=e.datepicker._possibleChars(e.datepicker._get(i,"dateFormat")),r=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||" ">r||!n||n.indexOf(r)>-1):void 0},_doKeyUp:function(t){var n,r=e.datepicker._getInst(t.target);if(r.input.val()!==r.lastVal)try{n=e.datepicker.parseDate(e.datepicker._get(r,"dateFormat"),r.input?r.input.val():null,e.datepicker._getFormatConfig(r)),n&&(e.datepicker._setDateFromField(r),e.datepicker._updateAlternate(r),e.datepicker._updateDatepicker(r))}catch(i){}return!0},_showDatepicker:function(t){if(t=t.target||t,"input"!==t.nodeName.toLowerCase()&&(t=e("input",t.parentNode)[0]),!e.datepicker._isDisabledDatepicker(t)&&e.datepicker._lastInput!==t){var r,i,s,u,a,f,l;r=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==r&&(e.datepicker._curInst.dpDiv.stop(!0,!0),r&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),i=e.datepicker._get(r,"beforeShow"),s=i?i.apply(t,[t,r]):{},s!==!1&&(o(r.settings,s),r.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(r),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),u=!1,e(t).parents().each(function(){return u|="fixed"===e(this).css("position"),!u}),a={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,r.dpDiv.empty(),r.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(r),a=e.datepicker._checkOffset(r,a,u),r.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":u?"fixed":"absolute",display:"none",left:a.left+"px",top:a.top+"px"}),r.inline||(f=e.datepicker._get(r,"showAnim"),l=e.datepicker._get(r,"duration"),r.dpDiv.css("z-index",n(e(t))+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[f]?r.dpDiv.show(f,e.datepicker._get(r,"showOptions"),l):r.dpDiv[f||"show"](f?l:null),e.datepicker._shouldFocusInput(r)&&r.input.trigger("focus"),e.datepicker._curInst=r))}},_updateDatepicker:function(t){this.maxRows=4,m=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t);var n,r=this._getNumberOfMonths(t),i=r[1],o=17,u=t.dpDiv.find("."+this._dayOverClass+" a");u.length>0&&s.apply(u.get(0)),t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),i>1&&t.dpDiv.addClass("ui-datepicker-multi-"+i).css("width",o*i+"em"),t.dpDiv[(1!==r[0]||1!==r[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&e.datepicker._shouldFocusInput(t)&&t.input.trigger("focus"),t.yearshtml&&(n=t.yearshtml,setTimeout(function(){n===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),n=t.yearshtml=null},0))},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(t,n,r){var i=t.dpDiv.outerWidth(),s=t.dpDiv.outerHeight(),o=t.input?t.input.outerWidth():0,u=t.input?t.input.outerHeight():0,a=document.documentElement.clientWidth+(r?0:e(document).scrollLeft()),f=document.documentElement.clientHeight+(r?0:e(document).scrollTop());return n.left-=this._get(t,"isRTL")?i-o:0,n.left-=r&&n.left===t.input.offset().left?e(document).scrollLeft():0,n.top-=r&&n.top===t.input.offset().top+u?e(document).scrollTop():0,n.left-=Math.min(n.left,n.left+i>a&&a>i?Math.abs(n.left+i-a):0),n.top-=Math.min(n.top,n.top+s>f&&f>s?Math.abs(s+u):0),n},_findPos:function(t){for(var n,r=this._getInst(t),i=this._get(r,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.filters.hidden(t));)t=t[i?"previousSibling":"nextSibling"];return n=e(t).offset(),[n.left,n.top]},_hideDatepicker:function(t){var n,r,i,s,o=this._curInst;!o||t&&o!==e.data(t,"datepicker")||this._datepickerShowing&&(n=this._get(o,"showAnim"),r=this._get(o,"duration"),i=function(){e.datepicker._tidyDialog(o)},e.effects&&(e.effects.effect[n]||e.effects[n])?o.dpDiv.hide(n,e.datepicker._get(o,"showOptions"),r,i):o.dpDiv["slideDown"===n?"slideUp":"fadeIn"===n?"fadeOut":"hide"](n?r:null,i),n||i(),this._datepickerShowing=!1,s=this._get(o,"onClose"),s&&s.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(e.datepicker._curInst){var n=e(t.target),r=e.datepicker._getInst(n[0]);(n[0].id!==e.datepicker._mainDivId&&0===n.parents("#"+e.datepicker._mainDivId).length&&!n.hasClass(e.datepicker.markerClassName)&&!n.closest("."+e.datepicker._triggerClass).length&&e.datepicker._datepickerShowing&&(!e.datepicker._inDialog||!e.blockUI)||n.hasClass(e.datepicker.markerClassName)&&e.datepicker._curInst!==r)&&e.datepicker._hideDatepicker()}},_adjustDate:function(t,n,r){var i=e(t),s=this._getInst(i[0]);this._isDisabledDatepicker(i[0])||(this._adjustInstDate(s,n+("M"===r?this._get(s,"showCurrentAtPos"):0),r),this._updateDatepicker(s))},_gotoToday:function(t){var n,r=e(t),i=this._getInst(r[0]);this._get(i,"gotoCurrent")&&i.currentDay?(i.selectedDay=i.currentDay,i.drawMonth=i.selectedMonth=i.currentMonth,i.drawYear=i.selectedYear=i.currentYear):(n=new Date,i.selectedDay=n.getDate(),i.drawMonth=i.selectedMonth=n.getMonth(),i.drawYear=i.selectedYear=n.getFullYear()),this._notifyChange(i),this._adjustDate(r)},_selectMonthYear:function(t,n,r){var i=e(t),s=this._getInst(i[0]);s["selected"+("M"===r?"Month":"Year")]=s["draw"+("M"===r?"Month":"Year")]=parseInt(n.options[n.selectedIndex].value,10),this._notifyChange(s),this._adjustDate(i)},_selectDay:function(t,n,r,i){var s,o=e(t);e(i).hasClass(this._unselectableClass)||this._isDisabledDatepicker(o[0])||(s=this._getInst(o[0]),s.selectedDay=s.currentDay=e("a",i).html(),s.selectedMonth=s.currentMonth=n,s.selectedYear=s.currentYear=r,this._selectDate(t,this._formatDate(s,s.currentDay,s.currentMonth,s.currentYear)))},_clearDate:function(t){var n=e(t);this._selectDate(n,"")},_selectDate:function(t,n){var r,i=e(t),s=this._getInst(i[0]);n=null!=n?n:this._formatDate(s),s.input&&s.input.val(n),this._updateAlternate(s),r=this._get(s,"onSelect"),r?r.apply(s.input?s.input[0]:null,[n,s]):s.input&&s.input.trigger("change"),s.inline?this._updateDatepicker(s):(this._hideDatepicker(),this._lastInput=s.input[0],"object"!=typeof s.input[0]&&s.input.trigger("focus"),this._lastInput=null)},_updateAlternate:function(t){var n,r,i,s=this._get(t,"altField");s&&(n=this._get(t,"altFormat")||this._get(t,"dateFormat"),r=this._getDate(t),i=this.formatDate(n,r,this._getFormatConfig(t)),e(s).val(i))},noWeekends:function(e){var t=e.getDay();return[t>0&&6>t,""]},iso8601Week:function(e){var t,n=new Date(e.getTime());return n.setDate(n.getDate()+4-(n.getDay()||7)),t=n.getTime(),n.setMonth(0),n.setDate(1),Math.floor(Math.round((t-n)/864e5)/7)+1},parseDate:function(t,n,r){if(null==t||null==n)throw"Invalid arguments";if(n="object"==typeof n?""+n:n+"",""===n)return null;var i,s,o,u,a=0,f=(r?r.shortYearCutoff:null)||this._defaults.shortYearCutoff,l="string"!=typeof f?f:(new Date).getFullYear()%100+parseInt(f,10),c=(r?r.dayNamesShort:null)||this._defaults.dayNamesShort,h=(r?r.dayNames:null)||this._defaults.dayNames,p=(r?r.monthNamesShort:null)||this._defaults.monthNamesShort,d=(r?r.monthNames:null)||this._defaults.monthNames,v=-1,m=-1,g=-1,y=-1,b=!1,w=function(e){var n=t.length>i+1&&t.charAt(i+1)===e;return n&&i++,n},E=function(e){var t=w(e),r="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,i="y"===e?r:1,s=RegExp("^\\d{"+i+","+r+"}"),o=n.substring(a).match(s);if(!o)throw"Missing number at position "+a;return a+=o[0].length,parseInt(o[0],10)},S=function(t,r,i){var s=-1,o=e.map(w(t)?i:r,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(o,function(e,t){var r=t[1];return n.substr(a,r.length).toLowerCase()===r.toLowerCase()?(s=t[0],a+=r.length,!1):void 0}),-1!==s)return s+1;throw"Unknown name at position "+a},x=function(){if(n.charAt(a)!==t.charAt(i))throw"Unexpected literal at position "+a;a++};for(i=0;t.length>i;i++)if(b)"'"!==t.charAt(i)||w("'")?x():b=!1;else switch(t.charAt(i)){case"d":g=E("d");break;case"D":S("D",c,h);break;case"o":y=E("o");break;case"m":m=E("m");break;case"M":m=S("M",p,d);break;case"y":v=E("y");break;case"@":u=new Date(E("@")),v=u.getFullYear(),m=u.getMonth()+1,g=u.getDate();break;case"!":u=new Date((E("!")-this._ticksTo1970)/1e4),v=u.getFullYear(),m=u.getMonth()+1,g=u.getDate();break;case"'":w("'")?x():b=!0;break;default:x()}if(n.length>a&&(o=n.substr(a),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===v?v=(new Date).getFullYear():100>v&&(v+=(new Date).getFullYear()-(new Date).getFullYear()%100+(l>=v?0:-100)),y>-1)for(m=1,g=y;;){if(s=this._getDaysInMonth(v,m-1),s>=g)break;m++,g-=s}if(u=this._daylightSavingAdjust(new Date(v,m-1,g)),u.getFullYear()!==v||u.getMonth()+1!==m||u.getDate()!==g)throw"Invalid date";return u},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:864e9*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(e,t,n){if(!t)return"";var r,i=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,s=(n?n.dayNames:null)||this._defaults.dayNames,o=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,u=(n?n.monthNames:null)||this._defaults.monthNames,a=function(t){var n=e.length>r+1&&e.charAt(r+1)===t;return n&&r++,n},f=function(e,t,n){var r=""+t;if(a(e))for(;n>r.length;)r="0"+r;return r},l=function(e,t,n,r){return a(e)?r[t]:n[t]},c="",h=!1;if(t)for(r=0;e.length>r;r++)if(h)"'"!==e.charAt(r)||a("'")?c+=e.charAt(r):h=!1;else switch(e.charAt(r)){case"d":c+=f("d",t.getDate(),2);break;case"D":c+=l("D",t.getDay(),i,s);break;case"o":c+=f("o",Math.round(((new Date(t.getFullYear(),t.getMonth(),t.getDate())).getTime()-(new Date(t.getFullYear(),0,0)).getTime())/864e5),3);break;case"m":c+=f("m",t.getMonth()+1,2);break;case"M":c+=l("M",t.getMonth(),o,u);break;case"y":c+=a("y")?t.getFullYear():(10>t.getFullYear()%100?"0":"")+t.getFullYear()%100;break;case"@":c+=t.getTime();break;case"!":c+=1e4*t.getTime()+this._ticksTo1970;break;case"'":a("'")?c+="'":h=!0;break;default:c+=e.charAt(r)}return c},_possibleChars:function(e){var t,n="",r=!1,i=function(n){var r=e.length>t+1&&e.charAt(t+1)===n;return r&&t++,r};for(t=0;e.length>t;t++)if(r)"'"!==e.charAt(t)||i("'")?n+=e.charAt(t):r=!1;else switch(e.charAt(t)){case"d":case"m":case"y":case"@":n+="0123456789";break;case"D":case"M":return null;case"'":i("'")?n+="'":r=!0;break;default:n+=e.charAt(t)}return n},_get:function(e,t){return void 0!==e.settings[t]?e.settings[t]:this._defaults[t]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var n=this._get(e,"dateFormat"),r=e.lastVal=e.input?e.input.val():null,i=this._getDefaultDate(e),s=i,o=this._getFormatConfig(e);try{s=this.parseDate(n,r,o)||i}catch(u){r=t?"":r}e.selectedDay=s.getDate(),e.drawMonth=e.selectedMonth=s.getMonth(),e.drawYear=e.selectedYear=s.getFullYear(),e.currentDay=r?s.getDate():0,e.currentMonth=r?s.getMonth():0,e.currentYear=r?s.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,n,r){var i=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},s=function(n){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),n,e.datepicker._getFormatConfig(t))}catch(r){}for(var i=(n.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,s=i.getFullYear(),o=i.getMonth(),u=i.getDate(),a=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,f=a.exec(n);f;){switch(f[2]||"d"){case"d":case"D":u+=parseInt(f[1],10);break;case"w":case"W":u+=7*parseInt(f[1],10);break;case"m":case"M":o+=parseInt(f[1],10),u=Math.min(u,e.datepicker._getDaysInMonth(s,o));break;case"y":case"Y":s+=parseInt(f[1],10),u=Math.min(u,e.datepicker._getDaysInMonth(s,o))}f=a.exec(n)}return new Date(s,o,u)},o=null==n||""===n?r:"string"==typeof n?s(n):"number"==typeof n?isNaN(n)?r:i(n):new Date(n.getTime());return o=o&&"Invalid Date"==""+o?r:o,o&&(o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0)),this._daylightSavingAdjust(o)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,n){var r=!t,i=e.selectedMonth,s=e.selectedYear,o=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=o.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=o.getMonth(),e.drawYear=e.selectedYear=e.currentYear=o.getFullYear(),i===e.selectedMonth&&s===e.selectedYear||n||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(r?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(t){var n=this._get(t,"stepMonths"),r="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(r,-n,"M")},next:function(){e.datepicker._adjustDate(r,+n,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(r)},selectDay:function(){return e.datepicker._selectDay(r,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(r,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(r,this,"Y"),!1}};e(this).on(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N,C,k,L,A,O,M,_,D,P,H,B,j,F,I,q=new Date,R=this._daylightSavingAdjust(new Date(q.getFullYear(),q.getMonth(),q.getDate())),U=this._get(e,"isRTL"),z=this._get(e,"showButtonPanel"),W=this._get(e,"hideIfNoPrevNext"),X=this._get(e,"navigationAsDateFormat"),V=this._getNumberOfMonths(e),$=this._get(e,"showCurrentAtPos"),J=this._get(e,"stepMonths"),K=1!==V[0]||1!==V[1],Q=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),G=this._getMinMaxDate(e,"min"),Y=this._getMinMaxDate(e,"max"),Z=e.drawMonth-$,et=e.drawYear;if(0>Z&&(Z+=12,et--),Y)for(t=this._daylightSavingAdjust(new Date(Y.getFullYear(),Y.getMonth()-V[0]*V[1]+1,Y.getDate())),t=G&&G>t?G:t;this._daylightSavingAdjust(new Date(et,Z,1))>t;)Z--,0>Z&&(Z=11,et--);for(e.drawMonth=Z,e.drawYear=et,n=this._get(e,"prevText"),n=X?this.formatDate(n,this._daylightSavingAdjust(new Date(et,Z-J,1)),this._getFormatConfig(e)):n,r=this._canAdjustMonth(e,-1,et,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(U?"e":"w")+"'>"+n+"</span></a>":W?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(U?"e":"w")+"'>"+n+"</span></a>",i=this._get(e,"nextText"),i=X?this.formatDate(i,this._daylightSavingAdjust(new Date(et,Z+J,1)),this._getFormatConfig(e)):i,s=this._canAdjustMonth(e,1,et,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(U?"w":"e")+"'>"+i+"</span></a>":W?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(U?"w":"e")+"'>"+i+"</span></a>",o=this._get(e,"currentText"),u=this._get(e,"gotoCurrent")&&e.currentDay?Q:R,o=X?this.formatDate(o,u,this._getFormatConfig(e)):o,a=e.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(e,"closeText")+"</button>",f=z?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(U?a:"")+(this._isInRange(e,u)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+o+"</button>":"")+(U?"":a)+"</div>":"",l=parseInt(this._get(e,"firstDay"),10),l=isNaN(l)?0:l,c=this._get(e,"showWeek"),h=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),d=this._get(e,"monthNames"),v=this._get(e,"monthNamesShort"),m=this._get(e,"beforeShowDay"),g=this._get(e,"showOtherMonths"),y=this._get(e,"selectOtherMonths"),b=this._getDefaultDate(e),w="",S=0;V[0]>S;S++){for(x="",this.maxRows=4,T=0;V[1]>T;T++){if(N=this._daylightSavingAdjust(new Date(et,Z,e.selectedDay)),C=" ui-corner-all",k="",K){if(k+="<div class='ui-datepicker-group",V[1]>1)switch(T){case 0:k+=" ui-datepicker-group-first",C=" ui-corner-"+(U?"right":"left");break;case V[1]-1:k+=" ui-datepicker-group-last",C=" ui-corner-"+(U?"left":"right");break;default:k+=" ui-datepicker-group-middle",C=""}k+="'>"}for(k+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+C+"'>"+(/all|left/.test(C)&&0===S?U?s:r:"")+(/all|right/.test(C)&&0===S?U?r:s:"")+this._generateMonthYearHeader(e,Z,et,G,Y,S>0||T>0,d,v)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",L=c?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",E=0;7>E;E++)A=(E+l)%7,L+="<th scope='col'"+((E+l+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+h[A]+"'>"+p[A]+"</span></th>";for(k+=L+"</tr></thead><tbody>",O=this._getDaysInMonth(et,Z),et===e.selectedYear&&Z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,O)),M=(this._getFirstDayOfMonth(et,Z)-l+7)%7,_=Math.ceil((M+O)/7),D=K?this.maxRows>_?this.maxRows:_:_,this.maxRows=D,P=this._daylightSavingAdjust(new Date(et,Z,1-M)),H=0;D>H;H++){for(k+="<tr>",B=c?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(P)+"</td>":"",E=0;7>E;E++)j=m?m.apply(e.input?e.input[0]:null,[P]):[!0,""],F=P.getMonth()!==Z,I=F&&!y||!j[0]||G&&G>P||Y&&P>Y,B+="<td class='"+((E+l+6)%7>=5?" ui-datepicker-week-end":"")+(F?" ui-datepicker-other-month":"")+(P.getTime()===N.getTime()&&Z===e.selectedMonth&&e._keyEvent||b.getTime()===P.getTime()&&b.getTime()===N.getTime()?" "+this._dayOverClass:"")+(I?" "+this._unselectableClass+" ui-state-disabled":"")+(F&&!g?"":" "+j[1]+(P.getTime()===Q.getTime()?" "+this._currentClass:"")+(P.getTime()===R.getTime()?" ui-datepicker-today":""))+"'"+(F&&!g||!j[2]?"":" title='"+j[2].replace(/'/g,"&#39;")+"'")+(I?"":" data-handler='selectDay' data-event='click' data-month='"+P.getMonth()+"' data-year='"+P.getFullYear()+"'")+">"+(F&&!g?"&#xa0;":I?"<span class='ui-state-default'>"+P.getDate()+"</span>":"<a class='ui-state-default"+(P.getTime()===R.getTime()?" ui-state-highlight":"")+(P.getTime()===Q.getTime()?" ui-state-active":"")+(F?" ui-priority-secondary":"")+"' href='#'>"+P.getDate()+"</a>")+"</td>",P.setDate(P.getDate()+1),P=this._daylightSavingAdjust(P);k+=B+"</tr>"}Z++,Z>11&&(Z=0,et++),k+="</tbody></table>"+(K?"</div>"+(V[0]>0&&T===V[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),x+=k}w+=x}return w+=f,e._keyEvent=!1,w},_generateMonthYearHeader:function(e,t,n,r,i,s,o,u){var a,f,l,c,h,p,d,v,m=this._get(e,"changeMonth"),g=this._get(e,"changeYear"),y=this._get(e,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",w="";if(s||!m)w+="<span class='ui-datepicker-month'>"+o[t]+"</span>";else{for(a=r&&r.getFullYear()===n,f=i&&i.getFullYear()===n,w+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",l=0;12>l;l++)(!a||l>=r.getMonth())&&(!f||i.getMonth()>=l)&&(w+="<option value='"+l+"'"+(l===t?" selected='selected'":"")+">"+u[l]+"</option>");w+="</select>"}if(y||(b+=w+(!s&&m&&g?"":"&#xa0;")),!e.yearshtml)if(e.yearshtml="",s||!g)b+="<span class='ui-datepicker-year'>"+n+"</span>";else{for(c=this._get(e,"yearRange").split(":"),h=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\-].*/)?n+parseInt(e.substring(1),10):e.match(/[+\-].*/)?h+parseInt(e,10):parseInt(e,10);return isNaN(t)?h:t},d=p(c[0]),v=Math.max(d,p(c[1]||"")),d=r?Math.max(d,r.getFullYear()):d,v=i?Math.min(v,i.getFullYear()):v,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";v>=d;d++)e.yearshtml+="<option value='"+d+"'"+(d===n?" selected='selected'":"")+">"+d+"</option>";e.yearshtml+="</select>",b+=e.yearshtml,e.yearshtml=null}return b+=this._get(e,"yearSuffix"),y&&(b+=(!s&&m&&g?"":"&#xa0;")+w),b+="</div>"},_adjustInstDate:function(e,t,n){var r=e.selectedYear+("Y"===n?t:0),i=e.selectedMonth+("M"===n?t:0),s=Math.min(e.selectedDay,this._getDaysInMonth(r,i))+("D"===n?t:0),o=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(r,i,s)));e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),("M"===n||"Y"===n)&&this._notifyChange(e)},_restrictMinMax:function(e,t){var n=this._getMinMaxDate(e,"min"),r=this._getMinMaxDate(e,"max"),i=n&&n>t?n:t;return r&&i>r?r:i},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return(new Date(e,t,1)).getDay()},_canAdjustMonth:function(e,t,n,r){var i=this._getNumberOfMonths(e),s=this._daylightSavingAdjust(new Date(n,r+(0>t?t:i[0]*i[1]),1));return 0>t&&s.setDate(this._getDaysInMonth(s.getFullYear(),s.getMonth())),this._isInRange(e,s)},_isInRange:function(e,t){var n,r,i=this._getMinMaxDate(e,"min"),s=this._getMinMaxDate(e,"max"),o=null,u=null,a=this._get(e,"yearRange");return a&&(n=a.split(":"),r=(new Date).getFullYear(),o=parseInt(n[0],10),u=parseInt(n[1],10),n[0].match(/[+\-].*/)&&(o+=r),n[1].match(/[+\-].*/)&&(u+=r)),(!i||t.getTime()>=i.getTime())&&(!s||t.getTime()<=s.getTime())&&(!o||t.getFullYear()>=o)&&(!u||u>=t.getFullYear())},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,n,r){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var i=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(r,n,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),i,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).on("mousedown",e.datepicker._checkExternalClick),e.datepicker.initialized=!0),0===e("#"+e.datepicker._mainDivId).length&&e("body").append(e.datepicker.dpDiv);var n=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(n)):this.each(function(){"string"==typeof t?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(n)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(n))},e.datepicker=new r,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.12.1",e.datepicker,e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var g=!1;e(document).on("mouseup",function(){g=!1}),e.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.on("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).on("click."+this.widgetName,function(n){return!0===e.data(n.target,t.widgetName+".preventClickEvent")?(e.removeData(n.target,t.widgetName+".preventClickEvent"),n.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!g){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var n=this,r=1===t.which,i="string"==typeof this.options.cancel&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;return r&&!i&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){n.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(t)!==!1,!this._mouseStarted)?(t.preventDefault(),!0):(!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return n._mouseMove(e)},this._mouseUpDelegate=function(e){return n._mouseUp(e)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),g=!0,!0)):!0}},_mouseMove:function(t){if(this._mouseMoved){if(e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button)return this._mouseUp(t);if(!t.which)if(t.originalEvent.altKey||t.originalEvent.ctrlKey||t.originalEvent.metaKey||t.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,g=!1,t.preventDefault()},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),e.ui.plugin={add:function(t,n,r){var i,s=e.ui[t].prototype;for(i in r)s.plugins[i]=s.plugins[i]||[],s.plugins[i].push([n,r[i]])},call:function(e,t,n,r){var i,s=e.plugins[t];if(s&&(r||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(i=0;s.length>i;i++)e.options[s[i][0]]&&s[i][1].apply(e.element,n)}},e.ui.safeBlur=function(t){t&&"body"!==t.nodeName.toLowerCase()&&e(t).trigger("blur")},e.widget("ui.draggable",e.ui.mouse,{version:"1.12.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(e,t){this._super(e,t),"handle"===e&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(t){var n=this.options;return this.helper||n.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(this._blurActiveElement(t),this._blockFrames(n.iframeFix===!0?"iframe":n.iframeFix),!0):!1)},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=e(this);return e("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var n=e.ui.safeActiveElement(this.document[0]),r=e(t.target);r.closest(n).length||e.ui.safeBlur(n)},_mouseStart:function(t){var n=this.options;return this.helper=this._createHelper(t),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===e(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,n.cursorAt&&this._adjustOffsetFromHelper(n.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(e){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:e.pageX-this.offset.left,top:e.pageY-this.offset.top}},_mouseDrag:function(t,n){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!n){var r=this._uiHash();if(this._trigger("drag",t,r)===!1)return this._mouseUp(new e.Event("mouseup",t)),!1;this.position=r.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var n=this,r=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(r=e.ui.ddmanager.drop(this,t)),this.dropped&&(r=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!r||"valid"===this.options.revert&&r||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,r)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){n._trigger("stop",t)!==!1&&n._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.trigger("focus"),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new e.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(t){var n=this.options,r=e.isFunction(n.helper),i=r?e(n.helper.apply(this.element[0],[t])):"clone"===n.helper?this.element.clone().removeAttr("id"):this.element;return i.parents("body").length||i.appendTo("parent"===n.appendTo?this.element[0].parentNode:n.appendTo),r&&i[0]===this.element[0]&&this._setPositionRelative(),i[0]===this.element[0]||/(fixed|absolute)/.test(i.css("position"))||i.css("position","absolute"),i},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(e){return/(html|body)/i.test(e.tagName)||e===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),n=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==n&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var e=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+(t?0:this.scrollParent.scrollTop()),left:e.left-(parseInt(this.helper.css("left"),10)||0)+(t?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,n,r,i=this.options,s=this.document[0];return this.relativeContainer=null,i.containment?"window"===i.containment?(this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||s.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===i.containment?(this.containment=[0,0,e(s).width()-this.helperProportions.width-this.margins.left,(e(s).height()||s.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):i.containment.constructor===Array?(this.containment=i.containment,void 0):("parent"===i.containment&&(i.containment=this.helper[0].parentNode),n=e(i.containment),r=n[0],r&&(t=/(scroll|auto)/.test(n.css("overflow")),this.containment=[(parseInt(n.css("borderLeftWidth"),10)||0)+(parseInt(n.css("paddingLeft"),10)||0),(parseInt(n.css("borderTopWidth"),10)||0)+(parseInt(n.css("paddingTop"),10)||0),(t?Math.max(r.scrollWidth,r.offsetWidth):r.offsetWidth)-(parseInt(n.css("borderRightWidth"),10)||0)-(parseInt(n.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(r.scrollHeight,r.offsetHeight):r.offsetHeight)-(parseInt(n.css("borderBottomWidth"),10)||0)-(parseInt(n.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=n),void 0):(this.containment=null,void 0)},_convertPositionTo:function(e,t){t||(t=this.position);var n="absolute"===e?1:-1,r=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*n+this.offset.parent.top*n-("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top)*n,left:t.left+this.offset.relative.left*n+this.offset.parent.left*n-("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)*n}},_generatePosition:function(e,t){var n,r,i,s,o=this.options,u=this._isRootNode(this.scrollParent[0]),a=e.pageX,f=e.pageY;return u&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),t&&(this.containment&&(this.relativeContainer?(r=this.relativeContainer.offset(),n=[this.containment[0]+r.left,this.containment[1]+r.top,this.containment[2]+r.left,this.containment[3]+r.top]):n=this.containment,e.pageX-this.offset.click.left<n[0]&&(a=n[0]+this.offset.click.left),e.pageY-this.offset.click.top<n[1]&&(f=n[1]+this.offset.click.top),e.pageX-this.offset.click.left>n[2]&&(a=n[2]+this.offset.click.left),e.pageY-this.offset.click.top>n[3]&&(f=n[3]+this.offset.click.top)),o.grid&&(i=o.grid[1]?this.originalPageY+Math.round((f-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,f=n?i-this.offset.click.top>=n[1]||i-this.offset.click.top>n[3]?i:i-this.offset.click.top>=n[1]?i-o.grid[1]:i+o.grid[1]:i,s=o.grid[0]?this.originalPageX+Math.round((a-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,a=n?s-this.offset.click.left>=n[0]||s-this.offset.click.left>n[2]?s:s-this.offset.click.left>=n[0]?s-o.grid[0]:s+o.grid[0]:s),"y"===o.axis&&(a=this.originalPageX),"x"===o.axis&&(f=this.originalPageY)),{top:f-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:u?0:this.offset.scroll.top),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:u?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(t,n,r){return r=r||this._uiHash(),e.ui.plugin.call(this,t,[n,r,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),r.offset=this.positionAbs),e.Widget.prototype._trigger.call(this,t,n,r)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,n,r){var i=e.extend({},n,{item:r.element});r.sortables=[],e(r.options.connectToSortable).each(function(){var n=e(this).sortable("instance");n&&!n.options.disabled&&(r.sortables.push(n),n.refreshPositions(),n._trigger("activate",t,i))})},stop:function(t,n,r){var i=e.extend({},n,{item:r.element});r.cancelHelperRemoval=!1,e.each(r.sortables,function(){var e=this;e.isOver?(e.isOver=0,r.cancelHelperRemoval=!0,e.cancelHelperRemoval=!1,e._storedCSS={position:e.placeholder.css("position"),top:e.placeholder.css("top"),left:e.placeholder.css("left")},e._mouseStop(t),e.options.helper=e.options._helper):(e.cancelHelperRemoval=!0,e._trigger("deactivate",t,i))})},drag:function(t,n,r){e.each(r.sortables,function(){var i=!1,s=this;s.positionAbs=r.positionAbs,s.helperProportions=r.helperProportions,s.offset.click=r.offset.click,s._intersectsWith(s.containerCache)&&(i=!0,e.each(r.sortables,function(){return this.positionAbs=r.positionAbs,this.helperProportions=r.helperProportions,this.offset.click=r.offset.click,this!==s&&this._intersectsWith(this.containerCache)&&e.contains(s.element[0],this.element[0])&&(i=!1),i})),i?(s.isOver||(s.isOver=1,r._parent=n.helper.parent(),s.currentItem=n.helper.appendTo(s.element).data("ui-sortable-item",!0),s.options._helper=s.options.helper,s.options.helper=function(){return n.helper[0]},t.target=s.currentItem[0],s._mouseCapture(t,!0),s._mouseStart(t,!0,!0),s.offset.click.top=r.offset.click.top,s.offset.click.left=r.offset.click.left,s.offset.parent.left-=r.offset.parent.left-s.offset.parent.left,s.offset.parent.top-=r.offset.parent.top-s.offset.parent.top,r._trigger("toSortable",t),r.dropped=s.element,e.each(r.sortables,function(){this.refreshPositions()}),r.currentItem=r.element,s.fromOutside=r),s.currentItem&&(s._mouseDrag(t),n.position=s.position)):s.isOver&&(s.isOver=0,s.cancelHelperRemoval=!0,s.options._revert=s.options.revert,s.options.revert=!1,s._trigger("out",t,s._uiHash(s)),s._mouseStop(t,!0),s.options.revert=s.options._revert,s.options.helper=s.options._helper,s.placeholder&&s.placeholder.remove(),n.helper.appendTo(r._parent),r._refreshOffsets(t),n.position=r._generatePosition(t,!0),r._trigger("fromSortable",t),r.dropped=!1,e.each(r.sortables,function(){this.refreshPositions()}))})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,n,r){var i=e("body"),s=r.options;i.css("cursor")&&(s._cursor=i.css("cursor")),i.css("cursor",s.cursor)},stop:function(t,n,r){var i=r.options;i._cursor&&e("body").css("cursor",i._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,n,r){var i=e(n.helper),s=r.options;i.css("opacity")&&(s._opacity=i.css("opacity")),i.css("opacity",s.opacity)},stop:function(t,n,r){var i=r.options;i._opacity&&e(n.helper).css("opacity",i._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(e,t,n){n.scrollParentNotHidden||(n.scrollParentNotHidden=n.helper.scrollParent(!1)),n.scrollParentNotHidden[0]!==n.document[0]&&"HTML"!==n.scrollParentNotHidden[0].tagName&&(n.overflowOffset=n.scrollParentNotHidden.offset())},drag:function(t,n,r){var i=r.options,s=!1,o=r.scrollParentNotHidden[0],u=r.document[0];o!==u&&"HTML"!==o.tagName?(i.axis&&"x"===i.axis||(r.overflowOffset.top+o.offsetHeight-t.pageY<i.scrollSensitivity?o.scrollTop=s=o.scrollTop+i.scrollSpeed:t.pageY-r.overflowOffset.top<i.scrollSensitivity&&(o.scrollTop=s=o.scrollTop-i.scrollSpeed)),i.axis&&"y"===i.axis||(r.overflowOffset.left+o.offsetWidth-t.pageX<i.scrollSensitivity?o.scrollLeft=s=o.scrollLeft+i.scrollSpeed:t.pageX-r.overflowOffset.left<i.scrollSensitivity&&(o.scrollLeft=s=o.scrollLeft-i.scrollSpeed))):(i.axis&&"x"===i.axis||(t.pageY-e(u).scrollTop()<i.scrollSensitivity?s=e(u).scrollTop(e(u).scrollTop()-i.scrollSpeed):e(window).height()-(t.pageY-e(u).scrollTop())<i.scrollSensitivity&&(s=e(u).scrollTop(e(u).scrollTop()+i.scrollSpeed))),i.axis&&"y"===i.axis||(t.pageX-e(u).scrollLeft()<i.scrollSensitivity?s=e(u).scrollLeft(e(u).scrollLeft()-i.scrollSpeed):e(window).width()-(t.pageX-e(u).scrollLeft())<i.scrollSensitivity&&(s=e(u).scrollLeft(e(u).scrollLeft()+i.scrollSpeed)))),s!==!1&&e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(r,t)}}),e.ui.plugin.add("draggable","snap",{start:function(t,n,r){var i=r.options;r.snapElements=[],e(i.snap.constructor!==String?i.snap.items||":data(ui-draggable)":i.snap).each(function(){var t=e(this),n=t.offset();this!==r.element[0]&&r.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:n.top,left:n.left})})},drag:function(t,n,r){var i,s,o,u,a,f,l,c,h,p,d=r.options,v=d.snapTolerance,m=n.offset.left,g=m+r.helperProportions.width,y=n.offset.top,b=y+r.helperProportions.height;for(h=r.snapElements.length-1;h>=0;h--)a=r.snapElements[h].left-r.margins.left,f=a+r.snapElements[h].width,l=r.snapElements[h].top-r.margins.top,c=l+r.snapElements[h].height,a-v>g||m>f+v||l-v>b||y>c+v||!e.contains(r.snapElements[h].item.ownerDocument,r.snapElements[h].item)?(r.snapElements[h].snapping&&r.options.snap.release&&r.options.snap.release.call(r.element,t,e.extend(r._uiHash(),{snapItem:r.snapElements[h].item})),r.snapElements[h].snapping=!1):("inner"!==d.snapMode&&(i=v>=Math.abs(l-b),s=v>=Math.abs(c-y),o=v>=Math.abs(a-g),u=v>=Math.abs(f-m),i&&(n.position.top=r._convertPositionTo("relative",{top:l-r.helperProportions.height,left:0}).top),s&&(n.position.top=r._convertPositionTo("relative",{top:c,left:0}).top),o&&(n.position.left=r._convertPositionTo("relative",{top:0,left:a-r.helperProportions.width}).left),u&&(n.position.left=r._convertPositionTo("relative",{top:0,left:f}).left)),p=i||s||o||u,"outer"!==d.snapMode&&(i=v>=Math.abs(l-y),s=v>=Math.abs(c-b),o=v>=Math.abs(a-m),u=v>=Math.abs(f-g),i&&(n.position.top=r._convertPositionTo("relative",{top:l,left:0}).top),s&&(n.position.top=r._convertPositionTo("relative",{top:c-r.helperProportions.height,left:0}).top),o&&(n.position.left=r._convertPositionTo("relative",{top:0,left:a}).left),u&&(n.position.left=r._convertPositionTo("relative",{top:0,left:f-r.helperProportions.width}).left)),!r.snapElements[h].snapping&&(i||s||o||u||p)&&r.options.snap.snap&&r.options.snap.snap.call(r.element,t,e.extend(r._uiHash(),{snapItem:r.snapElements[h].item})),r.snapElements[h].snapping=i||s||o||u||p)}}),e.ui.plugin.add("draggable","stack",{start:function(t,n,r){var i,s=r.options,o=e.makeArray(e(s.stack)).sort(function(t,n){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(n).css("zIndex"),10)||0)});o.length&&(i=parseInt(e(o[0]).css("zIndex"),10)||0,e(o).each(function(t){e(this).css("zIndex",i+t)}),this.css("zIndex",i+o.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,n,r){var i=e(n.helper),s=r.options;i.css("zIndex")&&(s._zIndex=i.css("zIndex")),i.css("zIndex",s.zIndex)},stop:function(t,n,r){var i=r.options;i._zIndex&&e(n.helper).css("zIndex",i._zIndex)}}),e.ui.draggable,e.widget("ui.resizable",e.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(e){return parseFloat(e)||0},_isNumber:function(e){return!isNaN(parseFloat(e))},_hasScroll:function(t,n){if("hidden"===e(t).css("overflow"))return!1;var r=n&&"left"===n?"scrollLeft":"scrollTop",i=!1;return t[r]>0?!0:(t[r]=1,i=t[r]>0,t[r]=0,i)},_create:function(){var t,n=this.options,r=this;this._addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!n.aspectRatio,aspectRatio:n.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:n.helper||n.ghost||n.animate?n.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(e("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,t={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(t),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(t),this._proportionallyResize()),this._setupHandles(),n.autoHide&&e(this.element).on("mouseenter",function(){n.disabled||(r._removeClass("ui-resizable-autohide"),r._handles.show())}).on("mouseleave",function(){n.disabled||r.resizing||(r._addClass("ui-resizable-autohide"),r._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,n=function(t){e(t).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(n(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),n(this.originalElement),this},_setOption:function(e,t){switch(this._super(e,t),e){case"handles":this._removeHandles(),this._setupHandles();break;default:}},_setupHandles:function(){var t,n,r,i,s,o=this.options,u=this;if(this.handles=o.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=e(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),r=this.handles.split(","),this.handles={},n=0;r.length>n;n++)t=e.trim(r[n]),i="ui-resizable-"+t,s=e("<div>"),this._addClass(s,"ui-resizable-handle "+i),s.css({zIndex:o.zIndex}),this.handles[t]=".ui-resizable-"+t,this.element.append(s);this._renderAxis=function(t){var n,r,i,s;t=t||this.element;for(n in this.handles)this.handles[n].constructor===String?this.handles[n]=this.element.children(this.handles[n]).first().show():(this.handles[n].jquery||this.handles[n].nodeType)&&(this.handles[n]=e(this.handles[n]),this._on(this.handles[n],{mousedown:u._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(r=e(this.handles[n],this.element),s=/sw|ne|nw|se|n|s/.test(n)?r.outerHeight():r.outerWidth(),i=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join(""),t.css(i,s),this._proportionallyResize()),this._handles=this._handles.add(this.handles[n])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){u.resizing||(this.className&&(s=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),u.axis=s&&s[1]?s[1]:"se")}),o.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(t){var n,r,i=!1;for(n in this.handles)r=e(this.handles[n])[0],(r===t.target||e.contains(r,t.target))&&(i=!0);return!this.options.disabled&&i},_mouseStart:function(t){var n,r,i,s=this.options,o=this.element;return this.resizing=!0,this._renderProxy(),n=this._num(this.helper.css("left")),r=this._num(this.helper.css("top")),s.containment&&(n+=e(s.containment).scrollLeft()||0,r+=e(s.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:n,top:r},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:o.width(),height:o.height()},this.originalSize=this._helper?{width:o.outerWidth(),height:o.outerHeight()}:{width:o.width(),height:o.height()},this.sizeDiff={width:o.outerWidth()-o.width(),height:o.outerHeight()-o.height()},this.originalPosition={left:n,top:r},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof s.aspectRatio?s.aspectRatio:this.originalSize.width/this.originalSize.height||1,i=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor","auto"===i?this.axis+"-resize":i),this._addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var n,r,i=this.originalMousePosition,s=this.axis,o=t.pageX-i.left||0,u=t.pageY-i.top||0,a=this._change[s];return this._updatePrevProperties(),a?(n=a.apply(this,[t,o,u]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(n=this._updateRatio(n,t)),n=this._respectSize(n,t),this._updateCache(n),this._propagate("resize",t),r=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(r)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(t){this.resizing=!1;var n,r,i,s,o,u,a,f=this.options,l=this;return this._helper&&(n=this._proportionallyResizeElements,r=n.length&&/textarea/i.test(n[0].nodeName),i=r&&this._hasScroll(n[0],"left")?0:l.sizeDiff.height,s=r?0:l.sizeDiff.width,o={width:l.helper.width()-s,height:l.helper.height()-i},u=parseFloat(l.element.css("left"))+(l.position.left-l.originalPosition.left)||null,a=parseFloat(l.element.css("top"))+(l.position.top-l.originalPosition.top)||null,f.animate||this.element.css(e.extend(o,{top:a,left:u})),l.helper.height(l.size.height),l.helper.width(l.size.width),this._helper&&!f.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var e={};return this.position.top!==this.prevPosition.top&&(e.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(e.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(e.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(e.height=this.size.height+"px"),this.helper.css(e),e},_updateVirtualBoundaries:function(e){var t,n,r,i,s,o=this.options;s={minWidth:this._isNumber(o.minWidth)?o.minWidth:0,maxWidth:this._isNumber(o.maxWidth)?o.maxWidth:1/0,minHeight:this._isNumber(o.minHeight)?o.minHeight:0,maxHeight:this._isNumber(o.maxHeight)?o.maxHeight:1/0},(this._aspectRatio||e)&&(t=s.minHeight*this.aspectRatio,r=s.minWidth/this.aspectRatio,n=s.maxHeight*this.aspectRatio,i=s.maxWidth/this.aspectRatio,t>s.minWidth&&(s.minWidth=t),r>s.minHeight&&(s.minHeight=r),s.maxWidth>n&&(s.maxWidth=n),s.maxHeight>i&&(s.maxHeight=i)),this._vBoundaries=s},_updateCache:function(e){this.offset=this.helper.offset(),this._isNumber(e.left)&&(this.position.left=e.left),this._isNumber(e.top)&&(this.position.top=e.top),this._isNumber(e.height)&&(this.size.height=e.height),this._isNumber(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,n=this.size,r=this.axis;return this._isNumber(e.height)?e.width=e.height*this.aspectRatio:this._isNumber(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===r&&(e.left=t.left+(n.width-e.width),e.top=null),"nw"===r&&(e.top=t.top+(n.height-e.height),e.left=t.left+(n.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,n=this.axis,r=this._isNumber(e.width)&&t.maxWidth&&t.maxWidth<e.width,i=this._isNumber(e.height)&&t.maxHeight&&t.maxHeight<e.height,s=this._isNumber(e.width)&&t.minWidth&&t.minWidth>e.width,o=this._isNumber(e.height)&&t.minHeight&&t.minHeight>e.height,u=this.originalPosition.left+this.originalSize.width,a=this.originalPosition.top+this.originalSize.height,f=/sw|nw|w/.test(n),l=/nw|ne|n/.test(n);return s&&(e.width=t.minWidth),o&&(e.height=t.minHeight),r&&(e.width=t.maxWidth),i&&(e.height=t.maxHeight),s&&f&&(e.left=u-t.minWidth),r&&f&&(e.left=u-t.maxWidth),o&&l&&(e.top=a-t.minHeight),i&&l&&(e.top=a-t.maxHeight),e.width||e.height||e.left||!e.top?e.width||e.height||e.top||!e.left||(e.left=null):e.top=null,e},_getPaddingPlusBorderDimensions:function(e){for(var t=0,n=[],r=[e.css("borderTopWidth"),e.css("borderRightWidth"),e.css("borderBottomWidth"),e.css("borderLeftWidth")],i=[e.css("paddingTop"),e.css("paddingRight"),e.css("paddingBottom"),e.css("paddingLeft")];4>t;t++)n[t]=parseFloat(r[t])||0,n[t]+=parseFloat(i[t])||0;return{height:n[0]+n[2],width:n[1]+n[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var e,t=0,n=this.helper||this.element;this._proportionallyResizeElements.length>t;t++)e=this._proportionallyResizeElements[t],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(e)),e.css({height:n.height()-this.outerDimensions.height||0,width:n.width()-this.outerDimensions.width||0})},_renderProxy:function(){var t=this.element,n=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("<div style='overflow:hidden;'></div>"),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++n.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var n=this.originalSize,r=this.originalPosition;return{left:r.left+t,width:n.width-t}},n:function(e,t,n){var r=this.originalSize,i=this.originalPosition;return{top:i.top+n,height:r.height-n}},s:function(e,t,n){return{height:this.originalSize.height+n}},se:function(t,n,r){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,n,r]))},sw:function(t,n,r){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,n,r]))},ne:function(t,n,r){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,n,r]))},nw:function(t,n,r){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,n,r]))}},_propagate:function(t,n){e.ui.plugin.call(this,t,[n,this.ui()]),"resize"!==t&&this._trigger(t,n,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var n=e(this).resizable("instance"),r=n.options,i=n._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),o=s&&n._hasScroll(i[0],"left")?0:n.sizeDiff.height,u=s?0:n.sizeDiff.width,a={width:n.size.width-u,height:n.size.height-o},f=parseFloat(n.element.css("left"))+(n.position.left-n.originalPosition.left)||null,l=parseFloat(n.element.css("top"))+(n.position.top-n.originalPosition.top)||null;n.element.animate(e.extend(a,l&&f?{top:l,left:f}:{}),{duration:r.animateDuration,easing:r.animateEasing,step:function(){var r={width:parseFloat(n.element.css("width")),height:parseFloat(n.element.css("height")),top:parseFloat(n.element.css("top")),left:parseFloat(n.element.css("left"))};i&&i.length&&e(i[0]).css({width:r.width,height:r.height}),n._updateCache(r),n._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var t,n,r,i,s,o,u,a=e(this).resizable("instance"),f=a.options,l=a.element,c=f.containment,h=c instanceof e?c.get(0):/parent/.test(c)?l.parent().get(0):c;h&&(a.containerElement=e(h),/document/.test(c)||c===document?(a.containerOffset={left:0,top:0},a.containerPosition={left:0,top:0},a.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(t=e(h),n=[],e(["Top","Right","Left","Bottom"]).each(function(e,r){n[e]=a._num(t.css("padding"+r))}),a.containerOffset=t.offset(),a.containerPosition=t.position(),a.containerSize={height:t.innerHeight()-n[3],width:t.innerWidth()-n[1]},r=a.containerOffset,i=a.containerSize.height,s=a.containerSize.width,o=a._hasScroll(h,"left")?h.scrollWidth:s,u=a._hasScroll(h)?h.scrollHeight:i,a.parentData={element:h,left:r.left,top:r.top,width:o,height:u}))},resize:function(t){var n,r,i,s,o=e(this).resizable("instance"),u=o.options,a=o.containerOffset,f=o.position,l=o._aspectRatio||t.shiftKey,c={top:0,left:0},h=o.containerElement,p=!0;h[0]!==document&&/static/.test(h.css("position"))&&(c=a),f.left<(o._helper?a.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-a.left:o.position.left-c.left),l&&(o.size.height=o.size.width/o.aspectRatio,p=!1),o.position.left=u.helper?a.left:0),f.top<(o._helper?a.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-a.top:o.position.top),l&&(o.size.width=o.size.height*o.aspectRatio,p=!1),o.position.top=o._helper?a.top:0),i=o.containerElement.get(0)===o.element.parent().get(0),s=/relative|absolute/.test(o.containerElement.css("position")),i&&s?(o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top):(o.offset.left=o.element.offset().left,o.offset.top=o.element.offset().top),n=Math.abs(o.sizeDiff.width+(o._helper?o.offset.left-c.left:o.offset.left-a.left)),r=Math.abs(o.sizeDiff.height+(o._helper?o.offset.top-c.top:o.offset.top-a.top)),n+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-n,l&&(o.size.height=o.size.width/o.aspectRatio,p=!1)),r+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-r,l&&(o.size.width=o.size.height*o.aspectRatio,p=!1)),p||(o.position.left=o.prevPosition.left,o.position.top=o.prevPosition.top,o.size.width=o.prevSize.width,o.size.height=o.prevSize.height)},stop:function(){var t=e(this).resizable("instance"),n=t.options,r=t.containerOffset,i=t.containerPosition,s=t.containerElement,o=e(t.helper),u=o.offset(),a=o.outerWidth()-t.sizeDiff.width,f=o.outerHeight()-t.sizeDiff.height;t._helper&&!n.animate&&/relative/.test(s.css("position"))&&e(this).css({left:u.left-i.left-r.left,width:a,height:f}),t._helper&&!n.animate&&/static/.test(s.css("position"))&&e(this).css({left:u.left-i.left-r.left,width:a,height:f})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).resizable("instance"),n=t.options;e(n.alsoResize).each(function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseFloat(t.width()),height:parseFloat(t.height()),left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})})},resize:function(t,n){var r=e(this).resizable("instance"),i=r.options,s=r.originalSize,o=r.originalPosition,u={height:r.size.height-s.height||0,width:r.size.width-s.width||0,top:r.position.top-o.top||0,left:r.position.left-o.left||0};e(i.alsoResize).each(function(){var t=e(this),r=e(this).data("ui-resizable-alsoresize"),i={},s=t.parents(n.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(s,function(e,t){var n=(r[t]||0)+(u[t]||0);n&&n>=0&&(i[t]=n||null)}),t.css(i)})},stop:function(){e(this).removeData("ui-resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).resizable("instance"),n=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:n.height,width:n.width,margin:0,left:0,top:0}),t._addClass(t.ghost,"ui-resizable-ghost"),e.uiBackCompat!==!1&&"string"==typeof t.options.ghost&&t.ghost.addClass(this.options.ghost),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t,n=e(this).resizable("instance"),r=n.options,i=n.size,s=n.originalSize,o=n.originalPosition,u=n.axis,a="number"==typeof r.grid?[r.grid,r.grid]:r.grid,f=a[0]||1,l=a[1]||1,c=Math.round((i.width-s.width)/f)*f,h=Math.round((i.height-s.height)/l)*l,p=s.width+c,d=s.height+h,v=r.maxWidth&&p>r.maxWidth,m=r.maxHeight&&d>r.maxHeight,g=r.minWidth&&r.minWidth>p,y=r.minHeight&&r.minHeight>d;r.grid=a,g&&(p+=f),y&&(d+=l),v&&(p-=f),m&&(d-=l),/^(se|s|e)$/.test(u)?(n.size.width=p,n.size.height=d):/^(ne)$/.test(u)?(n.size.width=p,n.size.height=d,n.position.top=o.top-h):/^(sw)$/.test(u)?(n.size.width=p,n.size.height=d,n.position.left=o.left-c):((0>=d-l||0>=p-f)&&(t=n._getPaddingPlusBorderDimensions(this)),d-l>0?(n.size.height=d,n.position.top=o.top-h):(d=l-t.height,n.size.height=d,n.position.top=o.top+s.height-d),p-f>0?(n.size.width=p,n.position.left=o.left-c):(p=f-t.width,n.size.width=p,n.position.left=o.left+s.width-p))}}),e.ui.resizable,e.widget("ui.dialog",{version:"1.12.1",options:{appendTo:"body",autoOpen:!0,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:!0,closeText:"Close",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var n=e(this).css(t).offset().top;0>n&&e(this).css("top",t.top-n)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),null==this.options.title&&null!=this.originalTitle&&(this.options.title=this.originalTitle),this.options.disabled&&(this.options.disabled=!1),this._createWrapper(),this.element.show().removeAttr("title").appendTo(this.uiDialog),this._addClass("ui-dialog-content","ui-widget-content"),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&e.fn.draggable&&this._makeDraggable(),this.options.resizable&&e.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?e(t):this.document.find(t||"body").eq(0)},_destroy:function(){var e,t=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().css(this.originalCss).detach(),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:e.noop,enable:e.noop,close:function(t){var n=this;this._isOpen&&this._trigger("beforeClose",t)!==!1&&(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),this.opener.filter(":focusable").trigger("focus").length||e.ui.safeBlur(e.ui.safeActiveElement(this.document[0])),this._hide(this.uiDialog,this.options.hide,function(){n._trigger("close",t)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,n){var r=!1,i=this.uiDialog.siblings(".ui-front:visible").map(function(){return+e(this).css("z-index")}).get(),s=Math.max.apply(null,i);return s>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",s+1),r=!0),r&&!n&&this._trigger("focus",t),r},open:function(){var t=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),void 0):(this._isOpen=!0,this.opener=e(e.ui.safeActiveElement(this.document[0])),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"),void 0)},_focusTabbable:function(){var e=this._focusedElement;e||(e=this.element.find("[autofocus]")),e.length||(e=this.element.find(":tabbable")),e.length||(e=this.uiDialogButtonPane.find(":tabbable")),e.length||(e=this.uiDialogTitlebarClose.filter(":tabbable")),e.length||(e=this.uiDialog),e.eq(0).trigger("focus")},_keepFocus:function(t){function n(){var t=e.ui.safeActiveElement(this.document[0]),n=this.uiDialog[0]===t||e.contains(this.uiDialog[0],t);n||this._focusTabbable()}t.preventDefault(),n.call(this),this._delay(n)},_createWrapper:function(){this.uiDialog=e("<div>").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front"),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===e.ui.keyCode.ESCAPE)return t.preventDefault(),this.close(t),void 0;if(t.keyCode===e.ui.keyCode.TAB&&!t.isDefaultPrevented()){var n=this.uiDialog.find(":tabbable"),r=n.filter(":first"),i=n.filter(":last");t.target!==i[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==r[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(this._delay(function(){i.trigger("focus")}),t.preventDefault()):(this._delay(function(){r.trigger("focus")}),t.preventDefault())}},mousedown:function(e){this._moveToTop(e)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=e("<div>"),this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix"),this._on(this.uiDialogTitlebar,{mousedown:function(t){e(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.trigger("focus")}}),this.uiDialogTitlebarClose=e("<button type='button'></button>").button({label:e("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar),this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close"),this._on(this.uiDialogTitlebarClose,{click:function(e){e.preventDefault(),this.close(e)}}),t=e("<span>").uniqueId().prependTo(this.uiDialogTitlebar),this._addClass(t,"ui-dialog-title"),this._title(t),this.uiDialogTitlebar.prependTo(this.uiDialog),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(e){this.options.title?e.text(this.options.title):e.html("&#160;")},_createButtonPane:function(){this.uiDialogButtonPane=e("<div>"),this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix"),this.uiButtonSet=e("<div>").appendTo(this.uiDialogButtonPane),this._addClass(this.uiButtonSet,"ui-dialog-buttonset"),this._createButtons()},_createButtons:function(){var t=this,n=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),e.isEmptyObject(n)||e.isArray(n)&&!n.length?(this._removeClass(this.uiDialog,"ui-dialog-buttons"),void 0):(e.each(n,function(n,r){var i,s;r=e.isFunction(r)?{click:r,text:n}:r,r=e.extend({type:"button"},r),i=r.click,s={icon:r.icon,iconPosition:r.iconPosition,showLabel:r.showLabel,icons:r.icons,text:r.text},delete r.click,delete r.icon,delete r.iconPosition,delete r.showLabel,delete r.icons,"boolean"==typeof r.text&&delete r.text,e("<button></button>",r).button(s).appendTo(t.uiButtonSet).on("click",function(){i.apply(t.element[0],arguments)})}),this._addClass(this.uiDialog,"ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),void 0)},_makeDraggable:function(){function t(e){return{position:e.position,offset:e.offset}}var n=this,r=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(r,i){n._addClass(e(this),"ui-dialog-dragging"),n._blockFrames(),n._trigger("dragStart",r,t(i))},drag:function(e,r){n._trigger("drag",e,t(r))},stop:function(i,s){var o=s.offset.left-n.document.scrollLeft(),u=s.offset.top-n.document.scrollTop();r.position={my:"left top",at:"left"+(o>=0?"+":"")+o+" "+"top"+(u>=0?"+":"")+u,of:n.window},n._removeClass(e(this),"ui-dialog-dragging"),n._unblockFrames(),n._trigger("dragStop",i,t(s))}})},_makeResizable:function(){function t(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}var n=this,r=this.options,i=r.resizable,s=this.uiDialog.css("position"),o="string"==typeof i?i:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:r.maxWidth,maxHeight:r.maxHeight,minWidth:r.minWidth,minHeight:this._minHeight(),handles:o,start:function(r,i){n._addClass(e(this),"ui-dialog-resizing"),n._blockFrames(),n._trigger("resizeStart",r,t(i))},resize:function(e,r){n._trigger("resize",e,t(r))},stop:function(i,s){var o=n.uiDialog.offset(),u=o.left-n.document.scrollLeft(),a=o.top-n.document.scrollTop();r.height=n.uiDialog.height(),r.width=n.uiDialog.width(),r.position={my:"left top",at:"left"+(u>=0?"+":"")+u+" "+"top"+(a>=0?"+":"")+a,of:n.window},n._removeClass(e(this),"ui-dialog-resizing"),n._unblockFrames(),n._trigger("resizeStop",i,t(s))}}).css("position",s)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._makeFocusTarget(),this._focusedElement=e(t.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var t=this._trackingInstances(),n=e.inArray(this,t);-1!==n&&t.splice(n,1)},_trackingInstances:function(){var e=this.document.data("ui-dialog-instances");return e||(e=[],this.document.data("ui-dialog-instances",e)),e},_minHeight:function(){var e=this.options;return"auto"===e.height?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");e||this.uiDialog.show(),this.uiDialog.position(this.options.position),e||this.uiDialog.hide()},_setOptions:function(t){var n=this,r=!1,i={};e.each(t,function(e,t){n._setOption(e,t),e in n.sizeRelatedOptions&&(r=!0),e in n.resizableRelatedOptions&&(i[e]=t)}),r&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",i)},_setOption:function(t,n){var r,i,s=this.uiDialog;"disabled"!==t&&(this._super(t,n),"appendTo"===t&&this.uiDialog.appendTo(this._appendTo()),"buttons"===t&&this._createButtons(),"closeText"===t&&this.uiDialogTitlebarClose.button({label:e("<a>").text(""+this.options.closeText).html()}),"draggable"===t&&(r=s.is(":data(ui-draggable)"),r&&!n&&s.draggable("destroy"),!r&&n&&this._makeDraggable()),"position"===t&&this._position(),"resizable"===t&&(i=s.is(":data(ui-resizable)"),i&&!n&&s.resizable("destroy"),i&&"string"==typeof n&&s.resizable("option","handles",n),i||n===!1||this._makeResizable()),"title"===t&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var e,t,n,r=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),r.minWidth>r.width&&(r.width=r.minWidth),e=this.uiDialog.css({height:"auto",width:r.width}).outerHeight(),t=Math.max(0,r.minHeight-e),n="number"==typeof r.maxHeight?Math.max(0,r.maxHeight-e):"none","auto"===r.height?this.element.css({minHeight:t,maxHeight:n,height:"auto"}):this.element.height(Math.max(0,r.height-e)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=e(this);return e("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return e(t.target).closest(".ui-dialog").length?!0:!!e(t.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var t=!0;this._delay(function(){t=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(e){t||this._allowInteraction(e)||(e.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=e("<div>").appendTo(this._appendTo()),this._addClass(this.overlay,null,"ui-widget-overlay ui-front"),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var e=this.document.data("ui-dialog-overlays")-1;e?this.document.data("ui-dialog-overlays",e):(this._off(this.document,"focusin"),this.document.removeData("ui-dialog-overlays")),this.overlay.remove(),this.overlay=null}}}),e.uiBackCompat!==!1&&e.widget("ui.dialog",e.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super(),this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(e,t){"dialogClass"===e&&this.uiDialog.removeClass(this.options.dialogClass).addClass(t),this._superApply(arguments)}}),e.ui.dialog,e.widget("ui.droppable",{version:"1.12.1",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,n=this.options,r=n.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(r)?r:function(e){return e.is(r)},this.proportions=function(){return arguments.length?(t=arguments[0],void 0):t?t:t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},this._addToManager(n.scope),n.addClasses&&this._addClass("ui-droppable")},_addToManager:function(t){e.ui.ddmanager.droppables[t]=e.ui.ddmanager.droppables[t]||[],e.ui.ddmanager.droppables[t].push(this)},_splice:function(e){for(var t=0;e.length>t;t++)e[t]===this&&e.splice(t,1)},_destroy:function(){var t=e.ui.ddmanager.droppables[this.options.scope];this._splice(t)},_setOption:function(t,n){if("accept"===t)this.accept=e.isFunction(n)?n:function(e){return e.is(n)};else if("scope"===t){var r=e.ui.ddmanager.droppables[this.options.scope];this._splice(r),this._addToManager(n)}this._super(t,n)},_activate:function(t){var n=e.ui.ddmanager.current;this._addActiveClass(),n&&this._trigger("activate",t,this.ui(n))},_deactivate:function(t){var n=e.ui.ddmanager.current;this._removeActiveClass(),n&&this._trigger("deactivate",t,this.ui(n))},_over:function(t){var n=e.ui.ddmanager.current;n&&(n.currentItem||n.element)[0]!==this.element[0]&&this.accept.call(this.element[0],n.currentItem||n.element)&&(this._addHoverClass(),this._trigger("over",t,this.ui(n)))},_out:function(t){var n=e.ui.ddmanager.current;n&&(n.currentItem||n.element)[0]!==this.element[0]&&this.accept.call(this.element[0],n.currentItem||n.element)&&(this._removeHoverClass(),this._trigger("out",t,this.ui(n)))},_drop:function(t,n){var r=n||e.ui.ddmanager.current,i=!1;return r&&(r.currentItem||r.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var n=e(this).droppable("instance");return n.options.greedy&&!n.options.disabled&&n.options.scope===r.options.scope&&n.accept.call(n.element[0],r.currentItem||r.element)&&y(r,e.extend(n,{offset:n.element.offset()}),n.options.tolerance,t)?(i=!0,!1):void 0}),i?!1:this.accept.call(this.element[0],r.currentItem||r.element)?(this._removeActiveClass(),this._removeHoverClass(),this._trigger("drop",t,this.ui(r)),this.element):!1):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}});var y=e.ui.intersect=function(){function e(e,t,n){return e>=t&&t+n>e}return function(t,n,r,i){if(!n.offset)return!1;var s=(t.positionAbs||t.position.absolute).left+t.margins.left,o=(t.positionAbs||t.position.absolute).top+t.margins.top,u=s+t.helperProportions.width,a=o+t.helperProportions.height,f=n.offset.left,l=n.offset.top,c=f+n.proportions().width,h=l+n.proportions().height;switch(r){case"fit":return s>=f&&c>=u&&o>=l&&h>=a;case"intersect":return s+t.helperProportions.width/2>f&&c>u-t.helperProportions.width/2&&o+t.helperProportions.height/2>l&&h>a-t.helperProportions.height/2;case"pointer":return e(i.pageY,l,n.proportions().height)&&e(i.pageX,f,n.proportions().width);case"touch":return(o>=l&&h>=o||a>=l&&h>=a||l>o&&a>h)&&(s>=f&&c>=s||u>=f&&c>=u||f>s&&u>c);default:return!1}}}();e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,n){var r,i,s=e.ui.ddmanager.droppables[t.options.scope]||[],o=n?n.type:null,u=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(r=0;s.length>r;r++)if(!(s[r].options.disabled||t&&!s[r].accept.call(s[r].element[0],t.currentItem||t.element))){for(i=0;u.length>i;i++)if(u[i]===s[r].element[0]){s[r].proportions().height=0;continue e}s[r].visible="none"!==s[r].element.css("display"),s[r].visible&&("mousedown"===o&&s[r]._activate.call(s[r],n),s[r].offset=s[r].element.offset(),s[r].proportions({width:s[r].element[0].offsetWidth,height:s[r].element[0].offsetHeight}))}},drop:function(t,n){var r=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&y(t,this,this.options.tolerance,n)&&(r=this._drop.call(this,n)||r),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,n)))}),r},dragStart:function(t,n){t.element.parentsUntil("body").on("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)})},drag:function(t,n){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,n),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var r,i,s,o=y(t,this,this.options.tolerance,n),u=!o&&this.isover?"isout":o&&!this.isover?"isover":null;u&&(this.options.greedy&&(i=this.options.scope,s=this.element.parents(":data(ui-droppable)").filter(function(){return e(this).droppable("instance").options.scope===i}),s.length&&(r=e(s[0]).droppable("instance"),r.greedyChild="isover"===u)),r&&"isover"===u&&(r.isover=!1,r.isout=!0,r._out.call(r,n)),this[u]=!0,this["isout"===u?"isover":"isout"]=!1,this["isover"===u?"_over":"_out"].call(this,n),r&&"isout"===u&&(r.isout=!1,r.isover=!0,r._over.call(r,n)))}})},dragStop:function(t,n){t.element.parentsUntil("body").off("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)}},e.uiBackCompat!==!1&&e.widget("ui.droppable",e.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super(),this.options.activeClass&&this.element.addClass(this.options.activeClass)},_removeActiveClass:function(){this._super(),this.options.activeClass&&this.element.removeClass(this.options.activeClass)},_addHoverClass:function(){this._super(),this.options.hoverClass&&this.element.addClass(this.options.hoverClass)},_removeHoverClass:function(){this._super(),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass)}}),e.ui.droppable,e.widget("ui.progressbar",{version:"1.12.1",options:{classes:{"ui-progressbar":"ui-corner-all","ui-progressbar-value":"ui-corner-left","ui-progressbar-complete":"ui-corner-right"},max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.attr({role:"progressbar","aria-valuemin":this.min}),this._addClass("ui-progressbar","ui-widget ui-widget-content"),this.valueDiv=e("<div>").appendTo(this.element),this._addClass(this.valueDiv,"ui-progressbar-value","ui-widget-header"),this._refreshValue()},_destroy:function(){this.element.removeAttr("role aria-valuemin aria-valuemax aria-valuenow"),this.valueDiv.remove()},value:function(e){return void 0===e?this.options.value:(this.options.value=this._constrainedValue(e),this._refreshValue(),void 0)},_constrainedValue:function(e){return void 0===e&&(e=this.options.value),this.indeterminate=e===!1,"number"!=typeof e&&(e=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,e))},_setOptions:function(e){var t=e.value;delete e.value,this._super(e),this.options.value=this._constrainedValue(t),this._refreshValue()},_setOption:function(e,t){"max"===e&&(t=Math.max(this.min,t)),this._super(e,t)},_setOptionDisabled:function(e){this._super(e),this.element.attr("aria-disabled",e),this._toggleClass(null,"ui-state-disabled",!!e)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,n=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).width(n.toFixed(0)+"%"),this._toggleClass(this.valueDiv,"ui-progressbar-complete",null,t===this.options.max)._toggleClass("ui-progressbar-indeterminate",null,this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=e("<div>").appendTo(this.valueDiv),this._addClass(this.overlayDiv,"ui-progressbar-overlay"))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}}),e.widget("ui.selectable",e.ui.mouse,{version:"1.12.1",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var t=this;this._addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){t.elementPos=e(t.element[0]).offset(),t.selectees=e(t.options.filter,t.element[0]),t._addClass(t.selectees,"ui-selectee"),t.selectees.each(function(){var n=e(this),r=n.offset(),i={left:r.left-t.elementPos.left,top:r.top-t.elementPos.top};e.data(this,"selectable-item",{element:this,$element:n,left:i.left,top:i.top,right:i.left+n.outerWidth(),bottom:i.top+n.outerHeight(),startselected:!1,selected:n.hasClass("ui-selected"),selecting:n.hasClass("ui-selecting"),unselecting:n.hasClass("ui-unselecting")})})},this.refresh(),this._mouseInit(),this.helper=e("<div>"),this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){this.selectees.removeData("selectable-item"),this._mouseDestroy()},_mouseStart:function(t){var n=this,r=this.options;this.opos=[t.pageX,t.pageY],this.elementPos=e(this.element[0]).offset(),this.options.disabled||(this.selectees=e(r.filter,this.element[0]),this._trigger("start",t),e(r.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),r.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var r=e.data(this,"selectable-item");r.startselected=!0,t.metaKey||t.ctrlKey||(n._removeClass(r.$element,"ui-selected"),r.selected=!1,n._addClass(r.$element,"ui-unselecting"),r.unselecting=!0,n._trigger("unselecting",t,{unselecting:r.element}))}),e(t.target).parents().addBack().each(function(){var r,i=e.data(this,"selectable-item");return i?(r=!t.metaKey&&!t.ctrlKey||!i.$element.hasClass("ui-selected"),n._removeClass(i.$element,r?"ui-unselecting":"ui-selected")._addClass(i.$element,r?"ui-selecting":"ui-unselecting"),i.unselecting=!r,i.selecting=r,i.selected=r,r?n._trigger("selecting",t,{selecting:i.element}):n._trigger("unselecting",t,{unselecting:i.element}),!1):void 0}))},_mouseDrag:function(t){if(this.dragged=!0,!this.options.disabled){var n,r=this,i=this.options,s=this.opos[0],o=this.opos[1],u=t.pageX,a=t.pageY;return s>u&&(n=u,u=s,s=n),o>a&&(n=a,a=o,o=n),this.helper.css({left:s,top:o,width:u-s,height:a-o}),this.selectees.each(function(){var n=e.data(this,"selectable-item"),f=!1,l={};n&&n.element!==r.element[0]&&(l.left=n.left+r.elementPos.left,l.right=n.right+r.elementPos.left,l.top=n.top+r.elementPos.top,l.bottom=n.bottom+r.elementPos.top,"touch"===i.tolerance?f=!(l.left>u||s>l.right||l.top>a||o>l.bottom):"fit"===i.tolerance&&(f=l.left>s&&u>l.right&&l.top>o&&a>l.bottom),f?(n.selected&&(r._removeClass(n.$element,"ui-selected"),n.selected=!1),n.unselecting&&(r._removeClass(n.$element,"ui-unselecting"),n.unselecting=!1),n.selecting||(r._addClass(n.$element,"ui-selecting"),n.selecting=!0,r._trigger("selecting",t,{selecting:n.element}))):(n.selecting&&((t.metaKey||t.ctrlKey)&&n.startselected?(r._removeClass(n.$element,"ui-selecting"),n.selecting=!1,r._addClass(n.$element,"ui-selected"),n.selected=!0):(r._removeClass(n.$element,"ui-selecting"),n.selecting=!1,n.startselected&&(r._addClass(n.$element,"ui-unselecting"),n.unselecting=!0),r._trigger("unselecting",t,{unselecting:n.element}))),n.selected&&(t.metaKey||t.ctrlKey||n.startselected||(r._removeClass(n.$element,"ui-selected"),n.selected=!1,r._addClass(n.$element,"ui-unselecting"),n.unselecting=!0,r._trigger("unselecting",t,{unselecting:n.element})))))}),!1}},_mouseStop:function(t){var n=this;return this.dragged=!1,e(".ui-unselecting",this.element[0]).each(function(){var r=e.data(this,"selectable-item");n._removeClass(r.$element,"ui-unselecting"),r.unselecting=!1,r.startselected=!1,n._trigger("unselected",t,{unselected:r.element})}),e(".ui-selecting",this.element[0]).each(function(){var r=e.data(this,"selectable-item");n._removeClass(r.$element,"ui-selecting")._addClass(r.$element,"ui-selected"),r.selecting=!1,r.selected=!0,r.startselected=!0,n._trigger("selected",t,{selected:r.element})}),this._trigger("stop",t),this.helper.remove(),!1}}),e.widget("ui.selectmenu",[e.ui.formResetMixin,{version:"1.12.1",defaultElement:"<select>",options:{appendTo:null,classes:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"},disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:!1,change:null,close:null,focus:null,open:null,select:null},_create:function(){var t=this.element.uniqueId().attr("id");this.ids={element:t,button:t+"-button",menu:t+"-menu"},this._drawButton(),this._drawMenu(),this._bindFormResetHandler(),this._rendered=!1,this.menuItems=e()},_drawButton:function(){var t,n=this,r=this._parseOption(this.element.find("option:selected"),this.element[0].selectedIndex);this.labels=this.element.labels().attr("for",this.ids.button),this._on(this.labels,{click:function(e){this.button.focus(),e.preventDefault()}}),this.element.hide(),this.button=e("<span>",{tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true",title:this.element.attr("title")}).insertAfter(this.element),this._addClass(this.button,"ui-selectmenu-button ui-selectmenu-button-closed","ui-button ui-widget"),t=e("<span>").appendTo(this.button),this._addClass(t,"ui-selectmenu-icon","ui-icon "+this.options.icons.button),this.buttonItem=this._renderButtonItem(r).appendTo(this.button),this.options.width!==!1&&this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){n._rendered||n._refreshMenu()})},_drawMenu:function(){var t=this;this.menu=e("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=e("<div>").append(this.menu),this._addClass(this.menuWrap,"ui-selectmenu-menu","ui-front"),this.menuWrap.appendTo(this._appendTo()),this.menuInstance=this.menu.menu({classes:{"ui-menu":"ui-corner-bottom"},role:"listbox",select:function(e,n){e.preventDefault(),t._setSelection(),t._select(n.item.data("ui-selectmenu-item"),e)},focus:function(e,n){var r=n.item.data("ui-selectmenu-item");null!=t.focusIndex&&r.index!==t.focusIndex&&(t._trigger("focus",e,{item:r}),t.isOpen||t._select(r,e)),t.focusIndex=r.index,t.button.attr("aria-activedescendant",t.menuItems.eq(r.index).attr("id"))}}).menu("instance"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(this._getSelectedItem().data("ui-selectmenu-item")||{})),null===this.options.width&&this._resizeButton()},_refreshMenu:function(){var e,t=this.element.find("option");this.menu.empty(),this._parseOptions(t),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup").find(".ui-menu-item-wrapper"),this._rendered=!0,t.length&&(e=this._getSelectedItem(),this.menuInstance.focus(null,e),this._setAria(e.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(e){this.options.disabled||(this._rendered?(this._removeClass(this.menu.find(".ui-state-active"),null,"ui-state-active"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.menuItems.length&&(this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",e)))},_position:function(){this.menuWrap.position(e.extend({of:this.button},this.options.position))},close:function(e){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",e))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderButtonItem:function(t){var n=e("<span>");return this._setText(n,t.label),this._addClass(n,"ui-selectmenu-text"),n},_renderMenu:function(t,n){var r=this,i="";e.each(n,function(n,s){var o;s.optgroup!==i&&(o=e("<li>",{text:s.optgroup}),r._addClass(o,"ui-selectmenu-optgroup","ui-menu-divider"+(s.element.parent("optgroup").prop("disabled")?" ui-state-disabled":"")),o.appendTo(t),i=s.optgroup),r._renderItemData(t,s)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-selectmenu-item",t)},_renderItem:function(t,n){var r=e("<li>"),i=e("<div>",{title:n.element.attr("title")});return n.disabled&&this._addClass(r,null,"ui-state-disabled"),this._setText(i,n.label),r.append(i).appendTo(t)},_setText:function(e,t){t?e.text(t):e.html("&#160;")},_move:function(e,t){var n,r,i=".ui-menu-item";this.isOpen?n=this.menuItems.eq(this.focusIndex).parent("li"):(n=this.menuItems.eq(this.element[0].selectedIndex).parent("li"),i+=":not(.ui-state-disabled)"),r="first"===e||"last"===e?n["first"===e?"prevAll":"nextAll"](i).eq(-1):n[e+"All"](i).eq(0),r.length&&this.menuInstance.focus(t,r)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex).parent("li")},_toggle:function(e){this[this.isOpen?"close":"open"](e)},_setSelection:function(){var e;this.range&&(window.getSelection?(e=window.getSelection(),e.removeAllRanges(),e.addRange(this.range)):this.range.select(),this.button.focus())},_documentClick:{mousedown:function(t){this.isOpen&&(e(t.target).closest(".ui-selectmenu-menu, #"+e.ui.escapeSelector(this.ids.button)).length||this.close(t))}},_buttonEvents:{mousedown:function(){var e;window.getSelection?(e=window.getSelection(),e.rangeCount&&(this.range=e.getRangeAt(0))):this.range=document.selection.createRange()},click:function(e){this._setSelection(),this._toggle(e)},keydown:function(t){var n=!0;switch(t.keyCode){case e.ui.keyCode.TAB:case e.ui.keyCode.ESCAPE:this.close(t),n=!1;break;case e.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(t);break;case e.ui.keyCode.UP:t.altKey?this._toggle(t):this._move("prev",t);break;case e.ui.keyCode.DOWN:t.altKey?this._toggle(t):this._move("next",t);break;case e.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(t):this._toggle(t);break;case e.ui.keyCode.LEFT:this._move("prev",t);break;case e.ui.keyCode.RIGHT:this._move("next",t);break;case e.ui.keyCode.HOME:case e.ui.keyCode.PAGE_UP:this._move("first",t);break;case e.ui.keyCode.END:case e.ui.keyCode.PAGE_DOWN:this._move("last",t);break;default:this.menu.trigger(t),n=!1}n&&t.preventDefault()}},_selectFocusedItem:function(e){var t=this.menuItems.eq(this.focusIndex).parent("li");t.hasClass("ui-state-disabled")||this._select(t.data("ui-selectmenu-item"),e)},_select:function(e,t){var n=this.element[0].selectedIndex;this.element[0].selectedIndex=e.index,this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(e)),this._setAria(e),this._trigger("select",t,{item:e}),e.index!==n&&this._trigger("change",t,{item:e}),this.close(t)},_setAria:function(e){var t=this.menuItems.eq(e.index).attr("id");this.button.attr({"aria-labelledby":t,"aria-activedescendant":t}),this.menu.attr("aria-activedescendant",t)},_setOption:function(e,t){if("icons"===e){var n=this.button.find("span.ui-icon");this._removeClass(n,null,this.options.icons.button)._addClass(n,null,t.button)}this._super(e,t),"appendTo"===e&&this.menuWrap.appendTo(this._appendTo()),"width"===e&&this._resizeButton()},_setOptionDisabled:function(e){this._super(e),this.menuInstance.option("disabled",e),this.button.attr("aria-disabled",e),this._toggleClass(this.button,null,"ui-state-disabled",e),this.element.prop("disabled",e),e?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front, dialog")),t.length||(t=this.document[0].body),t},_toggleAttr:function(){this.button.attr("aria-expanded",this.isOpen),this._removeClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"closed":"open"))._addClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"open":"closed"))._toggleClass(this.menuWrap,"ui-selectmenu-open",null,this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var e=this.options.width;return e===!1?(this.button.css("width",""),void 0):(null===e&&(e=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(e),void 0)},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){var e=this._super();return e.disabled=this.element.prop("disabled"),e},_parseOptions:function(t){var n=this,r=[];t.each(function(t,i){r.push(n._parseOption(e(i),t))}),this.items=r},_parseOption:function(e,t){var n=e.parent("optgroup");return{element:e,index:t,value:e.val(),label:e.text(),optgroup:n.attr("label")||"",disabled:n.prop("disabled")||e.prop("disabled")}},_destroy:function(){this._unbindFormResetHandler(),this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.labels.attr("for",this.ids.element)}}]),e.widget("ui.slider",e.ui.mouse,{version:"1.12.1",widgetEventPrefix:"slide",options:{animate:!1,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all","ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this._addClass("ui-slider ui-slider-"+this.orientation,"ui-widget ui-widget-content"),this._refresh(),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var t,n,r=this.options,i=this.element.find(".ui-slider-handle"),s="<span tabindex='0'></span>",o=[];for(n=r.values&&r.values.length||1,i.length>n&&(i.slice(n).remove(),i=i.slice(0,n)),t=i.length;n>t;t++)o.push(s);this.handles=i.add(e(o.join("")).appendTo(this.element)),this._addClass(this.handles,"ui-slider-handle","ui-state-default"),this.handle=this.handles.eq(0),this.handles.each(function(t){e(this).data("ui-slider-handle-index",t).attr("tabIndex",0)})},_createRange:function(){var t=this.options;t.range?(t.range===!0&&(t.values?t.values.length&&2!==t.values.length?t.values=[t.values[0],t.values[0]]:e.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?(this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max"),this.range.css({left:"",bottom:""})):(this.range=e("<div>").appendTo(this.element),this._addClass(this.range,"ui-slider-range")),("min"===t.range||"max"===t.range)&&this._addClass(this.range,"ui-slider-range-"+t.range)):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this._mouseDestroy()},_mouseCapture:function(t){var n,r,i,s,o,u,a,f,l=this,c=this.options;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),n={x:t.pageX,y:t.pageY},r=this._normValueFromMouse(n),i=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var n=Math.abs(r-l.values(t));(i>n||i===n&&(t===l._lastChangedValue||l.values(t)===c.min))&&(i=n,s=e(this),o=t)}),u=this._start(t,o),u===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,this._addClass(s,null,"ui-state-active"),s.trigger("focus"),a=s.offset(),f=!e(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=f?{left:0,top:0}:{left:t.pageX-a.left-s.width()/2,top:t.pageY-a.top-s.height()/2-(parseInt(s.css("borderTopWidth"),10)||0)-(parseInt(s.css("borderBottomWidth"),10)||0)+(parseInt(s.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,r),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},n=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,n),!1},_mouseStop:function(e){return this._removeClass(this.handles,null,"ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,n,r,i,s;return"horizontal"===this.orientation?(t=this.elementSize.width,n=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,n=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),r=n/t,r>1&&(r=1),0>r&&(r=0),"vertical"===this.orientation&&(r=1-r),i=this._valueMax()-this._valueMin(),s=this._valueMin()+r*i,this._trimAlignValue(s)},_uiHash:function(e,t,n){var r={handle:this.handles[e],handleIndex:e,value:void 0!==t?t:this.value()};return this._hasMultipleValues()&&(r.value=void 0!==t?t:this.values(e),r.values=n||this.values()),r},_hasMultipleValues:function(){return this.options.values&&this.options.values.length},_start:function(e,t){return this._trigger("start",e,this._uiHash(t))},_slide:function(e,t,n){var r,i,s=this.value(),o=this.values();this._hasMultipleValues()&&(i=this.values(t?0:1),s=this.values(t),2===this.options.values.length&&this.options.range===!0&&(n=0===t?Math.min(i,n):Math.max(i,n)),o[t]=n),n!==s&&(r=this._trigger("slide",e,this._uiHash(t,n,o)),r!==!1&&(this._hasMultipleValues()?this.values(t,n):this.value(n)))},_stop:function(e,t){this._trigger("stop",e,this._uiHash(t))},_change:function(e,t){this._keySliding||this._mouseSliding||(this._lastChangedValue=t,this._trigger("change",e,this._uiHash(t)))},value:function(e){return arguments.length?(this.options.value=this._trimAlignValue(e),this._refreshValue(),this._change(null,0),void 0):this._value()},values:function(t,n){var r,i,s;if(arguments.length>1)return this.options.values[t]=this._trimAlignValue(n),this._refreshValue(),this._change(null,t),void 0;if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this._hasMultipleValues()?this._values(t):this.value();for(r=this.options.values,i=arguments[0],s=0;r.length>s;s+=1)r[s]=this._trimAlignValue(i[s]),this._change(null,s);this._refreshValue()},_setOption:function(t,n){var r,i=0;switch("range"===t&&this.options.range===!0&&("min"===n?(this.options.value=this._values(0),this.options.values=null):"max"===n&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),e.isArray(this.options.values)&&(i=this.options.values.length),this._super(t,n),t){case"orientation":this._detectOrientation(),this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-"+this.orientation),this._refreshValue(),this.options.range&&this._refreshRange(n),this.handles.css("horizontal"===n?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),r=i-1;r>=0;r--)this._change(null,r);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_setOptionDisabled:function(e){this._super(e),this._toggleClass(null,"ui-state-disabled",!!e)},_value:function(){var e=this.options.value;return e=this._trimAlignValue(e)},_values:function(e){var t,n,r;if(arguments.length)return t=this.options.values[e],t=this._trimAlignValue(t);if(this._hasMultipleValues()){for(n=this.options.values.slice(),r=0;n.length>r;r+=1)n[r]=this._trimAlignValue(n[r]);return n}return[]},_trimAlignValue:function(e){if(this._valueMin()>=e)return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,n=(e-this._valueMin())%t,r=e-n;return 2*Math.abs(n)>=t&&(r+=n>0?t:-t),parseFloat(r.toFixed(5))},_calculateNewMax:function(){var e=this.options.max,t=this._valueMin(),n=this.options.step,r=Math.round((e-t)/n)*n;e=r+t,e>this.options.max&&(e-=n),this.max=parseFloat(e.toFixed(this._precision()))},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=""+e,n=t.indexOf(".");return-1===n?0:t.length-n-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(e){"vertical"===e&&this.range.css({width:"",left:""}),"horizontal"===e&&this.range.css({height:"",bottom:""})},_refreshValue:function(){var t,n,r,i,s,o=this.options.range,u=this.options,a=this,f=this._animateOff?!1:u.animate,l={};this._hasMultipleValues()?this.handles.each(function(r){n=100*((a.values(r)-a._valueMin())/(a._valueMax()-a._valueMin())),l["horizontal"===a.orientation?"left":"bottom"]=n+"%",e(this).stop(1,1)[f?"animate":"css"](l,u.animate),a.options.range===!0&&("horizontal"===a.orientation?(0===r&&a.range.stop(1,1)[f?"animate":"css"]({left:n+"%"},u.animate),1===r&&a.range[f?"animate":"css"]({width:n-t+"%"},{queue:!1,duration:u.animate})):(0===r&&a.range.stop(1,1)[f?"animate":"css"]({bottom:n+"%"},u.animate),1===r&&a.range[f?"animate":"css"]({height:n-t+"%"},{queue:!1,duration:u.animate}))),t=n}):(r=this.value(),i=this._valueMin(),s=this._valueMax(),n=s!==i?100*((r-i)/(s-i)):0,l["horizontal"===this.orientation?"left":"bottom"]=n+"%",this.handle.stop(1,1)[f?"animate":"css"](l,u.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[f?"animate":"css"]({width:n+"%"},u.animate),"max"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[f?"animate":"css"]({width:100-n+"%"},u.animate),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[f?"animate":"css"]({height:n+"%"},u.animate),"max"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[f?"animate":"css"]({height:100-n+"%"},u.animate))},_handleEvents:{keydown:function(t){var n,r,i,s,o=e(t.target).data("ui-slider-handle-index");switch(t.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(t.preventDefault(),!this._keySliding&&(this._keySliding=!0,this._addClass(e(t.target),null,"ui-state-active"),n=this._start(t,o),n===!1))return}switch(s=this.options.step,r=i=this._hasMultipleValues()?this.values(o):this.value(),t.keyCode){case e.ui.keyCode.HOME:i=this._valueMin();break;case e.ui.keyCode.END:i=this._valueMax();break;case e.ui.keyCode.PAGE_UP:i=this._trimAlignValue(r+(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.PAGE_DOWN:i=this._trimAlignValue(r-(this._valueMax()-this._valueMin())/this.numPages);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(r===this._valueMax())return;i=this._trimAlignValue(r+s);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(r===this._valueMin())return;i=this._trimAlignValue(r-s)}this._slide(t,o,i)},keyup:function(t){var n=e(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,n),this._change(t,n),this._removeClass(e(t.target),null,"ui-state-active"))}}}),e.widget("ui.sortable",e.ui.mouse,{version:"1.12.1",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(e,t,n){return e>=t&&t+n>e},_isFloating:function(e){return/left|right/.test(e.css("float"))||/inline|table-cell/.test(e.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(e,t){this._super(e,t),"handle"===e&&this._setHandleClassName()},_setHandleClassName:function(){var t=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),e.each(this.items,function(){t._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,n){var r=null,i=!1,s=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(t),e(t.target).parents().each(function(){return e.data(this,s.widgetName+"-item")===s?(r=e(this),!1):void 0}),e.data(t.target,s.widgetName+"-item")===s&&(r=e(t.target)),r?!this.options.handle||n||(e(this.options.handle,r).find("*").addBack().each(function(){this===t.target&&(i=!0)}),i)?(this.currentItem=r,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(t,n,r){var i,s,o=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(s=this.document.find("body"),this.storedCursor=s.css("cursor"),s.css("cursor",o.cursor),this.storedStylesheet=e("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(s)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!r)for(i=this.containers.length-1;i>=0;i--)this.containers[i]._trigger("activate",t,this._uiHash(this));return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var n,r,i,s,o=this.options,u=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<o.scrollSensitivity?this.scrollParent[0].scrollTop=u=this.scrollParent[0].scrollTop+o.scrollSpeed:t.pageY-this.overflowOffset.top<o.scrollSensitivity&&(this.scrollParent[0].scrollTop=u=this.scrollParent[0].scrollTop-o.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<o.scrollSensitivity?this.scrollParent[0].scrollLeft=u=this.scrollParent[0].scrollLeft+o.scrollSpeed:t.pageX-this.overflowOffset.left<o.scrollSensitivity&&(this.scrollParent[0].scrollLeft=u=this.scrollParent[0].scrollLeft-o.scrollSpeed)):(t.pageY-this.document.scrollTop()<o.scrollSensitivity?u=this.document.scrollTop(this.document.scrollTop()-o.scrollSpeed):this.window.height()-(t.pageY-this.document.scrollTop())<o.scrollSensitivity&&(u=this.document.scrollTop(this.document.scrollTop()+o.scrollSpeed)),t.pageX-this.document.scrollLeft()<o.scrollSensitivity?u=this.document.scrollLeft(this.document.scrollLeft()-o.scrollSpeed):this.window.width()-(t.pageX-this.document.scrollLeft())<o.scrollSensitivity&&(u=this.document.scrollLeft(this.document.scrollLeft()+o.scrollSpeed))),u!==!1&&e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),n=this.items.length-1;n>=0;n--)if(r=this.items[n],i=r.item[0],s=this._intersectsWithPointer(r),s&&r.instance===this.currentContainer&&i!==this.currentItem[0]&&this.placeholder[1===s?"next":"prev"]()[0]!==i&&!e.contains(this.placeholder[0],i)&&("semi-dynamic"===this.options.type?!e.contains(this.element[0],i):!0)){if(this.direction=1===s?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(r))break;this._rearrange(t,r),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,n){if(t){if(e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t),this.options.revert){var r=this,i=this.placeholder.offset(),s=this.options.axis,o={};s&&"x"!==s||(o.left=i.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),s&&"y"!==s||(o.top=i.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,e(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){r._clear(t)})}else this._clear(t,n);return!1}},cancel:function(){if(this.dragging){this._mouseUp(new e.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var n=this._getItemsAsjQuery(t&&t.connected),r=[];return t=t||{},e(n).each(function(){var n=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);n&&r.push((t.key||n[1]+"[]")+"="+(t.key&&t.expression?n[1]:n[2]))}),!r.length&&t.key&&r.push(t.key+"="),r.join("&")},toArray:function(t){var n=this._getItemsAsjQuery(t&&t.connected),r=[];return t=t||{},n.each(function(){r.push(e(t.item||this).attr(t.attribute||"id")||"")}),r},_intersectsWith:function(e){var t=this.positionAbs.left,n=t+this.helperProportions.width,r=this.positionAbs.top,i=r+this.helperProportions.height,s=e.left,o=s+e.width,u=e.top,a=u+e.height,f=this.offset.click.top,l=this.offset.click.left,c="x"===this.options.axis||r+f>u&&a>r+f,h="y"===this.options.axis||t+l>s&&o>t+l,p=c&&h;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?p:t+this.helperProportions.width/2>s&&o>n-this.helperProportions.width/2&&r+this.helperProportions.height/2>u&&a>i-this.helperProportions.height/2},_intersectsWithPointer:function(e){var t,n,r="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top,e.height),i="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left,e.width),s=r&&i;return s?(t=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection(),this.floating?"right"===n||"down"===t?2:1:t&&("down"===t?2:1)):!1},_intersectsWithSides:function(e){var t=this._isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),n=this._isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),r=this._getDragVerticalDirection(),i=this._getDragHorizontalDirection();return this.floating&&i?"right"===i&&n||"left"===i&&!n:r&&("down"===r&&t||"up"===r&&!t)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return 0!==e&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return 0!==e&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){function n(){u.push(this)}var r,i,s,o,u=[],a=[],f=this._connectWith();if(f&&t)for(r=f.length-1;r>=0;r--)for(s=e(f[r],this.document[0]),i=s.length-1;i>=0;i--)o=e.data(s[i],this.widgetFullName),o&&o!==this&&!o.options.disabled&&a.push([e.isFunction(o.options.items)?o.options.items.call(o.element):e(o.options.items,o.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),o]);for(a.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),r=a.length-1;r>=0;r--)a[r][0].each(n);return e(u)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var n=0;t.length>n;n++)if(t[n]===e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var n,r,i,s,o,u,a,f,l=this.items,c=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],h=this._connectWith();if(h&&this.ready)for(n=h.length-1;n>=0;n--)for(i=e(h[n],this.document[0]),r=i.length-1;r>=0;r--)s=e.data(i[r],this.widgetFullName),s&&s!==this&&!s.options.disabled&&(c.push([e.isFunction(s.options.items)?s.options.items.call(s.element[0],t,{item:this.currentItem}):e(s.options.items,s.element),s]),this.containers.push(s));for(n=c.length-1;n>=0;n--)for(o=c[n][1],u=c[n][0],r=0,f=u.length;f>r;r++)a=e(u[r]),a.data(this.widgetName+"-item",o),l.push({item:a,instance:o,width:0,height:0,left:0,top:0})},refreshPositions:function(t){this.floating=this.items.length?"x"===this.options.axis||this._isFloating(this.items[0].item):!1,this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var n,r,i,s;for(n=this.items.length-1;n>=0;n--)r=this.items[n],r.instance!==this.currentContainer&&this.currentContainer&&r.item[0]!==this.currentItem[0]||(i=this.options.toleranceElement?e(this.options.toleranceElement,r.item):r.item,t||(r.width=i.outerWidth(),r.height=i.outerHeight()),s=i.offset(),r.left=s.left,r.top=s.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(n=this.containers.length-1;n>=0;n--)s=this.containers[n].element.offset(),this.containers[n].containerCache.left=s.left,this.containers[n].containerCache.top=s.top,this.containers[n].containerCache.width=this.containers[n].element.outerWidth(),this.containers[n].containerCache.height=this.containers[n].element.outerHeight();return this},_createPlaceholder:function(t){t=t||this;var n,r=t.options;r.placeholder&&r.placeholder.constructor!==String||(n=r.placeholder,r.placeholder={element:function(){var r=t.currentItem[0].nodeName.toLowerCase(),i=e("<"+r+">",t.document[0]);return t._addClass(i,"ui-sortable-placeholder",n||t.currentItem[0].className)._removeClass(i,"ui-sortable-helper"),"tbody"===r?t._createTrPlaceholder(t.currentItem.find("tr").eq(0),e("<tr>",t.document[0]).appendTo(i)):"tr"===r?t._createTrPlaceholder(t.currentItem,i):"img"===r&&i.attr("src",t.currentItem.attr("src")),n||i.css("visibility","hidden"),i},update:function(e,i){(!n||r.forcePlaceholderSize)&&(i.height()||i.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),i.width()||i.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}}),t.placeholder=e(r.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),r.placeholder.update(t,t.placeholder)},_createTrPlaceholder:function(t,n){var r=this;t.children().each(function(){e("<td>&#160;</td>",r.document[0]).attr("colspan",e(this).attr("colspan")||1).appendTo(n)})},_contactContainers:function(t){var n,r,i,s,o,u,a,f,l,c,h=null,p=null;for(n=this.containers.length-1;n>=0;n--)if(!e.contains(this.currentItem[0],this.containers[n].element[0]))if(this._intersectsWith(this.containers[n].containerCache)){if(h&&e.contains(this.containers[n].element[0],h.element[0]))continue;h=this.containers[n],p=n}else this.containers[n].containerCache.over&&(this.containers[n]._trigger("out",t,this._uiHash(this)),this.containers[n].containerCache.over=0);if(h)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(i=1e4,s=null,l=h.floating||this._isFloating(this.currentItem),o=l?"left":"top",u=l?"width":"height",c=l?"pageX":"pageY",r=this.items.length-1;r>=0;r--)e.contains(this.containers[p].element[0],this.items[r].item[0])&&this.items[r].item[0]!==this.currentItem[0]&&(a=this.items[r].item.offset()[o],f=!1,t[c]-a>this.items[r][u]/2&&(f=!0),i>Math.abs(t[c]-a)&&(i=Math.abs(t[c]-a),s=this.items[r],this.direction=f?"up":"down"));if(!s&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash()),this.currentContainer.containerCache.over=1),void 0;s?this._rearrange(t,s,null,!0):this._rearrange(t,null,this.containers[p].element,!0),this._trigger("change",t,this._uiHash()),this.containers[p]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(t){var n=this.options,r=e.isFunction(n.helper)?e(n.helper.apply(this.element[0],[t,this.currentItem])):"clone"===n.helper?this.currentItem.clone():this.currentItem;return r.parents("body").length||e("parent"!==n.appendTo?n.appendTo:this.currentItem[0].parentNode)[0].appendChild(r[0]),r[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!r[0].style.width||n.forceHelperSize)&&r.width(this.currentItem.width()),(!r[0].style.height||n.forceHelperSize)&&r.height(this.currentItem.height()),r},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,n,r,i=this.options;"parent"===i.containment&&(i.containment=this.helper[0].parentNode),("document"===i.containment||"window"===i.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===i.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===i.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(i.containment)||(t=e(i.containment)[0],n=e(i.containment).offset(),r="hidden"!==e(t).css("overflow"),this.containment=[n.left+(parseInt(e(t).css("borderLeftWidth"),10)||0)+(parseInt(e(t).css("paddingLeft"),10)||0)-this.margins.left,n.top+(parseInt(e(t).css("borderTopWidth"),10)||0)+(parseInt(e(t).css("paddingTop"),10)||0)-this.margins.top,n.left+(r?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(e(t).css("borderLeftWidth"),10)||0)-(parseInt(e(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,n.top+(r?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(e(t).css("borderTopWidth"),10)||0)-(parseInt(e(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,n){n||(n=this.position);var r="absolute"===t?1:-1,i="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,s=/(html|body)/i.test(i[0].tagName);return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():s?0:i.scrollTop())*r,left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():s?0:i.scrollLeft())*r}},_generatePosition:function(t){var n,r,i=this.options,s=t.pageX,o=t.pageY,u="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(u[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(s=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(s=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),i.grid&&(n=this.originalPageY+Math.round((o-this.originalPageY)/i.grid[1])*i.grid[1],o=this.containment?n-this.offset.click.top>=this.containment[1]&&n-this.offset.click.top<=this.containment[3]?n:n-this.offset.click.top>=this.containment[1]?n-i.grid[1]:n+i.grid[1]:n,r=this.originalPageX+Math.round((s-this.originalPageX)/i.grid[0])*i.grid[0],s=this.containment?r-this.offset.click.left>=this.containment[0]&&r-this.offset.click.left<=this.containment[2]?r:r-this.offset.click.left>=this.containment[0]?r-i.grid[0]:r+i.grid[0]:r)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:u.scrollTop()),left:s-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:u.scrollLeft())}},_rearrange:function(e,t,n,r){n?n[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var i=this.counter;this._delay(function(){i===this.counter&&this.refreshPositions(!r)})},_clear:function(e,t){function n(e,t,n){return function(r){n._trigger(e,r,t._uiHash(t))}}this.reverting=!1;var r,i=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(r in this._storedCSS)("auto"===this._storedCSS[r]||"static"===this._storedCSS[r])&&(this._storedCSS[r]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!t&&i.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||t||i.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(t||(i.push(function(e){this._trigger("remove",e,this._uiHash())}),i.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),i.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),r=this.containers.length-1;r>=0;r--)t||i.push(n("deactivate",this,this.containers[r])),this.containers[r].containerCache.over&&(i.push(n("out",this,this.containers[r])),this.containers[r].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,t||this._trigger("beforeStop",e,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!t){for(r=0;i.length>r;r++)i[r].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){e.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var n=t||this;return{helper:n.helper,placeholder:n.placeholder||e([]),position:n.position,originalPosition:n.originalPosition,offset:n.positionAbs,item:n.currentItem,sender:t?t.element:null}}}),e.widget("ui.spinner",{version:"1.12.1",defaultElement:"<input>",widgetEventPrefix:"spin",options:{classes:{"ui-spinner":"ui-corner-all","ui-spinner-down":"ui-corner-br","ui-spinner-up":"ui-corner-tr"},culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t=this._super(),n=this.element;return e.each(["min","max","step"],function(e,r){var i=n.attr(r);null!=i&&i.length&&(t[r]=i)}),t},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e),void 0)},mousewheel:function(e,t){if(t){if(!this.spinning&&!this._start(e))return!1;this._spin((t>0?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()}},"mousedown .ui-spinner-button":function(t){function n(){var t=this.element[0]===e.ui.safeActiveElement(this.document[0]);t||(this.element.trigger("focus"),this.previous=r,this._delay(function(){this.previous=r}))}var r;r=this.element[0]===e.ui.safeActiveElement(this.document[0])?this.previous:this.element.val(),t.preventDefault(),n.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,n.call(this)}),this._start(t)!==!1&&this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){return e(t.currentTarget).hasClass("ui-state-active")?this._start(t)===!1?!1:(this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap("<span>").parent().append("<a></a><a></a>")},_draw:function(){this._enhance(),this._addClass(this.uiSpinner,"ui-spinner","ui-widget ui-widget-content"),this._addClass("ui-spinner-input"),this.element.attr("role","spinbutton"),this.buttons=this.uiSpinner.children("a").attr("tabIndex",-1).attr("aria-hidden",!0).button({classes:{"ui-button":""}}),this._removeClass(this.buttons,"ui-corner-all"),this._addClass(this.buttons.first(),"ui-spinner-button ui-spinner-up"),this._addClass(this.buttons.last(),"ui-spinner-button ui-spinner-down"),this.buttons.first().button({icon:this.options.icons.up,showLabel:!1}),this.buttons.last().button({icon:this.options.icons.down,showLabel:!1}),this.buttons.height()>Math.ceil(.5*this.uiSpinner.height())&&this.uiSpinner.height()>0&&this.uiSpinner.height(this.uiSpinner.height())},_keydown:function(t){var n=this.options,r=e.ui.keyCode;switch(t.keyCode){case r.UP:return this._repeat(null,1,t),!0;case r.DOWN:return this._repeat(null,-1,t),!0;case r.PAGE_UP:return this._repeat(null,n.page,t),!0;case r.PAGE_DOWN:return this._repeat(null,-n.page,t),!0}return!1},_start:function(e){return this.spinning||this._trigger("start",e)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(e,t,n){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,n)},e),this._spin(t*this.options.step,n)},_spin:function(e,t){var n=this.value()||0;this.counter||(this.counter=1),n=this._adjustValue(n+e*this._increment(this.counter)),this.spinning&&this._trigger("spin",t,{value:n})===!1||(this._value(n),this.counter++)},_increment:function(t){var n=this.options.incremental;return n?e.isFunction(n)?n(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=""+e,n=t.indexOf(".");return-1===n?0:t.length-n-1},_adjustValue:function(e){var t,n,r=this.options;return t=null!==r.min?r.min:0,n=e-t,n=Math.round(n/r.step)*r.step,e=t+n,e=parseFloat(e.toFixed(this._precision())),null!==r.max&&e>r.max?r.max:null!==r.min&&r.min>e?r.min:e},_stop:function(e){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",e))},_setOption:function(e,t){var n,r,i;return"culture"===e||"numberFormat"===e?(n=this._parse(this.element.val()),this.options[e]=t,this.element.val(this._format(n)),void 0):(("max"===e||"min"===e||"step"===e)&&"string"==typeof t&&(t=this._parse(t)),"icons"===e&&(r=this.buttons.first().find(".ui-icon"),this._removeClass(r,null,this.options.icons.up),this._addClass(r,null,t.up),i=this.buttons.last().find(".ui-icon"),this._removeClass(i,null,this.options.icons.down),this._addClass(i,null,t.down)),this._super(e,t),void 0)},_setOptionDisabled:function(e){this._super(e),this._toggleClass(this.uiSpinner,null,"ui-state-disabled",!!e),this.element.prop("disabled",!!e),this.buttons.button(e?"disable":"enable")},_setOptions:u(function(e){this._super(e)}),_parse:function(e){return"string"==typeof e&&""!==e&&(e=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(e,10,this.options.culture):+e),""===e||isNaN(e)?null:e},_format:function(e){return""===e?"":window.Globalize&&this.options.numberFormat?Globalize.format(e,this.options.numberFormat,this.options.culture):e},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var e=this.value();return null===e?!1:e===this._adjustValue(e)},_value:function(e,t){var n;""!==e&&(n=this._parse(e),null!==n&&(t||(n=this._adjustValue(n)),e=this._format(n))),this.element.val(e),this._refresh()},_destroy:function(){this.element.prop("disabled",!1).removeAttr("autocomplete role aria-valuemin aria-valuemax aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:u(function(e){this._stepUp(e)}),_stepUp:function(e){this._start()&&(this._spin((e||1)*this.options.step),this._stop())},stepDown:u(function(e){this._stepDown(e)}),_stepDown:function(e){this._start()&&(this._spin((e||1)*-this.options.step),this._stop())},pageUp:u(function(e){this._stepUp((e||1)*this.options.page)}),pageDown:u(function(e){this._stepDown((e||1)*this.options.page)}),value:function(e){return arguments.length?(u(this._value).call(this,e),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}}),e.uiBackCompat!==!1&&e.widget("ui.spinner",e.ui.spinner,{_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml())},_uiSpinnerHtml:function(){return"<span>"},_buttonHtml:function(){return"<a></a><a></a>"}}),e.ui.spinner,e.widget("ui.tabs",{version:"1.12.1",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var e=/#.*$/;return function(t){var n,r;n=t.href.replace(e,""),r=location.href.replace(e,"");try{n=decodeURIComponent(n)}catch(i){}try{r=decodeURIComponent(r)}catch(i){}return t.hash.length>1&&n===r}}(),_create:function(){var t=this,n=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-widget-content"),this._toggleClass("ui-tabs-collapsible",null,n.collapsible),this._processTabs(),n.active=this._initialActive(),e.isArray(n.disabled)&&(n.disabled=e.unique(n.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(n.active):e(),this._refresh(),this.active.length&&this.load(n.active)},_initialActive:function(){var t=this.options.active,n=this.options.collapsible,r=location.hash.substring(1);return null===t&&(r&&this.tabs.each(function(n,i){return e(i).attr("aria-controls")===r?(t=n,!1):void 0}),null===t&&(t=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===t||-1===t)&&(t=this.tabs.length?0:!1)),t!==!1&&(t=this.tabs.index(this.tabs.eq(t)),-1===t&&(t=n?!1:0)),!n&&t===!1&&this.anchors.length&&(t=0),t},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var n=e(e.ui.safeActiveElement(this.document[0])).closest("li"),r=this.tabs.index(n),i=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:r++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:i=!1,r--;break;case e.ui.keyCode.END:r=this.anchors.length-1;break;case e.ui.keyCode.HOME:r=0;break;case e.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),this._activate(r),void 0;case e.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),this._activate(r===this.options.active?!1:r),void 0;default:return}t.preventDefault(),clearTimeout(this.activating),r=this._focusNextTab(r,i),t.ctrlKey||t.metaKey||(n.attr("aria-selected","false"),this.tabs.eq(r).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",r)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.trigger("focus"))},_handlePageNav:function(t){return t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,n){function r(){return t>i&&(t=0),0>t&&(t=i),t}for(var i=this.tabs.length-1;-1!==e.inArray(r(),this.options.disabled);)t=n?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).trigger("focus"),e},_setOption:function(e,t){return"active"===e?(this._activate(t),void 0):(this._super(e,t),"collapsible"===e&&(this._toggleClass("ui-tabs-collapsible",null,t),t||this.options.active!==!1||this._activate(0)),"event"===e&&this._setupEvents(t),"heightStyle"===e&&this._setupHeightStyle(t),void 0)},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,n=this.tablist.children(":has(a[href])");t.disabled=e.map(n.filter(".ui-state-disabled"),function(e){return n.index(e)}),this._processTabs(),t.active!==!1&&this.anchors.length?this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=e()),this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass(this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this,n=this.tabs,r=this.anchors,i=this.panels;this.tablist=this._getList().attr("role","tablist"),this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("mousedown"+this.eventNamespace,"> li",function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass(this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map(function(){return e("a",this)[0]}).attr({role:"presentation",tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=e(),this.anchors.each(function(n,r){var i,s,o,u=e(r).uniqueId().attr("id"),a=e(r).closest("li"),f=a.attr("aria-controls");t._isLocal(r)?(i=r.hash,o=i.substring(1),s=t.element.find(t._sanitizeSelector(i))):(o=a.attr("aria-controls")||e({}).uniqueId()[0].id,i="#"+o,s=t.element.find(i),s.length||(s=t._createPanel(o),s.insertAfter(t.panels[n-1]||t.tablist)),s.attr("aria-live","polite")),s.length&&(t.panels=t.panels.add(s)),f&&a.data("ui-tabs-aria-controls",f),a.attr({"aria-controls":o,"aria-labelledby":u}),s.attr("aria-labelledby",u)}),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),n&&(this._off(n.not(this.tabs)),this._off(r.not(this.anchors)),this._off(i.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(t){return e("<div>").attr("id",t).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(t){var n,r,i;for(e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1),i=0;r=this.tabs[i];i++)n=e(r),t===!0||-1!==e.inArray(i,t)?(n.attr("aria-disabled","true"),this._addClass(n,null,"ui-state-disabled")):(n.removeAttr("aria-disabled"),this._removeClass(n,null,"ui-state-disabled"));this.options.disabled=t,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,t===!0)},_setupEvents:function(t){var n={};t&&e.each(t.split(" "),function(e,t){n[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(e){e.preventDefault()}}),this._on(this.anchors,n),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var n,r=this.element.parent();"fill"===t?(n=r.height(),n-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=e(this),r=t.css("position");"absolute"!==r&&"fixed"!==r&&(n-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){n-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,n-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===t&&(n=0,this.panels.each(function(){n=Math.max(n,e(this).height("").height())}).height(n))},_eventHandler:function(t){var n=this.options,r=this.active,i=e(t.currentTarget),s=i.closest("li"),o=s[0]===r[0],u=o&&n.collapsible,a=u?e():this._getPanelForTab(s),f=r.length?this._getPanelForTab(r):e(),l={oldTab:r,oldPanel:f,newTab:u?e():s,newPanel:a};t.preventDefault(),s.hasClass("ui-state-disabled")||s.hasClass("ui-tabs-loading")||this.running||o&&!n.collapsible||this._trigger("beforeActivate",t,l)===!1||(n.active=u?!1:this.tabs.index(s),this.active=o?e():s,this.xhr&&this.xhr.abort(),f.length||a.length||e.error("jQuery UI Tabs: Mismatching fragment identifier."),a.length&&this.load(this.tabs.index(s),t),this._toggle(t,l))},_toggle:function(t,n){function r(){s.running=!1,s._trigger("activate",t,n)}function i(){s._addClass(n.newTab.closest("li"),"ui-tabs-active","ui-state-active"),o.length&&s.options.show?s._show(o,s.options.show,r):(o.show(),r())}var s=this,o=n.newPanel,u=n.oldPanel;this.running=!0,u.length&&this.options.hide?this._hide(u,this.options.hide,function(){s._removeClass(n.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),i()}):(this._removeClass(n.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),u.hide(),i()),u.attr("aria-hidden","true"),n.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),o.length&&u.length?n.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr("aria-hidden","false"),n.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var n,r=this._findActive(t);r[0]!==this.active[0]&&(r.length||(r=this.active),n=r.find(".ui-tabs-anchor")[0],this._eventHandler({target:n,currentTarget:n,preventDefault:e.noop}))},_findActive:function(t){return t===!1?e():this.tabs.eq(t)},_getIndex:function(t){return"string"==typeof t&&(t=this.anchors.index(this.anchors.filter("[href$='"+e.ui.escapeSelector(t)+"']"))),t},_destroy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}),this.tabs.each(function(){var t=e(this),n=t.data("ui-tabs-aria-controls");n?t.attr("aria-controls",n).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(t){var n=this.options.disabled;n!==!1&&(void 0===t?n=!1:(t=this._getIndex(t),n=e.isArray(n)?e.map(n,function(e){return e!==t?e:null}):e.map(this.tabs,function(e,n){return n!==t?n:null})),this._setOptionDisabled(n))},disable:function(t){var n=this.options.disabled;if(n!==!0){if(void 0===t)n=!0;else{if(t=this._getIndex(t),-1!==e.inArray(t,n))return;n=e.isArray(n)?e.merge([t],n).sort():[t]}this._setOptionDisabled(n)}},load:function(t,n){t=this._getIndex(t);var r=this,i=this.tabs.eq(t),s=i.find(".ui-tabs-anchor"),o=this._getPanelForTab(i),u={tab:i,panel:o},a=function(e,t){"abort"===t&&r.panels.stop(!1,!0),r._removeClass(i,"ui-tabs-loading"),o.removeAttr("aria-busy"),e===r.xhr&&delete r.xhr};this._isLocal(s[0])||(this.xhr=e.ajax(this._ajaxSettings(s,n,u)),this.xhr&&"canceled"!==this.xhr.statusText&&(this._addClass(i,"ui-tabs-loading"),o.attr("aria-busy","true"),this.xhr.done(function(e,t,i){setTimeout(function(){o.html(e),r._trigger("load",n,u),a(i,t)},1)}).fail(function(e,t){setTimeout(function(){a(e,t)},1)})))},_ajaxSettings:function(t,n,r){var i=this;return{url:t.attr("href").replace(/#.*$/,""),beforeSend:function(t,s){return i._trigger("beforeLoad",n,e.extend({jqXHR:t,ajaxSettings:s},r))}}},_getPanelForTab:function(t){var n=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+n))}}),e.uiBackCompat!==!1&&e.widget("ui.tabs",e.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}}),e.ui.tabs,e.widget("ui.tooltip",{version:"1.12.1",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var t=e(this).attr("title")||"";return e("<a>").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,track:!1,close:null,open:null},_addDescribedBy:function(t,n){var r=(t.attr("aria-describedby")||"").split(/\s+/);r.push(n),t.data("ui-tooltip-id",n).attr("aria-describedby",e.trim(r.join(" ")))},_removeDescribedBy:function(t){var n=t.data("ui-tooltip-id"),r=(t.attr("aria-describedby")||"").split(/\s+/),i=e.inArray(n,r);-1!==i&&r.splice(i,1),t.removeData("ui-tooltip-id"),r=e.trim(r.join(" ")),r?t.attr("aria-describedby",r):t.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.liveRegion=e("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this.disabledTitles=e([])},_setOption:function(t,n){var r=this;this._super(t,n),"content"===t&&e.each(this.tooltips,function(e,t){r._updateContent(t.element)})},_setOptionDisabled:function(e){this[e?"_disable":"_enable"]()},_disable:function(){var t=this;e.each(this.tooltips,function(n,r){var i=e.Event("blur");i.target=i.currentTarget=r.element[0],t.close(i,!0)}),this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var t=e(this);return t.is("[title]")?t.data("ui-tooltip-title",t.attr("title")).removeAttr("title"):void 0}))},_enable:function(){this.disabledTitles.each(function(){var t=e(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))}),this.disabledTitles=e([])},open:function(t){var n=this,r=e(t?t.target:this.element).closest(this.options.items);r.length&&!r.data("ui-tooltip-id")&&(r.attr("title")&&r.data("ui-tooltip-title",r.attr("title")),r.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&r.parents().each(function(){var t,r=e(this);r.data("ui-tooltip-open")&&(t=e.Event("blur"),t.target=t.currentTarget=this,n.close(t,!0)),r.attr("title")&&(r.uniqueId(),n.parents[this.id]={element:this,title:r.attr("title")},r.attr("title",""))}),this._registerCloseHandlers(t,r),this._updateContent(r,t))},_updateContent:function(e,t){var n,r=this.options.content,i=this,s=t?t.type:null;return"string"==typeof r||r.nodeType||r.jquery?this._open(t,e,r):(n=r.call(e[0],function(n){i._delay(function(){e.data("ui-tooltip-open")&&(t&&(t.type=s),this._open(t,e,n))})}),n&&this._open(t,e,n),void 0)},_open:function(t,n,r){function i(e){f.of=e,o.is(":hidden")||o.position(f)}var s,o,u,a,f=e.extend({},this.options.position);if(r){if(s=this._find(n))return s.tooltip.find(".ui-tooltip-content").html(r),void 0;n.is("[title]")&&(t&&"mouseover"===t.type?n.attr("title",""):n.removeAttr("title")),s=this._tooltip(n),o=s.tooltip,this._addDescribedBy(n,o.attr("id")),o.find(".ui-tooltip-content").html(r),this.liveRegion.children().hide(),a=e("<div>").html(o.find(".ui-tooltip-content").html()),a.removeAttr("name").find("[name]").removeAttr("name"),a.removeAttr("id").find("[id]").removeAttr("id"),a.appendTo(this.liveRegion),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:i}),i(t)):o.position(e.extend({of:n},this.options.position)),o.hide(),this._show(o,this.options.show),this.options.track&&this.options.show&&this.options.show.delay&&(u=this.delayedShow=setInterval(function(){o.is(":visible")&&(i(f.of),clearInterval(u))},e.fx.interval)),this._trigger("open",t,{tooltip:o})}},_registerCloseHandlers:function(t,n){var r={keyup:function(t){if(t.keyCode===e.ui.keyCode.ESCAPE){var r=e.Event(t);r.currentTarget=n[0],this.close(r,!0)}}};n[0]!==this.element[0]&&(r.remove=function(){this._removeTooltip(this._find(n).tooltip)}),t&&"mouseover"!==t.type||(r.mouseleave="close"),t&&"focusin"!==t.type||(r.focusout="close"),this._on(!0,n,r)},close:function(t){var n,r=this,i=e(t?t.currentTarget:this.element),s=this._find(i);return s?(n=s.tooltip,s.closing||(clearInterval(this.delayedShow),i.data("ui-tooltip-title")&&!i.attr("title")&&i.attr("title",i.data("ui-tooltip-title")),this._removeDescribedBy(i),s.hiding=!0,n.stop(!0),this._hide(n,this.options.hide,function(){r._removeTooltip(e(this))}),i.removeData("ui-tooltip-open"),this._off(i,"mouseleave focusout keyup"),i[0]!==this.element[0]&&this._off(i,"remove"),this._off(this.document,"mousemove"),t&&"mouseleave"===t.type&&e.each(this.parents,function(t,n){e(n.element).attr("title",n.title),delete r.parents[t]}),s.closing=!0,this._trigger("close",t,{tooltip:n}),s.hiding||(s.closing=!1)),void 0):(i.removeData("ui-tooltip-open"),void 0)},_tooltip:function(t){var n=e("<div>").attr("role","tooltip"),r=e("<div>").appendTo(n),i=n.uniqueId().attr("id");return this._addClass(r,"ui-tooltip-content"),this._addClass(n,"ui-tooltip","ui-widget ui-widget-content"),n.appendTo(this._appendTo(t)),this.tooltips[i]={element:t,tooltip:n}},_find:function(e){var t=e.data("ui-tooltip-id");return t?this.tooltips[t]:null},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_appendTo:function(e){var t=e.closest(".ui-front, dialog");return t.length||(t=this.document[0].body),t},_destroy:function(){var t=this;e.each(this.tooltips,function(n,r){var i=e.Event("blur"),s=r.element;i.target=i.currentTarget=s[0],t.close(i,!0),e("#"+n).remove(),s.data("ui-tooltip-title")&&(s.attr("title")||s.attr("title",s.data("ui-tooltip-title")),s.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}}),e.uiBackCompat!==!1&&e.widget("ui.tooltip",e.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var e=this._superApply(arguments);return this.options.tooltipClass&&e.tooltip.addClass(this.options.tooltipClass),e}}),e.ui.tooltip}),function(e,t){var n=0,r=null,i=[],s=null;e.fn.split=function(o){function y(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=e.match(/^([0-9\.]+)(px|%)$/);if(t){if(t[2]=="px")return+t[1];if(l.orientation=="vertical")return p*+t[1]/100;if(l.orientation=="horizontal")return d*+t[1]/100}}}var u=this.data("splitter");if(u)return u;var a,f,l=e.extend({limit:100,orientation:"horizontal",position:"50%",invisible:!1,onDragStart:e.noop,onDragEnd:e.noop,onDrag:e.noop},o||{});this.settings=l;var c,h=this.children();l.orientation=="vertical"?(a=h.first().addClass("left_panel"),f=a.next().addClass("right_panel"),c="vsplitter"):l.orientation=="horizontal"&&(a=h.first().addClass("top_panel"),f=a.next().addClass("bottom_panel"),c="hsplitter"),l.invisible&&(c+=" splitter-invisible");var p=this.width(),d=this.height(),v=n++;this.addClass("splitter_panel");var m=e("<div/>").addClass(c).bind("mouseenter touchstart",function(){r=v}).bind("mouseleave touchend",function(){r=null}).insertAfter(a),g,b=e.extend(this,{refresh:function(){var e=this.width(),t=this.height();if(p!=e||d!=t)p=this.width(),d=this.height(),b.position(g)},position:function(){return l.orientation=="vertical"?function(e,n){if(e===t)return g;g=y(e);var r=m.width(),i=r/2;if(l.invisible){var s=a.width(g).outerWidth();f.width(b.width()-s),m.css("left",s-i)}else{var s=a.width(g-i).outerWidth();f.width(b.width()-s-r),m.css("left",s)}return n||b.find(".splitter_panel").trigger("splitter.resize"),b}:l.orientation=="horizontal"?function(e,n){if(e===t)return g;g=y(e);var r=m.height(),i=r/2;if(l.invisible){var s=a.height(g).outerHeight();f.height(b.height()-s),m.css("top",s-i)}else{var s=a.height(g-i).outerHeight();f.height(b.height()-s-r),m.css("top",s)}return n||b.find(".splitter_panel").trigger("splitter.resize"),b}:e.noop}(),orientation:l.orientation,limit:l.limit,isActive:function(){return r===v},destroy:function(){b.removeClass("splitter_panel"),m.unbind("mouseenter"),m.unbind("mouseleave"),m.unbind("touchstart"),m.unbind("touchmove"),m.unbind("touchend"),m.unbind("touchleave"),m.unbind("touchcancel"),l.orientation=="vertical"?(a.removeClass("left_panel"),f.removeClass("right_panel")):l.orientation=="horizontal"&&(a.removeClass("top_panel"),f.removeClass("bottom_panel")),b.unbind("splitter.resize"),b.find(".splitter_panel").trigger("splitter.resize"),i[v]=null,m.remove();var t=!1;for(var r=i.length;r--;)if(i[r]!==null){t=!0;break}t||(e(document.documentElement).unbind(".splitter"),e(window).unbind("resize.splitter"),b.data("splitter",null),i=[],n=0)}});b.bind("splitter.resize",function(e){var t=b.position();b.orientation=="vertical"&&t>b.width()?t=b.width()-b.limit-1:b.orientation=="horizontal"&&t>b.height()&&(t=b.height()-b.limit-1),t<b.limit&&(t=b.limit+1),b.position(t,!0)});var w;return l.orientation=="vertical"?w>p-l.limit?w=p-l.limit:w=y(l.position):l.orientation=="horizontal"&&(w>d-l.limit?w=d-l.limit:w=y(l.position)),w<l.limit&&(w=l.limit),b.position(w,!0),i.length==0&&(e(window).bind("resize.splitter",function(){e.each(i,function(e,t){t.refresh()})}),e(document.documentElement).bind("mousedown.splitter touchstart.splitter",function(t){if(r!==null)return s=i[r],e('<div class="splitterMask"></div>').css("cursor",s.children().eq(1).css("cursor")).insertAfter(s),s.settings.onDragStart(t),!1}).bind("mouseup.splitter touchend.splitter touchleave.splitter touchcancel.splitter",function(t){s&&(e(".splitterMask").remove(),s.settings.onDragEnd(t),s=null)}).bind("mousemove.splitter touchmove.splitter",function(e){if(s!==null){var t=s.limit,n=s.offset();if(s.orientation=="vertical"){var r=e.pageX;e.originalEvent&&e.originalEvent.changedTouches&&(r=e.originalEvent.changedTouches[0].pageX);var i=r-n.left;i<=s.limit?i=s.limit+1:i>=s.width()-t&&(i=s.width()-t-1),i>s.limit&&i<s.width()-t&&(s.position(i,!0),s.find(".splitter_panel").trigger("splitter.resize"),e.preventDefault())}else if(s.orientation=="horizontal"){var o=e.pageY;e.originalEvent&&e.originalEvent.changedTouches&&(o=e.originalEvent.changedTouches[0].pageY);var u=o-n.top;u<=s.limit?u=s.limit+1:u>=s.height()-t&&(u=s.height()-t-1),u>s.limit&&u<s.height()-t&&(s.position(u,!0),s.find(".splitter_panel").trigger("splitter.resize"),e.preventDefault())}s.settings.onDrag(e)}})),i.push(b),b.data("splitter",b),b}}(jQuery),define("splitter",["jquery"],function(){}),define("pane",["jquery","splitter"],function(){function e(e,t,n){var r=e.wrap('<div class="pane-container"></div>').parent();n=="above"||n=="left"?r.prepend(t):r.append(t),e.wrap('<div class="pane-wrapper"></div>'),t.wrap('<div class="pane-wrapper"></div>'),n=="above"||n=="below"?dir="horizontal":dir="vertical",r.split({orientation:dir,limit:10})}function t(e){var t=e.parents(".pane-container").first();t.split().destroy(),e.parent().remove(),t.children().first().children().first().unwrap().unwrap()}(function(e){function r(t){var n=t.children();return{splitter:t.split(),first:e(n[0]).children()[0],second:e(n[2]).children()[0]}}var t="tile",n={_init:function(t){return this.each(function(){var t=e(this),n=t.hasClass("horizontal")?"vertical":"horizontal",r=t.attr("data-split"),i=t.children();r||(r="50%"),i.each(function(){e(this).wrap('<div class="pane-wrapper"></div>')}),t.addClass("pane-container"),t.split({orientation:n,position:r,limit:10,onDragStart:function(){t.tile("resize_start")},onDrag:function(e){i.trigger("pane.resize")},onDragEnd:function(){t.tile("resize_save")}}),t.tile("resize_save")})},resize_start:function(){return this.each(function(){var t=e(this),n=r(t);t.find(".reactive-size").trigger("reactive-resize-start",n.splitter.orientation)})},resize_save:function(){return this.each(function(){var t=e(this),n=r(t),i,s;n.splitter.orientation=="horizontal"?(i=t.height(),s=e(n.first).height()):(i=t.width(),s=e(n.first).width());var o=Math.round(100*s/i)+"%";n.splitter.resizestart=o}),this.find(".reactive-size").trigger("reactive-resize"),this},resize:function(){return this.each(function(){var t=e(this),n=t.split();n.resizestart&&(n.position(n.resizestart),n.settings.onDrag(t))})}};e.fn.tile=function(r){if(n[r])return n[r].apply(this,Array.prototype.slice.call(arguments,1));if(typeof r=="object"||!r)return n._init.apply(this,arguments);e.error("Method "+r+" does not exist on jQuery."+t)}})(jQuery)}),function(e){var t={prefilled:null,CapitalizeFirstLetter:!1,preventSubmitOnEnter:!0,isClearInputOnEsc:!0,externalTagId:!1,prefillIdFieldName:"Id",prefillValueFieldName:"Value",AjaxPush:null,AjaxPushAllTags:null,AjaxPushParameters:null,delimiters:[9,13,44],backspace:[8],maxTags:0,hiddenTagListName:null,hiddenTagListId:null,replace:!0,output:null,deleteTagsOnBackspace:!0,tagsContainer:null,tagCloseIcon:"x",tagClass:"",validator:null,onlyTagList:!1,tagList:null,fillInputOnTagRemove:!1},n={pushTag:function(t,n,i){var s=e(this),o=s.data("opts"),u,a,f,l,c=s.data("tlis"),h=s.data("tlid"),p,d,v,m,g,y,b,w;t=r.trimTag(t,o.delimiterChars);if(!t||t.length<=0)return;if(o.onlyTagList&&undefined!==o.tagList&&o.tagList){var E=o.tagList;e.each(E,function(e,t){E[e]=t.toLowerCase()});var S=e.inArray(t.toLowerCase(),E);if(-1===S)return}o.CapitalizeFirstLetter&&t.length>1&&(t=t.charAt(0).toUpperCase()+t.slice(1).toLowerCase());if(o.validator&&!o.validator(t)){s.trigger("tm:invalid",t);return}if(o.maxTags>0&&c.length>=o.maxTags)return;u=!1,a=jQuery.map(c,function(e){return e.toLowerCase()}),p=e.inArray(t.toLowerCase(),a),-1!==p&&(u=!0);if(u){s.trigger("tm:duplicated",t);if(o.blinkClass)for(var x=0;x<6;++x)e("#"+s.data("tm_rndid")+"_"+h[p]).queue(function(t){e(this).toggleClass(o.blinkClass),t()}).delay(100);else e("#"+s.data("tm_rndid")+"_"+h[p]).stop().animate({backgroundColor:o.blinkBGColor_1},100).animate({backgroundColor:o.blinkBGColor_2},100).animate({backgroundColor:o.blinkBGColor_1},100).animate({backgroundColor:o.blinkBGColor_2},100).animate({backgroundColor:o.blinkBGColor_1},100).animate({backgroundColor:o.blinkBGColor_2},100)}else o.externalTagId===!0?(i===undefined&&e.error("externalTagId is not passed for tag -"+t),l=i):(f=Math.max.apply(null,h),f=f===-Infinity?0:f,l=++f),n||s.trigger("tm:pushing",[t,l]),c.push(t),h.push(l),n||o.AjaxPush!==null&&o.AjaxPushAllTags==null&&e.inArray(t,o.prefilled)===-1&&e.post(o.AjaxPush,e.extend({tag:t},o.AjaxPushParameters)),d=s.data("tm_rndid")+"_"+l,v=s.data("tm_rndid")+"_Remover_"+l,m=e("<span/>").text(t).html(),g='<span class="'+r.tagClasses.call(s)+'" id="'+d+'">',g+="<span>"+m+"</span>",g+='<a href="#" class="tm-tag-remove" id="'+v+'" TagIdToRemove="'+l+'">',g+=o.tagCloseIcon+"</a></span> ",y=e(g),o.tagsContainer!==null?e(o.tagsContainer).append(y):h.length>1?(w=s.siblings("#"+s.data("tm_rndid")+"_"+h[h.length-2]),w.after(y)):s.before(y),y.find("#"+v).on("click",s,function(t){t.preventDefault();var n=parseInt(e(this).attr("TagIdToRemove"));r.spliceTag.call(s,n,t.data)}),r.refreshHiddenTagList.call(s),n||s.trigger("tm:pushed",[t,l]),r.showOrHide.call(s);s.val("")},popTag:function(){var t=e(this),n,i,s=t.data("tlis"),o=t.data("tlid");o.length>0&&(n=o.pop(),i=s[s.length-1],t.trigger("tm:popping",[i,n]),s.pop(),e("#"+t.data("tm_rndid")+"_"+n).remove(),r.refreshHiddenTagList.call(t),t.trigger("tm:popped",[i,n]))},empty:function(){var t=e(this),n=t.data("tlis"),i=t.data("tlid"),s;while(i.length>0)s=i.pop(),n.pop(),e("#"+t.data("tm_rndid")+"_"+s).remove(),r.refreshHiddenTagList.call(t);t.trigger("tm:emptied",null),r.showOrHide.call(t)},tags:function(){var e=this,t=e.data("tlis");return t}},r={showOrHide:function(){var e=this,t=e.data("opts"),n=e.data("tlis");t.maxTags>0&&n.length<t.maxTags&&(e.show(),e.trigger("tm:show")),t.maxTags>0&&n.length>=t.maxTags&&(e.hide(),e.trigger("tm:hide"))},tagClasses:function(){var t=e(this),n=t.data("opts"),r=n.tagBaseClass,i=n.inputBaseClass,s;return s=r,t.attr("class")&&e.each(t.attr("class").split(" "),function(e,t){t.indexOf(i+"-")!==-1&&(s+=" "+r+t.substring(i.length))}),s+=n.tagClass?" "+n.tagClass:"",s},trimTag:function(t,n){var r;t=e.trim(t),r=0;for(r;r<t.length;r++)if(e.inArray(t.charCodeAt(r),n)!==-1)break;return t.substring(0,r)},refreshHiddenTagList:function(){var t=e(this),n=t.data("tlis"),r=t.data("lhiddenTagList");r&&e(r).val(n.join(t.data("opts").baseDelimiter)).change(),t.trigger("tm:refresh",n.join(t.data("opts").baseDelimiter))},killEvent:function(e){e.cancelBubble=!0,e.returnValue=!1,e.stopPropagation(),e.preventDefault()},keyInArray:function(t,n){return e.inArray(t.which,n)!==-1},applyDelimiter:function(t){var r=e(this);n.pushTag.call(r,e(this).val()),t.preventDefault()},prefill:function(t){var r=e(this),i=r.data("opts");e.each(t,function(e,t){i.externalTagId===!0?n.pushTag.call(r,t[i.prefillValueFieldName],!0,t[i.prefillIdFieldName]):n.pushTag.call(r,t,!0)})},pushAllTags:function(t,n){var r=e(this),i=r.data("opts"),s=r.data("tlis");i.AjaxPushAllTags&&(t.type!=="tm:pushed"||e.inArray(n,i.prefilled)===-1)&&e.post(i.AjaxPush,e.extend({tags:s.join(i.baseDelimiter)},i.AjaxPushParameters))},spliceTag:function(t){var n=this,i=n.data("tlis"),s=n.data("tlid"),o=e.inArray(t,s),u;-1!==o&&(u=i[o],n.trigger("tm:splicing",[u,t]),e("#"+n.data("tm_rndid")+"_"+t).remove(),i.splice(o,1),s.splice(o,1),r.refreshHiddenTagList.call(n),n.trigger("tm:spliced",[u,t])),r.showOrHide.call(n)},init:function(i){var s=e.extend({},t,i),o,u;return s.hiddenTagListName=s.hiddenTagListName===null?"hidden-"+this.attr("name"):s.hiddenTagListName,o=s.delimeters||s.delimiters,u=[9,13,17,18,19,37,38,39,40],s.delimiterChars=[],s.delimiterKeys=[],e.each(o,function(t,n){e.inArray(n,u)!==-1?s.delimiterKeys.push(n):s.delimiterChars.push(n)}),s.baseDelimiter=String.fromCharCode(s.delimiterChars[0]||44),s.tagBaseClass="tm-tag",s.inputBaseClass="tm-input",e.isFunction(s.validator)||(s.validator=null),this.each(function(){var t=e(this),i="",o="",u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";if(t.data("tagManager"))return!1;t.data("tagManager",!0);for(var a=0;a<5;a++)o+=u.charAt(Math.floor(Math.random()*u.length));t.data("tm_rndid",o),t.data("opts",s).data("tlis",[]).data("tlid",[]),s.output===null?(i=e("<input/>",{type:"hidden",name:s.hiddenTagListName}),t.after(i),t.data("lhiddenTagList",i)):t.data("lhiddenTagList",e(s.output)),s.AjaxPushAllTags&&(t.on("tm:spliced",r.pushAllTags),t.on("tm:popped",r.pushAllTags),t.on("tm:pushed",r.pushAllTags)),t.on("focus keypress",function(t){e(this).popover&&e(this).popover("hide")}),s.isClearInputOnEsc&&t.on("keyup",function(t){t.which===27&&(e(this).val(""),r.killEvent(t))}),t.on("keypress",function(e){r.keyInArray(e,s.delimiterChars)&&r.applyDelimiter.call(t,e)}),t.on("keydown",function(e){e.which===13&&s.preventSubmitOnEnter&&r.killEvent(e),r.keyInArray(e,s.delimiterKeys)&&r.applyDelimiter.call(t,e)}),s.deleteTagsOnBackspace&&t.on("keydown",function(i){r.keyInArray(i,s.backspace)&&e(this).val().length<=0&&(n.popTag.call(t),r.killEvent(i))}),s.fillInputOnTagRemove&&t.on("tm:popped",function(t,n){e(this).val(n)}),t.change(function(e){/webkit/.test(navigator.userAgent.toLowerCase())||t.focus(),r.killEvent(e)});if(s.prefilled!==null)typeof s.prefilled=="object"?r.prefill.call(t,s.prefilled):typeof s.prefilled=="string"?r.prefill.call(t,s.prefilled.split(s.baseDelimiter)):typeof s.prefilled=="function"&&r.prefill.call(t,s.prefilled());else if(s.output!==null){if(e(s.output)&&e(s.output).val())var f=e(s.output);r.prefill.call(t,e(s.output).val().split(s.baseDelimiter))}}),this}};e.fn.tagsManager=function(t){var i=e(this);return 0 in this?n[t]?n[t].apply(i,Array.prototype.slice.call(arguments,1)):typeof t=="object"||!t?r.init.apply(this,arguments):(e.error("Method "+t+" does not exist."),!1):this}}(jQuery),define("tagmanager",["jquery"],function(){}),define("form",["jquery","config","modal","laconic","tagmanager"],function(e,t,n){function i(t,n,r){return r=r||2,e.el.label({"class":"control-label col-xs-"+r+"","for":t},n)}function s(t,n){var r={name:t,type:"checkbox"};return n=n||{},n.checked&&(r.checked="checked"),n.title&&(r.title=n.title),e.el.input(r)}function o(t,n){var r={name:t,type:"text","class":"form-control"};return n=n||{},n.placeholder&&(r.placeholder=n.placeholder),n.title&&(r.title=n.title),n.value&&(r.value=n.value),n.disabled&&(r.disabled=n.disabled),n.type&&(r.type=n.type),e.el.input(r)}function u(t,n,r){var i={name:t,type:"text","class":"tm-input tag-list"};n&&(i.placeholder=n);var s=e.el.input(i);return r&&e(s).data("prefilled",r),s}function a(t){return e.el.p({"class":"help-block"},"Make saved file public and give it a meaningful name")}function f(t,n){var r={name:t,"class":"form-control"};return n=n||{},n.placeholder&&(r.placeholder=n.placeholder),e.el.textarea(r,n.value||"")}function l(t,n,r){function s(t){if(typeof t=="string")t==r.value?i.append(e.el.option({selected:"selected"},t)):i.append(e.el.option(t));else{var n={value:t.value};t.value==r.value&&(n.selected="selected"),i.append(e.el.option(n,t.label))}}var i=e(e.el.select({"class":"form-control",name:t}));r=r||{};for(var o=0;o<n.length;o++)s(n[o]);return i[0]}var r={serializeAsObject:function(t){var n=t.serializeArray(0),r={};for(var i=0;i<n.length;i++){var s=n[i].name,o=n[i].value,u=t.find('[name="'+s+'"]'),a=u.prop("type");o!=""&&(a=="hidden"&&s.indexOf("hidden-")==0?(s=s.slice("hidden-".length),r[s]==undefined?r[s]=o.split(","):r[s]=o.split(",").concat(r[s])):a=="text"&&u.hasClass("tag-list")?o!=""&&(r[s]!==undefined?r[s].push(o):r[s]=[o]):a=="number"?r[s]=parseInt(o):a=="checkbox"?r[s]=o=="on"?!0:!1:r[s]=o)}return t.find("[type=checkbox]").each(function(){var t=e(this),n=t.prop("name");r[n]===undefined&&(r[n]=!1)}),r},formError:function(e,t){e.find(".has-error").removeClass("has-error"),e.find(".help-block.with-errors").remove();if(t)if(t.code=="form_error"||t.code=="input_error"){errors=t.data.split("\n");for(var i=0;i<errors.length;i++){var s=errors[i].split(/:\s*(.*)?/);r.fieldError(e,s[0],s[1])}}else n.alert(t.data)},fieldError:function(t,n,r){var i=t.find("input[name="+n+"]");if(i.length>0){var s=i.closest(".form-group");i.parent().hasClass("input-group")&&(i=i.parent()),s.addClass("has-error"),i.after(e.el.p({"class":"help-block with-errors"},r))}else alert("Missing value for "+n)},showDialog:function(t){e(".swish-event-receiver").trigger("dialog",t)},formBroadcast:function(t,n){e(".swish-event-receiver").trigger(t,n)},fields:{fileName:function(n,r,u,f){var l=t.swish.community_examples?"Public | Example | name":"Public | name",c=e.el.div({"class":"form-group"},i("name",l),e.el.div({"class":"col-xs-10"},e.el.div({"class":"input-group"},e.el.span({"class":"input-group-addon",title:"If checked, other users can find this program"},s("public",{checked:r})),t.swish.community_examples?e.el.span({"class":"input-group-addon",title:"If checked, add to examples menu"},s("example",{checked:u})):undefined,o("name",{placeholder:"Name (leave empty for generated random name)",title:"Public name of your program",value:n,disabled:f})),a("Make saved file public or give it a meaningful name")));return c},title:function(t){var n=e.el.div({"class":"form-group"},i("title","Title"),e.el.div({"class":"col-xs-10"},o("title",{placeholder:"Descriptive title",value:t})));return n},author:function(t){var n=e.el.div({"class":"form-group"},i("author","Author"),e.el.div({"class":"col-xs-10"},o("author",{placeholder:"Your name",value:t})));return n},date:function(t,n,r){r=r||i;var s=e.el.div({"class":"form-group"},i(r,n),e.el.div({"class":"col-xs-10"},o(r,{disabled:!0,value:(new Date(t*1e3)).toLocaleString()})));return s},description:function(t){var n=e.el.div({"class":"form-group"},i("description","Description"),e.el.div({"class":"col-xs-10"},f("description",{value:t})));return n},commit_message:function(t){var n=e.el.div({"class":"form-group"},i("commit_message","Changes"),e.el.div({"class":"col-xs-10"},f("commit_message",{value:t,placeholder:"Describe your changes here"})));return n},tags:function(t){var n=e.el.div({"class":"form-group"},i("tags","Tags"),e.el.div({"class":"col-xs-10"},u("tags","Tags help finding this code",t)));return n},projection:function(t){var n=e.el.div({"class":"form-group"},i("projection","Projection"),e.el.div({"class":"col-xs-10"},o("projection",{placeholder:"Columns",value:t})));return n},csvFormat:function(t,n){var r;return t=t||["prolog"],n=n||t[0],t.length==1?r=e.el.input({type:"hidden",name:"format",value:t[0]}):r=e.el.div({"class":"form-group"},i("format","Format"),e.el.div({"class":"col-xs-10"},l("format",t,{value:n}))),r},limit:function(t,n){var r=e.el.div({"class":"form-group"},i("name","Distinct | limit"),e.el.div({"class":"col-xs-10"},e.el.div({"class":"input-group"},e.el.span({"class":"input-group-addon",title:"If checked only return distinct results"},s("distinct",{checked:n})),o("limit",{placeholder:"Maximum result count (blank for unlimited)",title:"Limit results",value:t}))));return r},checkboxes:function(t){var n,r=e.el.div({"class":"form-group"},i("options","Options",3),n=e.el.div({"class":"col-xs-9"}));for(var s=0;s<t.length;s++){var o=t[s],u={type:"checkbox",name:o.name,autocomplete:"false"};o.value&&(u.checked="checked"),e(n).append(e.el.label({"class":"checkbox-inline"},e.el.input(u),o.label))}return r},chunk:function(t){var n=e.el.div({"class":"form-group"},i("count","Initial solutions",3),e.el.div({"class":"col-xs-9"},e.el.div({"class":"input-group"},o("chunk",{title:"Initial number of solutions",type:"number",value:t}))));return n},name:function(t,n){n=n||3;var r=e.el.div({"class":"form-group"},i("name","Name",n),e.el.div({"class":"col-xs-"+(12-n)},o("name",{placeholder:"Name",value:t})));return r},filename:function(t,n){n=n||3;var r=e.el.div({"class":"form-group"},i("filename","File name",n),e.el.div({"class":"col-xs-"+(12-n)},o("filename",{placeholder:"File name",value:t})));return r},buttons:function(t){t=t||{};var n=t.label||"Save program",i=t.offset||2,s=e.el.button({name:"save","class":"btn btn-primary"},n);e(s).on("click",function(n){var i=e(n.target).parents("form")[0],s=r.serializeAsObject(e(i));return t.action(n,s),e(n.target).parents(".modal").modal("hide"),n.preventDefault(),!1});var o=e.el.div({"class":"form-group"},e.el.div({"class":"col-xs-offset-"+i+" col-xs-"+(12-i)},s,e.el.button({name:"cancel","class":"btn btn-danger","data-dismiss":"modal"},"Cancel")));return o},radio:function(t,n){var r=e.el.div({"class":"btn-group","data-toggle":"buttons"});for(var i=0;i<n.length;i++){var s="btn btn-default btn-xs";n[i].active&&(s+=" active");var o={type:"radio",name:t,autocomplete:"off",value:n[i].value},u={"class":s};n[i].title&&(u.title=n[i].title),e(r).append(e.el.label(u,e.el.input(o),n[i].label))}return r}},widgets:{glyphIconButton:function(t,n){var r={"class":"btn btn-info",type:"button"};return n.action&&(r["data-action"]=n.action),n.title&&(r.title=n.title),elem=e.el.button(r,e.el.span({"class":"glyphicon "+t})),elem},dropdownButton:function(t,n){n||(n={});var i=n.divClass,s=n.ulClass,o=e.el.div({"class":"btn-group dropdown"+(i?" "+i:"")},e.el.button({"class":"dropdown-toggle","data-toggle":"dropdown"},t),e.el.ul({"class":"dropdown-menu"+(s?" "+s:"")}));return n.actions&&r.widgets.populateMenu(e(o),n.client,n.actions),o},populateMenu:function(t,n,r){function s(t){var r=e(t).data("action");return r&&r.call(n,t),!1}function o(t,n){if(t.indexOf("--")==0)i.append(e.el.li({"class":"divider"}));else{var r=e.el.a(t);e(r).data("action",n),i.append(e.el.li(r))}}var i=t.find(".dropdown-menu");for(var u in r)r.hasOwnProperty(u)&&o(u,r[u]);return i.on("click","a",function(){s(this)}),t}}};return r}),!function(e){var t=function(){return{isMsie:function(){return/(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]:!1},isBlankString:function(e){return!e||/^\s*$/.test(e)},escapeRegExChars:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isArray:e.isArray,isFunction:e.isFunction,isObject:e.isPlainObject,isUndefined:function(e){return"undefined"==typeof e},toStr:function(e){return t.isUndefined(e)||null===e?"":e+""},bind:e.proxy,each:function(t,n){function r(e,t){return n(t,e)}e.each(t,r)},map:e.map,filter:e.grep,every:function(t,n){var r=!0;return t?(e.each(t,function(e,i){return(r=n.call(null,i,e,t))?void 0:!1}),!!r):r},some:function(t,n){var r=!1;return t?(e.each(t,function(e,i){return(r=n.call(null,i,e,t))?!1:void 0}),!!r):r},mixin:e.extend,getUniqueId:function(){var e=0;return function(){return e++}}(),templatify:function(t){function n(){return String(t)}return e.isFunction(t)?t:n},defer:function(e){setTimeout(e,0)},debounce:function(e,t,n){var r,i;return function(){var s,o,u=this,a=arguments;return s=function(){r=null,n||(i=e.apply(u,a))},o=n&&!r,clearTimeout(r),r=setTimeout(s,t),o&&(i=e.apply(u,a)),i}},throttle:function(e,t){var n,r,i,s,o,u;return o=0,u=function(){o=new Date,i=null,s=e.apply(n,r)},function(){var a=new Date,f=t-(a-o);return n=this,r=arguments,0>=f?(clearTimeout(i),i=null,o=a,s=e.apply(n,r)):i||(i=setTimeout(u,f)),s}},noop:function(){}}}(),n="0.10.5",r=function(){function e(e){return e=t.toStr(e),e?e.split(/\s+/):[]}function n(e){return e=t.toStr(e),e?e.split(/\W+/):[]}function r(e){return function(){var n=[].slice.call(arguments,0);return function(r){var i=[];return t.each(n,function(n){i=i.concat(e(t.toStr(r[n])))}),i}}}return{nonword:n,whitespace:e,obj:{nonword:r(n),whitespace:r(e)}}}(),i=function(){function n(n){this.maxSize=t.isNumber(n)?n:100,this.reset(),this.maxSize<=0&&(this.set=this.get=e.noop)}function r(){this.head=this.tail=null}function i(e,t){this.key=e,this.val=t,this.prev=this.next=null}return t.mixin(n.prototype,{set:function(e,t){var n,r=this.list.tail;this.size>=this.maxSize&&(this.list.remove(r),delete this.hash[r.key]),(n=this.hash[e])?(n.val=t,this.list.moveToFront(n)):(n=new i(e,t),this.list.add(n),this.hash[e]=n,this.size++)},get:function(e){var t=this.hash[e];return t?(this.list.moveToFront(t),t.val):void 0},reset:function(){this.size=0,this.hash={},this.list=new r}}),t.mixin(r.prototype,{add:function(e){this.head&&(e.next=this.head,this.head.prev=e),this.head=e,this.tail=this.tail||e},remove:function(e){e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev},moveToFront:function(e){this.remove(e),this.add(e)}}),n}(),s=function(){function e(e){this.prefix=["__",e,"__"].join(""),this.ttlKey="__ttl__",this.keyMatcher=new RegExp("^"+t.escapeRegExChars(this.prefix))}function n(){return(new Date).getTime()}function r(e){return JSON.stringify(t.isUndefined(e)?null:e)}function i(e){return JSON.parse(e)}var s,o;try{s=window.localStorage,s.setItem("~~~","!"),s.removeItem("~~~")}catch(u){s=null}return o=s&&window.JSON?{_prefix:function(e){return this.prefix+e},_ttlKey:function(e){return this._prefix(e)+this.ttlKey},get:function(e){return this.isExpired(e)&&this.remove(e),i(s.getItem(this._prefix(e)))},set:function(e,i,o){return t.isNumber(o)?s.setItem(this._ttlKey(e),r(n()+o)):s.removeItem(this._ttlKey(e)),s.setItem(this._prefix(e),r(i))},remove:function(e){return s.removeItem(this._ttlKey(e)),s.removeItem(this._prefix(e)),this},clear:function(){var e,t,n=[],r=s.length;for(e=0;r>e;e++)(t=s.key(e)).match(this.keyMatcher)&&n.push(t.replace(this.keyMatcher,""));for(e=n.length;e--;)this.remove(n[e]);return this},isExpired:function(e){var r=i(s.getItem(this._ttlKey(e)));return t.isNumber(r)&&n()>r?!0:!1}}:{get:t.noop,set:t.noop,remove:t.noop,clear:t.noop,isExpired:t.noop},t.mixin(e.prototype,o),e}(),o=function(){function n(t){t=t||{},this.cancelled=!1,this.lastUrl=null,this._send=t.transport?r(t.transport):e.ajax,this._get=t.rateLimiter?t.rateLimiter(this._get):this._get,this._cache=t.cache===!1?new i(0):a}function r(n){return function(r,i){function s(e){t.defer(function(){u.resolve(e)})}function o(e){t.defer(function(){u.reject(e)})}var u=e.Deferred();return n(r,i,s,o),u}}var s=0,o={},u=6,a=new i(10);return n.setMaxPendingRequests=function(e){u=e},n.resetCache=function(){a.reset()},t.mixin(n.prototype,{_get:function(e,t,n){function r(t){n&&n(null,t),l._cache.set(e,t)}function i(){n&&n(!0)}function a(){s--,delete o[e],l.onDeckRequestArgs&&(l._get.apply(l,l.onDeckRequestArgs),l.onDeckRequestArgs=null)}var f,l=this;this.cancelled||e!==this.lastUrl||((f=o[e])?f.done(r).fail(i):u>s?(s++,o[e]=this._send(e,t).done(r).fail(i).always(a)):this.onDeckRequestArgs=[].slice.call(arguments,0))},get:function(e,n,r){var i;return t.isFunction(n)&&(r=n,n={}),this.cancelled=!1,this.lastUrl=e,(i=this._cache.get(e))?t.defer(function(){r&&r(null,i)}):this._get(e,n,r),!!i},cancel:function(){this.cancelled=!0}}),n}(),u=function(){function n(t){t=t||{},t.datumTokenizer&&t.queryTokenizer||e.error("datumTokenizer and queryTokenizer are both required"),this.datumTokenizer=t.datumTokenizer,this.queryTokenizer=t.queryTokenizer,this.reset()}function r(e){return e=t.filter(e,function(e){return!!e}),e=t.map(e,function(e){return e.toLowerCase()})}function i(){return{ids:[],children:{}}}function s(e){for(var t={},n=[],r=0,i=e.length;i>r;r++)t[e[r]]||(t[e[r]]=!0,n.push(e[r]));return n}function o(e,t){function n(e,t){return e-t}var r=0,i=0,s=[];e=e.sort(n),t=t.sort(n);for(var o=e.length,u=t.length;o>r&&u>i;)e[r]<t[i]?r++:e[r]>t[i]?i++:(s.push(e[r]),r++,i++);return s}return t.mixin(n.prototype,{bootstrap:function(e){this.datums=e.datums,this.trie=e.trie},add:function(e){var n=this;e=t.isArray(e)?e:[e],t.each(e,function(e){var s,o;s=n.datums.push(e)-1,o=r(n.datumTokenizer(e)),t.each(o,function(e){var t,r,o;for(t=n.trie,r=e.split("");o=r.shift();)t=t.children[o]||(t.children[o]=i()),t.ids.push(s)})})},get:function(e){var n,i,u=this;return n=r(this.queryTokenizer(e)),t.each(n,function(e){var t,n,r,s;if(i&&0===i.length)return!1;for(t=u.trie,n=e.split("");t&&(r=n.shift());)t=t.children[r];return t&&0===n.length?(s=t.ids.slice(0),void (i=i?o(i,s):s)):(i=[],!1)}),i?t.map(s(i),function(e){return u.datums[e]}):[]},reset:function(){this.datums=[],this.trie=i()},serialize:function(){return{datums:this.datums,trie:this.trie}}}),n}(),a=function(){function r(e){return e.local||null}function i(r){var i,s;return s={url:null,thumbprint:"",ttl:864e5,filter:null,ajax:{}},(i=r.prefetch||null)&&(i=t.isString(i)?{url:i}:i,i=t.mixin(s,i),i.thumbprint=n+i.thumbprint,i.ajax.type=i.ajax.type||"GET",i.ajax.dataType=i.ajax.dataType||"json",!i.url&&e.error("prefetch requires url to be set")),i}function s(n){function r(e){return function(n){return t.debounce(n,e)}}function i(e){return function(n){return t.throttle(n,e)}}var s,o;return o={url:null,cache:!0,wildcard:"%QUERY",replace:null,rateLimitBy:"debounce",rateLimitWait:300,send:null,filter:null,ajax:{}},(s=n.remote||null)&&(s=t.isString(s)?{url:s}:s,s=t.mixin(o,s),s.rateLimiter=/^throttle$/i.test(s.rateLimitBy)?i(s.rateLimitWait):r(s.rateLimitWait),s.ajax.type=s.ajax.type||"GET",s.ajax.dataType=s.ajax.dataType||"json",delete s.rateLimitBy,delete s.rateLimitWait,!s.url&&e.error("remote requires url to be set")),s}return{local:r,prefetch:i,remote:s}}();!function(n){function i(t){t&&(t.local||t.prefetch||t.remote)||e.error("one of local, prefetch, or remote is required"),this.limit=t.limit||5,this.sorter=f(t.sorter),this.dupDetector=t.dupDetector||l,this.local=a.local(t),this.prefetch=a.prefetch(t),this.remote=a.remote(t),this.cacheKey=this.prefetch?this.prefetch.cacheKey||this.prefetch.url:null,this.index=new u({datumTokenizer:t.datumTokenizer,queryTokenizer:t.queryTokenizer}),this.storage=this.cacheKey?new s(this.cacheKey):null}function f(e){function n(t){return t.sort(e)}function r(e){return e}return t.isFunction(e)?n:r}function l(){return!1}var c,h;return c=n.Bloodhound,h={data:"data",protocol:"protocol",thumbprint:"thumbprint"},n.Bloodhound=i,i.noConflict=function(){return n.Bloodhound=c,i},i.tokenizers=r,t.mixin(i.prototype,{_loadPrefetch:function(t){function n(e){s.clear(),s.add(t.filter?t.filter(e):e),s._saveToStorage(s.index.serialize(),t.thumbprint,t.ttl)}var r,i,s=this;return(r=this._readFromStorage(t.thumbprint))?(this.index.bootstrap(r),i=e.Deferred().resolve()):i=e.ajax(t.url,t.ajax).done(n),i},_getFromRemote:function(e,t){function n(e,n){t(e?[]:s.remote.filter?s.remote.filter(n):n)}var r,i,s=this;if(this.transport)return e=e||"",i=encodeURIComponent(e),r=this.remote.replace?this.remote.replace(this.remote.url,e):this.remote.url.replace(this.remote.wildcard,i),this.transport.get(r,this.remote.ajax,n)},_cancelLastRemoteRequest:function(){this.transport&&this.transport.cancel()},_saveToStorage:function(e,t,n){this.storage&&(this.storage.set(h.data,e,n),this.storage.set(h.protocol,location.protocol,n),this.storage.set(h.thumbprint,t,n))},_readFromStorage:function(e){var t,n={};return this.storage&&(n.data=this.storage.get(h.data),n.protocol=this.storage.get(h.protocol),n.thumbprint=this.storage.get(h.thumbprint)),t=n.thumbprint!==e||n.protocol!==location.protocol,n.data&&!t?n.data:null},_initialize:function(){function n(){i.add(t.isFunction(s)?s():s)}var r,i=this,s=this.local;return r=this.prefetch?this._loadPrefetch(this.prefetch):e.Deferred().resolve(),s&&r.done(n),this.transport=this.remote?new o(this.remote):null,this.initPromise=r.promise()},initialize:function(e){return!this.initPromise||e?this._initialize():this.initPromise},add:function(e){this.index.add(e)},get:function(e,n){function r(e){var r=s.slice(0);t.each(e,function(e){var n;return n=t.some(r,function(t){return i.dupDetector(e,t)}),!n&&r.push(e),r.length<i.limit}),n&&n(i.sorter(r))}var i=this,s=[],o=!1;s=this.index.get(e),s=this.sorter(s).slice(0,this.limit),s.length<this.limit?o=this._getFromRemote(e,r):this._cancelLastRemoteRequest(),o||(s.length>0||!this.transport)&&n&&n(s)},clear:function(){this.index.reset()},clearPrefetchCache:function(){this.storage&&this.storage.clear()},clearRemoteCache:function(){this.transport&&o.resetCache()},ttAdapter:function(){return t.bind(this.get,this)}}),i}(this);var f=function(){return{wrapper:'<span class="twitter-typeahead"></span>',dropdown:'<span class="tt-dropdown-menu"></span>',dataset:'<div class="tt-dataset-%CLASS%"></div>',suggestions:'<span class="tt-suggestions"></span>',suggestion:'<div class="tt-suggestion"></div>'}}(),l=function(){var e={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},dropdown:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},suggestions:{display:"block"},suggestion:{whiteSpace:"nowrap",cursor:"pointer"},suggestionChild:{whiteSpace:"normal"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};return t.isMsie()&&t.mixin(e.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),t.isMsie()&&t.isMsie()<=7&&t.mixin(e.input,{marginTop:"-1px"}),e}(),c=function(){function n(t){t&&t.el||e.error("EventBus initialized without el"),this.$el=e(t.el)}var r="typeahead:";return t.mixin(n.prototype,{trigger:function(e){var t=[].slice.call(arguments,1);this.$el.trigger(r+e,t)}}),n}(),h=function(){function e(e,t,n,r){var i;if(!n)return this;for(t=t.split(a),n=r?u(n,r):n,this._callbacks=this._callbacks||{};i=t.shift();)this._callbacks[i]=this._callbacks[i]||{sync:[],async:[]},this._callbacks[i][e].push(n);return this}function t(t,n,r){return e.call(this,"async",t,n,r)}function n(t,n,r){return e.call(this,"sync",t,n,r)}function r(e){var t;if(!this._callbacks)return this;for(e=e.split(a);t=e.shift();)delete this._callbacks[t];return this}function i(e){var t,n,r,i,o;if(!this._callbacks)return this;for(e=e.split(a),r=[].slice.call(arguments,1);(t=e.shift())&&(n=this._callbacks[t]);)i=s(n.sync,this,[t].concat(r)),o=s(n.async,this,[t].concat(r)),i()&&f(o);return this}function s(e,t,n){function r(){for(var r,i=0,s=e.length;!r&&s>i;i+=1)r=e[i].apply(t,n)===!1;return!r}return r}function o(){var e;return e=window.setImmediate?function(e){setImmediate(function(){e()})}:function(e){setTimeout(function(){e()},0)}}function u(e,t){return e.bind?e.bind(t):function(){e.apply(t,[].slice.call(arguments,0))}}var a=/\s+/,f=o();return{onSync:n,onAsync:t,off:r,trigger:i}}(),p=function(e){function n(e,n,r){for(var i,s=[],o=0,u=e.length;u>o;o++)s.push(t.escapeRegExChars(e[o]));return i=r?"\\b("+s.join("|")+")\\b":"("+s.join("|")+")",n?new RegExp(i):new RegExp(i,"i")}var r={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:!1,caseSensitive:!1};return function(i){function s(t){var n,r,s;return(n=u.exec(t.data))&&(s=e.createElement(i.tagName),i.className&&(s.className=i.className),r=t.splitText(n.index),r.splitText(n[0].length),s.appendChild(r.cloneNode(!0)),t.parentNode.replaceChild(s,r)),!!n}function o(e,t){for(var n,r=3,i=0;i<e.childNodes.length;i++)n=e.childNodes[i],n.nodeType===r?i+=t(n)?1:0:o(n,t)}var u;i=t.mixin({},r,i),i.node&&i.pattern&&(i.pattern=t.isArray(i.pattern)?i.pattern:[i.pattern],u=n(i.pattern,i.caseSensitive,i.wordsOnly),o(i.node,s))}}(window.document),d=function(){function n(n){var i,s,u,a,f=this;n=n||{},n.input||e.error("input is missing"),i=t.bind(this._onBlur,this),s=t.bind(this._onFocus,this),u=t.bind(this._onKeydown,this),a=t.bind(this._onInput,this),this.$hint=e(n.hint),this.$input=e(n.input).on("blur.tt",i).on("focus.tt",s).on("keydown.tt",u),0===this.$hint.length&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=t.noop),t.isMsie()?this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",function(e){o[e.which||e.keyCode]||t.defer(t.bind(f._onInput,f,e))}):this.$input.on("input.tt",a),this.query=this.$input.val(),this.$overflowHelper=r(this.$input)}function r(t){return e('<pre aria-hidden="true"></pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:t.css("font-family"),fontSize:t.css("font-size"),fontStyle:t.css("font-style"),fontVariant:t.css("font-variant"),fontWeight:t.css("font-weight"),wordSpacing:t.css("word-spacing"),letterSpacing:t.css("letter-spacing"),textIndent:t.css("text-indent"),textRendering:t.css("text-rendering"),textTransform:t.css("text-transform")}).insertAfter(t)}function i(e,t){return n.normalizeQuery(e)===n.normalizeQuery(t)}function s(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}var o;return o={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"},n.normalizeQuery=function(e){return(e||"").replace(/^\s*/g,"").replace(/\s{2,}/g," ")},t.mixin(n.prototype,h,{_onBlur:function(){this.resetInputValue(),this.trigger("blurred")},_onFocus:function(){this.trigger("focused")},_onKeydown:function(e){var t=o[e.which||e.keyCode];this._managePreventDefault(t,e),t&&this._shouldTrigger(t,e)&&this.trigger(t+"Keyed",e)},_onInput:function(){this._checkInputValue()},_managePreventDefault:function(e,t){var n,r,i;switch(e){case"tab":r=this.getHint(),i=this.getInputValue(),n=r&&r!==i&&!s(t);break;case"up":case"down":n=!s(t);break;default:n=!1}n&&t.preventDefault()},_shouldTrigger:function(e,t){var n;switch(e){case"tab":n=!s(t);break;default:n=!0}return n},_checkInputValue:function(){var e,t,n;e=this.getInputValue(),t=i(e,this.query),n=t?this.query.length!==e.length:!1,this.query=e,t?n&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query)},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getQuery:function(){return this.query},setQuery:function(e){this.query=e},getInputValue:function(){return this.$input.val()},setInputValue:function(e,t){this.$input.val(e),t?this.clearHint():this._checkInputValue()},resetInputValue:function(){this.setInputValue(this.query,!0)},getHint:function(){return this.$hint.val()},setHint:function(e){this.$hint.val(e)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var e,t,n,r;e=this.getInputValue(),t=this.getHint(),n=e!==t&&0===t.indexOf(e),r=""!==e&&n&&!this.hasOverflow(),!r&&this.clearHint()},getLanguageDirection:function(){return(this.$input.css("direction")||"ltr").toLowerCase()},hasOverflow:function(){var e=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=e},isCursorAtEnd:function(){var e,n,r;return e=this.$input.val().length,n=this.$input[0].selectionStart,t.isNumber(n)?n===e:document.selection?(r=document.selection.createRange(),r.moveStart("character",-e),e===r.text.length):!0},destroy:function(){this.$hint.off(".tt"),this.$input.off(".tt"),this.$hint=this.$input=this.$overflowHelper=null}}),n}(),v=function(){function n(n){n=n||{},n.templates=n.templates||{},n.source||e.error("missing source"),n.name&&!s(n.name)&&e.error("invalid dataset name: "+n.name),this.query=null,this.highlight=!!n.highlight,this.name=n.name||t.getUniqueId(),this.source=n.source,this.displayFn=r(n.display||n.displayKey),this.templates=i(n.templates,this.displayFn),this.$el=e(f.dataset.replace("%CLASS%",this.name))}function r(e){function n(t){return t[e]}return e=e||"value",t.isFunction(e)?e:n}function i(e,n){function r(e){return"<p>"+n(e)+"</p>"}return{empty:e.empty&&t.templatify(e.empty),header:e.header&&t.templatify(e.header),footer:e.footer&&t.templatify(e.footer),suggestion:e.suggestion||r}}function s(e){return/^[_a-zA-Z0-9-]+$/.test(e)}var o="ttDataset",u="ttValue",a="ttDatum";return n.extractDatasetName=function(t){return e(t).data(o)},n.extractValue=function(t){return e(t).data(u)},n.extractDatum=function(t){return e(t).data(a)},t.mixin(n.prototype,h,{_render:function(n,r){function i(){return v.templates.empty({query:n,isEmpty:!0})}function s(){function i(t){var n;return n=e(f.suggestion).append(v.templates.suggestion(t)).data(o,v.name).data(u,v.displayFn(t)).data(a,t),n.children().each(function(){e(this).css(l.suggestionChild)}),n}var s,c;return s=e(f.suggestions).css(l.suggestions),c=t.map(r,i),s.append.apply(s,c),v.highlight&&p({className:"tt-highlight",node:s[0],pattern:n}),s}function c(){return v.templates.header({query:n,isEmpty:!d})}function h(){return v.templates.footer({query:n,isEmpty:!d})}if(this.$el){var d,v=this;this.$el.empty(),d=r&&r.length,!d&&this.templates.empty?this.$el.html(i()).prepend(v.templates.header?c():null).append(v.templates.footer?h():null):d&&this.$el.html(s()).prepend(v.templates.header?c():null).append(v.templates.footer?h():null),this.trigger("rendered")}},getRoot:function(){return this.$el},update:function(e){function t(t){n.canceled||e!==n.query||n._render(e,t)}var n=this;this.query=e,this.canceled=!1,this.source(e,t)},cancel:function(){this.canceled=!0},clear:function(){this.cancel(),this.$el.empty(),this.trigger("rendered")},isEmpty:function(){return this.$el.is(":empty")},destroy:function(){this.$el=null}}),n}(),m=function(){function n(n){var i,s,o,u=this;n=n||{},n.menu||e.error("menu is required"),this.isOpen=!1,this.isEmpty=!0,this.datasets=t.map(n.datasets,r),i=t.bind(this._onSuggestionClick,this),s=t.bind(this._onSuggestionMouseEnter,this),o=t.bind(this._onSuggestionMouseLeave,this),this.$menu=e(n.menu).on("click.tt",".tt-suggestion",i).on("mouseenter.tt",".tt-suggestion",s).on("mouseleave.tt",".tt-suggestion",o),t.each(this.datasets,function(e){u.$menu.append(e.getRoot()),e.onSync("rendered",u._onRendered,u)})}function r(e){return new v(e)}return t.mixin(n.prototype,h,{_onSuggestionClick:function(t){this.trigger("suggestionClicked",e(t.currentTarget))},_onSuggestionMouseEnter:function(t){this._removeCursor(),this._setCursor(e(t.currentTarget),!0)},_onSuggestionMouseLeave:function(){this._removeCursor()},_onRendered:function(){function e(e){return e.isEmpty()}this.isEmpty=t.every(this.datasets,e),this.isEmpty?this._hide():this.isOpen&&this._show(),this.trigger("datasetRendered")},_hide:function(){this.$menu.hide()},_show:function(){this.$menu.css("display","block")},_getSuggestions:function(){return this.$menu.find(".tt-suggestion")},_getCursor:function(){return this.$menu.find(".tt-cursor").first()},_setCursor:function(e,t){e.first().addClass("tt-cursor"),!t&&this.trigger("cursorMoved")},_removeCursor:function(){this._getCursor().removeClass("tt-cursor")},_moveCursor:function(e){var t,n,r,i;if(this.isOpen){if(n=this._getCursor(),t=this._getSuggestions(),this._removeCursor(),r=t.index(n)+e,r=(r+1)%(t.length+1)-1,-1===r)return void this.trigger("cursorRemoved");-1>r&&(r=t.length-1),this._setCursor(i=t.eq(r)),this._ensureVisible(i)}},_ensureVisible:function(e){var t,n,r,i;t=e.position().top,n=t+e.outerHeight(!0),r=this.$menu.scrollTop(),i=this.$menu.height()+parseInt(this.$menu.css("paddingTop"),10)+parseInt(this.$menu.css("paddingBottom"),10),0>t?this.$menu.scrollTop(r+t):n>i&&this.$menu.scrollTop(r+(n-i))},close:function(){this.isOpen&&(this.isOpen=!1,this._removeCursor(),this._hide(),this.trigger("closed"))},open:function(){this.isOpen||(this.isOpen=!0,!this.isEmpty&&this._show(),this.trigger("opened"))},setLanguageDirection:function(e){this.$menu.css("ltr"===e?l.ltr:l.rtl)},moveCursorUp:function(){this._moveCursor(-1)},moveCursorDown:function(){this._moveCursor(1)},getDatumForSuggestion:function(e){var t=null;return e.length&&(t={raw:v.extractDatum(e),value:v.extractValue(e),datasetName:v.extractDatasetName(e)}),t},getDatumForCursor:function(){return this.getDatumForSuggestion(this._getCursor().first())},getDatumForTopSuggestion:function(){return this.getDatumForSuggestion(this._getSuggestions().first())},update:function(e){function n(t){t.update(e)}t.each(this.datasets,n)},empty:function(){function e(e){e.clear()}t.each(this.datasets,e),this.isEmpty=!0},isVisible:function(){return this.isOpen&&!this.isEmpty},destroy:function(){function e(e){e.destroy()}this.$menu.off(".tt"),this.$menu=null,t.each(this.datasets,e)}}),n}(),g=function(){function n(n){var i,s,o;n=n||{},n.input||e.error("missing input"),this.isActivated=!1,this.autoselect=!!n.autoselect,this.minLength=t.isNumber(n.minLength)?n.minLength:1,this.$node=r(n.input,n.withHint),i=this.$node.find(".tt-dropdown-menu"),s=this.$node.find(".tt-input"),o=this.$node.find(".tt-hint"),s.on("blur.tt",function(e){var n,r,o;n=document.activeElement,r=i.is(n),o=i.has(n).length>0,t.isMsie()&&(r||o)&&(e.preventDefault(),e.stopImmediatePropagation(),t.defer(function(){s.focus()}))}),i.on("mousedown.tt",function(e){e.preventDefault()}),this.eventBus=n.eventBus||new c({el:s}),this.dropdown=(new m({menu:i,datasets:n.datasets})).onSync("suggestionClicked",this._onSuggestionClicked,this).onSync("cursorMoved",this._onCursorMoved,this).onSync("cursorRemoved",this._onCursorRemoved,this).onSync("opened",this._onOpened,this).onSync("closed",this._onClosed,this).onAsync("datasetRendered",this._onDatasetRendered,this),this.input=(new d({input:s,hint:o})).onSync("focused",this._onFocused,this).onSync("blurred",this._onBlurred,this).onSync("enterKeyed",this._onEnterKeyed,this).onSync("tabKeyed",this._onTabKeyed,this).onSync("escKeyed",this._onEscKeyed,this).onSync("upKeyed",this._onUpKeyed,this).onSync("downKeyed",this._onDownKeyed,this).onSync("leftKeyed",this._onLeftKeyed,this).onSync("rightKeyed",this._onRightKeyed,this).onSync("queryChanged",this._onQueryChanged,this).onSync("whitespaceChanged",this._onWhitespaceChanged,this),this._setLanguageDirection()}function r(t,n){var r,s,u,a;r=e(t),s=e(f.wrapper).css(l.wrapper),u=e(f.dropdown).css(l.dropdown),a=r.clone().css(l.hint).css(i(r)),a.val("").removeData().addClass("tt-hint").removeAttr("id name placeholder required").prop("readonly",!0).attr({autocomplete:"off",spellcheck:"false",tabindex:-1}),r.data(o,{dir:r.attr("dir"),autocomplete:r.attr("autocomplete"),spellcheck:r.attr("spellcheck"),style:r.attr("style")}),r.addClass("tt-input").attr({autocomplete:"off",spellcheck:!1}).css(n?l.input:l.inputWithNoHint);try{!r.attr("dir")&&r.attr("dir","auto")}catch(c){}return r.wrap(s).parent().prepend(n?a:null).append(u)}function i(e){return{backgroundAttachment:e.css("background-attachment"),backgroundClip:e.css("background-clip"),backgroundColor:e.css("background-color"),backgroundImage:e.css("background-image"),backgroundOrigin:e.css("background-origin"),backgroundPosition:e.css("background-position"),backgroundRepeat:e.css("background-repeat"),backgroundSize:e.css("background-size")}}function s(e){var n=e.find(".tt-input");t.each(n.data(o),function(e,r){t.isUndefined(e)?n.removeAttr(r):n.attr(r,e)}),n.detach().removeData(o).removeClass("tt-input").insertAfter(e),e.remove()}var o="ttAttrs";return t.mixin(n.prototype,{_onSuggestionClicked:function(e,t){var n;(n=this.dropdown.getDatumForSuggestion(t))&&this._select(n)},_onCursorMoved:function(){var e=this.dropdown.getDatumForCursor();this.input.setInputValue(e.value,!0),this.eventBus.trigger("cursorchanged",e.raw,e.datasetName)},_onCursorRemoved:function(){this.input.resetInputValue(),this._updateHint()},_onDatasetRendered:function(){this._updateHint()},_onOpened:function(){this._updateHint(),this.eventBus.trigger("opened")},_onClosed:function(){this.input.clearHint(),this.eventBus.trigger("closed")},_onFocused:function(){this.isActivated=!0,this.dropdown.open()},_onBlurred:function(){this.isActivated=!1,this.dropdown.empty(),this.dropdown.close()},_onEnterKeyed:function(e,t){var n,r;n=this.dropdown.getDatumForCursor(),r=this.dropdown.getDatumForTopSuggestion(),n?(this._select(n),t.preventDefault()):this.autoselect&&r&&(this._select(r),t.preventDefault())},_onTabKeyed:function(e,t){var n;(n=this.dropdown.getDatumForCursor())?(this._select(n),t.preventDefault()):this._autocomplete(!0)},_onEscKeyed:function(){this.dropdown.close(),this.input.resetInputValue()},_onUpKeyed:function(){var e=this.input.getQuery();this.dropdown.isEmpty&&e.length>=this.minLength?this.dropdown.update(e):this.dropdown.moveCursorUp(),this.dropdown.open()},_onDownKeyed:function(){var e=this.input.getQuery();this.dropdown.isEmpty&&e.length>=this.minLength?this.dropdown.update(e):this.dropdown.moveCursorDown(),this.dropdown.open()},_onLeftKeyed:function(){"rtl"===this.dir&&this._autocomplete()},_onRightKeyed:function(){"ltr"===this.dir&&this._autocomplete()},_onQueryChanged:function(e,t){this.input.clearHintIfInvalid(),t.length>=this.minLength?this.dropdown.update(t):this.dropdown.empty(),this.dropdown.open(),this._setLanguageDirection()},_onWhitespaceChanged:function(){this._updateHint(),this.dropdown.open()},_setLanguageDirection:function(){var e;this.dir!==(e=this.input.getLanguageDirection())&&(this.dir=e,this.$node.css("direction",e),this.dropdown.setLanguageDirection(e))},_updateHint:function(){var e,n,r,i,s,o;e=this.dropdown.getDatumForTopSuggestion(),e&&this.dropdown.isVisible()&&!this.input.hasOverflow()?(n=this.input.getInputValue(),r=d.normalizeQuery(n),i=t.escapeRegExChars(r),s=new RegExp("^(?:"+i+")(.+$)","i"),o=s.exec(e.value),o?this.input.setHint(n+o[1]):this.input.clearHint()):this.input.clearHint()},_autocomplete:function(e){var t,n,r,i;t=this.input.getHint(),n=this.input.getQuery(),r=e||this.input.isCursorAtEnd(),t&&n!==t&&r&&(i=this.dropdown.getDatumForTopSuggestion(),i&&this.input.setInputValue(i.value),this.eventBus.trigger("autocompleted",i.raw,i.datasetName))},_select:function(e){this.input.setQuery(e.value),this.input.setInputValue(e.value,!0),this._setLanguageDirection(),this.eventBus.trigger("selected",e.raw,e.datasetName),this.dropdown.close(),t.defer(t.bind(this.dropdown.empty,this.dropdown))},open:function(){this.dropdown.open()},close:function(){this.dropdown.close()},setVal:function(e){e=t.toStr(e),this.isActivated?this.input.setInputValue(e):(this.input.setQuery(e),this.input.setInputValue(e,!0)),this._setLanguageDirection()},getVal:function(){return this.input.getQuery()},destroy:function(){this.input.destroy(),this.dropdown.destroy(),s(this.$node),this.$node=null}}),n}();!function(){var n,r,i;n=e.fn.typeahead,r="ttTypeahead",i={initialize:function(n,i){function s(){var s,o,u=e(this);t.each(i,function(e){e.highlight=!!n.highlight}),o=new g({input:u,eventBus:s=new c({el:u}),withHint:t.isUndefined(n.hint)?!0:!!n.hint,minLength:n.minLength,autoselect:n.autoselect,datasets:i}),u.data(r,o)}return i=t.isArray(i)?i:[].slice.call(arguments,1),n=n||{},this.each(s)},open:function(){function t(){var t,n=e(this);(t=n.data(r))&&t.open()}return this.each(t)},close:function(){function t(){var t,n=e(this);(t=n.data(r))&&t.close()}return this.each(t)},val:function(t){function n(){var n,i=e(this);(n=i.data(r))&&n.setVal(t)}function i(e){var t,n;return(t=e.data(r))&&(n=t.getVal()),n}return arguments.length?this.each(n):i(this.first())},destroy:function(){function t(){var t,n=e(this);(t=n.data(r))&&(t.destroy(),n.removeData(r))}return this.each(t)}},e.fn.typeahead=function(t){var n;return i[t]&&"initialize"!==t?(n=this.filter(function(){return!!e(this).data(r)}),i[t].apply(n,[].slice.call(arguments,1))):i.initialize.apply(this,arguments)},e.fn.typeahead.noConflict=function(){return e.fn.typeahead=n,this}}()}(window.jQuery),define("typeahead",["jquery"],function(){}),define("search",["jquery","config","typeahead"],function(e,t){(function(e){function i(e){return e?document.createElement("a").appendChild(document.createTextNode(e)).parentNode.innerHTML:""}function s(t,n){var t=t.replace("%QUERY",encodeURIComponent(n)),r=e("label.active > input[name=smatch]").val();return r&&(t+="&match="+r),t}var n="search",r={_init:function(n){return this.each(function(){function u(e){return(e.tags||[]).push(e.name)}function a(e){function t(e){return e.split(".").pop()}function n(e){return e.split(".").slice(0,-1).join(".")}var r='<div class="tt-match file type-icon '+t(e.name)+'">'+'<span class="tt-label">'+i(n(e.name));0/0;if(e.tags){r+='<span class="tt-tags">';for(var s=0;s<e.tags.length;s++){var o=e.tags[s];r+='<span class="tt-tag">'+i(o)+"</span>"}r+="</span>"}return e.title&&(r+='<div class="tt-title file">'+i(e.title)+"</div>"),r+="</div>",r}function h(e){var t="";if(e.file!=l||e.alias!=c){var n=e.file.split(".").pop();l=e.file,c=e.alias,t='<div class="tt-file-header type-icon '+n+'">'+'<span class="tt-path-file">'+i(e.file)+"</span>"+"</div>"}return t+w(e)}function d(e){return Bloodhound.tokenizers.whitespace(e.text)}function v(e){var t="";if(e.file!=l||e.alias!=c)l=e.file,c=e.alias,t='<div class="tt-file-header type-icon '+e.ext+'">'+'<span class="tt-path-alias">'+i(e.alias)+'</span>(<span class="tt-path-file">'+i(e.file)+")</span>"+"</div>";return e.text&&(t+=w(e)),t}function m(e,n){var r=t.swish.templates,i=[],s=e.split(" "),o=[];for(var u=0;u<s.length;u++)o.push({prefix:s[u],regex:new RegExp("_"+s[u])});for(var u=0;u<r.length;u++){var a=r[u];if(a.arity!==undefined){for(var f=0,l=!0;f<o.length&&l;f++)!a.name.startsWith(o[f].prefix)&&!a.name.match(o[f].regex)&&(l=!1);l&&i.push(a)}}n(i)}function g(e){var t='<div class="tt-match predicate';return e.type&&(t+=" "+e.type),e.mode&&(t+='" title="'+e.mode),t+='"><span class="tt-label">'+i(e.name)+"/"+e.arity+"</span>",e.iso&&(t+='<span class="tt-tags">',e.iso&&(t+='<span class="tt-tag">ISO</span>'),t+="</span>"),e.summary&&(t+='<div class="tt-title file">'+i(e.summary)+"</div>"),t+="</div>",t+="</div>",t}function b(t,n){r=t;if(t.length<2)return[];var i=[],s=new RegExp("\\b"+t,"g");y=s,e(".prolog-editor").each(function(){var t=this,n=e(t).prologEditor("search",s,{max:7});for(var r=0;r<n.length;r++)n[r].editor=t,n[r].regex=y,i.push(n[r])}),n(i)}function w(e){var t=e.text,n;(n=t.search(y))>20&&(t="..."+t.slice(n-17)),t.length>80&&(t=t.substring(0,80));var r='<div class="tt-match source"><span class="tt-line"><span class="tt-lineno">'+e.line+"</span>"+'<span class="tt-text">'+i(t)+"</span>"+"</span>"+"</div>";return r}function x(e){var t=[],n=e.replace(/\s+/g," ").split(" ");for(var r=0;r<n.length;r++)t.push(E[n[r]]);return t}var n=e(this),r,o=new Bloodhound({name:"files",remote:t.http.locations.swish_typeahead+"?set=file&q=%QUERY",datumTokenizer:u,queryTokenizer:Bloodhound.tokenizers.whitespace});o.initialize();var f=new Bloodhound({name:"store_content",limit:20,cache:!1,remote:{url:t.http.locations.swish_typeahead+"?set=store_content&q=%QUERY",replace:s},datumTokenizer:d,queryTokenizer:Bloodhound.tokenizers.whitespace});f.initialize();var l=null,c=null,p=new Bloodhound({name:"source",limit:15,cache:!1,query_cache_length:1,remote:{url:t.http.locations.swish_typeahead+"?set=sources&q=%QUERY",replace:s},datumTokenizer:d,queryTokenizer:Bloodhound.tokenizers.whitespace});p.initialize();var y,E={source:{name:"source",source:b,templates:{suggestion:w}},sources:{name:"sources",source:p.ttAdapter(),templates:{suggestion:v},limit:15},files:{name:"files",source:o.ttAdapter(),templates:{suggestion:a}},store_content:{name:"store_content",source:f.ttAdapter(),templates:{suggestion:h}},predicates:{name:"predicates",source:m,templates:{suggestion:g}}},S=E.sources.source;E.sources.source=function(e,t){return l=null,c=null,y=new RegExp(RegExp.escape(e)),S(e,t)},n.typeahead({minLength:2,highlight:!0},x(n.data("search-in"))).on("typeahead:selected typeahead:autocompleted",function(t,r,i){if(r.type=="store")r.query&&(r.regex=new RegExp(RegExp.escape(r.query),"g"),r.showAllMatches=!0),e(t.target).parents(".swish").swish("playFile",r);else if(r.arity!==undefined)e(".swish-event-receiver").trigger("pldoc",r);else if(r.editor!==undefined&&r.line!==undefined)e(r.editor).prologEditor("gotoLine",r.line,{regex:r.regex,showAllMatches:!0});else if(r.alias!==undefined){var s=encodeURI("/"+r.alias+"/"+r.file+"."+r.ext),o={url:s,line:r.line};r.query&&(o.regex=new RegExp(RegExp.escape(r.query),"g"),o.showAllMatches=!0),e(t.target).parents(".swish").swish("playURL",o)}else n.data("target",{datum:r,set:i}),console.log(n.data("target"))}),n.parents("form").submit(function(e){var t=n.data("target"),r=n.val();if(!t||!t.datum||t.datum.label!=r)t=r;return n.val(""),n.data("target",null),n.search("search",t),!1})})},search:function(e){alert("Full search not yet implemented\nPlease select from auto completion list")}};typeof String.prototype.startsWith!="function"&&(String.prototype.startsWith=function(e){return this.lastIndexOf(e,0)===0}),e.fn.search=function(t){if(r[t])return r[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return r._init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery."+n)}})(jQuery),RegExp.escape=function(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}}),define("tabbed",["jquery","form","config","preferences","modal","laconic","search"],function(e,t,n,r,i){var s={tabTypes:{},type:function(e){var t=e.split(".").pop();for(var n in s.tabTypes)if(s.tabTypes.hasOwnProperty(n)&&s.tabTypes[n].dataType==t)return s.tabTypes[n]}};return function(e){function f(t,n,r){e(t).wrap('<div role="tabpanel" class="tab-pane" id="'+n+'"></div>');var i=e(t).parent();return r&&i.addClass("active"),i}function l(t,n){var r=e.el.span({"class":"glyphicon glyphicon-"+t});return n&&e(r).addClass(n),r}function c(){return"tabbed-tab-"+u++}function h(e){if(n.swish.profiles)for(var t=0;t<n.swish.profiles.length;t++)if(n.swish.profiles[t].value==e)return n.swish.profiles[t]}var o="tabbed",u=0,a={_init:function(t){return t=t||{},this.each(function(){var n=e(this),r={};r.newTab=t.newTab,r.tabTypes=t.tabTypes||s.tabTypes,n.data(o,r),n.addClass("tabbed"),n.tabbed("makeTabbed"),n.on("source",function(e,t){n.tabbed("tabFromSource",t)}),n.on("trace-location",function(e,t){n.tabbed("showTracePort",t)}),n.on("data-is-clean",function(t,r){var i=e(t.target).closest(".tab-pane"),s=n.tabbed("navTab",i.attr("id"));s&&(r?s.removeClass("data-dirty"):s.addClass("data-dirty"))})})},makeTabbed:function(){var t=this.children(),n=e.el.ul({"class":"nav nav-tabs",role:"tablist"}),r=e.el.div({"class":"tab-content"});this.prepend(r),this.prepend(n),e(n).on("click","span.xclose",function(t){var n=e(t.target).parent().attr("data-id");e(t.target).parents(".tabbed").first().tabbed("removeTab",n),t.preventDefault()}),e(n).on("click","a",function(t){e(t.target).closest("a").tab("show"),t.preventDefault()});for(var i=0;i<t.length;i++){var s=e(t[i]),o=c(),u=s.attr("data-label")||"Unknown",a=s.attr("data-close")!="disabled",h=i==t.length-1,p=this.tabbed("tabLabel",o,u,a);h&&e(p).addClass("active"),e(n).append(p),e(r).append(f(e(t[i]),o,h))}var d=e.el.a({"class":"tab-new compact",title:"Open a new tab"},l("plus"));e(n).append(e.el.li({role:"presentation"},d)),e(d).on("click",function(t){var n=e(t.target).parents(".tabbed").first();return n.tabbed("newTab"),t.preventDefault(),!1}),e(n).on("shown.bs.tab","a",function(t){var n=e(t.target).data("id");e("#"+n+" .swish-event-receiver").trigger("activate-tab")}),this.tabbed("navContent").children().length==0&&this.tabbed("newTab")},newTab:function(t){var n=this.data(o);return t==undefined&&(n.newTab?t=n.newTab():(t=this.tabbed("tabSelect"),e(t).append(this.tabbed("profileForm"),e.el.hr(),this.tabbed("searchForm")))),this.tabbed("addTab",t,{active:!0,close:!0})},tabFromSource:function(t){var n=this.find("div.tabbed-select");if(n.length>0){var r=e(n[0]).closest(".tab-pane");this.tabbed("show",r.attr("id")),typeof t=="object"&&delete t.newTab,this.tabbed("setSource",r,t)}else{var r=this.tabbed("newTab",e("<span></span>"));typeof t=="object"&&delete t.newTab,this.tabbed("setSource",r,t)||this.tabbed("removeTab",r.attr("id"))}return this},setSource:function(t,n){if(typeof n=="object"&&(n.meta&&n.meta.name||n.url)){var r=n.meta&&n.meta.name?n.meta.name:n.url,i=s.type(r),o=e.el.div();return t.html(""),t.tabbed("title",i.label,i.dataType),t.append(o),i.create(o),e(o).trigger("source",n),!0}return!1},showTracePort:function(t){if(t&&t.source&&t.source.file){var n=t.source.file,r,i,s;function o(){var e;if(n.startsWith("pengine://"))return n.split("/")[2]}function u(){var e="swish://";if(n.startsWith(e))return n.slice(e.length)}if(r=o())s=this.find(".prolog-editor").filter(function(t,n){return e(n).prologEditor("pengine",{has:r})});else if(i=u()){s=this.find(".storage").storage("match",{file:i});if(!s)return this.closest(".swish").swish("playFile",{file:i,newTab:!0,noHistory:!0,prompt:t}),this}s&&s.prologEditor("showTracePort",t)}return this},addTab:function(t,n){var r=this.tabbed("navTabs"),i=c(),s=f(t,i,n.close);this.tabbed("navContent").append(s);var o=this.tabbed("tabLabel",i,"New tab",close,"select"),u=r.find("a.tab-new");return u.length==1?e(o).insertBefore(u.first().parent()):r.append(o),n.active&&e(o).find("a").first().tab("show"),s},removeTab:function(t){var n=this.tabbed("navTabs").find("a[data-id='"+t+"']").parent(),r=e("#"+t),i;if(r.find(".storage").storage("unload","closetab")==0)return;r.is(":visible")&&(i=n.prev()||n.next()),n.remove(),r.find(".prolog-runner").prologRunner("close"),r.remove(),i&&i.length>0?i.find("a").first().tab("show"):this.tabbed("navContent").children().length==0&&this.tabbed("newTab")},show:function(e){var t=this.tabbed("navTab",e);if(t)return t.tab("show"),this},tabLabel:function(t,n,r,i){var s;r&&(s=l("remove","xclose"),e(s).attr("title","Close tab")),i=i||"pl";var o=e.el.a({"class":"compact",href:"#"+t,"data-id":t},e.el.span({"class":"tab-icon type-icon "+i}),e.el.span({"class":"tab-dirty",title:"Tab is modified.  See File/Save and Edit/View changes"}),e.el.span({"class":"tab-title"},n),s),u=e.el.li({role:"presentation"},o);return u},title:function(t,n){var r=this.closest(".tab-pane");r.length==0&&(fsorg=this.data("fullscreen_origin"),fsorg&&(r=e(fsorg).closest(".tab-pane")));var i=r.closest(".tabbed"),s=r.attr("id"),o=i.tabbed("navTabs"),u=o.find("a[data-id="+s+"]");u.find(".tab-title").text(t);if(n){var a=u.find(".tab-icon");a.removeClass(),a.addClass("tab-icon type-icon "+n)}return i},tabSelect:function(){var t=this.data(o),n=e.el.div({"class":"tabbed-select"},e.el.div({"class":"tabbed-create"},e.el.label({"class":"tabbed-left"},"Create a "),g=e.el.div({"class":"btn-group",role:"group"}),e.el.label({"class":"tabbed-right"},"here"))),u=[];for(var a in t.tabTypes)t.tabTypes.hasOwnProperty(a)&&t.tabTypes[a].order&&u.push(a);u.sort(function(e,n){return t.tabTypes[e].order-t.tabTypes[n].order});for(var f=0;f<u.length;f++){var l=t.tabTypes[u[f]];e(g).append(e.el.button({type:"button","class":"btn btn-primary","data-type":l.typeName,"data-ext":l.dataType},l.label))}return e(g).on("click",".btn",function(t){var n=e(t.target).data("type"),i=e(t.target).closest(".tab-pane"),o=e.el.div(),u=e.extend({},s.tabTypes[n]),a=i.find("label.active > input[name=profile]").val();a&&(u.profile=a,u.value=i.tabbed("profileValue",a,s.tabTypes[n].dataType),u.value!=undefined&&r.setVal("default-profile",a)),i.html(""),i.tabbed("title",u.label,u.dataType),i.append(o),s.tabTypes[n].create(o,u)}),e(g).addClass("swish-event-receiver"),e(g).on("download save fileInfo print",function(t){var n=e(t.target).closest(".tab-pane");if(n.is(":visible")){var r={download:"you wish to download",save:"you wish to save",print:"you wish to print",fileInfo:"for which you want details"};i.alert("Please activate the tab "+r[t.type]),t.stopPropagation()}}),e(g).on("profile-selected",function(t,n){e(t.target).find("button").each(function(){e(this).prop("disabled",n.type.indexOf(e(this).data("ext"))<0)})}),n},searchForm:function(){var n=e.el.form({"class":"search-sources"},e.el.label({"class":"control-label"},"Open source file containing"),e.el.div({"class":"input-group"},e.el.input({type:"text","class":"form-control search",placeholder:"Search sources","data-search-in":"sources store_content"}),e.el.div({"class":"input-group-btn"},e.el.button({"class":"btn btn-default",type:"submit"},e.el.i({"class":"glyphicon glyphicon-search"})))),e.el.div({"class":"input-group"},t.fields.radio("smatch",[{label:"Start of line",value:"sol"},{label:"Start of word",value:"sow",active:!0},{label:"Anywhere",value:"anywhere"}])));return e(n).find("input.search").search(),n},profileForm:function(){if(n.swish.profiles&&n.swish.profiles.length>0){var i;for(var s=0;s<n.swish.profiles.length;s++)delete n.swish.profiles[s].active;if(i=r.getVal("default-profile"))for(var s=0;s<n.swish.profiles.length;s++)n.swish.profiles[s].value==i&&(n.swish.profiles[s].active=!0);else n.swish.profiles[0].active=!0;var o=e.el.div({"class":"tabbed-profile"},e.el.label({"class":"tabbed-left"},"based on"),e.el.div({"class":"input-group select-profile"},t.fields.radio("profile",n.swish.profiles)),e.el.label({"class":"tabbed-right"},"profile"));return e(o).on("click",function(t){var n=e(t.target).find("input").val(),r=h(n);e(t.target).closest(".tab-pane").find(".tabbed-create .btn-group").trigger("profile-selected",r)}),o}},profileValue:function(t,r){var s=n.http.locations.swish+"profile/"+t+"."+r;return e.ajax({url:s,type:"GET",data:{format:"raw"},async:!1,error:function(e){i.ajaxError(e)}}).responseText},navTabs:function(){return this.find("ul.nav-tabs").first()},navTab:function(e){var t=this.find("ul.nav-tabs").first().find("a[data-id='"+e+"']");if(t.length>0)return t},navContent:function(){return this.find("div.tab-content").first()}};e.fn.tabbed=function(t){if(a[t])return a[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return a._init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery."+o)}}(jQuery),s}),define("prolog",["jquery","config","form","preferences"],function(e,t,n,r){var i={downloadCSV:function(s,o,u){u=u||{},u.disposition=u.disposition||u.filename||"swish-results.csv";if(u.projection){var a,f=u.format||"prolog";function l(t,n){return e.el.input({type:"hidden",name:t,value:n})}u.distinct&&(s="distinct(["+u.projection+"],("+s+"))");if(u.limit){var c=parseInt(u.limit.replace(/[ _]/g,""));if(typeof c!="number")return alert("Not an integer: ",u.limit),!1;s="limit("+c+",("+s+"))"}a=e.el.form({method:"POST",action:t.http.locations.pengines+"/create",target:"_blank"},l("format","csv"),l("chunk","10"),l("solutions","all"),l("disposition",u.disposition),l("application","swish"),l("ask",s),l("src_text",o),l("template",f+"("+u.projection+")")),console.log(a),e("body").append(a),a.submit(),e(a).remove()}else{var h=e().prologEditor("variables",s),p=u.disposition;p.indexOf(".")<0&&(p+=".csv");function d(){var u=e.el.form({"class":"form-horizontal"},n.fields.projection(h.join(",")),n.fields.csvFormat(t.swish.csv_formats,r.getVal("csvFormat")),n.fields.limit("10 000",!1),n.fields.filename(p,2),n.fields.buttons({label:"Download CSV",action:function(e,n){return e.preventDefault(),t.swish.csv_formats.length>1&&r.setVal("csvFormat",n.format),i.downloadCSV(s,o,n),!1}}));this.append(u)}n.showDialog({title:"Download query results as CSV",body:d})}return this},trimFullStop:function(e){return e.replace(/\.\s*$/m,"")},options:{application:"swish",chunk:5}};return e.swish=function(e){for(var t in i.options)i.options.hasOwnProperty(t)&&!e.hasOwnProperty(t)&&(e[t]=i.options[t]);return new Pengine(e)},i}),function(e,t){typeof exports=="object"&&typeof module!="undefined"?module.exports=t():typeof define=="function"&&define.amd?define("cm/lib/codemirror",t):e.CodeMirror=t()}(this,function(){function S(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function T(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function N(e,t){return T(e).appendChild(t)}function C(e,t,n,r){var i=document.createElement(e);n&&(i.className=n),r&&(i.style.cssText=r);if(typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var s=0;s<t.length;++s)i.appendChild(t[s]);return i}function L(e,t){t.nodeType==3&&(t=t.parentNode);if(e.contains)return e.contains(t);do{t.nodeType==11&&(t=t.host);if(t==e)return!0}while(t=t.parentNode)}function A(){var e;try{e=document.activeElement}catch(t){e=document.body||null}while(e&&e.root&&e.root.activeElement)e=e.root.activeElement;return e}function O(e,t){var n=e.className;S(t).test(n)||(e.className+=(n?" ":"")+t)}function M(e,t){var n=e.split(" ");for(var r=0;r<n.length;r++)n[r]&&!S(n[r]).test(t)&&(t+=" "+n[r]);return t}function D(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function P(e,t,n){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(n!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function H(e,t,n,r,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var s=r||0,o=i||0;;){var u=e.indexOf("	",s);if(u<0||u>=t)return o+(t-s);o+=u-s,o+=n-o%n,s=u+1}}function B(){this.id=null}function j(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}function z(e,t,n){for(var r=0,i=0;;){var s=e.indexOf("	",r);s==-1&&(s=e.length);var o=s-r;if(s==e.length||i+o>=t)return r+Math.min(o,t-i);i+=s-r,i+=n-i%n,r=s+1;if(i>=t)return r}}function X(e){while(W.length<=e)W.push(V(W)+" ");return W[e]}function V(e){return e[e.length-1]}function $(e,t){var n=[];for(var r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function J(e,t,n){var r=0,i=n(t);while(r<e.length&&n(e[r])<=i)r++;e.splice(r,0,t)}function K(){}function Q(e,t){var n;return Object.create?n=Object.create(e):(K.prototype=e,n=new K),t&&P(t,n),n}function Y(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||G.test(e))}function Z(e,t){return t?t.source.indexOf("\\w")>-1&&Y(e)?!0:t.test(e):Y(e)}function et(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function nt(e){return e.charCodeAt(0)>=768&&tt.test(e)}function rt(e,t,r){var i=this;this.input=r,i.scrollbarFiller=C("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=C("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=C("div",null,"CodeMirror-code"),i.selectionDiv=C("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=C("div",null,"CodeMirror-cursors"),i.measure=C("div",null,"CodeMirror-measure"),i.lineMeasure=C("div",null,"CodeMirror-measure"),i.lineSpace=C("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none"),i.mover=C("div",[C("div",[i.lineSpace],"CodeMirror-lines")],null,"position: relative"),i.sizer=C("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=C("div",null,null,"position: absolute; height: "+F+"px; width: 1px;"),i.gutters=C("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=C("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=C("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),s&&o<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!u&&(!n||!v)&&(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,r.init(i)}function it(e,t){t-=e.first;if(t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");var n=e;while(!n.lines)for(var r=0;;++r){var i=n.children[r],s=i.chunkSize();if(t<s){n=i;break}t-=s}return n.lines[t]}function st(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(e){var s=e.text;i==n.line&&(s=s.slice(0,n.ch)),i==t.line&&(s=s.slice(t.ch)),r.push(s),++i}),r}function ot(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function ut(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function at(e){if(e.parent==null)return null;var t=e.parent,n=j(t.lines,e);for(var r=t.parent;r;t=r,r=r.parent)for(var i=0;;++i){if(r.children[i]==t)break;n+=r.children[i].chunkSize()}return n+t.first}function ft(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],s=i.height;if(t<s){e=i;continue e}t-=s,n+=i.chunkSize()}return n}while(!e.lines);var o=0;for(;o<e.lines.length;++o){var u=e.lines[o],a=u.height;if(t<a)break;t-=a}return n+o}function lt(e,t){return t>=e.first&&t<e.first+e.size}function ct(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ht(e,t){if(!(this instanceof ht))return new ht(e,t);this.line=e,this.ch=t}function pt(e,t){return e.line-t.line||e.ch-t.ch}function dt(e){return ht(e.line,e.ch)}function vt(e,t){return pt(e,t)<0?t:e}function mt(e,t){return pt(e,t)<0?e:t}function gt(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function yt(e,t){if(t.line<e.first)return ht(e.first,0);var n=e.first+e.size-1;return t.line>n?ht(n,it(e,n).text.length):bt(t,it(e,t.line).text.length)}function bt(e,t){var n=e.ch;return n==null||n>t?ht(e.line,t):n<0?ht(e.line,0):e}function wt(e,t){var n=[];for(var r=0;r<t.length;r++)n[r]=yt(e,t[r]);return n}function xt(){Et=!0}function Tt(){St=!0}function Nt(e,t,n){this.marker=e,this.from=t,this.to=n}function Ct(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function kt(e,t){var n;for(var r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Lt(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function At(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var s=e[i],o=s.marker,u=s.from==null||(o.inclusiveLeft?s.from<=t:s.from<t);if(u||s.from==t&&o.type=="bookmark"&&(!n||!s.marker.insertLeft)){var a=s.to==null||(o.inclusiveRight?s.to>=t:s.to>t);(r||(r=[])).push(new Nt(o,s.from,a?null:s.to))}}return r}function Ot(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var s=e[i],o=s.marker,u=s.to==null||(o.inclusiveRight?s.to>=t:s.to>t);if(u||s.from==t&&o.type=="bookmark"&&(!n||s.marker.insertLeft)){var a=s.from==null||(o.inclusiveLeft?s.from<=t:s.from<t);(r||(r=[])).push(new Nt(o,a?null:s.from-t,s.to==null?null:s.to-t))}}return r}function Mt(e,t){if(t.full)return null;var n=lt(e,t.from.line)&&it(e,t.from.line).markedSpans,r=lt(e,t.to.line)&&it(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,s=t.to.ch,o=pt(t.from,t.to)==0,u=At(n,i,o),a=Ot(r,s,o),f=t.text.length==1,l=V(t.text).length+(f?i:0);if(u)for(var c=0;c<u.length;++c){var h=u[c];if(h.to==null){var p=Ct(a,h.marker);p?f&&(h.to=p.to==null?null:p.to+l):h.to=i}}if(a)for(var d=0;d<a.length;++d){var v=a[d];v.to!=null&&(v.to+=l);if(v.from==null){var m=Ct(u,v.marker);m||(v.from=l,f&&(u||(u=[])).push(v))}else v.from+=l,f&&(u||(u=[])).push(v)}u&&(u=_t(u)),a&&a!=u&&(a=_t(a));var g=[u];if(!f){var y=t.text.length-2,b;if(y>0&&u)for(var w=0;w<u.length;++w)u[w].to==null&&(b||(b=[])).push(new Nt(u[w].marker,null,null));for(var E=0;E<y;++E)g.push(b);g.push(a)}return g}function _t(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Dt(e,t,n){var r=null;e.iter(t.line,n.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;n.readOnly&&(!r||j(r,n)==-1)&&(r||(r=[])).push(n)}});if(!r)return null;var i=[{from:t,to:n}];for(var s=0;s<r.length;++s){var o=r[s],u=o.find(0);for(var a=0;a<i.length;++a){var f=i[a];if(pt(f.to,u.from)<0||pt(f.from,u.to)>0)continue;var l=[a,1],c=pt(f.from,u.from),h=pt(f.to,u.to);(c<0||!o.inclusiveLeft&&!c)&&l.push({from:f.from,to:u.from}),(h>0||!o.inclusiveRight&&!h)&&l.push({from:u.to,to:f.to}),i.splice.apply(i,l),a+=l.length-1}}return i}function Pt(e){var t=e.markedSpans;if(!t)return;for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}function Ht(e,t){if(!t)return;for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}function Bt(e){return e.inclusiveLeft?-1:0}function jt(e){return e.inclusiveRight?1:0}function Ft(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),s=pt(r.from,i.from)||Bt(e)-Bt(t);if(s)return-s;var o=pt(r.to,i.to)||jt(e)-jt(t);return o?o:t.id-e.id}function It(e,t){var n=St&&e.markedSpans,r;if(n)for(var i=void 0,s=0;s<n.length;++s)i=n[s],i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||Ft(r,i.marker)<0)&&(r=i.marker);return r}function qt(e){return It(e,!0)}function Rt(e){return It(e,!1)}function Ut(e,t,n,r,i){var s=it(e,t),o=St&&s.markedSpans;if(o)for(var u=0;u<o.length;++u){var a=o[u];if(!a.marker.collapsed)continue;var f=a.marker.find(0),l=pt(f.from,n)||Bt(a.marker)-Bt(i),c=pt(f.to,r)||jt(a.marker)-jt(i);if(l>=0&&c<=0||l<=0&&c>=0)continue;if(l<=0&&(a.marker.inclusiveRight&&i.inclusiveLeft?pt(f.to,n)>=0:pt(f.to,n)>0)||l>=0&&(a.marker.inclusiveRight&&i.inclusiveLeft?pt(f.from,r)<=0:pt(f.from,r)<0))return!0}}function zt(e){var t;while(t=qt(e))e=t.find(-1,!0).line;return e}function Wt(e){var t,n;while(t=Rt(e))e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function Xt(e,t){var n=it(e,t),r=zt(n);return n==r?t:at(r)}function Vt(e,t){if(t>e.lastLine())return t;var n=it(e,t),r;if(!$t(e,n))return t;while(r=Rt(n))n=r.find(1,!0).line;return at(n)+1}function $t(e,t){var n=St&&t.markedSpans;if(n)for(var r=void 0,i=0;i<n.length;++i){r=n[i];if(!r.marker.collapsed)continue;if(r.from==null)return!0;if(r.marker.widgetNode)continue;if(r.from==0&&r.marker.inclusiveLeft&&Jt(e,t,r))return!0}}function Jt(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return Jt(e,r.line,Ct(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,s=0;s<t.markedSpans.length;++s){i=t.markedSpans[s];if(i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(i.to==null||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&Jt(e,t,i))return!0}}function Kt(e){e=zt(e);var t=0,n=e.parent;for(var r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var s=n.parent;s;n=s,s=n.parent)for(var o=0;o<s.children.length;++o){var u=s.children[o];if(u==n)break;t+=u.height}return t}function Qt(e){if(e.height==0)return 0;var t=e.text.length,n,r=e;while(n=qt(r)){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}r=e;while(n=Rt(r)){var s=n.find(0,!0);t-=r.text.length-s.from.ch,r=s.to.line,t+=r.text.length-s.to.ch}return t}function Gt(e){var t=e.display,n=e.doc;t.maxLine=it(n,n.first),t.maxLineLength=Qt(t.maxLine),t.maxLineChanged=!0,n.iter(function(e){var n=Qt(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}function Yt(e,t,n,r){if(!e)return r(t,n,"ltr");var i=!1;for(var s=0;s<e.length;++s){var o=e[s];if(o.from<n&&o.to>t||t==n&&o.to==t)r(Math.max(o.from,t),Math.min(o.to,n),o.level==1?"rtl":"ltr"),i=!0}i||r(t,n,"ltr")}function Zt(e){return e.level%2?e.to:e.from}function en(e){return e.level%2?e.from:e.to}function tn(e){var t=cn(e);return t?Zt(t[0]):0}function nn(e){var t=cn(e);return t?en(V(t)):e.text.length}function rn(e,t,n){var r=e[0].level;return t==r?!0:n==r?!1:t<n}function on(e,t){var n;sn=null;for(var r=0;r<e.length;++r){var i=e[r];if(i.from<t&&i.to>t)return r;if(i.from==t||i.to==t){if(n!=null)return rn(e,i.level,e[n].level)?(i.from!=i.to&&(sn=n),r):(i.from!=i.to&&(sn=r),n);n=r}}return n}function un(e,t,n,r){if(!r)return t+n;do t+=n;while(t>0&&nt(e.text.charAt(t)));return t}function an(e,t,n,r){var i=cn(e);if(!i)return fn(e,t,n,r);var s=on(i,t),o=i[s],u=un(e,t,o.level%2?-n:n,r);for(;;){if(u>o.from&&u<o.to)return u;if(u==o.from||u==o.to)return on(i,u)==s?u:(o=i[s+=n],n>0==o.level%2?o.to:o.from);o=i[s+=n];if(!o)return null;n>0==o.level%2?u=un(e,o.to,-1,r):u=un(e,o.from,1,r)}}function fn(e,t,n,r){var i=t+n;if(r)while(i>0&&nt(e.text.charAt(i)))i+=n;return i<0||i>e.text.length?null:i}function cn(e){var t=e.order;return t==null&&(t=e.order=ln(e.text)),t}function dn(e,t){return e._handlers&&e._handlers[t]||hn}function vn(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var s=j(i,n);s>-1&&(r[t]=i.slice(0,s).concat(i.slice(s+1)))}}}function mn(e,t){var n=dn(e,t);if(!n.length)return;var r=Array.prototype.slice.call(arguments,2);for(var i=0;i<n.length;++i)n[i].apply(null,r)}function gn(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),mn(e,n||t.type,e,t),xn(t)||t.codemirrorIgnore}function yn(e){var t=e._handlers&&e._handlers.cursorActivity;if(!t)return;var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]);for(var r=0;r<t.length;++r)j(n,t[r])==-1&&n.push(t[r])}function bn(e,t){return dn(e,t).length>0}function wn(e){e.prototype.on=function(e,t){pn(this,e,t)},e.prototype.off=function(e,t){vn(this,e,t)}}function En(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Sn(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function xn(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==0}function Tn(e){En(e),Sn(e)}function Nn(e){return e.target||e.srcElement}function Cn(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),m&&e.ctrlKey&&t==1&&(t=3),t}function An(e){if(Ln==null){var t=C("span","​");N(e,C("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Ln=t.offsetWidth<=1&&t.offsetHeight>2&&!(s&&o<8))}var n=Ln?C("span","​"):C("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Mn(e){if(On!=null)return On;var t=N(e,document.createTextNode("AخA")),n=k(t,0,1).getBoundingClientRect(),r=k(t,1,2).getBoundingClientRect();return T(e),!n||n.left==n.right?!1:On=r.right-n.right<3}function Bn(e){if(Hn!=null)return Hn;var t=N(e,C("span","x")),n=t.getBoundingClientRect(),r=k(t,0,1).getBoundingClientRect();return Hn=Math.abs(n.left-r.left)>1}function In(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),jn[e]=t}function qn(e,t){Fn[e]=t}function Rn(e){if(typeof e=="string"&&Fn.hasOwnProperty(e))e=Fn[e];else if(e&&typeof e.name=="string"&&Fn.hasOwnProperty(e.name)){var t=Fn[e.name];typeof t=="string"&&(t={name:t}),e=Q(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Rn("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Rn("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Un(e,t){t=Rn(t);var n=jn[t.name];if(!n)return Un(e,"text/plain");var r=n(e,t);if(zn.hasOwnProperty(t.name)){var i=zn[t.name];for(var s in i){if(!i.hasOwnProperty(s))continue;r.hasOwnProperty(s)&&(r["_"+s]=r[s]),r[s]=i[s]}}r.name=t.name,t.helperType&&(r.helperType=t.helperType);if(t.modeProps)for(var o in t.modeProps)r[o]=t.modeProps[o];return r}function Wn(e,t){var n=zn.hasOwnProperty(e)?zn[e]:zn[e]={};P(t,n)}function Xn(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Vn(e,t){var n;while(e.innerMode){n=e.innerMode(t);if(!n||n.mode==e)break;t=n.state,e=n.mode}return n||{mode:e,state:t}}function $n(e,t,n){return e.startState?e.startState(t,n):!0}function Kn(e,t,n,r){var i=[e.state.modeGen],s={};rr(e,t.text,e.doc.mode,n,function(e,t){return i.push(e,t)},s,r);var o=function(n){var r=e.state.overlays[n],o=1,u=0;rr(e,t.text,r.mode,!0,function(e,t){var n=o;while(u<e){var s=i[o];s>e&&i.splice(o,1,e,i[o+1],s),o+=2,u=Math.min(e,s)}if(!t)return;if(r.opaque)i.splice(n,o-n,e,"overlay "+t),o=n+2;else for(;n<o;n+=2){var a=i[n+1];i[n+1]=(a?a+" ":"")+"overlay "+t}},s)};for(var u=0;u<e.state.overlays.length;++u)o(u);return{styles:i,classes:s.bgClass||s.textClass?s:null}}function Qn(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=Gn(e,at(t)),i=Kn(e,t,t.text.length>e.options.maxHighlightLength?Xn(e.doc.mode,r):r);t.stateAfter=r,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.frontier&&e.doc.frontier++}return t.styles}function Gn(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return!0;var s=ir(e,t,n),o=s>r.first&&it(r,s-1).stateAfter;return o?o=Xn(r.mode,o):o=$n(r.mode),r.iter(s,t,function(n){Yn(e,n.text,o);var u=s==t-1||s%5==0||s>=i.viewFrom&&s<i.viewTo;n.stateAfter=u?Xn(r.mode,o):null,++s}),n&&(r.frontier=s),o}function Yn(e,t,n,r){var i=e.doc.mode,s=new Jn(t,e.options.tabSize);s.start=s.pos=r||0,t==""&&Zn(i,n);while(!s.eol())er(i,s,n),s.start=s.pos}function Zn(e,t){if(e.blankLine)return e.blankLine(t);if(!e.innerMode)return;var n=Vn(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}function er(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=Vn(e,n).mode);var s=e.token(t,n);if(t.pos>t.start)return s}throw new Error("Mode "+e.name+" failed to advance stream.")}function tr(e,t,n,r){var i=function(e){return{start:l.start,end:l.pos,string:l.current(),type:u||null,state:e?Xn(s.mode,f):f}},s=e.doc,o=s.mode,u;t=yt(s,t);var a=it(s,t.line),f=Gn(e,t.line,n),l=new Jn(a.text,e.options.tabSize),c;r&&(c=[]);while((r||l.pos<t.ch)&&!l.eol())l.start=l.pos,u=er(o,l,f),r&&c.push(i(!0));return r?c:i()}function nr(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";t[r]==null?t[r]=n[2]:(new RegExp("(?:^|s)"+n[2]+"(?:$|s)")).test(t[r])||(t[r]+=" "+n[2])}return e}function rr(e,t,n,r,i,s,o){var u=n.flattenSpans;u==null&&(u=e.options.flattenSpans);var a=0,f=null,l=new Jn(t,e.options.tabSize),c,h=e.options.addModeClass&&[null];t==""&&nr(Zn(n,r),s);while(!l.eol()){l.pos>e.options.maxHighlightLength?(u=!1,o&&Yn(e,t,r,l.pos),l.pos=t.length,c=null):c=nr(er(n,l,r,h),s);if(h){var p=h[0].name;p&&(c="m-"+(c?p+" "+c:p))}if(!u||f!=c){while(a<l.start)a=Math.min(l.start,a+5e3),i(a,f);f=c}l.start=l.pos}while(a<l.pos){var d=Math.min(l.pos,a+5e3);i(d,f),a=d}}function ir(e,t,n){var r,i,s=e.doc,o=n?-1:t-(e.doc.mode.innerMode?1e3:100);for(var u=t;u>o;--u){if(u<=s.first)return s.first;var a=it(s,u-1);if(a.stateAfter&&(!n||u<=s.frontier))return u;var f=H(a.text,null,e.options.tabSize);if(i==null||r>f)i=u-1,r=f}return i}function sr(e,t,n){this.text=e,Ht(this,t),this.height=n?n(this):1}function or(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Pt(e),Ht(e,n);var i=r?r(e):1;i!=e.height&&ut(e,i)}function ur(e){e.parent=null,Pt(e)}function lr(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?fr:ar;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function cr(e,t){var n=C("span",null,null,u?"padding-right: .1px":null),r={pre:C("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(s||u)&&e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;r.pos=0,r.addToken=pr,Mn(e.display.measure)&&(a=cn(o))&&(r.addToken=vr(r.addToken,a)),r.map=[];var f=t!=e.display.externalMeasured&&at(o);gr(o,r,Qn(e,o,f)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=M(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=M(o.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(An(e.display.measure))),i==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(u){var l=r.content.lastChild;if(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab"))r.content.className="cm-tab-wrap-hack"}return mn(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=M(r.pre.className,r.textClass||"")),r}function hr(e){var t=C("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function pr(e,t,n,r,i,u,a){if(!t)return;var f=e.splitSpaces?dr(t,e.trailingSpace):t,l=e.cm.state.specialChars,c=!1,h;if(!l.test(t))e.col+=t.length,h=document.createTextNode(f),e.map.push(e.pos,e.pos+t.length,h),s&&o<9&&(c=!0),e.pos+=t.length;else{h=document.createDocumentFragment();var p=0;for(;;){l.lastIndex=p;var d=l.exec(t),v=d?d.index-p:t.length-p;if(v){var m=document.createTextNode(f.slice(p,p+v));s&&o<9?h.appendChild(C("span",[m])):h.appendChild(m),e.map.push(e.pos,e.pos+v,m),e.col+=v,e.pos+=v}if(!d)break;p+=v+1;var g=void 0;if(d[0]=="	"){var y=e.cm.options.tabSize,b=y-e.col%y;g=h.appendChild(C("span",X(b),"cm-tab")),g.setAttribute("role","presentation"),g.setAttribute("cm-text","	"),e.col+=b}else d[0]=="\r"||d[0]=="\n"?(g=h.appendChild(C("span",d[0]=="\r"?"␍":"␤","cm-invalidchar")),g.setAttribute("cm-text",d[0]),e.col+=1):(g=e.cm.options.specialCharPlaceholder(d[0]),g.setAttribute("cm-text",d[0]),s&&o<9?h.appendChild(C("span",[g])):h.appendChild(g),e.col+=1);e.map.push(e.pos,e.pos+1,g),e.pos++}}e.trailingSpace=f.charCodeAt(t.length-1)==32;if(n||r||i||c||a){var w=n||"";r&&(w+=r),i&&(w+=i);var E=C("span",[h],w,a);return u&&(E.title=u),e.content.appendChild(E)}e.content.appendChild(h)}function dr(e,t){if(e.length>1&&!/  /.test(e))return e;var n=t,r="";for(var i=0;i<e.length;i++){var s=e.charAt(i);s==" "&&n&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(s=" "),r+=s,n=s==" "}return r}function vr(e,t){return function(n,r,i,s,o,u,a){i=i?i+" cm-force-border":"cm-force-border";var f=n.pos,l=f+r.length;for(;;){var c=void 0;for(var h=0;h<t.length;h++){c=t[h];if(c.to>f&&c.from<=f)break}if(c.to>=l)return e(n,r,i,s,o,u,a);e(n,r.slice(0,c.to-f),i,s,null,u,a),s=null,r=r.slice(c.to-f),f=c.to}}}function mr(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function gr(e,t,n){var r=e.markedSpans,i=e.text,s=0;if(!r){for(var o=1;o<n.length;o+=2)t.addToken(t,i.slice(s,s=n[o]),lr(n[o+1],t.cm.options));return}var u=i.length,a=0,f=1,l="",c,h,p=0,d,v,m,g,y;for(;;){if(p==a){d=v=m=g=h="",y=null,p=Infinity;var b=[],w=void 0;for(var E=0;E<r.length;++E){var S=r[E],x=S.marker;x.type=="bookmark"&&S.from==a&&x.widgetNode?b.push(x):S.from<=a&&(S.to==null||S.to>a||x.collapsed&&S.to==a&&S.from==a)?(S.to!=null&&S.to!=a&&p>S.to&&(p=S.to,v=""),x.className&&(d+=" "+x.className),x.css&&(h=(h?h+";":"")+x.css),x.startStyle&&S.from==a&&(m+=" "+x.startStyle),x.endStyle&&S.to==p&&(w||(w=[])).push(x.endStyle,S.to),x.title&&!g&&(g=x.title),x.collapsed&&(!y||Ft(y.marker,x)<0)&&(y=S)):S.from>a&&p>S.from&&(p=S.from)}if(w)for(var T=0;T<w.length;T+=2)w[T+1]==p&&(v+=" "+w[T]);if(!y||y.from==a)for(var N=0;N<b.length;++N)mr(t,0,b[N]);if(y&&(y.from||0)==a){mr(t,(y.to==null?u+1:y.to)-a,y.marker,y.from==null);if(y.to==null)return;y.to==a&&(y=!1)}}if(a>=u)break;var C=Math.min(u,p);for(;;){if(l){var k=a+l.length;if(!y){var L=k>C?l.slice(0,C-a):l;t.addToken(t,L,c?c+d:d,m,a+L.length==p?v:"",g,h)}if(k>=C){l=l.slice(C-a),a=C;break}a=k,m=""}l=i.slice(s,s=n[f++]),c=lr(n[f++],t.cm.options)}}}function yr(e,t,n){this.line=t,this.rest=Wt(t),this.size=this.rest?at(V(this.rest))-n+1:1,this.node=this.text=null,this.hidden=$t(e,t)}function br(e,t,n){var r=[],i;for(var s=t;s<n;s=i){var o=new yr(e.doc,it(e.doc,s),s);i=s+o.size,r.push(o)}return r}function Er(e){wr?wr.ops.push(e):e.ownsGroup=wr={ops:[e],delayedCallbacks:[]}}function Sr(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)while(i.cursorActivityCalled<i.cursorActivityHandlers.length)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function xr(e,t){var n=e.ownsGroup;if(!n)return;try{Sr(n)}finally{wr=null,t(n)}}function Nr(e,t){var n=dn(e,t);if(!n.length)return;var r=Array.prototype.slice.call(arguments,2),i;wr?i=wr.delayedCallbacks:Tr?i=Tr:(i=Tr=[],setTimeout(Cr,0));var s=function(e){i.push(function(){return n[e].apply(null,r)})};for(var o=0;o<n.length;++o)s(o)}function Cr(){var e=Tr;Tr=null;for(var t=0;t<e.length;++t)e[t]()}function kr(e,t,n,r){for(var i=0;i<t.changes.length;i++){var s=t.changes[i];s=="text"?Mr(e,t):s=="gutter"?Dr(e,t,n,r):s=="class"?_r(t):s=="widget"&&Pr(e,t,r)}t.changes=null}function Lr(e){return e.node==e.text&&(e.node=C("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),s&&o<8&&(e.node.style.zIndex=2)),e.node}function Ar(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;t&&(t+=" CodeMirror-linebackground");if(e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var n=Lr(e);e.background=n.insertBefore(C("div",null,t),n.firstChild)}}function Or(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):cr(e,t)}function Mr(e,t){var n=t.text.className,r=Or(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,_r(t)):n&&(t.text.className=n)}function _r(e){Ar(e),e.line.wrapClass?Lr(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function Dr(e,t,n,r){t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null);if(t.line.gutterClass){var i=Lr(t);t.gutterBackground=C("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),i.insertBefore(t.gutterBackground,t.text)}var s=t.line.gutterMarkers;if(e.options.lineNumbers||s){var o=Lr(t),u=t.gutter=C("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");e.display.input.setUneditable(u),o.insertBefore(u,t.text),t.line.gutterClass&&(u.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!s||!s["CodeMirror-linenumbers"])&&(t.lineNumber=u.appendChild(C("div",ct(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px")));if(s)for(var a=0;a<e.options.gutters.length;++a){var f=e.options.gutters[a],l=s.hasOwnProperty(f)&&s[f];l&&u.appendChild(C("div",[l],"CodeMirror-gutter-elt","left: "+r.gutterLeft[f]+"px; width: "+r.gutterWidth[f]+"px"))}}}function Pr(e,t,n){t.alignable&&(t.alignable=null);for(var r=t.node.firstChild,i=void 0;r;r=i)i=r.nextSibling,r.className=="CodeMirror-linewidget"&&t.node.removeChild(r);Br(e,t,n)}function Hr(e,t,n,r){var i=Or(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),_r(t),Dr(e,t,n,r),Br(e,t,r),t.node}function Br(e,t,n){jr(e,t.line,t,n,!0);if(t.rest)for(var r=0;r<t.rest.length;r++)jr(e,t.rest[r],t,n,!1)}function jr(e,t,n,r,i){if(!t.widgets)return;var s=Lr(n);for(var o=0,u=t.widgets;o<u.length;++o){var a=u[o],f=C("div",[a.node],"CodeMirror-linewidget");a.handleMouseEvents||f.setAttribute("cm-ignore-events","true"),Fr(a,f,n,r),e.display.input.setUneditable(f),i&&a.above?s.insertBefore(f,n.gutter||n.text):s.appendChild(f),Nr(a,"redraw")}}function Fr(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function Ir(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!L(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),N(t.display.measure,C("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function qr(e,t){for(var n=Nn(t);n!=e.wrapper;n=n.parentNode)if(!n||n.nodeType==1&&n.getAttribute("cm-ignore-events")=="true"||n.parentNode==e.sizer&&n!=e.mover)return!0}function Rr(e){return e.lineSpace.offsetTop}function Ur(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function zr(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=N(e.measure,C("pre","x")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function Wr(e){return F-e.display.nativeBarWidth}function Xr(e){return e.display.scroller.clientWidth-Wr(e)-e.display.barWidth}function Vr(e){return e.display.scroller.clientHeight-Wr(e)-e.display.barHeight}function $r(e,t,n){var r=e.options.lineWrapping,i=r&&Xr(e);if(!t.measure.heights||r&&t.measure.width!=i){var s=t.measure.heights=[];if(r){t.measure.width=i;var o=t.text.firstChild.getClientRects();for(var u=0;u<o.length-1;u++){var a=o[u],f=o[u+1];Math.abs(a.bottom-f.bottom)>2&&s.push((a.bottom+f.top)/2-n.top)}}s.push(n.bottom-n.top)}}function Jr(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(at(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Kr(e,t){t=zt(t);var n=at(t),r=e.display.externalMeasured=new yr(e.doc,t,n);r.lineN=n;var i=r.built=cr(e,r);return r.text=i.pre,N(e.display.lineMeasure,i.pre),r}function Qr(e,t,n,r){return Zr(e,Yr(e,t),n,r)}function Gr(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Ci(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function Yr(e,t){var n=at(t),r=Gr(e,n);r&&!r.text?r=null:r&&r.changes&&(kr(e,r,n,Ei(e)),e.curOp.forceUpdate=!0),r||(r=Kr(e,t));var i=Jr(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Zr(e,t,n,r,i){t.before&&(n=-1);var s=n+(r||""),o;return t.cache.hasOwnProperty(s)?o=t.cache[s]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||($r(e,t.view,t.rect),t.hasHeights=!0),o=ri(e,t,n,r),o.bogus||(t.cache[s]=o)),{left:o.left,right:o.right,top:i?o.rtop:o.top,bottom:i?o.rbottom:o.bottom}}function ti(e,t,n){var r,i,s,o,u,a;for(var f=0;f<e.length;f+=3){u=e[f],a=e[f+1];if(t<u)i=0,s=1,o="left";else if(t<a)i=t-u,s=i+1;else if(f==e.length-3||t==a&&e[f+3]>t)s=a-u,i=s-1,t>=a&&(o="right");if(i!=null){r=e[f+2],u==a&&n==(r.insertLeft?"left":"right")&&(o=n);if(n=="left"&&i==0)while(f&&e[f-2]==e[f-3]&&e[f-1].insertLeft)r=e[(f-=3)+2],o="left";if(n=="right"&&i==a-u)while(f<e.length-3&&e[f+3]==e[f+4]&&!e[f+5].insertLeft)r=e[(f+=3)+2],o="right";break}}return{node:r,start:i,end:s,collapse:o,coverStart:u,coverEnd:a}}function ni(e,t){var n=ei;if(t=="left"){for(var r=0;r<e.length;r++)if((n=e[r]).left!=n.right)break}else for(var i=e.length-1;i>=0;i--)if((n=e[i]).left!=n.right)break;return n}function ri(e,t,n,r){var i=ti(t.map,n,r),u=i.node,a=i.start,f=i.end,l=i.collapse,c;if(u.nodeType==3){for(var h=0;h<4;h++){while(a&&nt(t.line.text.charAt(i.coverStart+a)))--a;while(i.coverStart+f<i.coverEnd&&nt(t.line.text.charAt(i.coverStart+f)))++f;s&&o<9&&a==0&&f==i.coverEnd-i.coverStart?c=u.parentNode.getBoundingClientRect():c=ni(k(u,a,f).getClientRects(),r);if(c.left||c.right||a==0)break;f=a,a-=1,l="right"}s&&o<11&&(c=ii(e.display.measure,c))}else{a>0&&(l=r="right");var p;e.options.lineWrapping&&(p=u.getClientRects()).length>1?c=p[r=="right"?p.length-1:0]:c=u.getBoundingClientRect()}if(s&&o<9&&!a&&(!c||!c.left&&!c.right)){var d=u.parentNode.getClientRects()[0];d?c={left:d.left,right:d.left+wi(e.display),top:d.top,bottom:d.bottom}:c=ei}var v=c.top-t.rect.top,m=c.bottom-t.rect.top,g=(v+m)/2,y=t.view.measure.heights,b=0;for(;b<y.length-1;b++)if(g<y[b])break;var w=b?y[b-1]:0,E=y[b],S={left:(l=="right"?c.right:c.left)-t.rect.left,right:(l=="left"?c.left:c.right)-t.rect.left,top:w,bottom:E};return!c.left&&!c.right&&(S.bogus=!0),e.options.singleCursorHeightPerLine||(S.rtop=v,S.rbottom=m),S}function ii(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Bn(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function si(e){if(e.measure){e.measure.cache={},e.measure.heights=null;if(e.rest)for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}}function oi(e){e.display.externalMeasure=null,T(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)si(e.display.view[t])}function ui(e){oi(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function ai(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function fi(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function li(e,t,n,r,i){if(!i&&t.widgets)for(var s=0;s<t.widgets.length;++s)if(t.widgets[s].above){var o=Ir(t.widgets[s]);n.top+=o,n.bottom+=o}if(r=="line")return n;r||(r="local");var u=Kt(t);r=="local"?u+=Rr(e.display):u-=e.display.viewOffset;if(r=="page"||r=="window"){var a=e.display.lineSpace.getBoundingClientRect();u+=a.top+(r=="window"?0:fi());var f=a.left+(r=="window"?0:ai());n.left+=f,n.right+=f}return n.top+=u,n.bottom+=u,n}function ci(e,t,n){if(n=="div")return t;var r=t.left,i=t.top;if(n=="page")r-=ai(),i-=fi();else if(n=="local"||!n){var s=e.display.sizer.getBoundingClientRect();r+=s.left,i+=s.top}var o=e.display.lineSpace.getBoundingClientRect();return{left:r-o.left,top:i-o.top}}function hi(e,t,n,r,i){return r||(r=it(e.doc,t.line)),li(e,r,Qr(e,r,t.ch,i),n)}function pi(e,t,n,r,i,s){function o(t,o){var u=Zr(e,i,t,o?"right":"left",s);return o?u.left=u.right:u.right=u.left,li(e,r,u,n)}function u(e,t){var n=a[t],r=n.level%2;return e==Zt(n)&&t&&n.level<a[t-1].level?(n=a[--t],e=en(n)-(n.level%2?0:1),r=!0):e==en(n)&&t<a.length-1&&n.level<a[t+1].level&&(n=a[++t],e=Zt(n)-n.level%2,r=!1),r&&e==n.to&&e>n.from?o(e-1):o(e,r)}r=r||it(e.doc,t.line),i||(i=Yr(e,r));var a=cn(r),f=t.ch;if(!a)return o(f);var l=on(a,f),c=u(f,l);return sn!=null&&(c.other=u(f,sn)),c}function di(e,t){var n=0;t=yt(e.doc,t),e.options.lineWrapping||(n=wi(e.display)*t.ch);var r=it(e.doc,t.line),i=Kt(r)+Rr(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function vi(e,t,n,r){var i=ht(e,t);return i.xRel=r,n&&(i.outside=!0),i}function mi(e,t,n){var r=e.doc;n+=e.display.viewOffset;if(n<0)return vi(r.first,0,!0,-1);var i=ft(r,n),s=r.first+r.size-1;if(i>s)return vi(r.first+r.size-1,it(r,s).text.length,!0,1);t<0&&(t=0);var o=it(r,i);for(;;){var u=gi(e,o,i,t,n),a=Rt(o),f=a&&a.find(0,!0);if(!a||!(u.ch>f.from.ch||u.ch==f.from.ch&&u.xRel>0))return u;i=at(o=f.to.line)}}function gi(e,t,n,r,i){function f(r){var i=pi(e,ht(n,r),"line",t,a);return o=!0,s>i.bottom?i.left-u:s<i.top?i.left+u:(o=!1,i.left)}var s=i-Kt(t),o=!1,u=2*e.display.wrapper.clientWidth,a=Yr(e,t),l=cn(t),c=t.text.length,h=tn(t),p=nn(t),d=f(h),v=o,m=f(p),g=o;if(r>m)return vi(n,p,g,1);for(;;){if(l?p==h||p==an(t,h,1):p-h<=1){var y=r<d||r-d<=m-r?h:p,b=y==h?v:g,w=r-(y==h?d:m);if(g&&!l&&!/\s/.test(t.text.charAt(y))&&w>0&&y<t.text.length&&a.view.measure.heights.length>1){var E=Zr(e,a,y,"right");s<=E.bottom&&s>=E.top&&Math.abs(r-E.right)<w&&(b=!1,y++,w=r-E.right)}while(nt(t.text.charAt(y)))++y;var S=vi(n,y,b,w<-1?-1:w>1?1:0);return S}var x=Math.ceil(c/2),T=h+x;if(l){T=h;for(var N=0;N<x;++N)T=an(t,T,1)}var C=f(T);if(C>r){p=T,m=C;if(g=o)m+=1e3;c=x}else h=T,d=C,v=o,c-=x}}function bi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(yi==null){yi=C("pre");for(var t=0;t<49;++t)yi.appendChild(document.createTextNode("x")),yi.appendChild(C("br"));yi.appendChild(document.createTextNode("x"))}N(e.measure,yi);var n=yi.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),T(e.measure),n||1}function wi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=C("span","xxxxxxxxxx"),n=C("pre",[t]);N(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Ei(e){var t=e.display,n={},r={},i=t.gutters.clientLeft;for(var s=t.gutters.firstChild,o=0;s;s=s.nextSibling,++o)n[e.options.gutters[o]]=s.offsetLeft+s.clientLeft+i,r[e.options.gutters[o]]=s.clientWidth;return{fixedPos:Si(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Si(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function xi(e){var t=bi(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/wi(e.display)-3);return function(i){if($t(e.doc,i))return 0;var s=0;if(i.widgets)for(var o=0;o<i.widgets.length;o++)i.widgets[o].height&&(s+=i.widgets[o].height);return n?s+(Math.ceil(i.text.length/r)||1)*t:s+t}}function Ti(e){var t=e.doc,n=xi(e);t.iter(function(e){var t=n(e);t!=e.height&&ut(e,t)})}function Ni(e,t,n,r){var i=e.display;if(!n&&Nn(t).getAttribute("cm-not-content")=="true")return null;var s,o,u=i.lineSpace.getBoundingClientRect();try{s=t.clientX-u.left,o=t.clientY-u.top}catch(t){return null}var a=mi(e,s,o),f;if(r&&a.xRel==1&&(f=it(e.doc,a.line).text).length==a.ch){var l=H(f,f.length,e.options.tabSize)-f.length;a=ht(a.line,Math.max(0,Math.round((s-zr(e.display).left)/wi(e.display))-l))}return a}function Ci(e,t){if(t>=e.display.viewTo)return null;t-=e.display.viewFrom;if(t<0)return null;var n=e.display.view;for(var r=0;r<n.length;r++){t-=n[r].size;if(t<0)return r}}function ki(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Li(e,t){var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),s=r.selection=document.createDocumentFragment();for(var o=0;o<n.sel.ranges.length;o++){if(t===!1&&o==n.sel.primIndex)continue;var u=n.sel.ranges[o];if(u.from().line>=e.display.viewTo||u.to().line<e.display.viewFrom)continue;var a=u.empty();(a||e.options.showCursorWhenSelecting)&&Ai(e,u.head,i),a||Oi(e,u,s)}return r}function Ai(e,t,n){var r=pi(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(C("div"," ","CodeMirror-cursor"));i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px";if(r.other){var s=n.appendChild(C("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=r.other.left+"px",s.style.top=r.other.top+"px",s.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Oi(e,t,n){function f(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),s.appendChild(C("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n                             top: "+t+"px; width: "+(n==null?a-e:n)+"px;\n                             height: "+(r-t)+"px"))}function l(t,n,r){function h(n,r){return hi(e,ht(t,n),"div",s,r)}var s=it(i,t),o=s.text.length,l,c;return Yt(cn(s),n||0,r==null?o:r,function(e,t,i){var s=h(e,"left"),p,d,v;if(e==t)p=s,d=v=s.left;else{p=h(t-1,"right");if(i=="rtl"){var m=s;s=p,p=m}d=s.left,v=p.right}n==null&&e==0&&(d=u),p.top-s.top>3&&(f(d,s.top,null,s.bottom),d=u,s.bottom<p.top&&f(d,s.bottom,null,p.top)),r==null&&t==o&&(v=a);if(!l||s.top<l.top||s.top==l.top&&s.left<l.left)l=s;if(!c||p.bottom>c.bottom||p.bottom==c.bottom&&p.right>c.right)c=p;d<u+1&&(d=u),f(d,p.top,v-d,p.bottom)}),{start:l,end:c}}var r=e.display,i=e.doc,s=document.createDocumentFragment(),o=zr(e.display),u=o.left,a=Math.max(r.sizerWidth,Xr(e)-r.sizer.offsetLeft)-o.right,c=t.from(),h=t.to();if(c.line==h.line)l(c.line,c.ch,h.ch);else{var p=it(i,c.line),d=it(i,h.line),v=zt(p)==zt(d),m=l(c.line,c.ch,v?p.text.length+1:null).end,g=l(h.line,v?0:null,h.ch).start;v&&(m.top<g.top-2?(f(m.right,m.top,null,m.bottom),f(u,g.top,g.left,g.bottom)):f(m.right,m.top,g.left-m.right,m.bottom)),m.bottom<g.top&&f(u,m.bottom,null,g.top)}n.appendChild(s)}function Mi(e){if(!e.state.focused)return;var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}function _i(e){e.state.focused||(e.display.input.focus(),Pi(e))}function Di(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Hi(e))},100)}function Pi(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1);if(e.options.readOnly=="nocursor")return;e.state.focused||(mn(e,"focus",e,t),e.state.focused=!0,O(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),u&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Mi(e)}function Hi(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(mn(e,"blur",e,t),e.state.focused=!1,x(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Bi(e){var t=e.display,n=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;var r=Si(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,s=r+"px";for(var o=0;o<n.length;o++)if(!n[o].hidden){e.options.fixedGutter&&(n[o].gutter&&(n[o].gutter.style.left=s),n[o].gutterBackground&&(n[o].gutterBackground.style.left=s));var u=n[o].alignable;if(u)for(var a=0;a<u.length;a++)u[a].style.left=s}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}function ji(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=ct(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(C("div",[C("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),s=i.firstChild.offsetWidth,o=i.offsetWidth-s;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(s,r.lineGutter.offsetWidth-o)+1,r.lineNumWidth=r.lineNumInnerWidth+o,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Hs(e),!0}return!1}function Fi(e){var t=e.display,n=t.lineDiv.offsetTop;for(var r=0;r<t.view.length;r++){var i=t.view[r],u=void 0;if(i.hidden)continue;if(s&&o<8){var a=i.node.offsetTop+i.node.offsetHeight;u=a-n,n=a}else{var f=i.node.getBoundingClientRect();u=f.bottom-f.top}var l=i.line.height-u;u<2&&(u=bi(t));if(l>.001||l<-0.001){ut(i.line,u),Ii(i.line);if(i.rest)for(var c=0;c<i.rest.length;c++)Ii(i.rest[c])}}}function Ii(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.parentNode.offsetHeight}function qi(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Rr(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,s=ft(t,r),o=ft(t,i);if(n&&n.ensure){var u=n.ensure.from.line,a=n.ensure.to.line;u<s?(s=u,o=ft(t,Kt(it(t,u))+e.wrapper.clientHeight)):Math.min(a,t.lastLine())>=o&&(s=ft(t,Kt(it(t,a))-e.wrapper.clientHeight),o=a)}return{from:s,to:Math.max(o,s+1)}}function Ri(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;e.doc.scrollTop=t,n||Ds(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),n&&Ds(e),ks(e,100)}function Ui(e,t,n){if(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)return;t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,Bi(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function Xi(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function Vi(e){var t=Xi(e);return t.x*=Wi,t.y*=Wi,t}function $i(e,t){var r=Xi(t),i=r.x,s=r.y,o=e.display,a=o.scroller,f=a.scrollWidth>a.clientWidth,c=a.scrollHeight>a.clientHeight;if(!(i&&f||s&&c))return;if(s&&m&&u)e:for(var h=t.target,p=o.view;h!=a;h=h.parentNode)for(var d=0;d<p.length;d++)if(p[d].node==h){e.display.currentWheelTarget=h;break e}if(i&&!n&&!l&&Wi!=null){s&&c&&Ri(e,Math.max(0,Math.min(a.scrollTop+s*Wi,a.scrollHeight-a.clientHeight))),Ui(e,Math.max(0,Math.min(a.scrollLeft+i*Wi,a.scrollWidth-a.clientWidth))),(!s||s&&c)&&En(t),o.wheelStartX=null;return}if(s&&Wi!=null){var v=s*Wi,g=e.doc.scrollTop,y=g+o.wrapper.clientHeight;v<0?g=Math.max(0,g+v-50):y=Math.min(e.doc.height,y+v+50),Ds(e,{top:g,bottom:y})}zi<20&&(o.wheelStartX==null?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=i,o.wheelDY=s,setTimeout(function(){if(o.wheelStartX==null)return;var e=a.scrollLeft-o.wheelStartX,t=a.scrollTop-o.wheelStartY,n=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null;if(!n)return;Wi=(Wi*zi+n)/(zi+1),++zi},200)):(o.wheelDX+=i,o.wheelDY+=s))}function Ji(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Ur(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Wr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function Ki(e,t,n){this.cm=n;var r=this.vert=C("div",[C("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=C("div",[C("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(r),e(i),pn(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),pn(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,s&&o<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function Qi(){}function Gi(e,t){t||(t=Ji(e));var n=e.display.barWidth,r=e.display.barHeight;Yi(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Fi(e),Yi(e,Ji(e)),n=e.display.barWidth,r=e.display.barHeight}function Yi(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}function es(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&x(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Zi[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),pn(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?Ui(e,t):Ri(e,t)},e),e.display.scrollbars.addClass&&O(e.display.wrapper,e.display.scrollbars.addClass)}function ts(e,t){if(gn(e,"scrollCursorIntoView"))return;var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1);if(i!=null&&!p){var s=C("div","​",null,"position: absolute;\n                         top: "+(t.top-n.viewOffset-Rr(e.display))+"px;\n                         height: "+(t.bottom-t.top+Wr(e)+n.barHeight)+"px;\n                         left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(s),s.scrollIntoView(i),e.display.lineSpace.removeChild(s)}}function ns(e,t,n,r){r==null&&(r=0);var i;for(var s=0;s<5;s++){var o=!1;i=pi(e,t);var u=!n||n==t?i:pi(e,n),a=is(e,Math.min(i.left,u.left),Math.min(i.top,u.top)-r,Math.max(i.left,u.left),Math.max(i.bottom,u.bottom)+r),f=e.doc.scrollTop,l=e.doc.scrollLeft;a.scrollTop!=null&&(Ri(e,a.scrollTop),Math.abs(e.doc.scrollTop-f)>1&&(o=!0)),a.scrollLeft!=null&&(Ui(e,a.scrollLeft),Math.abs(e.doc.scrollLeft-l)>1&&(o=!0));if(!o)break}return i}function rs(e,t,n,r,i){var s=is(e,t,n,r,i);s.scrollTop!=null&&Ri(e,s.scrollTop),s.scrollLeft!=null&&Ui(e,s.scrollLeft)}function is(e,t,n,r,i){var s=e.display,o=bi(e.display);n<0&&(n=0);var u=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:s.scroller.scrollTop,a=Vr(e),f={};i-n>a&&(i=n+a);var l=e.doc.height+Ur(s),c=n<o,h=i>l-o;if(n<u)f.scrollTop=c?0:n;else if(i>u+a){var p=Math.min(n,(h?l:i)-a);p!=u&&(f.scrollTop=p)}var d=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:s.scroller.scrollLeft,v=Xr(e)-(e.options.fixedGutter?s.gutters.offsetWidth:0),m=r-t>v;return m&&(r=t+v),t<10?f.scrollLeft=0:t<d?f.scrollLeft=Math.max(0,t-(m?0:10)):r>v+d-3&&(f.scrollLeft=r+(m?0:10)-v),f}function ss(e,t,n){(t!=null||n!=null)&&us(e),t!=null&&(e.curOp.scrollLeft=(e.curOp.scrollLeft==null?e.doc.scrollLeft:e.curOp.scrollLeft)+t),n!=null&&(e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+n)}function os(e){us(e);var t=e.getCursor(),n=t,r=t;e.options.lineWrapping||(n=t.ch?ht(t.line,t.ch-1):t,r=ht(t.line,t.ch+1)),e.curOp.scrollToPos={from:n,to:r,margin:e.options.cursorScrollMargin,isCursor:!0}}function us(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=di(e,t.from),r=di(e,t.to),i=is(e,Math.min(n.left,r.left),Math.min(n.top,r.top)-t.margin,Math.max(n.right,r.right),Math.max(n.bottom,r.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function fs(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++as},Er(e.curOp)}function ls(e){var t=e.curOp;xr(t,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;cs(e)})}function cs(e){var t=e.ops;for(var n=0;n<t.length;n++)hs(t[n]);for(var r=0;r<t.length;r++)ps(t[r]);for(var i=0;i<t.length;i++)ds(t[i]);for(var s=0;s<t.length;s++)vs(t[s]);for(var o=0;o<t.length;o++)ms(t[o])}function hs(e){var t=e.cm,n=t.display;Os(t),e.updateMaxLine&&Gt(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new As(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function ps(e){e.updatedDisplay=e.mustUpdate&&Ms(e.cm,e.update)}function ds(e){var t=e.cm,n=t.display;e.updatedDisplay&&Fi(t),e.barMeasure=Ji(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Qr(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Wr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Xr(t)));if(e.updatedDisplay||e.selectionChanged)e.preparedSelection=n.input.prepareSelection(e.focus)}function vs(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Ui(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==A()&&(!document.hasFocus||document.hasFocus());e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Gi(t,e.barMeasure),e.updatedDisplay&&Bs(t,e.barMeasure),e.selectionChanged&&Mi(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&_i(e.cm)}function ms(e){var t=e.cm,n=t.display,r=t.doc;e.updatedDisplay&&_s(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&(n.scroller.scrollTop!=e.scrollTop||e.forceScroll)&&(r.scrollTop=Math.max(0,Math.min(n.scroller.scrollHeight-n.scroller.clientHeight,e.scrollTop)),n.scrollbars.setScrollTop(r.scrollTop),n.scroller.scrollTop=r.scrollTop),e.scrollLeft!=null&&(n.scroller.scrollLeft!=e.scrollLeft||e.forceScroll)&&(r.scrollLeft=Math.max(0,Math.min(n.scroller.scrollWidth-n.scroller.clientWidth,e.scrollLeft)),n.scrollbars.setScrollLeft(r.scrollLeft),n.scroller.scrollLeft=r.scrollLeft,Bi(t));if(e.scrollToPos){var i=ns(t,yt(r,e.scrollToPos.from),yt(r,e.scrollToPos.to),e.scrollToPos.margin);e.scrollToPos.isCursor&&t.state.focused&&ts(t,i)}var s=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(s)for(var u=0;u<s.length;++u)s[u].lines.length||mn(s[u],"hide");if(o)for(var a=0;a<o.length;++a)o[a].lines.length&&mn(o[a],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&mn(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function gs(e,t){if(e.curOp)return t();fs(e);try{return t()}finally{ls(e)}}function ys(e,t){return function(){if(e.curOp)return t.apply(e,arguments);fs(e);try{return t.apply(e,arguments)}finally{ls(e)}}}function bs(e){return function(){if(this.curOp)return e.apply(this,arguments);fs(this);try{return e.apply(this,arguments)}finally{ls(this)}}}function ws(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);fs(t);try{return e.apply(this,arguments)}finally{ls(t)}}}function Es(e,t,n,r){t==null&&(t=e.doc.first),n==null&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;r&&n<i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0;if(t>=i.viewTo)St&&Xt(e.doc,t)<i.viewTo&&xs(e);else if(n<=i.viewFrom)St&&Vt(e.doc,n+r)>i.viewFrom?xs(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)xs(e);else if(t<=i.viewFrom){var s=Ts(e,n,n+r,1);s?(i.view=i.view.slice(s.index),i.viewFrom=s.lineN,i.viewTo+=r):xs(e)}else if(n>=i.viewTo){var o=Ts(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):xs(e)}else{var u=Ts(e,t,t,-1),a=Ts(e,n,n+r,1);u&&a?(i.view=i.view.slice(0,u.index).concat(br(e,u.lineN,a.lineN)).concat(i.view.slice(a.index)),i.viewTo+=r):xs(e)}var f=i.externalMeasured;f&&(n<f.lineN?f.lineN+=r:t<f.lineN+f.size&&(i.externalMeasured=null))}function Ss(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null);if(t<r.viewFrom||t>=r.viewTo)return;var s=r.view[Ci(e,t)];if(s.node==null)return;var o=s.changes||(s.changes=[]);j(o,n)==-1&&o.push(n)}function xs(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ts(e,t,n,r){var i=Ci(e,t),s,o=e.display.view;if(!St||n==e.doc.first+e.doc.size)return{index:i,lineN:n};var u=e.display.viewFrom;for(var a=0;a<i;a++)u+=o[a].size;if(u!=t){if(r>0){if(i==o.length-1)return null;s=u+o[i].size-t,i++}else s=u-t;t+=s,n+=s}while(Xt(e.doc,n)!=n){if(i==(r<0?0:o.length-1))return null;n+=r*o[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function Ns(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=br(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=br(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Ci(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(br(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Ci(e,n)))),r.viewTo=n}function Cs(e){var t=e.display.view,n=0;for(var r=0;r<t.length;r++){var i=t[r];!i.hidden&&(!i.node||i.changes)&&++n}return n}function ks(e,t){e.doc.mode.startState&&e.doc.frontier<e.display.viewTo&&e.state.highlight.set(t,D(Ls,e))}function Ls(e){var t=e.doc;t.frontier<t.first&&(t.frontier=t.first);if(t.frontier>=e.display.viewTo)return;var n=+(new Date)+e.options.workTime,r=Xn(t.mode,Gn(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(s){if(t.frontier>=e.display.viewFrom){var o=s.styles,u=s.text.length>e.options.maxHighlightLength,a=Kn(e,s,u?Xn(t.mode,r):r,!0);s.styles=a.styles;var f=s.styleClasses,l=a.classes;l?s.styleClasses=l:f&&(s.styleClasses=null);var c=!o||o.length!=s.styles.length||f!=l&&(!f||!l||f.bgClass!=l.bgClass||f.textClass!=l.textClass);for(var h=0;!c&&h<o.length;++h)c=o[h]!=s.styles[h];c&&i.push(t.frontier),s.stateAfter=u?r:Xn(t.mode,r)}else s.text.length<=e.options.maxHighlightLength&&Yn(e,s.text,r),s.stateAfter=t.frontier%5==0?Xn(t.mode,r):null;++t.frontier;if(+(new Date)>n)return ks(e,e.options.workDelay),!0}),i.length&&gs(e,function(){for(var t=0;t<i.length;t++)Ss(e,i[t],"text")})}function As(e,t,n){var r=e.display;this.viewport=t,this.visible=qi(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Xr(e),this.force=n,this.dims=Ei(e),this.events=[]}function Os(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Wr(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Wr(e)+"px",t.scrollbarsClipped=!0)}function Ms(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return xs(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&Cs(e)==0)return!1;ji(e)&&(xs(e),t.dims=Ei(e));var i=r.first+r.size,s=Math.max(t.visible.from-e.options.viewportMargin,r.first),o=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<s&&s-n.viewFrom<20&&(s=Math.max(r.first,n.viewFrom)),n.viewTo>o&&n.viewTo-o<20&&(o=Math.min(i,n.viewTo)),St&&(s=Xt(e.doc,s),o=Vt(e.doc,o));var u=s!=n.viewFrom||o!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Ns(e,s,o),n.viewOffset=Kt(it(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var a=Cs(e);if(!u&&a==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var f=A();return a>4&&(n.lineDiv.style.display="none"),Ps(e,n.updateLineNumbers,t.dims),a>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,f&&A()!=f&&f.offsetHeight&&f.focus(),T(n.cursorDiv),T(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,u&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,ks(e,400)),n.updateLineNumbers=null,!0}function _s(e,t){var n=t.viewport;for(var r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==Xr(e)){n&&n.top!=null&&(n={top:Math.min(e.doc.height+Ur(e.display)-Vr(e),n.top)}),t.visible=qi(e.display,e.doc,n);if(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}if(!Ms(e,t))break;Fi(e);var i=Ji(e);ki(e),Gi(e,i),Bs(e,i)}t.signal(e,"update",e);if(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo}function Ds(e,t){var n=new As(e,t);if(Ms(e,n)){Fi(e),_s(e,n);var r=Ji(e);ki(e),Gi(e,r),Bs(e,r),n.finish()}}function Ps(e,t,n){function a(t){var n=t.nextSibling;return u&&m&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}var r=e.display,i=e.options.lineNumbers,s=r.lineDiv,o=s.firstChild,f=r.view,l=r.viewFrom;for(var c=0;c<f.length;c++){var h=f[c];if(!h.hidden)if(!h.node||h.node.parentNode!=s){var p=Hr(e,h,l,n);s.insertBefore(p,o)}else{while(o!=h.node)o=a(o);var d=i&&t!=null&&t<=l&&h.lineNumber;h.changes&&(j(h.changes,"gutter")>-1&&(d=!1),kr(e,h,l,n)),d&&(T(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(ct(e.options,l)))),o=h.node.nextSibling}l+=h.size}while(o)o=a(o)}function Hs(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function Bs(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Wr(e)+"px"}function js(e){var t=e.display.gutters,n=e.options.gutters;T(t);var r=0;for(;r<n.length;++r){var i=n[r],s=t.appendChild(C("div",null,"CodeMirror-gutter "+i));i=="CodeMirror-linenumbers"&&(e.display.lineGutter=s,s.style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=r?"":"none",Hs(e)}function Fs(e){var t=j(e.gutters,"CodeMirror-linenumbers");t==-1&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function Is(e,t){this.ranges=e,this.primIndex=t}function qs(e,t){this.anchor=e,this.head=t}function Rs(e,t){var n=e[t];e.sort(function(e,t){return pt(e.from(),t.from())}),t=j(e,n);for(var r=1;r<e.length;r++){var i=e[r],s=e[r-1];if(pt(s.to(),i.from())>=0){var o=mt(s.from(),i.from()),u=vt(s.to(),i.to()),a=s.empty()?i.from()==i.head:s.from()==s.head;r<=t&&--t,e.splice(--r,2,new qs(a?u:o,a?o:u))}}return new Is(e,t)}function Us(e,t){return new Is([new qs(e,t||e)],0)}function zs(e){return e.text?ht(e.from.line+e.text.length-1,V(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Ws(e,t){if(pt(e,t.from)<0)return e;if(pt(e,t.to)<=0)return zs(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=zs(t).ch-t.to.ch),ht(n,r)}function Xs(e,t){var n=[];for(var r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new qs(Ws(i.anchor,t),Ws(i.head,t)))}return Rs(n,e.sel.primIndex)}function Vs(e,t,n){return e.line==t.line?ht(n.line,e.ch-t.ch+n.ch):ht(n.line+(e.line-t.line),e.ch)}function $s(e,t,n){var r=[],i=ht(e.first,0),s=i;for(var o=0;o<t.length;o++){var u=t[o],a=Vs(u.from,i,s),f=Vs(zs(u),i,s);i=u.to,s=f;if(n=="around"){var l=e.sel.ranges[o],c=pt(l.head,l.anchor)<0;r[o]=new qs(c?f:a,c?a:f)}else r[o]=new qs(a,a)}return new Is(r,e.sel.primIndex)}function Js(e){e.doc.mode=Un(e.options,e.doc.modeOption),Ks(e)}function Ks(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,ks(e,100),e.state.modeGen++,e.curOp&&Es(e)}function Qs(e,t){return t.from.ch==0&&t.to.ch==0&&V(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Gs(e,t,n,r){function i(e){return n?n[e]:null}function s(e,n,i){or(e,n,i,r),Nr(e,"change",e,t)}function o(e,t){var n=[];for(var s=e;s<t;++s)n.push(new sr(f[s],i(s),r));return n}var u=t.from,a=t.to,f=t.text,l=it(e,u.line),c=it(e,a.line),h=V(f),p=i(f.length-1),d=a.line-u.line;if(t.full)e.insert(0,o(0,f.length)),e.remove(f.length,e.size-f.length);else if(Qs(e,t)){var v=o(0,f.length-1);s(c,c.text,p),d&&e.remove(u.line,d),v.length&&e.insert(u.line,v)}else if(l==c)if(f.length==1)s(l,l.text.slice(0,u.ch)+h+l.text.slice(a.ch),p);else{var m=o(1,f.length-1);m.push(new sr(h+l.text.slice(a.ch),p,r)),s(l,l.text.slice(0,u.ch)+f[0],i(0)),e.insert(u.line+1,m)}else if(f.length==1)s(l,l.text.slice(0,u.ch)+f[0]+c.text.slice(a.ch),i(0)),e.remove(u.line+1,d);else{s(l,l.text.slice(0,u.ch)+f[0],i(0)),s(c,h+c.text.slice(a.ch),p);var g=o(1,f.length-1);d>1&&e.remove(u.line+1,d-1),e.insert(u.line+1,g)}Nr(e,"change",e,t)}function Ys(e,t,n){function r(e,i,s){if(e.linked)for(var o=0;o<e.linked.length;++o){var u=e.linked[o];if(u.doc==i)continue;var a=s&&u.sharedHist;if(n&&!a)continue;t(u.doc,a),r(u.doc,e,a)}}r(e,null,!0)}function Zs(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Ti(e),Js(e),e.options.lineWrapping||Gt(e),e.options.mode=t.modeOption,Es(e)}function eo(e){this.done=[],this.undone=[],this.undoDepth=Infinity,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function to(e,t){var n={from:dt(t.from),to:zs(t),text:st(e,t.from,t.to)};return ao(e,n,t.from.line,t.to.line+1),Ys(e,function(e){return ao(e,n,t.from.line,t.to.line+1)},!0),n}function no(e){while(e.length){var t=V(e);if(!t.ranges)break;e.pop()}}function ro(e,t){if(t)return no(e.done),V(e.done);if(e.done.length&&!V(e.done).ranges)return V(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),V(e.done)}function io(e,t,n,r){var i=e.history;i.undone.length=0;var s=+(new Date),o,u;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&e.cm&&i.lastModTime>s-e.cm.options.historyEventDelay||t.origin.charAt(0)=="*"))&&(o=ro(i,i.lastOp==r)))u=V(o.changes),pt(t.from,t.to)==0&&pt(t.from,u.to)==0?u.to=zs(t):o.changes.push(to(e,t));else{var a=V(i.done);(!a||!a.ranges)&&uo(e.sel,i.done),o={changes:[to(e,t)],generation:i.generation},i.done.push(o);while(i.done.length>i.undoDepth)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,u||mn(e,"historyAdded")}function so(e,t,n,r){var i=t.charAt(0);return i=="*"||i=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function oo(e,t,n,r){var i=e.history,s=r&&r.origin;n==i.lastSelOp||s&&i.lastSelOrigin==s&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==s||so(e,s,V(i.done),t))?i.done[i.done.length-1]=t:uo(t,i.done),i.lastSelTime=+(new Date),i.lastSelOrigin=s,i.lastSelOp=n,r&&r.clearRedo!==!1&&no(i.undone)}function uo(e,t){var n=V(t);n&&n.ranges&&n.equals(e)||t.push(e)}function ao(e,t,n,r){var i=t["spans_"+e.id],s=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[s]=n.markedSpans),++s})}function fo(e){if(!e)return null;var t;for(var n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function lo(e,t){var n=t["spans_"+e.id];if(!n)return null;var r=[];for(var i=0;i<t.text.length;++i)r.push(fo(n[i]));return r}function co(e,t){var n=lo(e,t),r=Mt(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var s=n[i],o=r[i];if(s&&o)e:for(var u=0;u<o.length;++u){var a=o[u];for(var f=0;f<s.length;++f)if(s[f].marker==a.marker)continue e;s.push(a)}else o&&(n[i]=o)}return n}function ho(e,t,n){var r=[];for(var i=0;i<e.length;++i){var s=e[i];if(s.ranges){r.push(n?Is.prototype.deepCopy.call(s):s);continue}var o=s.changes,u=[];r.push({changes:u});for(var a=0;a<o.length;++a){var f=o[a],l=void 0;u.push({from:f.from,to:f.to,text:f.text});if(t)for(var c in f)(l=c.match(/^spans_(\d+)$/))&&j(t,Number(l[1]))>-1&&(V(u)[c]=f[c],delete f[c])}}return r}function po(e,t,n,r){if(e.cm&&e.cm.display.shift||e.extend){var i=t.anchor;if(r){var s=pt(n,i)<0;s!=pt(r,i)<0?(i=n,n=r):s!=pt(n,r)<0&&(n=r)}return new qs(i,n)}return new qs(r||n,n)}function vo(e,t,n,r){Eo(e,new Is([po(e,e.sel.primary(),t,n)],0),r)}function mo(e,t,n){var r=[];for(var i=0;i<e.sel.ranges.length;i++)r[i]=po(e,e.sel.ranges[i],t[i],null);var s=Rs(r,e.sel.primIndex);Eo(e,s,n)}function go(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,Eo(e,Rs(i,e.sel.primIndex),r)}function yo(e,t,n,r){Eo(e,Us(t,n),r)}function bo(e,t,n){var r={ranges:t.ranges,update:function(t){var n=this;this.ranges=[];for(var r=0;r<t.length;r++)n.ranges[r]=new qs(yt(e,t[r].anchor),yt(e,t[r].head))},origin:n&&n.origin};return mn(e,"beforeSelectionChange",e,r),e.cm&&mn(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Rs(r.ranges,r.ranges.length-1):t}function wo(e,t,n){var r=e.history.done,i=V(r);i&&i.ranges?(r[r.length-1]=t,So(e,t,n)):Eo(e,t,n)}function Eo(e,t,n){So(e,t,n),oo(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function So(e,t,n){if(bn(e,"beforeSelectionChange")||e.cm&&bn(e.cm,"beforeSelectionChange"))t=bo(e,t,n);var r=n&&n.bias||(pt(t.primary().head,e.sel.primary().head)<0?-1:1);xo(e,No(e,t,r,!0)),(!n||n.scroll!==!1)&&e.cm&&os(e.cm)}function xo(e,t){if(t.equals(e.sel))return;e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,yn(e.cm)),Nr(e,"cursorActivity",e)}function To(e){xo(e,No(e,e.sel,null,!1),q)}function No(e,t,n,r){var i;for(var s=0;s<t.ranges.length;s++){var o=t.ranges[s],u=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[s],a=ko(e,o.anchor,u&&u.anchor,n,r),f=ko(e,o.head,u&&u.head,n,r);if(i||a!=o.anchor||f!=o.head)i||(i=t.ranges.slice(0,s)),i[s]=new qs(a,f)}return i?Rs(i,t.primIndex):t}function Co(e,t,n,r,i){var s=it(e,t.line);if(s.markedSpans)for(var o=0;o<s.markedSpans.length;++o){var u=s.markedSpans[o],a=u.marker;if((u.from==null||(a.inclusiveLeft?u.from<=t.ch:u.from<t.ch))&&(u.to==null||(a.inclusiveRight?u.to>=t.ch:u.to>t.ch))){if(i){mn(a,"beforeCursorEnter");if(a.explicitlyCleared){if(!s.markedSpans)break;--o;continue}}if(!a.atomic)continue;if(n){var f=a.find(r<0?1:-1),l=void 0;if(r<0?a.inclusiveRight:a.inclusiveLeft)f=Lo(e,f,-r,f&&f.line==t.line?s:null);if(f&&f.line==t.line&&(l=pt(f,n))&&(r<0?l<0:l>0))return Co(e,f,t,r,i)}var c=a.find(r<0?-1:1);if(r<0?a.inclusiveLeft:a.inclusiveRight)c=Lo(e,c,r,c.line==t.line?s:null);return c?Co(e,c,t,r,i):null}}return t}function ko(e,t,n,r,i){var s=r||1,o=Co(e,t,n,s,i)||!i&&Co(e,t,n,s,!0)||Co(e,t,n,-s,i)||!i&&Co(e,t,n,-s,!0);return o?o:(e.cantEdit=!0,ht(e.first,0))}function Lo(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?yt(e,ht(t.line-1)):null:n>0&&t.ch==(r||it(e,t.line)).text.length?t.line<e.first+e.size-1?ht(t.line+1,0):null:new ht(t.line,t.ch+n)}function Ao(e){e.setSelection(ht(e.firstLine(),0),ht(e.lastLine()),q)}function Oo(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(t,n,i,s){t&&(r.from=yt(e,t)),n&&(r.to=yt(e,n)),i&&(r.text=i),s!==undefined&&(r.origin=s)}),mn(e,"beforeChange",e,r),e.cm&&mn(e.cm,"beforeChange",e.cm,r),r.canceled?null:{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Mo(e,t,n){if(e.cm){if(!e.cm.curOp)return ys(e.cm,Mo)(e,t,n);if(e.cm.state.suppressEdits)return}if(bn(e,"beforeChange")||e.cm&&bn(e.cm,"beforeChange")){t=Oo(e,t,!0);if(!t)return}var r=Et&&!n&&Dt(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)_o(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text});else _o(e,t)}function _o(e,t){if(t.text.length==1&&t.text[0]==""&&pt(t.from,t.to)==0)return;var n=Xs(e,t);io(e,t,n,e.cm?e.cm.curOp.id:NaN),Ho(e,t,n,Mt(e,t));var r=[];Ys(e,function(e,n){!n&&j(r,e.history)==-1&&(qo(e.history,t),r.push(e.history)),Ho(e,t,null,Mt(e,t))})}function Do(e,t,n){if(e.cm&&e.cm.state.suppressEdits&&!n)return;var r=e.history,i,s=e.sel,o=t=="undo"?r.done:r.undone,u=t=="undo"?r.undone:r.done,a=0;for(;a<o.length;a++){i=o[a];if(n?i.ranges&&!i.equals(e.sel):!i.ranges)break}if(a==o.length)return;r.lastOrigin=r.lastSelOrigin=null;for(;;){i=o.pop();if(!i.ranges)break;uo(i,u);if(n&&!i.equals(e.sel)){Eo(e,i,{clearRedo:!1});return}s=i}var f=[];uo(s,u),u.push({changes:f,generation:r.generation}),r.generation=i.generation||++r.maxGeneration;var l=bn(e,"beforeChange")||e.cm&&bn(e.cm,"beforeChange"),c=function(n){var r=i.changes[n];r.origin=t;if(l&&!Oo(e,r,!1))return o.length=0,{};f.push(to(e,r));var s=n?Xs(e,r):V(o);Ho(e,r,s,co(e,r)),!n&&e.cm&&e.cm.scrollIntoView({from:r.from,to:zs(r)});var u=[];Ys(e,function(e,t){!t&&j(u,e.history)==-1&&(qo(e.history,r),u.push(e.history)),Ho(e,r,null,co(e,r))})};for(var h=i.changes.length-1;h>=0;--h){var p=c(h);if(p)return p.v}}function Po(e,t){if(t==0)return;e.first+=t,e.sel=new Is($(e.sel.ranges,function(e){return new qs(ht(e.anchor.line+t,e.anchor.ch),ht(e.head.line+t,e.head.ch))}),e.sel.primIndex);if(e.cm){Es(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)Ss(e.cm,r,"gutter")}}function Ho(e,t,n,r){if(e.cm&&!e.cm.curOp)return ys(e.cm,Ho)(e,t,n,r);if(t.to.line<e.first){Po(e,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>e.lastLine())return;if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);Po(e,i),t={from:ht(e.first,0),to:ht(t.to.line+i,t.to.ch),text:[V(t.text)],origin:t.origin}}var s=e.lastLine();t.to.line>s&&(t={from:t.from,to:ht(s,it(e,s).text.length),text:[t.text[0]],origin:t.origin}),t.removed=st(e,t.from,t.to),n||(n=Xs(e,t)),e.cm?Bo(e.cm,t,r):Gs(e,t,r),So(e,n,q)}function Bo(e,t,n){var r=e.doc,i=e.display,s=t.from,o=t.to,u=!1,a=s.line;e.options.lineWrapping||(a=at(zt(it(r,s.line))),r.iter(a,o.line+1,function(e){if(e==i.maxLine)return u=!0,!0})),r.sel.contains(t.from,t.to)>-1&&yn(e),Gs(r,t,n,xi(e)),e.options.lineWrapping||(r.iter(a,s.line+t.text.length,function(e){var t=Qt(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,u=!1)}),u&&(e.curOp.updateMaxLine=!0)),r.frontier=Math.min(r.frontier,s.line),ks(e,400);var f=t.text.length-(o.line-s.line)-1;t.full?Es(e):s.line==o.line&&t.text.length==1&&!Qs(e.doc,t)?Ss(e,s.line,"text"):Es(e,s.line,o.line+1,f);var l=bn(e,"changes"),c=bn(e,"change");if(c||l){var h={from:s,to:o,text:t.text,removed:t.removed,origin:t.origin};c&&Nr(e,"change",e,h),l&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}function jo(e,t,n,r,i){r||(r=n);if(pt(r,n)<0){var s=r;r=n,n=s}typeof t=="string"&&(t=e.splitLines(t)),Mo(e,{from:n,to:r,text:t,origin:i})}function Fo(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function Io(e,t,n,r){for(var i=0;i<e.length;++i){var s=e[i],o=!0;if(s.ranges){s.copied||(s=e[i]=s.deepCopy(),s.copied=!0);for(var u=0;u<s.ranges.length;u++)Fo(s.ranges[u].anchor,t,n,r),Fo(s.ranges[u].head,t,n,r);continue}for(var a=0;a<s.changes.length;++a){var f=s.changes[a];if(n<f.from.line)f.from=ht(f.from.line+r,f.from.ch),f.to=ht(f.to.line+r,f.to.ch);else if(t<=f.to.line){o=!1;break}}o||(e.splice(0,i+1),i=0)}}function qo(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;Io(e.done,n,r,i),Io(e.undone,n,r,i)}function Ro(e,t,n,r){var i=t,s=t;return typeof t=="number"?s=it(e,gt(e,t)):i=at(t),i==null?null:(r(s,i)&&e.cm&&Ss(e.cm,i,n),s)}function Uo(e){var t=this;this.lines=e,this.parent=null;var n=0;for(var r=0;r<e.length;++r)e[r].parent=t,n+=e[r].height;this.height=n}function zo(e){var t=this;this.children=e;var n=0,r=0;for(var i=0;i<e.length;++i){var s=e[i];n+=s.chunkSize(),r+=s.height,s.parent=t}this.size=n,this.height=r,this.parent=null}function Wo(e,t,n){var r=this;if(n)for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i]);this.doc=e,this.node=t}function Xo(e,t,n){Kt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&ss(e,null,n)}function Vo(e,t,n,r){var i=new Wo(e,n,r),s=e.cm;return s&&i.noHScroll&&(s.display.alignWidgets=!0),Ro(e,t,"widget",function(t){var n=t.widgets||(t.widgets=[]);i.insertAt==null?n.push(i):n.splice(Math.min(n.length-1,Math.max(0,i.insertAt)),0,i),i.line=t;if(s&&!$t(e,t)){var r=Kt(t)<e.scrollTop;ut(t,t.height+Ir(i)),r&&ss(s,null,i.height),s.curOp.forceUpdate=!0}return!0}),i}function Jo(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++$o}function Ko(e,t,n,r,i){if(r&&r.shared)return Go(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return ys(e.cm,Ko)(e,t,n,r,i);var s=new Jo(e,i),o=pt(t,n);r&&P(r,s,!1);if(o>0||o==0&&s.clearWhenEmpty!==!1)return s;s.replacedWith&&(s.collapsed=!0,s.widgetNode=C("span",[s.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||s.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(s.widgetNode.insertLeft=!0));if(s.collapsed){if(Ut(e,t.line,t,n,s)||t.line!=n.line&&Ut(e,n.line,t,n,s))throw new Error("Inserting collapsed marker partially overlapping an existing one");Tt()}s.addToHistory&&io(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var u=t.line,a=e.cm,f;e.iter(u,n.line+1,function(e){a&&s.collapsed&&!a.options.lineWrapping&&zt(e)==a.display.maxLine&&(f=!0),s.collapsed&&u!=t.line&&ut(e,0),Lt(e,new Nt(s,u==t.line?t.ch:null,u==n.line?n.ch:null)),++u}),s.collapsed&&e.iter(t.line,n.line+1,function(t){$t(e,t)&&ut(t,0)}),s.clearOnEnter&&pn(s,"beforeCursorEnter",function(){return s.clear()}),s.readOnly&&(xt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),s.collapsed&&(s.id=++$o,s.atomic=!0);if(a){f&&(a.curOp.updateMaxLine=!0);if(s.collapsed)Es(a,t.line,n.line+1);else if(s.className||s.title||s.startStyle||s.endStyle||s.css)for(var l=t.line;l<=n.line;l++)Ss(a,l,"text");s.atomic&&To(a.doc),Nr(a,"markerAdded",a,s)}return s}function Qo(e,t){var n=this;this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=n}function Go(e,t,n,r,i){r=P(r),r.shared=!1;var s=[Ko(e,t,n,r,i)],o=s[0],u=r.widgetNode;return Ys(e,function(e){u&&(r.widgetNode=u.cloneNode(!0)),s.push(Ko(e,yt(e,t),yt(e,n),r,i));for(var a=0;a<e.linked.length;++a)if(e.linked[a].isParent)return;o=V(s)}),new Qo(s,o)}function Yo(e){return e.findMarks(ht(e.first,0),e.clipPos(ht(e.lastLine())),function(e){return e.parent})}function Zo(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),s=e.clipPos(i.from),o=e.clipPos(i.to);if(pt(s,o)){var u=Ko(e,s,o,r.primary,r.primary.type);r.markers.push(u),u.parent=r}}}function eu(e){var t=function(t){var n=e[t],r=[n.primary.doc];Ys(n.primary.doc,function(e){return r.push(e)});for(var i=0;i<n.markers.length;i++){var s=n.markers[i];j(r,s.doc)==-1&&(s.parent=null,n.markers.splice(i--,1))}};for(var n=0;n<e.length;n++)t(n)}function iu(e){var t=this;uu(t);if(gn(t,e)||qr(t.display,e))return;En(e),s&&(ru=+(new Date));var n=Ni(t,e,!0),r=e.dataTransfer.files;if(!n||t.isReadOnly())return;if(r&&r.length&&window.FileReader&&window.File){var i=r.length,o=Array(i),u=0,a=function(e,r){if(t.options.allowDropFileTypes&&j(t.options.allowDropFileTypes,e.type)==-1)return;var s=new FileReader;s.onload=ys(t,function(){var e=s.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[r]=e;if(++u==i){n=yt(t.doc,n);var a={from:n,to:n,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};Mo(t.doc,a),wo(t.doc,Us(n,zs(a)))}}),s.readAsText(e)};for(var f=0;f<i;++f)a(r[f],f)}else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var l=e.dataTransfer.getData("Text");if(l){var c;t.state.draggingText&&!t.state.draggingText.copy&&(c=t.listSelections()),So(t.doc,Us(n,n));if(c)for(var h=0;h<c.length;++h)jo(t.doc,"",c[h].anchor,c[h].head,"drag");t.replaceSelection(l,"around","paste"),t.display.input.focus()}}catch(e){}}}function su(e,t){if(s&&(!e.state.draggingText||+(new Date)-ru<100)){Tn(t);return}if(gn(e,t)||qr(e.display,t))return;t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove";if(t.dataTransfer.setDragImage&&!c){var n=C("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",l&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),l&&n.parentNode.removeChild(n)}}function ou(e,t){var n=Ni(e,t);if(!n)return;var r=document.createDocumentFragment();Ai(e,n,r),e.display.dragCursor||(e.display.dragCursor=C("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),N(e.display.dragCursor,r)}function uu(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function au(e){if(!document.body.getElementsByClassName)return;var t=document.body.getElementsByClassName("CodeMirror");for(var n=0;n<t.length;n++){var r=t[n].CodeMirror;r&&e(r)}}function lu(){if(fu)return;cu(),fu=!0}function cu(){var e;pn(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,au(hu)},100))}),pn(window,"blur",function(){return au(Hi)})}function hu(e){var t=e.display;if(t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth)return;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}function yu(e){var t=e.split(/-(?!$)/);e=t[t.length-1];var n,r,i,s;for(var o=0;o<t.length-1;o++){var u=t[o];if(/^(cmd|meta|m)$/i.test(u))s=!0;else if(/^a(lt)?$/i.test(u))n=!0;else if(/^(c|ctrl|control)$/i.test(u))r=!0;else{if(!/^s(hift)?$/i.test(u))throw new Error("Unrecognized modifier name: "+u);i=!0}}return n&&(e="Alt-"+e),r&&(e="Ctrl-"+e),s&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function bu(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if(r=="..."){delete e[n];continue}var i=$(n.split(" "),yu);for(var s=0;s<i.length;s++){var o=void 0,u=void 0;s==i.length-1?(u=i.join(" "),o=r):(u=i.slice(0,s+1).join(" "),o="...");var a=t[u];if(!a)t[u]=o;else if(a!=o)throw new Error("Inconsistent bindings for "+u)}delete e[n]}for(var f in t)e[f]=t[f];return e}function wu(e,t,n,r){t=xu(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return"nothing";if(i==="...")return"multi";if(i!=null&&n(i))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return wu(e,t.fallthrough,n,r);for(var s=0;s<t.fallthrough.length;s++){var o=wu(e,t.fallthrough[s],n,r);if(o)return o}}}function Eu(e){var t=typeof e=="string"?e:pu[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Su(e,t){if(l&&e.keyCode==34&&e["char"])return!1;var n=pu[e.keyCode],r=n;return r==null||e.altGraphKey?!1:(e.altKey&&n!="Alt"&&(r="Alt-"+r),(w?e.metaKey:e.ctrlKey)&&n!="Ctrl"&&(r="Ctrl-"+r),(w?e.ctrlKey:e.metaKey)&&n!="Cmd"&&(r="Cmd-"+r),!t&&e.shiftKey&&n!="Shift"&&(r="Shift-"+r),r)}function xu(e){return typeof e=="string"?gu[e]:e}function Tu(e,t){var n=e.doc.sel.ranges,r=[];for(var i=0;i<n.length;i++){var s=t(n[i]);while(r.length&&pt(s.from,V(r).to)<=0){var o=r.pop();if(pt(o.from,s.from)<0){s.from=o.from;break}}r.push(s)}gs(e,function(){for(var t=r.length-1;t>=0;t--)jo(e.doc,"",r[t].from,r[t].to,"+delete");os(e)})}function Cu(e,t){var n=it(e.doc,t),r=zt(n);r!=n&&(t=at(r));var i=cn(r),s=i?i[0].level%2?nn(r):tn(r):0;return ht(t,s)}function ku(e,t){var n,r=it(e.doc,t);while(n=Rt(r))r=n.find(1,!0).line,t=null;var i=cn(r),s=i?i[0].level%2?tn(r):nn(r):r.text.length;return ht(t==null?at(r):t,s)}function Lu(e,t){var n=Cu(e,t.line),r=it(e.doc,n.line),i=cn(r);if(!i||i[0].level==0){var s=Math.max(0,r.text.search(/\S/)),o=t.line==n.line&&t.ch<=s&&t.ch;return ht(n.line,o?0:s)}return n}function Au(e,t,n){if(typeof t=="string"){t=Nu[t];if(!t)return!1}e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=I}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function Ou(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=wu(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&wu(t,e.options.extraKeys,n,e)||wu(t,e.options.keyMap,n,e)}function _u(e,t,n,r){var i=e.state.keySeq;if(i){if(Eu(t))return"handled";Mu.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),t=i+" "+t}var s=Ou(e,t,r);s=="multi"&&(e.state.keySeq=t),s=="handled"&&Nr(e,"keyHandled",e,t,n);if(s=="handled"||s=="multi")En(n),Mi(e);return i&&!s&&/\'$/.test(t)?(En(n),!0):!!s}function Du(e,t){var n=Su(t,!0);return n?t.shiftKey&&!e.state.keySeq?_u(e,"Shift-"+n,t,function(t){return Au(e,t,!0)})||_u(e,n,t,function(t){if(typeof t=="string"?/^go[A-Z]/.test(t):t.motion)return Au(e,t)}):_u(e,n,t,function(t){return Au(e,t)}):!1}function Pu(e,t,n){return _u(e,"'"+n+"'",t,function(t){return Au(e,t,!0)})}function Bu(e){var t=this;t.curOp.focus=A();if(gn(t,e))return;s&&o<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var r=Du(t,e);l&&(Hu=r?n:null,!r&&n==88&&!Pn&&(m?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&ju(t)}function ju(e){function n(e){if(e.keyCode==18||!e.altKey)x(t,"CodeMirror-crosshair"),vn(document,"keyup",n),vn(document,"mouseover",n)}var t=e.display.lineDiv;O(t,"CodeMirror-crosshair"),pn(document,"keyup",n),pn(document,"mouseover",n)}function Fu(e){e.keyCode==16&&(this.doc.sel.shift=!1),gn(this,e)}function Iu(e){var t=this;if(qr(t.display,e)||gn(t,e)||e.ctrlKey&&!e.altKey||m&&e.metaKey)return;var n=e.keyCode,r=e.charCode;if(l&&n==Hu){Hu=null,En(e);return}if(l&&(!e.which||e.which<10)&&Du(t,e))return;var i=String.fromCharCode(r==null?n:r);if(i=="\b")return;if(Pu(t,e,i))return;t.display.input.onKeyPress(e)}function qu(e){var t=this,n=t.display;if(gn(t,e)||n.activeTouch&&n.input.supportsTouch())return;n.input.ensurePolled(),n.shift=e.shiftKey;if(qr(n,e)){u||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if($u(t,e))return;var r=Ni(t,e);window.focus();switch(Cn(e)){case 1:t.state.selectingText?t.state.selectingText(e):r?zu(t,e,r):Nn(e)==n.scroller&&En(e);break;case 2:u&&(t.state.lastMiddleDown=+(new Date)),r&&vo(t.doc,r),setTimeout(function(){return n.input.focus()},20),En(e);break;case 3:E?Ju(t,e):Di(t)}}function zu(e,t,n){s?setTimeout(D(_i,e),0):e.curOp.focus=A();var r=+(new Date),i;Uu&&Uu.time>r-400&&pt(Uu.pos,n)==0?i="triple":Ru&&Ru.time>r-400&&pt(Ru.pos,n)==0?(i="double",Uu={time:r,pos:n}):(i="single",Ru={time:r,pos:n});var o=e.doc.sel,u=m?t.metaKey:t.ctrlKey,a;e.options.dragDrop&&kn&&!e.isReadOnly()&&i=="single"&&(a=o.contains(n))>-1&&(pt((a=o.ranges[a]).from(),n)<0||n.xRel>0)&&(pt(a.to(),n)>0||n.xRel<0)?Wu(e,t,n,u):Xu(e,t,n,i,u)}function Wu(e,t,n,r){var i=e.display,a=+(new Date),f=ys(e,function(l){u&&(i.scroller.draggable=!1),e.state.draggingText=!1,vn(document,"mouseup",f),vn(i.scroller,"drop",f),Math.abs(t.clientX-l.clientX)+Math.abs(t.clientY-l.clientY)<10&&(En(l),!r&&+(new Date)-200<a&&vo(e.doc,n),u||s&&o==9?setTimeout(function(){document.body.focus(),i.input.focus()},20):i.input.focus())});u&&(i.scroller.draggable=!0),e.state.draggingText=f,f.copy=m?t.altKey:t.ctrlKey,i.scroller.dragDrop&&i.scroller.dragDrop(),pn(document,"mouseup",f),pn(i.scroller,"drop",f)}function Xu(e,t,n,r,i){function d(t){if(pt(p,t)==0)return;p=t;if(r=="rect"){var i=[],s=e.options.tabSize,l=H(it(o,n.line).text,n.ch,s),c=H(it(o,t.line).text,t.ch,s),h=Math.min(l,c),d=Math.max(l,c);for(var v=Math.min(n.line,t.line),m=Math.min(e.lastLine(),Math.max(n.line,t.line));v<=m;v++){var g=it(o,v).text,y=z(g,h,s);h==d?i.push(new qs(ht(v,y),ht(v,y))):g.length>y&&i.push(new qs(ht(v,y),ht(v,z(g,d,s))))}i.length||i.push(new qs(n,n)),Eo(o,Rs(f.ranges.slice(0,a).concat(i),a),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b=u,w=b.anchor,E=t;if(r!="single"){var S;r=="double"?S=e.findWordAt(t):S=new qs(ht(t.line,0),yt(o,ht(t.line+1,0))),pt(S.anchor,w)>0?(E=S.head,w=mt(b.from(),S.anchor)):(E=S.anchor,w=vt(b.to(),S.head))}var x=f.ranges.slice(0);x[a]=new qs(yt(o,w),E),Eo(o,Rs(x,a),R)}}function y(t){var n=++m,i=Ni(e,t,!0,r=="rect");if(!i)return;if(pt(i,p)!=0){e.curOp.focus=A(),d(i);var u=qi(s,o);(i.line>=u.to||i.line<u.from)&&setTimeout(ys(e,function(){m==n&&y(t)}),150)}else{var a=t.clientY<v.top?-20:t.clientY>v.bottom?20:0;a&&setTimeout(ys(e,function(){if(m!=n)return;s.scroller.scrollTop+=a,y(t)}),50)}}function b(t){e.state.selectingText=!1,m=Infinity,En(t),s.input.focus(),vn(document,"mousemove",w),vn(document,"mouseup",E),o.history.lastSelOrigin=null}var s=e.display,o=e.doc;En(t);var u,a,f=o.sel,l=f.ranges;i&&!t.shiftKey?(a=o.sel.contains(n),a>-1?u=l[a]:u=new qs(n,n)):(u=o.sel.primary(),a=o.sel.primIndex);if(g?t.shiftKey&&t.metaKey:t.altKey)r="rect",i||(u=new qs(n,n)),n=Ni(e,t,!0,!0),a=-1;else if(r=="double"){var c=e.findWordAt(n);e.display.shift||o.extend?u=po(o,u,c.anchor,c.head):u=c}else if(r=="triple"){var h=new qs(ht(n.line,0),yt(o,ht(n.line+1,0)));e.display.shift||o.extend?u=po(o,u,h.anchor,h.head):u=h}else u=po(o,u,n);i?a==-1?(a=l.length,Eo(o,Rs(l.concat([u]),a),{scroll:!1,origin:"*mouse"})):l.length>1&&l[a].empty()&&r=="single"&&!t.shiftKey?(Eo(o,Rs(l.slice(0,a).concat(l.slice(a+1)),0),{scroll:!1,origin:"*mouse"}),f=o.sel):go(o,a,u,R):(a=0,Eo(o,new Is([u],0),R),f=o.sel);var p=n,v=s.wrapper.getBoundingClientRect(),m=0,w=ys(e,function(e){Cn(e)?y(e):b(e)}),E=ys(e,b);e.state.selectingText=E,pn(document,"mousemove",w),pn(document,"mouseup",E)}function Vu(e,t,n,r){var i,s;try{i=t.clientX,s=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&En(t);var o=e.display,u=o.lineDiv.getBoundingClientRect();if(s>u.bottom||!bn(e,n))return xn(t);s-=u.top-o.viewOffset;for(var a=0;a<e.options.gutters.length;++a){var f=o.gutters.childNodes[a];if(f&&f.getBoundingClientRect().right>=i){var l=ft(e.doc,s),c=e.options.gutters[a];return mn(e,n,e,l,c,t),xn(t)}}}function $u(e,t){return Vu(e,t,"gutterClick",!0)}function Ju(e,t){if(qr(e.display,t)||Ku(e,t))return;if(gn(e,t,"contextmenu"))return;e.display.input.onContextMenu(t)}function Ku(e,t){return bn(e,"gutterContextMenu")?Vu(e,t,"gutterContextMenu",!1):!1}function Qu(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),ui(e)}function ea(e){function n(n,r,i,s){e.defaults[n]=r,i&&(t[n]=s?function(e,t,n){n!=Gu&&i(e,t,n)}:i)}var t=e.optionHandlers;e.defineOption=n,e.Init=Gu,n("value","",function(e,t){return e.setValue(t)},!0),n("mode",null,function(e,t){e.doc.modeOption=t,Js(e)},!0),n("indentUnit",2,Js,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(e){Ks(e),ui(e),Es(e)},!0),n("lineSeparator",null,function(e,t){e.doc.lineSep=t;if(!t)return;var n=[],r=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var s=e.text.indexOf(t,i);if(s==-1)break;i=s+t.length,n.push(ht(r,s))}r++});for(var i=n.length-1;i>=0;i--)jo(e.doc,t,n[i],ht(n[i].line,n[i].ch+t.length))}),n("specialChars",/[\u0000-\u001f\u007f\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("	")?"":"|	"),"g"),n!=Gu&&e.refresh()}),n("specialCharPlaceholder",hr,function(e){return e.refresh()},!0),n("electricChars",!0),n("inputStyle",v?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),n("rtlMoveVisually",!y),n("wholeLineUpdateBefore",!0),n("theme","default",function(e){Qu(e),ta(e)},!0),n("keyMap","default",function(e,t,n){var r=xu(t),i=n!=Gu&&xu(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)}),n("extraKeys",null),n("lineWrapping",!1,ra,!0),n("gutters",[],function(e){Fs(e.options),ta(e)},!0),n("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?Si(e.display)+"px":"0",e.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(e){return Gi(e)},!0),n("scrollbarStyle","native",function(e){es(e),Gi(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),n("lineNumbers",!1,function(e){Fs(e.options),ta(e)},!0),n("firstLineNumber",1,ta,!0),n("lineNumberFormatter",function(e){return e},ta,!0),n("showCursorWhenSelecting",!1,ki,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("readOnly",!1,function(e,t){t=="nocursor"?(Hi(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),n("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),n("dragDrop",!0,na),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,ki,!0),n("singleCursorHeightPerLine",!0,ki,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Ks,!0),n("addModeClass",!1,Ks,!0),n("pollInterval",100),n("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),n("historyEventDelay",1250),n("viewportMargin",10,function(e){return e.refresh()},!0),n("maxHighlightLength",1e4,Ks,!0),n("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),n("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),n("autofocus",null)}function ta(e){js(e),Es(e),setTimeout(function(){return Bi(e)},20)}function na(e,t,n){var r=n&&n!=Gu;if(!t!=!r){var i=e.display.dragFunctions,s=t?pn:vn;s(e.display.scroller,"dragstart",i.start),s(e.display.scroller,"dragenter",i.enter),s(e.display.scroller,"dragover",i.over),s(e.display.scroller,"dragleave",i.leave),s(e.display.scroller,"drop",i.drop)}}function ra(e){e.options.lineWrapping?(O(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(x(e.display.wrapper,"CodeMirror-wrap"),Gt(e)),Ti(e),Es(e),ui(e),setTimeout(function(){return Gi(e)},100)}function ia(e,t){var n=this;if(!(this instanceof ia))return new ia(e,t);this.options=t=t?P(t):{},P(Yu,t,!1),Fs(t);var r=t.value;typeof r=="string"&&(r=new nu(r,t.mode,null,t.lineSeparator)),this.doc=r;var i=new ia.inputStyles[t.inputStyle](this),a=this.display=new rt(e,r,i);a.wrapper.CodeMirror=this,js(this),Qu(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),t.autofocus&&!v&&a.input.focus(),es(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new B,keySeq:null,specialChars:null},s&&o<11&&setTimeout(function(){return n.display.input.reset(!0)},20),sa(this),lu(),fs(this),this.curOp.forceUpdate=!0,Zs(this,r),t.autofocus&&!v||this.hasFocus()?setTimeout(D(Pi,this),20):Hi(this);for(var f in Zu)Zu.hasOwnProperty(f)&&Zu[f](n,t[f],Gu);ji(this),t.finishInit&&t.finishInit(this);for(var l=0;l<oa.length;++l)oa[l](n);ls(this),u&&t.lineWrapping&&getComputedStyle(a.lineDiv).textRendering=="optimizelegibility"&&(a.lineDiv.style.textRendering="auto")}function sa(e){function i(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+(new Date))}function u(e){if(e.touches.length!=1)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function a(e,t){if(t.left==null)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}var t=e.display;pn(t.scroller,"mousedown",ys(e,qu)),s&&o<11?pn(t.scroller,"dblclick",ys(e,function(t){if(gn(e,t))return;var n=Ni(e,t);if(!n||$u(e,t)||qr(e.display,t))return;En(t);var r=e.findWordAt(n);vo(e.doc,r.anchor,r.head)})):pn(t.scroller,"dblclick",function(t){return gn(e,t)||En(t)}),E||pn(t.scroller,"contextmenu",function(t){return Ju(e,t)});var n,r={end:0};pn(t.scroller,"touchstart",function(i){if(!gn(e,i)&&!u(i)){t.input.ensurePolled(),clearTimeout(n);var s=+(new Date);t.activeTouch={start:s,moved:!1,prev:s-r.end<=300?r:null},i.touches.length==1&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}}),pn(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),pn(t.scroller,"touchend",function(n){var r=t.activeTouch;if(r&&!qr(t,n)&&r.left!=null&&!r.moved&&new Date-r.start<300){var s=e.coordsChar(t.activeTouch,"page"),o;!r.prev||a(r,r.prev)?o=new qs(s,s):!r.prev.prev||a(r,r.prev.prev)?o=e.findWordAt(s):o=new qs(ht(s.line,0),yt(e.doc,ht(s.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),En(n)}i()}),pn(t.scroller,"touchcancel",i),pn(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Ri(e,t.scroller.scrollTop),Ui(e,t.scroller.scrollLeft,!0),mn(e,"scroll",e))}),pn(t.scroller,"mousewheel",function(t){return $i(e,t)}),pn(t.scroller,"DOMMouseScroll",function(t){return $i(e,t)}),pn(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(t){gn(e,t)||Tn(t)},over:function(t){gn(e,t)||(ou(e,t),Tn(t))},start:function(t){return su(e,t)},drop:ys(e,iu),leave:function(t){gn(e,t)||uu(e)}};var f=t.input.getField();pn(f,"keyup",function(t){return Fu.call(e,t)}),pn(f,"keydown",ys(e,Bu)),pn(f,"keypress",ys(e,Iu)),pn(f,"focus",function(t){return Pi(e,t)}),pn(f,"blur",function(t){return Hi(e,t)})}function ua(e,t,n,r){var i=e.doc,s;n==null&&(n="add"),n=="smart"&&(i.mode.indent?s=Gn(e,t):n="prev");var o=e.options.tabSize,u=it(i,t),a=H(u.text,null,o);u.stateAfter&&(u.stateAfter=null);var f=u.text.match(/^\s*/)[0],l;if(!r&&!/\S/.test(u.text))l=0,n="not";else if(n=="smart"){l=i.mode.indent(s,u.text.slice(f.length),u.text);if(l==I||l>150){if(!r)return;n="prev"}}n=="prev"?t>i.first?l=H(it(i,t-1).text,null,o):l=0:n=="add"?l=a+e.options.indentUnit:n=="subtract"?l=a-e.options.indentUnit:typeof n=="number"&&(l=a+n),l=Math.max(0,l);var c="",h=0;if(e.options.indentWithTabs)for(var p=Math.floor(l/o);p;--p)h+=o,c+="	";h<l&&(c+=X(l-h));if(c!=f)return jo(i,c,ht(t,0),ht(t,f.length),"+input"),u.stateAfter=null,!0;for(var d=0;d<i.sel.ranges.length;d++){var v=i.sel.ranges[d];if(v.head.line==t&&v.head.ch<f.length){var m=ht(t,f.length);go(i,d,new qs(m,m));break}}}function fa(e){aa=e}function la(e,t,n,r,i){var s=e.doc;e.display.shift=!1,r||(r=s.sel);var o=e.state.pasteIncoming||i=="paste",u=_n(t),a=null;if(o&&r.ranges.length>1)if(aa&&aa.text.join("\n")==t){if(r.ranges.length%aa.text.length==0){a=[];for(var f=0;f<aa.text.length;f++)a.push(s.splitLines(aa.text[f]))}}else u.length==r.ranges.length&&(a=$(u,function(e){return[e]}));var l;for(var c=r.ranges.length-1;c>=0;c--){var h=r.ranges[c],p=h.from(),d=h.to();h.empty()&&(n&&n>0?p=ht(p.line,p.ch-n):e.state.overwrite&&!o?d=ht(d.line,Math.min(it(s,d.line).text.length,d.ch+V(u).length)):aa&&aa.lineWise&&aa.text.join("\n")==t&&(p=d=ht(p.line,0))),l=e.curOp.updateInput;var v={from:p,to:d,text:a?a[c%a.length]:u,origin:i||(o?"paste":e.state.cutIncoming?"cut":"+input")};Mo(e.doc,v),Nr(e,"inputRead",e,v)}t&&!o&&ha(e,t),os(e),e.curOp.updateInput=l,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function ca(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&gs(t,function(){return la(t,n,0,null,"paste")}),!0}function ha(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;var n=e.doc.sel;for(var r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)continue;var s=e.getModeAt(i.head),o=!1;if(s.electricChars){for(var u=0;u<s.electricChars.length;u++)if(t.indexOf(s.electricChars.charAt(u))>-1){o=ua(e,i.head.line,"smart");break}}else s.electricInput&&s.electricInput.test(it(e.doc,i.head.line).text.slice(0,i.head.ch))&&(o=ua(e,i.head.line,"smart"));o&&Nr(e,"electricInput",e,i.head.line)}}function pa(e){var t=[],n=[];for(var r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,s={anchor:ht(i,0),head:ht(i+1,0)};n.push(s),t.push(e.getRange(s.anchor,s.head))}return{text:t,ranges:n}}function da(e,t){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck",!!t)}function va(){var e=C("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=C("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return u?e.style.width="1000px":e.setAttribute("wrap","off"),d&&(e.style.border="1px solid black"),da(e),t}function ma(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,i=r[e];if(r[e]==n&&e!="mode")return;r[e]=n,t.hasOwnProperty(e)&&ys(this,t[e])(this,n,i)},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](xu(e))},removeKeyMap:function(e){var t=this.state.keyMaps;for(var n=0;n<t.length;++n)if(t[n]==e||t[n].name==e)return t.splice(n,1),!0},addOverlay:bs(function(t,n){var r=t.token?t:e.getMode(this.options,t);if(r.startState)throw new Error("Overlays may not be stateful.");J(this.state.overlays,{mode:r,modeSpec:t,opaque:n&&n.opaque,priority:n&&n.priority||0},function(e){return e.priority}),this.state.modeGen++,Es(this)}),removeOverlay:bs(function(e){var t=this,n=this.state.overlays;for(var r=0;r<n.length;++r){var i=n[r].modeSpec;if(i==e||typeof e=="string"&&i.name==e){n.splice(r,1),t.state.modeGen++,Es(t);return}}}),indentLine:bs(function(e,t,n){typeof t!="string"&&typeof t!="number"&&(t==null?t=this.options.smartIndent?"smart":"prev":t=t?"add":"subtract"),lt(this.doc,e)&&ua(this,e,t,n)}),indentSelection:bs(function(e){var t=this,n=this.doc.sel.ranges,r=-1;for(var i=0;i<n.length;i++){var s=n[i];if(!s.empty()){var o=s.from(),u=s.to(),a=Math.max(r,o.line);r=Math.min(t.lastLine(),u.line-(u.ch?0:1))+1;for(var f=a;f<r;++f)ua(t,f,e);var l=t.doc.sel.ranges;o.ch==0&&n.length==l.length&&l[i].from().ch>0&&go(t.doc,i,new qs(o,l[i].to()),q)}else s.head.line>r&&(ua(t,s.head.line,e,!0),r=s.head.line,i==t.doc.sel.primIndex&&os(t))}}),getTokenAt:function(e,t){return tr(this,e,t)},getLineTokens:function(e,t){return tr(this,ht(e),t,!0)},getTokenTypeAt:function(e){e=yt(this.doc,e);var t=Qn(this,it(this.doc,e.line)),n=0,r=(t.length-1)/2,i=e.ch,s;if(i==0)s=t[2];else for(;;){var o=n+r>>1;if((o?t[o*2-1]:0)>=i)r=o;else{if(!(t[o*2+1]<i)){s=t[o*2+2];break}n=o+1}}var u=s?s.indexOf("overlay "):-1;return u<0?s:u==0?null:s.slice(0,u-1)},getModeAt:function(t){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=this,i=[];if(!n.hasOwnProperty(t))return i;var s=n[t],o=this.getModeAt(e);if(typeof o[t]=="string")s[o[t]]&&i.push(s[o[t]]);else if(o[t])for(var u=0;u<o[t].length;u++){var a=s[o[t][u]];a&&i.push(a)}else o.helperType&&s[o.helperType]?i.push(s[o.helperType]):s[o.name]&&i.push(s[o.name]);for(var f=0;f<s._global.length;f++){var l=s._global[f];l.pred(o,r)&&j(i,l.val)==-1&&i.push(l.val)}return i},getStateAfter:function(e,t){var n=this.doc;return e=gt(n,e==null?n.first+n.size-1:e),Gn(this,e+1,t)},cursorCoords:function(e,t){var n,r=this.doc.sel.primary();return e==null?n=r.head:typeof e=="object"?n=yt(this.doc,e):n=e?r.from():r.to(),pi(this,n,t||"page")},charCoords:function(e,t){return hi(this,yt(this.doc,e),t||"page")},coordsChar:function(e,t){return e=ci(this,e,t||"page"),mi(this,e.left,e.top)},lineAtHeight:function(e,t){return e=ci(this,{top:e,left:0},t||"page").top,ft(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,n){var r=!1,i;if(typeof e=="number"){var s=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>s&&(e=s,r=!0),i=it(this.doc,e)}else i=e;return li(this,i,{top:0,left:0},t||"page",n).top+(r?this.doc.height-Kt(i):0)},defaultTextHeight:function(){return bi(this.display)},defaultCharWidth:function(){return wi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var s=this.display;e=pi(this,yt(this.doc,e));var o=e.bottom,u=e.left;t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),s.sizer.appendChild(t);if(r=="over")o=e.top;else if(r=="above"||r=="near"){var a=Math.max(s.wrapper.clientHeight,this.doc.height),f=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);(r=="above"||e.bottom+t.offsetHeight>a)&&e.top>t.offsetHeight?o=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=a&&(o=e.bottom),u+t.offsetWidth>f&&(u=f-t.offsetWidth)}t.style.top=o+"px",t.style.left=t.style.right="",i=="right"?(u=s.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):(i=="left"?u=0:i=="middle"&&(u=(s.sizer.clientWidth-t.offsetWidth)/2),t.style.left=u+"px"),n&&rs(this,u,o,u+t.offsetWidth,o+t.offsetHeight)},triggerOnKeyDown:bs(Bu),triggerOnKeyPress:bs(Iu),triggerOnKeyUp:Fu,execCommand:function(e){if(Nu.hasOwnProperty(e))return Nu[e].call(null,this)},triggerElectric:bs(function(e){ha(this,e)}),findPosH:function(e,t,n,r){var i=this,s=1;t<0&&(s=-1,t=-t);var o=yt(this.doc,e);for(var u=0;u<t;++u){o=ga(i.doc,o,s,n,r);if(o.hitSide)break}return o},moveH:bs(function(e,t){var n=this;this.extendSelectionsBy(function(r){return n.display.shift||n.doc.extend||r.empty()?ga(n.doc,r.head,e,t,n.options.rtlMoveVisually):e<0?r.from():r.to()},U)}),deleteH:bs(function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Tu(this,function(n){var i=ga(r,n.head,e,t,!1);return e<0?{from:i,to:n.head}:{from:n.head,to:i}})}),findPosV:function(e,t,n,r){var i=this,s=1,o=r;t<0&&(s=-1,t=-t);var u=yt(this.doc,e);for(var a=0;a<t;++a){var f=pi(i,u,"div");o==null?o=f.left:f.left=o,u=ya(i,f,s,n);if(u.hitSide)break}return u},moveV:bs(function(e,t){var n=this,r=this.doc,i=[],s=!this.display.shift&&!r.extend&&r.sel.somethingSelected();r.extendSelectionsBy(function(o){if(s)return e<0?o.from():o.to();var u=pi(n,o.head,"div");o.goalColumn!=null&&(u.left=o.goalColumn),i.push(u.left);var a=ya(n,u,e,t);return t=="page"&&o==r.sel.primary()&&ss(n,null,hi(n,a,"div").top-u.top),a},U);if(i.length)for(var o=0;o<r.sel.ranges.length;o++)r.sel.ranges[o].goalColumn=i[o]}),findWordAt:function(e){var t=this.doc,n=it(t,e.line).text,r=e.ch,i=e.ch;if(n){var s=this.getHelper(e,"wordChars");(e.xRel<0||i==n.length)&&r?--r:++i;var o=n.charAt(r),u=Z(o,s)?function(e){return Z(e,s)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!Z(e)};while(r>0&&u(n.charAt(r-1)))--r;while(i<n.length&&u(n.charAt(i)))++i}return new qs(ht(e.line,r),ht(e.line,i))},toggleOverwrite:function(e){if(e!=null&&e==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?O(this.display.cursorDiv,"CodeMirror-overwrite"):x(this.display.cursorDiv,"CodeMirror-overwrite"),mn(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==A()},isReadOnly:function(){return!!this.options.readOnly||!!this.doc.cantEdit},scrollTo:bs(function(e,t){(e!=null||t!=null)&&us(this),e!=null&&(this.curOp.scrollLeft=e),t!=null&&(this.curOp.scrollTop=t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Wr(this)-this.display.barHeight,width:e.scrollWidth-Wr(this)-this.display.barWidth,clientHeight:Vr(this),clientWidth:Xr(this)}},scrollIntoView:bs(function(e,t){e==null?(e={from:this.doc.sel.primary().head,to:null},t==null&&(t=this.options.cursorScrollMargin)):typeof e=="number"?e={from:ht(e,0),to:null}:e.from==null&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0;if(e.from.line!=null)us(this),this.curOp.scrollToPos=e;else{var n=is(this,Math.min(e.from.left,e.to.left),Math.min(e.from.top,e.to.top)-e.margin,Math.max(e.from.right,e.to.right),Math.max(e.from.bottom,e.to.bottom)+e.margin);this.scrollTo(n.scrollLeft,n.scrollTop)}}),setSize:bs(function(e,t){var n=this,r=function(e){return typeof e=="number"||/^\d+$/.test(String(e))?e+"px":e};e!=null&&(this.display.wrapper.style.width=r(e)),t!=null&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&oi(this);var i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){Ss(n,i,"widget");break}++i}),this.curOp.forceUpdate=!0,mn(this,"refresh",this)}),operation:function(e){return gs(this,e)},refresh:bs(function(){var e=this.display.cachedTextHeight;Es(this),this.curOp.forceUpdate=!0,ui(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),Hs(this),(e==null||Math.abs(e-bi(this.display))>.5)&&Ti(this),mn(this,"refresh",this)}),swapDoc:bs(function(e){var t=this.doc;return t.cm=null,Zs(this,e),ui(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Nr(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},wn(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,s){e.registerHelper(t,r,s),n[t]._global.push({pred:i,val:s})}}function ga(e,t,n,r,i){function f(){var t=s+n;return t<e.first||t>=e.first+e.size?!1:(s=t,a=it(e,t))}function l(e){var t=(i?an:fn)(a,o,n,!0);if(t==null){if(!!e||!f())return!1;i?o=(n<0?nn:tn)(a):o=n<0?a.text.length:0}else o=t;return!0}var s=t.line,o=t.ch,u=n,a=it(e,s);if(r=="char")l();else if(r=="column")l(!0);else if(r=="word"||r=="group"){var c=null,h=r=="group",p=e.cm&&e.cm.getHelper(t,"wordChars");for(var d=!0;;d=!1){if(n<0&&!l(!d))break;var v=a.text.charAt(o)||"\n",m=Z(v,p)?"w":h&&v=="\n"?"n":!h||/\s/.test(v)?null:"p";h&&!d&&!m&&(m="s");if(c&&c!=m){n<0&&(n=1,l());break}m&&(c=m);if(n>0&&!l(!d))break}}var g=ko(e,ht(s,o),t,u,!0);return pt(t,g)||(g.hitSide=!0),g}function ya(e,t,n,r){var i=e.doc,s=t.left,o;if(r=="page"){var u=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),a=Math.max(u-.5*bi(e.display),3);o=(n>0?t.bottom:t.top)+n*a}else r=="line"&&(o=n>0?t.bottom+3:t.top-3);var f;for(;;){f=mi(e,s,o);if(!f.outside)break;if(n<0?o<=0:o>=i.height){f.hitSide=!0;break}o+=n*5}return f}function ba(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new B,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null}function wa(e,t){var n=Gr(e,t.line);if(!n||n.hidden)return null;var r=it(e.doc,t.line),i=Jr(n,r,t.line),s=cn(r),o="left";if(s){var u=on(s,t.ch);o=u%2?"right":"left"}var a=ti(i.map,t.ch,o);return a.offset=a.collapse=="right"?a.end:a.start,a}function Ea(e,t){return t&&(e.bad=!0),e}function Sa(e,t,n,r,i){function a(e){return function(t){return t.id==e}}function f(t){if(t.nodeType==1){var n=t.getAttribute("cm-text");if(n!=null){n==""?s+=t.textContent.replace(/\u200b/g,""):s+=n;return}var l=t.getAttribute("cm-marker"),c;if(l){var h=e.findMarks(ht(r,0),ht(i+1,0),a(+l));h.length&&(c=h[0].find())&&(s+=st(e.doc,c.from,c.to).join(u));return}if(t.getAttribute("contenteditable")=="false")return;for(var p=0;p<t.childNodes.length;p++)f(t.childNodes[p]);/^(pre|div|p)$/i.test(t.nodeName)&&(o=!0)}else if(t.nodeType==3){var d=t.nodeValue;if(!d)return;o&&(s+=u,o=!1),s+=d}}var s="",o=!1,u=e.doc.lineSeparator();for(;;){f(t);if(t==n)break;t=t.nextSibling}return s}function xa(e,t,n){var r;if(t==e.display.lineDiv){r=e.display.lineDiv.childNodes[n];if(!r)return Ea(e.clipPos(ht(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var s=e.display.view[i];if(s.node==r)return Ta(s,t,n)}}function Ta(e,t,n){function l(t,n,r){for(var i=-1;i<(f?f.length:0);i++){var s=i<0?a.map:f[i];for(var o=0;o<s.length;o+=3){var u=s[o+2];if(u==t||u==n){var l=at(i<0?e.line:e.rest[i]),c=s[o]+r;if(r<0||u!=t)c=s[o+(r?1:0)];return ht(l,c)}}}}var r=e.text.firstChild,i=!1;if(!t||!L(r,t))return Ea(ht(at(e.line),0),!0);if(t==r){i=!0,t=r.childNodes[n],n=0;if(!t){var s=e.rest?V(e.rest):e.line;return Ea(ht(at(s),s.text.length),i)}}var o=t.nodeType==3?t:null,u=t;!o&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(o=t.firstChild,n&&(n=o.nodeValue.length));while(u.parentNode!=r)u=u.parentNode;var a=e.measure,f=a.maps,c=l(o,u,n);if(c)return Ea(c,i);for(var h=u.nextSibling,p=o?o.nodeValue.length-n:0;h;h=h.nextSibling){c=l(h,h.firstChild,0);if(c)return Ea(ht(c.line,c.ch-p),i);p+=h.textContent.length}for(var d=u.previousSibling,v=n;d;d=d.previousSibling){c=l(d,d.firstChild,-1);if(c)return Ea(ht(c.line,c.ch+v),i);v+=d.textContent.length}}function Na(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new B,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null}function Ca(e,t){function r(){e.value=a.getValue()}t=t?P(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder);if(t.autofocus==null){var n=A();t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}var i;if(e.form){pn(e.form,"submit",r);if(!t.leaveSubmitMethodAlone){var s=e.form;i=s.submit;try{var o=s.submit=function(){r(),s.submit=i,s.submit(),s.submit=o}}catch(u){}}}t.finishInit=function(t){t.save=r,t.getTextArea=function(){return e},t.toTextArea=function(){t.toTextArea=isNaN,r(),e.parentNode.removeChild(t.getWrapperElement()),e.style.display="",e.form&&(vn(e.form,"submit",r),typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var a=ia(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return a}function ka(e){e.off=vn,e.on=pn,e.wheelEventPixels=Vi,e.Doc=nu,e.splitLines=_n,e.countColumn=H,e.findColumn=z,e.isWordChar=Y,e.Pass=I,e.signal=mn,e.Line=sr,e.changeEnd=zs,e.scrollbarModel=Zi,e.Pos=ht,e.cmpPos=pt,e.modes=jn,e.mimeModes=Fn,e.resolveMode=Rn,e.getMode=Un,e.modeExtensions=zn,e.extendMode=Wn,e.copyState=Xn,e.startState=$n,e.innerMode=Vn,e.commands=Nu,e.keyMap=gu,e.keyName=Su,e.isModifierKey=Eu,e.lookupKey=wu,e.normalizeKeyMap=bu,e.StringStream=Jn,e.SharedTextMarker=Qo,e.TextMarker=Jo,e.LineWidget=Wo,e.e_preventDefault=En,e.e_stopPropagation=Sn,e.e_stop=Tn,e.addClass=O,e.contains=L,e.rmClass=x,e.keyNames=pu}var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),s=r||i,o=s&&(r?document.documentMode||6:i[1]),u=/WebKit\//.test(e),a=u&&/Qt\/\d+\.\d+/.test(e),f=/Chrome\//.test(e),l=/Opera\//.test(e),c=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),p=/PhantomJS/.test(e),d=/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),v=d||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),m=d||/Mac/.test(t),g=/\bCrOS\b/.test(e),y=/win/i.test(t),b=l&&e.match(/Version\/(\d*\.\d*)/);b&&(b=Number(b[1])),b&&b>=15&&(l=!1,u=!0);var w=m&&(a||l&&(b==null||b<12.11)),E=n||s&&o>=9,x=function(e,t){var n=e.className,r=S(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}},k;document.createRange?k=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:k=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var _=function(e){e.select()};d?_=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:s&&(_=function(e){try{e.select()}catch(t){}}),B.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var F=30,I={toString:function(){return"CodeMirror.Pass"}},q={scroll:!1},R={origin:"*mouse"},U={origin:"+move"},W=[""],G=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,tt=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/,Et=!1,St=!1,sn=null,ln=function(){function n(n){return n<=247?e.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1773?t.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":n==8204?"b":"L"}function f(e,t,n){this.level=e,this.from=t,this.to=n}var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,s=/[LRr]/,o=/[Lb1n]/,u=/[1n]/,a="L";return function(e){if(!r.test(e))return!1;var t=e.length,l=[];for(var c=0;c<t;++c)l.push(n(e.charCodeAt(c)));for(var h=0,p=a;h<t;++h){var d=l[h];d=="m"?l[h]=p:p=d}for(var v=0,m=a;v<t;++v){var g=l[v];g=="1"&&m=="r"?l[v]="n":s.test(g)&&(m=g,g=="r"&&(l[v]="R"))}for(var y=1,b=l[0];y<t-1;++y){var w=l[y];w=="+"&&b=="1"&&l[y+1]=="1"?l[y]="1":w==","&&b==l[y+1]&&(b=="1"||b=="n")&&(l[y]=b),b=w}for(var E=0;E<t;++E){var S=l[E];if(S==",")l[E]="N";else if(S=="%"){var x=void 0;for(x=E+1;x<t&&l[x]=="%";++x);var T=E&&l[E-1]=="!"||x<t&&l[x]=="1"?"1":"N";for(var N=E;N<x;++N)l[N]=T;E=x-1}}for(var C=0,k=a;C<t;++C){var L=l[C];k=="L"&&L=="1"?l[C]="L":s.test(L)&&(k=L)}for(var A=0;A<t;++A)if(i.test(l[A])){var O=void 0;for(O=A+1;O<t&&i.test(l[O]);++O);var M=(A?l[A-1]:a)=="L",_=(O<t?l[O]:a)=="L",D=M||_?"L":"R";for(var P=A;P<O;++P)l[P]=D;A=O-1}var H=[],B;for(var j=0;j<t;)if(o.test(l[j])){var F=j;for(++j;j<t&&o.test(l[j]);++j);H.push(new f(0,F,j))}else{var I=j,q=H.length;for(++j;j<t&&l[j]!="L";++j);for(var R=I;R<j;)if(u.test(l[R])){I<R&&H.splice(q,0,new f(1,I,R));var U=R;for(++R;R<j&&u.test(l[R]);++R);H.splice(q,0,new f(2,U,R)),I=R}else++R;I<j&&H.splice(q,0,new f(1,I,j))}return H[0].level==1&&(B=e.match(/^\s+/))&&(H[0].from=B[0].length,H.unshift(new f(0,0,B[0].length))),V(H).level==1&&(B=e.match(/\s+$/))&&(V(H).to-=B[0].length,H.push(new f(0,t-B[0].length,t))),H[0].level==2&&H.unshift(new f(1,H[0].to,H[0].to)),H[0].level!=V(H).level&&H.push(new f(H[0].level,t,t)),H}}(),hn=[],pn=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||hn).concat(n)}},kn=function(){if(s&&o<9)return!1;var e=C("div");return"draggable"in e||"dragDrop"in e}(),Ln,On,_n="\n\nb".split(/\n/).length!=3?function(e){var t=0,n=[],r=e.length;while(t<=r){var i=e.indexOf("\n",t);i==-1&&(i=e.length);var s=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),o=s.indexOf("\r");o!=-1?(n.push(s.slice(0,o)),t+=o+1):(n.push(s),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Dn=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(n){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Pn=function(){var e=C("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Hn=null,jn={},Fn={},zn={},Jn=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};Jn.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||undefined},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(e){var t=this.string.charAt(this.pos),n;typeof e=="string"?n=t==e:n=t&&(e.test?e.test(t):e(t));if(n)return++this.pos,t},eatWhile:function(e){var t=this.pos;while(this.eat(e));return this.pos>t},eatSpace:function(){var e=this,t=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++e.pos;return this.pos>t},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=H(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return H(this.string,null,this.tabSize)-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},match:function(e,t,n){if(typeof e!="string"){var s=this.string.slice(this.pos).match(e);return s&&s.index>0?null:(s&&t!==!1&&(this.pos+=s[0].length),s)}var r=function(e){return n?e.toLowerCase():e},i=this.string.substr(this.pos,e.length);if(r(i)==r(e))return t!==!1&&(this.pos+=e.length),!0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}},wn(sr),sr.prototype.lineNo=function(){return at(this)};var ar={},fr={},wr=null,Tr=null,ei={left:0,right:0,top:0,bottom:0},yi,zi=0,Wi=null;s?Wi=-0.53:n?Wi=15:f?Wi=-0.7:c&&(Wi=-1/3),Ki.prototype=P({update:function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var s=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=e.scrollWidth-e.clientWidth+s+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},setScrollLeft:function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},setScrollTop:function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},zeroWidthHack:function(){var e=m&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new B,this.disableVert=new B},enableZeroWidthBar:function(e,t){function n(){var r=e.getBoundingClientRect(),i=document.elementFromPoint(r.left+1,r.bottom-1);i!=e?e.style.pointerEvents="none":t.set(1e3,n)}e.style.pointerEvents="auto",t.set(1e3,n)},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},Ki.prototype),Qi.prototype=P({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},Qi.prototype);var Zi={"native":Ki,"null":Qi},as=0;As.prototype.signal=function(e,t){bn(e,t)&&this.events.push(arguments)},As.prototype.finish=function(){var e=this;for(var t=0;t<this.events.length;t++)mn.apply(null,e.events[t])},Is.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(e){var t=this;if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var n=0;n<this.ranges.length;n++){var r=t.ranges[n],i=e.ranges[n];if(pt(r.anchor,i.anchor)!=0||pt(r.head,i.head)!=0)return!1}return!0},deepCopy:function(){var e=this,t=[];for(var n=0;n<this.ranges.length;n++)t[n]=new qs(dt(e.ranges[n].anchor),dt(e.ranges[n].head));return new Is(t,this.primIndex)},somethingSelected:function(){var e=this;for(var t=0;t<this.ranges.length;t++)if(!e.ranges[t].empty())return!0;return!1},contains:function(e,t){var n=this;t||(t=e);for(var r=0;r<this.ranges.length;r++){var i=n.ranges[r];if(pt(t,i.from())>=0&&pt(e,i.to())<=0)return r}return-1}},qs.prototype={from:function(){return mt(this.anchor,this.head)},to:function(){return vt(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}},Uo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){var n=this;for(var r=e,i=e+t;r<i;++r){var s=n.lines[r];n.height-=s.height,ur(s),Nr(s,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){var r=this;this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var i=0;i<t.length;++i)t[i].parent=r},iterN:function(e,t,n){var r=this;for(var i=e+t;e<i;++e)if(n(r.lines[e]))return!0}},zo.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){var n=this;this.size-=t;for(var r=0;r<this.children.length;++r){var i=n.children[r],s=i.chunkSize();if(e<s){var o=Math.min(t,s-e),u=i.height;i.removeInner(e,o),n.height-=u-i.height,s==o&&(n.children.splice(r--,1),i.parent=null);if((t-=o)==0)break;e=0}else e-=s}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Uo))){var a=[];this.collapse(a),this.children=[new Uo(a)],this.children[0].parent=this}},collapse:function(e){var t=this;for(var n=0;n<this.children.length;++n)t.children[n].collapse(e)},insertInner:function(e,t,n){var r=this;this.size+=t.length,this.height+=n;for(var i=0;i<this.children.length;++i){var s=r.children[i],o=s.chunkSize();if(e<=o){s.insertInner(e,t,n);if(s.lines&&s.lines.length>50){var u=s.lines.length%25+25;for(var a=u;a<s.lines.length;){var f=new Uo(s.lines.slice(a,a+=25));s.height-=f.height,r.children.splice(++i,0,f),f.parent=r}s.lines=s.lines.slice(0,u),r.maybeSpill()}break}e-=o}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new zo(t);if(!e.parent){var r=new zo(e.children);r.parent=e,e.children=[r,n],e=r}else{e.size-=n.size,e.height-=n.height;var i=j(e.parent.children,e);e.parent.children.splice(i+1,0,n)}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,t,n){var r=this;for(var i=0;i<this.children.length;++i){var s=r.children[i],o=s.chunkSize();if(e<o){var u=Math.min(t,o-e);if(s.iterN(e,u,n))return!0;if((t-=u)==0)break;e=0}else e-=o}}},wn(Wo),Wo.prototype.clear=function(){var e=this,t=this.doc.cm,n=this.line.widgets,r=this.line,i=at(r);if(i==null||!n)return;for(var s=0;s<n.length;++s)n[s]==e&&n.splice(s--,1);n.length||(r.widgets=null);var o=Ir(this);ut(r,Math.max(0,r.height-o)),t&&gs(t,function(){Xo(t,r,-o),Ss(t,i,"widget")})},Wo.prototype.changed=function(){var e=this.height,t=this.doc.cm,n=this.line;this.height=null;var r=Ir(this)-e;if(!r)return;ut(n,n.height+r),t&&gs(t,function(){t.curOp.forceUpdate=!0,Xo(t,n,r)})};var $o=0;wn(Jo),Jo.prototype.clear=function(){var e=this;if(this.explicitlyCleared)return;var t=this.doc.cm,n=t&&!t.curOp;n&&fs(t);if(bn(this,"clear")){var r=this.find();r&&Nr(this,"clear",r.from,r.to)}var i=null,s=null;for(var o=0;o<this.lines.length;++o){var u=e.lines[o],a=Ct(u.markedSpans,e);t&&!e.collapsed?Ss(t,at(u),"text"):t&&(a.to!=null&&(s=at(u)),a.from!=null&&(i=at(u))),u.markedSpans=kt(u.markedSpans,a),a.from==null&&e.collapsed&&!$t(e.doc,u)&&t&&ut(u,bi(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var f=0;f<this.lines.length;++f){var l=zt(e.lines[f]),c=Qt(l);c>t.display.maxLineLength&&(t.display.maxLine=l,t.display.maxLineLength=c,t.display.maxLineChanged=!0)}i!=null&&t&&this.collapsed&&Es(t,i,s+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&To(t.doc)),t&&Nr(t,"markerCleared",t,this),n&&ls(t),this.parent&&this.parent.clear()},Jo.prototype.find=function(e,t){var n=this;e==null&&this.type=="bookmark"&&(e=1);var r,i;for(var s=0;s<this.lines.length;++s){var o=n.lines[s],u=Ct(o.markedSpans,n);if(u.from!=null){r=ht(t?o:at(o),u.from);if(e==-1)return r}if(u.to!=null){i=ht(t?o:at(o),u.to);if(e==1)return i}}return r&&{from:r,to:i}},Jo.prototype.changed=function(){var e=this.find(-1,!0),t=this,n=this.doc.cm;if(!e||!n)return;gs(n,function(){var r=e.line,i=at(e.line),s=Gr(n,i);s&&(si(s),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0;if(!$t(t.doc,r)&&t.height!=null){var o=t.height;t.height=null;var u=Ir(t)-o;u&&ut(r,r.height+u)}})},Jo.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||j(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Jo.prototype.detachLine=function(e){this.lines.splice(j(this.lines,e),1);if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},wn(Qo),Qo.prototype.clear=function(){var e=this;if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var t=0;t<this.markers.length;++t)e.markers[t].clear();Nr(this,"clear")},Qo.prototype.find=function(e,t){return this.primary.find(e,t)};var tu=0,nu=function(e,t,n,r){if(!(this instanceof nu))return new nu(e,t,n,r);n==null&&(n=0),zo.call(this,[new Uo([new sr("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=n;var i=ht(n,0);this.sel=Us(i),this.history=new eo(null),this.id=++tu,this.modeOption=t,this.lineSep=r,this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Gs(this,{from:i,to:i,text:e}),Eo(this,Us(i),q)};nu.prototype=Q(zo.prototype,{constructor:nu,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){var n=0;for(var r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=ot(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:ws(function(e){var t=ht(this.first,0),n=this.first+this.size-1;Mo(this,{from:t,to:ht(n,it(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),Eo(this,Us(t))}),replaceRange:function(e,t,n,r){t=yt(this,t),n=n?yt(this,n):t,jo(this,e,t,n,r)},getRange:function(e,t,n){var r=st(this,yt(this,e),yt(this,t));return n===!1?r:r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(lt(this,e))return it(this,e)},getLineNumber:function(e){return at(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=it(this,e)),zt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return yt(this,e)},getCursor:function(e){var t=this.sel.primary(),n;return e==null||e=="head"?n=t.head:e=="anchor"?n=t.anchor:e=="end"||e=="to"||e===!1?n=t.to():n=t.from(),n},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ws(function(e,t,n){yo(this,yt(this,typeof e=="number"?ht(e,t||0):e),null,n)}),setSelection:ws(function(e,t,n){yo(this,yt(this,e),yt(this,t||e),n)}),extendSelection:ws(function(e,t,n){vo(this,yt(this,e),t&&yt(this,t),n)}),extendSelections:ws(function(e,t){mo(this,wt(this,e),t)}),extendSelectionsBy:ws(function(e,t){var n=$(this.sel.ranges,e);mo(this,wt(this,n),t)}),setSelections:ws(function(e,t,n){var r=this;if(!e.length)return;var i=[];for(var s=0;s<e.length;s++)i[s]=new qs(yt(r,e[s].anchor),yt(r,e[s].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Eo(this,Rs(i,t),n)}),addSelection:ws(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new qs(yt(this,e),yt(this,t||e))),Eo(this,Rs(r,r.length-1),n)}),getSelection:function(e){var t=this,n=this.sel.ranges,r;for(var i=0;i<n.length;i++){var s=st(t,n[i].from(),n[i].to());r=r?r.concat(s):s}return e===!1?r:r.join(e||this.lineSeparator())},getSelections:function(e){var t=this,n=[],r=this.sel.ranges;for(var i=0;i<r.length;i++){var s=st(t,r[i].from(),r[i].to());e!==!1&&(s=s.join(e||t.lineSeparator())),n[i]=s}return n},replaceSelection:function(e,t,n){var r=[];for(var i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:ws(function(e,t,n){var r=this,i=[],s=this.sel;for(var o=0;o<s.ranges.length;o++){var u=s.ranges[o];i[o]={from:u.from(),to:u.to(),text:r.splitLines(e[o]),origin:n}}var a=t&&t!="end"&&$s(this,i,t);for(var f=i.length-1;f>=0;f--)Mo(r,i[f]);a?wo(this,a):this.cm&&os(this.cm)}),undo:ws(function(){Do(this,"undo")}),redo:ws(function(){Do(this,"redo")}),undoSelection:ws(function(){Do(this,"undo",!0)}),redoSelection:ws(function(){Do(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){var e=this.history,t=0,n=0;for(var r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){this.history=new eo(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:ho(this.history.done),undone:ho(this.history.undone)}},setHistory:function(e){var t=this.history=new eo(this.history.maxGeneration);t.done=ho(e.done.slice(0),null,!0),t.undone=ho(e.undone.slice(0),null,!0)},setGutterMarker:ws(function(e,t,n){return Ro(this,e,"gutter",function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&et(r)&&(e.gutterMarkers=null),!0})}),clearGutter:ws(function(e){var t=this,n=this.first;this.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&Ro(t,r,"gutter",function(){return r.gutterMarkers[e]=null,et(r.gutterMarkers)&&(r.gutterMarkers=null),!0}),++n})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!lt(this,e))return null;t=e,e=it(this,e);if(!e)return null}else{t=at(e);if(t==null)return null}return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:ws(function(e,t,n){return Ro(this,e,t=="gutter"?"gutter":"class",function(e){var r=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!e[r])e[r]=n;else{if(S(n).test(e[r]))return!1;e[r]+=" "+n}return!0})}),removeLineClass:ws(function(e,t,n){return Ro(this,e,t=="gutter"?"gutter":"class",function(e){var r=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",i=e[r];if(!i)return!1;if(n==null)e[r]=null;else{var s=i.match(S(n));if(!s)return!1;var o=s.index+s[0].length;e[r]=i.slice(0,s.index)+(!s.index||o==i.length?"":" ")+i.slice(o)||null}return!0})}),addLineWidget:ws(function(e,t,n){return Vo(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Ko(this,yt(this,e),yt(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=yt(this,e),Ko(this,e,e,n,"bookmark")},findMarksAt:function(e){e=yt(this,e);var t=[],n=it(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=yt(this,e),t=yt(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(s){var o=s.markedSpans;if(o)for(var u=0;u<o.length;u++){var a=o[u];!(a.to!=null&&i==e.line&&e.ch>=a.to||a.from==null&&i!=e.line||a.from!=null&&i==t.line&&a.from>=t.ch)&&(!n||n(a.marker))&&r.push(a.marker.parent||a.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)n[r].from!=null&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var s=i.text.length+r;if(s>e)return t=e,!0;e-=s,++n}),yt(this,ht(n,t))},indexFromPos:function(e){e=yt(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+n}),t},copy:function(e){var t=new nu(ot(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<n&&(n=e.to);var r=new nu(ot(this,t,n),e.mode||this.modeOption,t,this.lineSep);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Zo(r,Yo(this)),r},unlinkDoc:function(e){var t=this;e instanceof ia&&(e=e.doc);if(this.linked)for(var n=0;n<this.linked.length;++n){var r=t.linked[n];if(r.doc!=e)continue;t.linked.splice(n,1),e.unlinkDoc(t),eu(Yo(t));break}if(e.history==this.history){var i=[e.id];Ys(e,function(e){return i.push(e.id)},!0),e.history=new eo(null),e.history.done=ho(this.history.done,i),e.history.undone=ho(this.history.undone,i)}},iterLinkedDocs:function(e){Ys(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):_n(e)},lineSeparator:function(){return this.lineSep||"\n"}}),nu.prototype.eachLine=nu.prototype.iter;var ru=0,fu=!1,pu={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};for(var du=0;du<10;du++)pu[du+48]=pu[du+96]=String(du);for(var vu=65;vu<=90;vu++)pu[vu]=String.fromCharCode(vu);for(var mu=1;mu<=12;mu++)pu[mu+111]=pu[mu+63235]="F"+mu;var gu={};gu.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},gu.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},gu.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},gu.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},gu["default"]=m?gu.macDefault:gu.pcDefault;var Nu={selectAll:Ao,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),q)},killLine:function(e){return Tu(e,function(t){if(t.empty()){var n=it(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:ht(t.head.line+1,0)}:{from:t.head,to:ht(t.head.line,n)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Tu(e,function(t){return{from:ht(t.from().line,0),to:yt(e.doc,ht(t.to().line+1,0))}})},delLineLeft:function(e){return Tu(e,function(e){return{from:ht(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){return Tu(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return Tu(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(ht(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ht(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Cu(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Lu(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return ku(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},U)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},U)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?Lu(e,t.head):r},U)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"char")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("	")},insertSoftTab:function(e){var t=[],n=e.listSelections(),r=e.options.tabSize;for(var i=0;i<n.length;i++){var s=n[i].from(),o=H(e.getLine(s.line),s.ch,r);t.push(X(r-o%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return gs(e,function(){var t=e.listSelections(),n=[];for(var r=0;r<t.length;r++){if(!t[r].empty())continue;var i=t[r].head,s=it(e.doc,i.line).text;if(s){i.ch==s.length&&(i=new ht(i.line,i.ch-1));if(i.ch>0)i=new ht(i.line,i.ch+1),e.replaceRange(s.charAt(i.ch-1)+s.charAt(i.ch-2),ht(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var o=it(e.doc,i.line-1).text;o&&(i=new ht(i.line,1),e.replaceRange(s.charAt(0)+e.doc.lineSeparator()+o.charAt(o.length-1),ht(i.line-1,o.length-1),i,"+transpose"))}}n.push(new qs(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return gs(e,function(){var t=e.listSelections();for(var n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);os(e)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}},Mu=new B,Hu=null,Ru,Uu,Gu={toString:function(){return"CodeMirror.Init"}},Yu={},Zu={};ia.defaults=Yu,ia.optionHandlers=Zu;var oa=[];ia.defineInitHook=function(e){return oa.push(e)};var aa=null;ba.prototype=P({init:function(e){function s(e){if(gn(r,e))return;if(r.somethingSelected())fa({lineWise:!1,text:r.getSelections()}),e.type=="cut"&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=pa(r);fa({lineWise:!0,text:t.text}),e.type=="cut"&&r.operation(function(){r.setSelections(t.ranges,0,q),r.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var s=aa.text.join("\n");e.clipboardData.setData("Text",s);if(e.clipboardData.getData("Text")==s){e.preventDefault();return}}var o=va(),u=o.firstChild;r.display.lineSpace.insertBefore(o,r.display.lineSpace.firstChild),u.value=aa.text.join("\n");var a=document.activeElement;_(u),setTimeout(function(){r.display.lineSpace.removeChild(o),a.focus(),a==i&&n.showPrimarySelection()},50)}var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;da(i,r.options.spellcheck),pn(i,"paste",function(e){if(gn(r,e)||ca(e,r))return;o<=11&&setTimeout(ys(r,function(){n.pollContent()||Es(r)}),20)}),pn(i,"compositionstart",function(e){t.composing={data:e.data}}),pn(i,"compositionupdate",function(e){t.composing||(t.composing={data:e.data})}),pn(i,"compositionend",function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing=null)}),pn(i,"touchstart",function(){return n.forceCompositionEnd()}),pn(i,"input",function(){t.composing||t.readFromDOMSoon()}),pn(i,"copy",s),pn(i,"cut",s)},prepareSelection:function(){var e=Li(this.cm,!1);return e.focus=this.cm.state.focused,e},showSelection:function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},showPrimarySelection:function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),r=xa(this.cm,e.anchorNode,e.anchorOffset),i=xa(this.cm,e.focusNode,e.focusOffset);if(r&&!r.bad&&i&&!i.bad&&pt(mt(r,i),t.from())==0&&pt(vt(r,i),t.to())==0)return;var s=wa(this.cm,t.from()),o=wa(this.cm,t.to());if(!s&&!o)return;var u=this.cm.display.view,a=e.rangeCount&&e.getRangeAt(0);if(!s)s={node:u[0].measure.map[2],offset:0};else if(!o){var f=u[u.length-1].measure,l=f.maps?f.maps[f.maps.length-1]:f.map;o={node:l[l.length-1],offset:l[l.length-2]-l[l.length-3]}}var c;try{c=k(s.node,s.offset,o.offset,o.node)}catch(h){}c&&(!n&&this.cm.state.focused?(e.collapse(s.node,s.offset),c.collapsed||(e.removeAllRanges(),e.addRange(c))):(e.removeAllRanges(),e.addRange(c)),a&&e.anchorNode==null?e.addRange(a):n&&this.startGracePeriod()),this.rememberSelection()},startGracePeriod:function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},showMultipleSelections:function(e){N(this.cm.display.cursorDiv,e.cursors),N(this.cm.display.selectionDiv,e.selection)},rememberSelection:function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},selectionInEditor:function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return L(this.div,t)},focus:function(){this.cm.options.readOnly!="nocursor"&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}var e=this;this.selectionInEditor()?this.pollSelection():gs(this.cm,function(){return e.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,t)},selectionChanged:function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&this.readDOMTimeout==null&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;this.rememberSelection();var n=xa(t,e.anchorNode,e.anchorOffset),r=xa(t,e.focusNode,e.focusOffset);n&&r&&gs(t,function(){Eo(t.doc,Us(n,r),q);if(n.bad||r.bad)t.curOp.selectionChanged=!0})}},pollContent:function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();r.ch==0&&r.line>e.firstLine()&&(r=ht(r.line-1,it(e.doc,r.line-1).length)),i.ch==it(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=ht(i.line+1,0));if(r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var s,o,u;r.line==t.viewFrom||(s=Ci(e,r.line))==0?(o=at(t.view[0].line),u=t.view[0].node):(o=at(t.view[s].line),u=t.view[s-1].node.nextSibling);var a=Ci(e,i.line),f,l;a==t.view.length-1?(f=t.viewTo-1,l=t.lineDiv.lastChild):(f=at(t.view[a+1].line)-1,l=t.view[a+1].node.previousSibling);if(!u)return!1;var c=e.doc.splitLines(Sa(e,u,l,o,f)),h=st(e.doc,ht(o,0),ht(f,it(e.doc,f).text.length));while(c.length>1&&h.length>1)if(V(c)==V(h))c.pop(),h.pop(),f--;else{if(c[0]!=h[0])break;c.shift(),h.shift(),o++}var p=0,d=0,v=c[0],m=h[0],g=Math.min(v.length,m.length);while(p<g&&v.charCodeAt(p)==m.charCodeAt(p))++p;var y=V(c),b=V(h),w=Math.min(y.length-(c.length==1?p:0),b.length-(h.length==1?p:0));while(d<w&&y.charCodeAt(y.length-d-1)==b.charCodeAt(b.length-d-1))++d;c[c.length-1]=y.slice(0,y.length-d).replace(/^\u200b+/,""),c[0]=c[0].slice(p).replace(/\u200b+$/,"");var E=ht(o,p),S=ht(f,h.length?V(h).length-d:0);if(c.length>1||c[0]||pt(E,S))return jo(e.doc,c,E,S,"+input"),!0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){if(!this.composing)return;this.composing=null,this.pollContent()||Es(this.cm),this.div.blur(),this.div.focus()},readFromDOMSoon:function(){var e=this;if(this.readDOMTimeout!=null)return;this.readDOMTimeout=setTimeout(function(){e.readDOMTimeout=null;if(e.composing)return;(e.cm.isReadOnly()||!e.pollContent())&&gs(e.cm,function(){return Es(e.cm)})},80)},setUneditable:function(e){e.contentEditable="false"},onKeyPress:function(e){e.preventDefault(),this.cm.isReadOnly()||ys(this.cm,la)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},readOnlyChanged:function(e){this.div.contentEditable=String(e!="nocursor")},onContextMenu:K,resetPosition:K,needsContentAttribute:!0},ba.prototype),Na.prototype=P({init:function(e){function a(e){if(gn(r,e))return;if(r.somethingSelected())fa({lineWise:!1,text:r.getSelections()}),n.inaccurateSelection&&(n.prevInput="",n.inaccurateSelection=!1,u.value=aa.text.join("\n"),_(u));else{if(!r.options.lineWiseCopyCut)return;var t=pa(r);fa({lineWise:!0,text:t.text}),e.type=="cut"?r.setSelections(t.ranges,null,q):(n.prevInput="",u.value=t.text.join("\n"),_(u))}e.type=="cut"&&(r.state.cutIncoming=!0)}var t=this,n=this,r=this.cm,i=this.wrapper=va(),u=this.textarea=i.firstChild;e.wrapper.insertBefore(i,e.wrapper.firstChild),d&&(u.style.width="0px"),pn(u,"input",function(){s&&o>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),pn(u,"paste",function(e){if(gn(r,e)||ca(e,r))return;r.state.pasteIncoming=!0,n.fastPoll()}),pn(u,"cut",a),pn(u,"copy",a),pn(e.scroller,"paste",function(t){if(qr(e,t)||gn(r,t))return;r.state.pasteIncoming=!0,n.focus()}),pn(e.lineSpace,"selectstart",function(t){qr(e,t)||En(t)}),pn(u,"compositionstart",function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}}),pn(u,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},prepareSelection:function(){var e=this.cm,t=e.display,n=e.doc,r=Li(e);if(e.options.moveInputWithCursor){var i=pi(e,n.sel.primary().head,"div"),s=t.wrapper.getBoundingClientRect(),o=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+o.top-s.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+o.left-s.left))}return r},showSelection:function(e){var t=this.cm,n=t.display;N(n.cursorDiv,e.cursors),N(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},reset:function(e){if(this.contextMenuPending)return;var t,n,r=this.cm,i=r.doc;if(r.somethingSelected()){this.prevInput="";var u=i.sel.primary();t=Pn&&(u.to().line-u.from().line>100||(n=r.getSelection()).length>1e3);var a=t?"-":n||r.getSelection();this.textarea.value=a,r.state.focused&&_(this.textarea),s&&o>=9&&(this.hasSelection=a)}else e||(this.prevInput=this.textarea.value="",s&&o>=9&&(this.hasSelection=null));this.inaccurateSelection=t},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if(this.cm.options.readOnly!="nocursor"&&(!v||A()!=this.textarea))try{this.textarea.focus()}catch(e){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var e=this;if(this.pollingFast)return;this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},fastPoll:function(){function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,n)},poll:function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Dn(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(s&&o>=9&&this.hasSelection===i||m&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var u=i.charCodeAt(0);u==8203&&!r&&(r="​");if(u==8666)return this.reset(),this.cm.execCommand("undo")}var a=0,f=Math.min(r.length,i.length);while(a<f&&r.charCodeAt(a)==i.charCodeAt(a))++a;return gs(t,function(){la(t,i.slice(a),r.length-a,null,e.composing?"*compose":null),i.length>1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){s&&o>=9&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(e){function m(){if(i.selectionStart!=null){var e=n.somethingSelected(),s="​"+(e?i.value:"");i.value="⇚",i.value=s,t.prevInput=e?"":"​",i.selectionStart=1,i.selectionEnd=s.length,r.selForContextMenu=n.doc.sel}}function g(){t.contextMenuPending=!1,t.wrapper.style.cssText=p,i.style.cssText=h,s&&o<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=f);if(i.selectionStart!=null){(!s||s&&o<9)&&m();var e=0,u=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="​"?ys(n,Ao)(n):e++<10?r.detectingSelectAll=setTimeout(u,500):r.input.reset()};r.detectingSelectAll=setTimeout(u,200)}}var t=this,n=t.cm,r=n.display,i=t.textarea,a=Ni(n,e),f=r.scroller.scrollTop;if(!a||l)return;var c=n.options.resetSelectionOnContextMenu;c&&n.doc.sel.contains(a)==-1&&ys(n,Eo)(n.doc,Us(a),q);var h=i.style.cssText,p=t.wrapper.style.cssText;t.wrapper.style.cssText="position: absolute";var d=t.wrapper.getBoundingClientRect();i.style.cssText="position: absolute; width: 30px; height: 30px;\n      top: "+(e.clientY-d.top-5)+"px; left: "+(e.clientX-d.left-5)+"px;\n      z-index: 1000; background: "+(s?"rgba(255, 255, 255, .05)":"transparent")+";\n      outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var v;u&&(v=window.scrollY),r.input.focus(),u&&window.scrollTo(null,v),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=!0,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),s&&o>=9&&m();if(E){Tn(e);var y=function(){vn(window,"mouseup",y),setTimeout(g,20)};pn(window,"mouseup",y)}else setTimeout(g,50)},readOnlyChanged:function(e){e||this.reset()},setUneditable:K,needsContentAttribute:!1},Na.prototype),ea(ia),ma(ia);var La="iter insert remove copy getEditor constructor".split(" ");for(var Aa in nu.prototype)nu.prototype.hasOwnProperty(Aa)&&j(La,Aa)<0&&(ia.prototype[Aa]=function(e){return function(){return e.apply(this.doc,arguments)}}(nu.prototype[Aa]));return wn(nu),ia.inputStyles={textarea:Na,contenteditable:ba},ia.defineMode=function(e){!ia.defaults.mode&&e!="null"&&(ia.defaults.mode=e),In.apply(this,arguments)},ia.defineMIME=qn,ia.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),ia.defineMIME("text/plain","null"),ia.defineExtension=function(e,t){ia.prototype[e]=t},ia.defineDocExtension=function(e,t){nu.prototype[e]=t},ia.fromTextArea=Ca,ka(ia),ia.version="5.21.0",ia}),define("answer",["jquery","laconic"],function(){(function($){function answerHasOutput(e){return e.variables.length>0||e.residuals}function renderSubstitutions(e,t){t.push(', <span class="pl-comment">% where</span><br/>');for(var n=0;n<e.length;n++)t.push('<span class="where-binding">',"<span class='pl-var'>",e[n].var+"</span> = ",e[n].value,"</span>"),n<e.length-1&&t.push(",<br/>")}function renderAnswer(e){var t=[],n=e.variables;for(var r=0;r<n.length;r++){var i=n[r].variables;for(var s=0;s<i.length-1;s++)t.push("<span class='pl-ovar'>",i[s],"</span> = ","<span class='pl-var'>",i[s+1],"</span>, ");t.push("<span class='pl-ovar'>",i[i.length-1],"</span> = ",n[r].value),n[r].substitutions&&renderSubstitutions(n[r].substitutions,t),(r<n.length-1||e.residuals)&&t.push(",<br/>")}var o;if(o=e.residuals)for(var r=0;r<o.length;r++)t.push(o[r]),r<o.length-1&&t.push(",<br/>");return t.join("")}function renderTabledAnswer(e,t){function r(t){var n=e.variables;for(var r=0;r<n.length;r++){var i=n[r].variables;for(var s=0;s<i.length;s++)if(i[s]==t)return n[r]}return null}function u(){t.find("tr.projection th.residuals").length==0&&($("<th class='residuals'>Residual goals</th>").insertBefore(t.find("tr.projection th.answer-nth")),$("<td></td>").insertBefore(t.find("tr td.answer-nth")))}var n=[];for(var i=0;i<e.projection.length;i++){var s=e.projection[i],o=r(s);n.push("<td>"),o?(n.push(o.value),o.substitutions&&renderSubstitutions(o.substitutions,n)):n.push("<span class='pl-var'>",s,"</span>"),n.push("</td>")}var a;if(a=e.residuals){u(),n.push("<td>");for(var i=0;i<a.length;i++)n.push(a[i]),i<a.length-1&&n.push(",<br/>");n.push("</td>")}return e.nth&&n.push("<td class='answer-nth'>",e.nth,"</td>"),n.join("")}function evalScripts(elem){elem.find("script").each(function(){var type=this.getAttribute("type")||"text/javascript";type=="text/javascript"&&($.ajaxScript=$(this),eval(this.textContent))}),$.ajaxScript&&delete $.ajaxScript}var pluginName="prologAnswer",methods={_init:function(e){return this.each(function(){var t=$(this);if(answerHasOutput(e))if(t.is("table")){var n=$.el.tr();t.append(n),n.innerHTML=renderTabledAnswer(e,t),evalScripts($(n)),$(n).find(".render-multi").renderMulti()}else t[0].innerHTML=renderAnswer(e),evalScripts(t),t.find(".render-multi").renderMulti();else t.append($.el.span({"class":"prolog-true"},"true"))})}};$.fn.prologAnswer=function(e){if(methods[e])return methods[e].apply(this,Array.prototype.slice.call(arguments,1));if(typeof e=="object"||!e)return methods._init.apply(this,arguments);$.error("Method "+e+" does not exist on jQuery."+pluginName)}})(jQuery),function(e){function s(){var t=e("#render-select");return t[0]||(t=e(e.el.form({id:"render-select",style:"display:none"})),t.on("click","a",function(n){var r=e(n.target).closest("a"),i=r.data("nr");return t.data("target").renderMulti(r.data("action"),i),!1}),t.on("click",function(){var n=e("input[name=render]:checked",e(this)).val();t.data("target").renderMulti("select",parseInt(n))}),t.hover(function(){r=!0,u()},function(){a()}),e("body").append(t)),t}function o(){if(!r){var e=s(),t=e.data("target");t&&(t.removeClass("render-selecting"),e.data("target",null)),e.hide(400)}}function u(){n=setTimeout(function(){o()},400)}function a(){r=!1,u()}function f(t){var n=t.originalEvent.dataTransfer;return n.setData("Text",e(t.target).renderMulti("prologText")),!0}var t="renderMulti",n=0,r=!1,i={_init:function(n){return this.each(function(){var n=e(this),r={current:0},i=[],s=e.el.div({"class":"render-multi-active"}),o=0;n.children().each(function(){var t=e(this).css("display");i.push(t),o++==0?(n.css("display",t),e(this).attr("draggable",!1)):e(this).hide()}),r.display=i,n.append(s),e(s).hover(function(e){n.renderMulti("showSelect",e)},function(e){n.renderMulti("hideSelect",e)}),n.attr("draggable",!0).bind("dragstart",f),n.data(t,r)})},selectMenu:function(){function s(e,t){var n,r;return t=="Prolog term"?(n="Copy",r="copy"):(n="Download",r="download"),btn='<a href="#" class="btn btn-style btn-sm" data-nr="'+e+'" data-action="'+r+'" title="'+n+'">'+'<span class="glyphicon glyphicon-'+r+'"></span></a>',btn}var n=this.data(t),r=["<label>View as</label><br>"],i=this.children(),o=0;for(var o=0;o<n.display.length;o++){var u=e(i[o]),a=u.attr("data-render");a||(o==0?a="Default rendered":a="Alt rendered ["+(o+1)+"]"),r.push("<div class='render-item'>",s(o,a),"<input type='radio' name='render' value='",o,"'"),o==n.current&&r.push(" checked"),r.push("> ",a,"</div>")}return r.push("</form"),r.join("")},showSelect:function(e){var t=this,i=s(),o=this.offset(),u;r=!0,n&&(clearTimeout(n),n=0),(u=i.data("target"))&&u.removeClass("render-selecting"),i.data("target",t),i.html(this.renderMulti("selectMenu")),i.css({top:o.top+5+"px",left:o.left+5+"px"}).show(400),this.addClass("render-selecting")},hideSelect:function(e){a()},select:function(n){var r=this.data(t);if(r.current!=n){var i=this.children(),s=r.display[n];e(i[r.current]).hide(400),e(i[n]).show(400,function(){e(this).css("display",s)}),this.css("display",s),e(i[n]).is("span.render-as-prolog")?this.attr("draggable",!1):this.attr("draggable",!0),r.current=n}o()},copy:function(e){function s(e){var t=document.createRange();t.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(t)}var n=this.children(),r=this.data(t),i=r.current;this.renderMulti("select",e),s(n[e]);try{document.execCommand("copy")}catch(o){alert("Sorry, cannot copy text with this browser")}return this.renderMulti("select",i),this},download:function(t){function o(){return e("<a>")[0].download!=undefined}var n=this.children(),r=e(n[t]),i="html",s;if(r.hasClass("export-dom")){var u={};r=r.trigger("export-dom",u),u.element?(s=u.element.outerHTML,i=u.extension||"html",type=u.contentType||"text/html"):alert("Failed to export rendered result")}else if(r.find("svg").length==1){var a=r.find("svg");a.attr("xmlns")||a.attr("xmlns","http://www.w3.org/2000/svg"),s=a[0].outerHTML,i="svg",type="image/svg+xml"}else s=r.html(),type="text/html";o()||(type="application/octet-stream");var f="data:"+type+";charset=UTF-8,"+encodeURIComponent(s),l=e.el.a({href:f,download:"swish-rendered."+i});return this.append(l),l.click(),e(l).remove(),this},prologText:function(){return this.find("span.render-as-prolog").text()}};e.fn.renderMulti=function(n){if(i[n])return i[n].apply(this,Array.prototype.slice.call(arguments,1));if(typeof n=="object"||!n)return i._init.apply(this,arguments);e.error("Method "+n+" does not exist on jQuery."+t)}}(jQuery)}),function(e,t,n){(function(e){typeof define=="function"&&define.amd?define("sparkline",["jquery"],e):jQuery&&!jQuery.fn.sparkline&&e(jQuery)})(function(r){var i={},s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N,C,k,L,A,O,M,_,D,P,H,B,j=0;s=function(){return{common:{type:"line",lineColor:"#00f",fillColor:"#cdf",defaultPixelsPerValue:3,width:"auto",height:"auto",composite:!1,tagValuesAttribute:"values",tagOptionsPrefix:"spark",enableTagOptions:!1,enableHighlight:!0,highlightLighten:1.4,tooltipSkipNull:!0,tooltipPrefix:"",tooltipSuffix:"",disableHiddenCheck:!1,numberFormatter:!1,numberDigitGroupCount:3,numberDigitGroupSep:",",numberDecimalMark:".",disableTooltips:!1,disableInteraction:!1},line:{spotColor:"#f80",highlightSpotColor:"#5f5",highlightLineColor:"#f22",spotRadius:1.5,minSpotColor:"#f80",maxSpotColor:"#f80",lineWidth:1,normalRangeMin:n,normalRangeMax:n,normalRangeColor:"#ccc",drawNormalOnTop:!1,chartRangeMin:n,chartRangeMax:n,chartRangeMinX:n,chartRangeMaxX:n,tooltipFormat:new u('<span style="color: {{color}}">&#9679;</span> {{prefix}}{{y}}{{suffix}}')},bar:{barColor:"#3366cc",negBarColor:"#f44",stackedBarColor:["#3366cc","#dc3912","#ff9900","#109618","#66aa00","#dd4477","#0099c6","#990099"],zeroColor:n,nullColor:n,zeroAxis:!0,barWidth:4,barSpacing:1,chartRangeMax:n,chartRangeMin:n,chartRangeClip:!1,colorMap:n,tooltipFormat:new u('<span style="color: {{color}}">&#9679;</span> {{prefix}}{{value}}{{suffix}}')},tristate:{barWidth:4,barSpacing:1,posBarColor:"#6f6",negBarColor:"#f44",zeroBarColor:"#999",colorMap:{},tooltipFormat:new u('<span style="color: {{color}}">&#9679;</span> {{value:map}}'),tooltipValueLookups:{map:{"-1":"Loss",0:"Draw",1:"Win"}}},discrete:{lineHeight:"auto",thresholdColor:n,thresholdValue:0,chartRangeMax:n,chartRangeMin:n,chartRangeClip:!1,tooltipFormat:new u("{{prefix}}{{value}}{{suffix}}")},bullet:{targetColor:"#f33",targetWidth:3,performanceColor:"#33f",rangeColors:["#d3dafe","#a8b6ff","#7f94ff"],base:n,tooltipFormat:new u("{{fieldkey:fields}} - {{value}}"),tooltipValueLookups:{fields:{r:"Range",p:"Performance",t:"Target"}}},pie:{offset:0,sliceColors:["#3366cc","#dc3912","#ff9900","#109618","#66aa00","#dd4477","#0099c6","#990099"],borderWidth:0,borderColor:"#000",tooltipFormat:new u('<span style="color: {{color}}">&#9679;</span> {{value}} ({{percent.1}}%)')},box:{raw:!1,boxLineColor:"#000",boxFillColor:"#cdf",whiskerColor:"#000",outlierLineColor:"#333",outlierFillColor:"#fff",medianColor:"#f00",showOutliers:!0,outlierIQR:1.5,spotRadius:1.5,target:n,targetColor:"#4a2",chartRangeMax:n,chartRangeMin:n,tooltipFormat:new u("{{field:fields}}: {{value}}"),tooltipFormatFieldlistKey:"field",tooltipValueLookups:{fields:{lq:"Lower Quartile",med:"Median",uq:"Upper Quartile",lo:"Left Outlier",ro:"Right Outlier",lw:"Left Whisker",rw:"Right Whisker"}}}}},O='.jqstooltip { position: absolute;left: 0px;top: 0px;visibility: hidden;background: rgb(0, 0, 0) transparent;background-color: rgba(0,0,0,0.6);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";color: white;font: 10px arial, san serif;text-align: left;white-space: nowrap;padding: 5px;border: 1px solid white;z-index: 10000;}.jqsfield { color: white;font: 10px arial, san serif;text-align: left;}',o=function(){var e,t;return e=function(){this.init.apply(this,arguments)},arguments.length>1?(arguments[0]?(e.prototype=r.extend(new arguments[0],arguments[arguments.length-1]),e._super=arguments[0].prototype):e.prototype=arguments[arguments.length-1],arguments.length>2&&(t=Array.prototype.slice.call(arguments,1,-1),t.unshift(e.prototype),r.extend.apply(r,t))):e.prototype=arguments[0],e.prototype.cls=e,e},r.SPFormatClass=u=o({fre:/\{\{([\w.]+?)(:(.+?))?\}\}/g,precre:/(\w+)\.(\d+)/,init:function(e,t){this.format=e,this.fclass=t},render:function(e,t,r){var i=this,s=e,o,u,a,f,l;return this.format.replace(this.fre,function(){var e;return u=arguments[1],a=arguments[3],o=i.precre.exec(u),o?(l=o[2],u=o[1]):l=!1,f=s[u],f===n?"":a&&t&&t[a]?(e=t[a],e.get?t[a].get(f)||f:t[a][f]||f):(p(f)&&(r.get("numberFormatter")?f=r.get("numberFormatter")(f):f=y(f,l,r.get("numberDigitGroupCount"),r.get("numberDigitGroupSep"),r.get("numberDecimalMark"))),f)})}}),r.spformat=function(e,t){return new u(e,t)},a=function(e,t,n){return e<t?t:e>n?n:e},f=function(e,n){var r;return n===2?(r=t.floor(e.length/2),e.length%2?e[r]:(e[r-1]+e[r])/2):e.length%2?(r=(e.length*n+n)/4,r%1?(e[t.floor(r)]+e[t.floor(r)-1])/2:e[r-1]):(r=(e.length*n+2)/4,r%1?(e[t.floor(r)]+e[t.floor(r)-1])/2:e[r-1])},l=function(e){var t;switch(e){case"undefined":e=n;break;case"null":e=null;break;case"true":e=!0;break;case"false":e=!1;break;default:t=parseFloat(e),e==t&&(e=t)}return e},c=function(e){var t,n=[];for(t=e.length;t--;)n[t]=l(e[t]);return n},h=function(e,t){var n,r,i=[];for(n=0,r=e.length;n<r;n++)e[n]!==t&&i.push(e[n]);return i},p=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},y=function(e,t,n,i,s){var o,u;e=(t===!1?parseFloat(e).toString():e.toFixed(t)).split(""),o=(o=r.inArray(".",e))<0?e.length:o,o<e.length&&(e[o]=s);for(u=o-n;u>0;u-=n)e.splice(u,0,i);return e.join("")},d=function(e,t,n){var r;for(r=t.length;r--;){if(n&&t[r]===null)continue;if(t[r]!==e)return!1}return!0},v=function(e){var t=0,n;for(n=e.length;n--;)t+=typeof e[n]=="number"?e[n]:0;return t},g=function(e){return r.isArray(e)?e:[e]},m=function(t){var n;e.createStyleSheet?e.createStyleSheet().cssText=t:(n=e.createElement("style"),n.type="text/css",e.getElementsByTagName("head")[0].appendChild(n),n[typeof e.body.style.WebkitAppearance=="string"?"innerText":"innerHTML"]=t)},r.fn.simpledraw=function(t,i,s,o){var u,a;if(s&&(u=this.data("_jqs_vcanvas")))return u;if(r.fn.sparkline.canvas===!1)return!1;if(r.fn.sparkline.canvas===n){var f=e.createElement("canvas");if(!f.getContext||!f.getContext("2d")){if(!e.namespaces||!!e.namespaces.v)return r.fn.sparkline.canvas=!1,!1;e.namespaces.add("v","urn:schemas-microsoft-com:vml","#default#VML"),r.fn.sparkline.canvas=function(e,t,n,r){return new H(e,t,n)}}else r.fn.sparkline.canvas=function(e,t,n,r){return new P(e,t,n,r)}}return t===n&&(t=r(this).innerWidth()),i===n&&(i=r(this).innerHeight()),u=r.fn.sparkline.canvas(t,i,this,o),a=r(this).data("_jqs_mhandler"),a&&a.registerCanvas(u),u},r.fn.cleardraw=function(){var e=this.data("_jqs_vcanvas");e&&e.reset()},r.RangeMapClass=b=o({init:function(e){var t,n,r=[];for(t in e)e.hasOwnProperty(t)&&typeof t=="string"&&t.indexOf(":")>-1&&(n=t.split(":"),n[0]=n[0].length===0?-Infinity:parseFloat(n[0]),n[1]=n[1].length===0?Infinity:parseFloat(n[1]),n[2]=e[t],r.push(n));this.map=e,this.rangelist=r||!1},get:function(e){var t=this.rangelist,r,i,s;if((s=this.map[e])!==n)return s;if(t)for(r=t.length;r--;){i=t[r];if(i[0]<=e&&i[1]>=e)return i[2]}return n}}),r.range_map=function(e){return new b(e)},w=o({init:function(e,t){var n=r(e);this.$el=n,this.options=t,this.currentPageX=0,this.currentPageY=0,this.el=e,this.splist=[],this.tooltip=null,this.over=!1,this.displayTooltips=!t.get("disableTooltips"),this.highlightEnabled=!t.get("disableHighlight")},registerSparkline:function(e){this.splist.push(e),this.over&&this.updateDisplay()},registerCanvas:function(e){var t=r(e.canvas);this.canvas=e,this.$canvas=t,t.mouseenter(r.proxy(this.mouseenter,this)),t.mouseleave(r.proxy(this.mouseleave,this)),t.click(r.proxy(this.mouseclick,this))},reset:function(e){this.splist=[],this.tooltip&&e&&(this.tooltip.remove(),this.tooltip=n)},mouseclick:function(e){var t=r.Event("sparklineClick");t.originalEvent=e,t.sparklines=this.splist,this.$el.trigger(t)},mouseenter:function(t){r(e.body).unbind("mousemove.jqs"),r(e.body).bind("mousemove.jqs",r.proxy(this.mousemove,this)),this.over=!0,this.currentPageX=t.pageX,this.currentPageY=t.pageY,this.currentEl=t.target,!this.tooltip&&this.displayTooltips&&(this.tooltip=new E(this.options),this.tooltip.updatePosition(t.pageX,t.pageY)),this.updateDisplay()},mouseleave:function(){r(e.body).unbind("mousemove.jqs");var t=this.splist,n=t.length,i=!1,s,o;this.over=!1,this.currentEl=null,this.tooltip&&(this.tooltip.remove(),this.tooltip=null);for(o=0;o<n;o++)s=t[o],s.clearRegionHighlight()&&(i=!0);i&&this.canvas.render()},mousemove:function(e){this.currentPageX=e.pageX,this.currentPageY=e.pageY,this.currentEl=e.target,this.tooltip&&this.tooltip.updatePosition(e.pageX,e.pageY),this.updateDisplay()},updateDisplay:function(){var e=this.splist,t=e.length,n=!1,i=this.$canvas.offset(),s=this.currentPageX-i.left,o=this.currentPageY-i.top,u,a,f,l,c;if(!this.over)return;for(f=0;f<t;f++)a=e[f],l=a.setRegionHighlight(this.currentEl,s,o),l&&(n=!0);if(n){c=r.Event("sparklineRegionChange"),c.sparklines=this.splist,this.$el.trigger(c);if(this.tooltip){u="";for(f=0;f<t;f++)a=e[f],u+=a.getCurrentRegionTooltip();this.tooltip.setContent(u)}this.disableHighlight||this.canvas.render()}l===null&&this.mouseleave()}}),E=o({sizeStyle:"position: static !important;display: block !important;visibility: hidden !important;float: left !important;",init:function(t){var n=t.get("tooltipClassname","jqstooltip"),i=this.sizeStyle,s;this.container=t.get("tooltipContainer")||e.body,this.tooltipOffsetX=t.get("tooltipOffsetX",10),this.tooltipOffsetY=t.get("tooltipOffsetY",12),r("#jqssizetip").remove(),r("#jqstooltip").remove(),this.sizetip=r("<div/>",{id:"jqssizetip",style:i,"class":n}),this.tooltip=r("<div/>",{id:"jqstooltip","class":n}).appendTo(this.container),s=this.tooltip.offset(),this.offsetLeft=s.left,this.offsetTop=s.top,this.hidden=!0,r(window).unbind("resize.jqs scroll.jqs"),r(window).bind("resize.jqs scroll.jqs",r.proxy(this.updateWindowDims,this)),this.updateWindowDims()},updateWindowDims:function(){this.scrollTop=r(window).scrollTop(),this.scrollLeft=r(window).scrollLeft(),this.scrollRight=this.scrollLeft+r(window).width(),this.updatePosition()},getSize:function(e){this.sizetip.html(e).appendTo(this.container),this.width=this.sizetip.width()+1,this.height=this.sizetip.height(),this.sizetip.remove()},setContent:function(e){if(!e){this.tooltip.css("visibility","hidden"),this.hidden=!0;return}this.getSize(e),this.tooltip.html(e).css({width:this.width,height:this.height,visibility:"visible"}),this.hidden&&(this.hidden=!1,this.updatePosition())},updatePosition:function(e,t){if(e===n){if(this.mousex===n)return;e=this.mousex-this.offsetLeft,t=this.mousey-this.offsetTop}else this.mousex=e-=this.offsetLeft,this.mousey=t-=this.offsetTop;if(!this.height||!this.width||this.hidden)return;t-=this.height+this.tooltipOffsetY,e+=this.tooltipOffsetX,t<this.scrollTop&&(t=this.scrollTop),e<this.scrollLeft?e=this.scrollLeft:e+this.width>this.scrollRight&&(e=this.scrollRight-this.width),this.tooltip.css({left:e,top:t})},remove:function(){this.tooltip.remove(),this.sizetip.remove(),this.sizetip=this.tooltip=n,r(window).unbind("resize.jqs scroll.jqs")}}),M=function(){m(O)},r(M),B=[],r.fn.sparkline=function(t,i){return this.each(function(){var s=new r.fn.sparkline.options(this,i),o=r(this),u,a;u=function(){var i,u,a,f,l,c,h;if(t==="html"||t===n){h=this.getAttribute(s.get("tagValuesAttribute"));if(h===n||h===null)h=o.html();i=h.replace(/(^\s*<!--)|(-->\s*$)|\s+/g,"").split(",")}else i=t;u=s.get("width")==="auto"?i.length*s.get("defaultPixelsPerValue"):s.get("width");if(s.get("height")==="auto"){if(!s.get("composite")||!r.data(this,"_jqs_vcanvas"))f=e.createElement("span"),f.innerHTML="a",o.html(f),a=r(f).innerHeight()||r(f).height(),r(f).remove(),f=null}else a=s.get("height");s.get("disableInteraction")?l=!1:(l=r.data(this,"_jqs_mhandler"),l?s.get("composite")||l.reset():(l=new w(this,s),r.data(this,"_jqs_mhandler",l)));if(s.get("composite")&&!r.data(this,"_jqs_vcanvas")){r.data(this,"_jqs_errnotify")||(alert("Attempted to attach a composite sparkline to an element with no existing sparkline"),r.data(this,"_jqs_errnotify",!0));return}c=new(r.fn.sparkline[s.get("type")])(this,i,s,u,a),c.render(),l&&l.registerSparkline(c)};if(r(this).html()&&!s.get("disableHiddenCheck")&&r(this).is(":hidden")||!r(this).parents("body").length){if(!s.get("composite")&&r.data(this,"_jqs_pending"))for(a=B.length;a;a--)B[a-1][0]==this&&B.splice(a-1,1);B.push([this,u]),r.data(this,"_jqs_pending",!0)}else u.call(this)})},r.fn.sparkline.defaults=s(),r.sparkline_display_visible=function(){var e,t,n,i=[];for(t=0,n=B.length;t<n;t++)e=B[t][0],r(e).is(":visible")&&!r(e).parents().is(":hidden")?(B[t][1].call(e),r.data(B[t][0],"_jqs_pending",!1),i.push(t)):!r(e).closest("html").length&&!r.data(e,"_jqs_pending")&&(r.data(B[t][0],"_jqs_pending",!1),i.push(t));for(t=i.length;t;t--)B.splice(i[t-1],1)},r.fn.sparkline.options=o({init:function(e,t){var n,s,o,u;this.userOptions=t=t||{},this.tag=e,this.tagValCache={},s=r.fn.sparkline.defaults,o=s.common,this.tagOptionsPrefix=t.enableTagOptions&&(t.tagOptionsPrefix||o.tagOptionsPrefix),u=this.getTagSetting("type"),u===i?n=s[t.type||o.type]:n=s[u],this.mergedOptions=r.extend({},o,n,t)},getTagSetting:function(e){var t=this.tagOptionsPrefix,r,s,o,u;if(t===!1||t===n)return i;if(this.tagValCache.hasOwnProperty(e))r=this.tagValCache.key;else{r=this.tag.getAttribute(t+e);if(r===n||r===null)r=i;else if(r.substr(0,1)==="["){r=r.substr(1,r.length-2).split(",");for(s=r.length;s--;)r[s]=l(r[s].replace(/(^\s*)|(\s*$)/g,""))}else if(r.substr(0,1)==="{"){o=r.substr(1,r.length-2).split(","),r={};for(s=o.length;s--;)u=o[s].split(":",2),r[u[0].replace(/(^\s*)|(\s*$)/g,"")]=l(u[1].replace(/(^\s*)|(\s*$)/g,""))}else r=l(r);this.tagValCache.key=r}return r},get:function(e,t){var r=this.getTagSetting(e),s;return r!==i?r:(s=this.mergedOptions[e])===n?t:s}}),r.fn.sparkline._base=o({disabled:!1,init:function(e,t,i,s,o){this.el=e,this.$el=r(e),this.values=t,this.options=i,this.width=s,this.height=o,this.currentRegion=n},initTarget:function(){var e=!this.options.get("disableInteraction");(this.target=this.$el.simpledraw(this.width,this.height,this.options.get("composite"),e))?(this.canvasWidth=this.target.pixelWidth,this.canvasHeight=this.target.pixelHeight):this.disabled=!0},render:function(){return this.disabled?(this.el.innerHTML="",!1):!0},getRegion:function(e,t){},setRegionHighlight:function(e,t,r){var i=this.currentRegion,s=!this.options.get("disableHighlight"),o;return t>this.canvasWidth||r>this.canvasHeight||t<0||r<0?null:(o=this.getRegion(e,t,r),i!==o?(i!==n&&s&&this.removeHighlight(),this.currentRegion=o,o!==n&&s&&this.renderHighlight(),!0):!1)},clearRegionHighlight:function(){return this.currentRegion!==n?(this.removeHighlight(),this.currentRegion=n,!0):!1},renderHighlight:function(){this.changeHighlight(!0)},removeHighlight:function(){this.changeHighlight(!1)},changeHighlight:function(e){},getCurrentRegionTooltip:function(){var e=this.options,t="",i=[],s,o,a,f,l,c,h,p,d,v,m,g,y,b;if(this.currentRegion===n)return"";s=this.getCurrentRegionFields(),m=e.get("tooltipFormatter");if(m)return m(this,e,s);e.get("tooltipChartTitle")&&(t+='<div class="jqs jqstitle">'+e.get("tooltipChartTitle")+"</div>\n"),o=this.options.get("tooltipFormat");if(!o)return"";r.isArray(o)||(o=[o]),r.isArray(s)||(s=[s]),h=this.options.get("tooltipFormatFieldlist"),p=this.options.get("tooltipFormatFieldlistKey");if(h&&p){d=[];for(c=s.length;c--;)v=s[c][p],(b=r.inArray(v,h))!=-1&&(d[b]=s[c]);s=d}a=o.length,y=s.length;for(c=0;c<a;c++){g=o[c],typeof g=="string"&&(g=new u(g)),f=g.fclass||"jqsfield";for(b=0;b<y;b++)if(!s[b].isNull||!e.get("tooltipSkipNull"))r.extend(s[b],{prefix:e.get("tooltipPrefix"),suffix:e.get("tooltipSuffix")}),l=g.render(s[b],e.get("tooltipValueLookups"),e),i.push('<div class="'+f+'">'+l+"</div>")}return i.length?t+i.join("\n"):""},getCurrentRegionFields:function(){},calcHighlightColor:function(e,n){var r=n.get("highlightColor"),i=n.get("highlightLighten"),s,o,u,f;if(r)return r;if(i){s=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(e)||/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);if(s){u=[],o=e.length===4?16:1;for(f=0;f<3;f++)u[f]=a(t.round(parseInt(s[f+1],16)*o*i),0,255);return"rgb("+u.join(",")+")"}}return e}}),S={changeHighlight:function(e){var t=this.currentRegion,n=this.target,i=this.regionShapes[t],s;i&&(s=this.renderRegion(t,e),r.isArray(s)||r.isArray(i)?(n.replaceWithShapes(i,s),this.regionShapes[t]=r.map(s,function(e){return e.id})):(n.replaceWithShape(i,s),this.regionShapes[t]=s.id))},render:function(){var e=this.values,t=this.target,n=this.regionShapes,i,s,o,u;if(!this.cls._super.render.call(this))return;for(o=e.length;o--;){i=this.renderRegion(o);if(i)if(r.isArray(i)){s=[];for(u=i.length;u--;)i[u].append(),s.push(i[u].id);n[o]=s}else i.append(),n[o]=i.id;else n[o]=null}t.render()}},r.fn.sparkline.line=x=o(r.fn.sparkline._base,{type:"line",init:function(e,t,n,r,i){x._super.init.call(this,e,t,n,r,i),this.vertices=[],this.regionMap=[],this.xvalues=[],this.yvalues=[],this.yminmax=[],this.hightlightSpotId=null,this.lastShapeId=null,this.initTarget()},getRegion:function(e,t,r){var i,s=this.regionMap;for(i=s.length;i--;)if(s[i]!==null&&t>=s[i][0]&&t<=s[i][1])return s[i][2];return n},getCurrentRegionFields:function(){var e=this.currentRegion;return{isNull:this.yvalues[e]===null,x:this.xvalues[e],y:this.yvalues[e],color:this.options.get("lineColor"),fillColor:this.options.get("fillColor"),offset:e}},renderHighlight:function(){var e=this.currentRegion,t=this.target,r=this.vertices[e],i=this.options,s=i.get("spotRadius"),o=i.get("highlightSpotColor"),u=i.get("highlightLineColor"),a,f;if(!r)return;s&&o&&(a=t.drawCircle(r[0],r[1],s,n,o),this.highlightSpotId=a.id,t.insertAfterShape(this.lastShapeId,a)),u&&(f=t.drawLine(r[0],this.canvasTop,r[0],this.canvasTop+this.canvasHeight,u),this.highlightLineId=f.id,t.insertAfterShape(this.lastShapeId,f))},removeHighlight:function(){var e=this.target;this.highlightSpotId&&(e.removeShapeId(this.highlightSpotId),this.highlightSpotId=null),this.highlightLineId&&(e.removeShapeId(this.highlightLineId),this.highlightLineId=null)},scanValues:function(){var e=this.values,n=e.length,r=this.xvalues,i=this.yvalues,s=this.yminmax,o,u,a,f,l;for(o=0;o<n;o++)u=e[o],a=typeof e[o]=="string",f=typeof e[o]=="object"&&e[o]instanceof Array,l=a&&e[o].split(":"),a&&l.length===2?(r.push(Number(l[0])),i.push(Number(l[1])),s.push(Number(l[1]))):f?(r.push(u[0]),i.push(u[1]),s.push(u[1])):(r.push(o),e[o]===null||e[o]==="null"?i.push(null):(i.push(Number(u)),s.push(Number(u))));this.options.get("xvalues")&&(r=this.options.get("xvalues")),this.maxy=this.maxyorg=t.max.apply(t,s),this.miny=this.minyorg=t.min.apply(t,s),this.maxx=t.max.apply(t,r),this.minx=t.min.apply(t,r),this.xvalues=r,this.yvalues=i,this.yminmax=s},processRangeOptions:function(){var e=this.options,t=e.get("normalRangeMin"),r=e.get("normalRangeMax");t!==n&&(t<this.miny&&(this.miny=t),r>this.maxy&&(this.maxy=r)),e.get("chartRangeMin")!==n&&(e.get("chartRangeClip")||e.get("chartRangeMin")<this.miny)&&(this.miny=e.get("chartRangeMin")),e.get("chartRangeMax")!==n&&(e.get("chartRangeClip")||e.get("chartRangeMax")>this.maxy)&&(this.maxy=e.get("chartRangeMax")),e.get("chartRangeMinX")!==n&&(e.get("chartRangeClipX")||e.get("chartRangeMinX")<this.minx)&&(this.minx=e.get("chartRangeMinX")),e.get("chartRangeMaxX")!==n&&(e.get("chartRangeClipX")||e.get("chartRangeMaxX")>this.maxx)&&(this.maxx=e.get("chartRangeMaxX"))},drawNormalRange:function(e,r,i,s,o){var u=this.options.get("normalRangeMin"),a=this.options.get("normalRangeMax"),f=r+t.round(i-i*((a-this.miny)/o)),l=t.round(i*(a-u)/o);this.target.drawRect(e,f,s,l,n,this.options.get("normalRangeColor")).append()},render:function(){var e=this.options,i=this.target,s=this.canvasWidth,o=this.canvasHeight,u=this.vertices,a=e.get("spotRadius"),f=this.regionMap,l,c,h,p,d,v,m,g,y,w,E,S,T,N,C,k,L,A,O,M,_,D,P,H,B;if(!x._super.render.call(this))return;this.scanValues(),this.processRangeOptions(),P=this.xvalues,H=this.yvalues;if(!this.yminmax.length||this.yvalues.length<2)return;p=d=0,l=this.maxx-this.minx===0?1:this.maxx-this.minx,c=this.maxy-this.miny===0?1:this.maxy-this.miny,h=this.yvalues.length-1,a&&(s<a*4||o<a*4)&&(a=0);if(a){_=e.get("highlightSpotColor")&&!e.get("disableInteraction");if(_||e.get("minSpotColor")||e.get("spotColor")&&H[h]===this.miny)o-=t.ceil(a);if(_||e.get("maxSpotColor")||e.get("spotColor")&&H[h]===this.maxy)o-=t.ceil(a),p+=t.ceil(a);if(_||(e.get("minSpotColor")||e.get("maxSpotColor"))&&(H[0]===this.miny||H[0]===this.maxy))d+=t.ceil(a),s-=t.ceil(a);if(_||e.get("spotColor")||e.get("minSpotColor")||e.get("maxSpotColor")&&(H[h]===this.miny||H[h]===this.maxy))s-=t.ceil(a)}o--,e.get("normalRangeMin")!==n&&!e.get("drawNormalOnTop")&&this.drawNormalRange(d,p,o,s,c),m=[],g=[m],N=C=null,k=H.length;for(B=0;B<k;B++)y=P[B],E=P[B+1],w=H[B],S=d+t.round((y-this.minx)*(s/l)),T=B<k-1?d+t.round((E-this.minx)*(s/l)):s,C=S+(T-S)/2,f[B]=[N||0,C,B],N=C,w===null?B&&(H[B-1]!==null&&(m=[],g.push(m)),u.push(null)):(w<this.miny&&(w=this.miny),w>this.maxy&&(w=this.maxy),m.length||m.push([S,p+o]),v=[S,p+t.round(o-o*((w-this.miny)/c))],m.push(v),u.push(v));L=[],A=[],O=g.length;for(B=0;B<O;B++)m=g[B],m.length&&(e.get("fillColor")&&(m.push([m[m.length-1][0],p+o]),A.push(m.slice(0)),m.pop()),m.length>2&&(m[0]=[m[0][0],m[1][1]]),L.push(m));O=A.length;for(B=0;B<O;B++)i.drawShape(A[B],e.get("fillColor"),e.get("fillColor")).append();e.get("normalRangeMin")!==n&&e.get("drawNormalOnTop")&&this.drawNormalRange(d,p,o,s,c),O=L.length;for(B=0;B<O;B++)i.drawShape(L[B],e.get("lineColor"),n,e.get("lineWidth")).append();if(a&&e.get("valueSpots")){M=e.get("valueSpots"),M.get===n&&(M=new b(M));for(B=0;B<k;B++)D=M.get(H[B]),D&&i.drawCircle(d+t.round((P[B]-this.minx)*(s/l)),p+t.round(o-o*((H[B]-this.miny)/c)),a,n,D).append()}a&&e.get("spotColor")&&H[h]!==null&&i.drawCircle(d+t.round((P[P.length-1]-this.minx)*(s/l)),p+t.round(o-o*((H[h]-this.miny)/c)),a,n,e.get("spotColor")).append(),this.maxy!==this.minyorg&&(a&&e.get("minSpotColor")&&(y=P[r.inArray(this.minyorg,H)],i.drawCircle(d+t.round((y-this.minx)*(s/l)),p+t.round(o-o*((this.minyorg-this.miny)/c)),a,n,e.get("minSpotColor")).append()),a&&e.get("maxSpotColor")&&(y=P[r.inArray(this.maxyorg,H)],i.drawCircle(d+t.round((y-this.minx)*(s/l)),p+t.round(o-o*((this.maxyorg-this.miny)/c)),a,n,e.get("maxSpotColor")).append())),this.lastShapeId=i.getLastShapeId(),this.canvasTop=p,i.render()}}),r.fn.sparkline.bar=T=o(r.fn.sparkline._base,S,{type:"bar",init:function(e,i,s,o,u){var f=parseInt(s.get("barWidth"),10),p=parseInt(s.get("barSpacing"),10),d=s.get("chartRangeMin"),v=s.get("chartRangeMax"),m=s.get("chartRangeClip"),g=Infinity,y=-Infinity,w,E,S,x,N,C,k,L,A,O,M,_,D,P,H,B,j,F,I,q,R,U,z;T._super.init.call(this,e,i,s,o,u);for(C=0,k=i.length;C<k;C++){q=i[C],w=typeof q=="string"&&q.indexOf(":")>-1;if(w||r.isArray(q))H=!0,w&&(q=i[C]=c(q.split(":"))),q=h(q,null),E=t.min.apply(t,q),S=t.max.apply(t,q),E<g&&(g=E),S>y&&(y=S)}this.stacked=H,this.regionShapes={},this.barWidth=f,this.barSpacing=p,this.totalBarWidth=f+p,this.width=o=i.length*f+(i.length-1)*p,this.initTarget(),m&&(D=d===n?-Infinity:d,P=v===n?Infinity:v),N=[],x=H?[]:N;var W=[],X=[];for(C=0,k=i.length;C<k;C++)if(H){B=i[C],i[C]=I=[],W[C]=0,x[C]=X[C]=0;for(j=0,F=B.length;j<F;j++)q=I[j]=m?a(B[j],D,P):B[j],q!==null&&(q>0&&(W[C]+=q),g<0&&y>0?q<0?X[C]+=t.abs(q):x[C]+=q:x[C]+=t.abs(q-(q<0?y:g)),N.push(q))}else q=m?a(i[C],D,P):i[C],q=i[C]=l(q),q!==null&&N.push(q);this.max=_=t.max.apply(t,N),this.min=M=t.min.apply(t,N),this.stackMax=y=H?t.max.apply(t,W):_,this.stackMin=g=H?t.min.apply(t,N):M,s.get("chartRangeMin")!==n&&(s.get("chartRangeClip")||s.get("chartRangeMin")<M)&&(M=s.get("chartRangeMin")),s.get("chartRangeMax")!==n&&(s.get("chartRangeClip")||s.get("chartRangeMax")>_)&&(_=s.get("chartRangeMax")),this.zeroAxis=A=s.get("zeroAxis",!0),M<=0&&_>=0&&A?O=0:A==0?O=M:M>0?O=M:O=_,this.xaxisOffset=O,L=H?t.max.apply(t,x)+t.max.apply(t,X):_-M,this.canvasHeightEf=A&&M<0?this.canvasHeight-2:this.canvasHeight-1,M<O?(U=H&&_>=0?y:_,R=(U-O)/L*this.canvasHeight,R!==t.ceil(R)&&(this.canvasHeightEf-=2,R=t.ceil(R))):R=this.canvasHeight,this.yoffset=R,r.isArray(s.get("colorMap"))?(this.colorMapByIndex=s.get("colorMap"),this.colorMapByValue=null):(this.colorMapByIndex=null,this.colorMapByValue=s.get("colorMap"),this.colorMapByValue&&this.colorMapByValue.get===n&&(this.colorMapByValue=new b(this.colorMapByValue))),this.range=L},getRegion:function(e,r,i){var s=t.floor(r/this.totalBarWidth);return s<0||s>=this.values.length?n:s},getCurrentRegionFields:function(){var e=this.currentRegion,t=g(this.values[e]),n=[],r,i;for(i=t.length;i--;)r=t[i],n.push({isNull:r===null,value:r,color:this.calcColor(i,r,e),offset:e});return n},calcColor:function(e,t,i){var s=this.colorMapByIndex,o=this.colorMapByValue,u=this.options,a,f;return this.stacked?a=u.get("stackedBarColor"):a=t<0?u.get("negBarColor"):u.get("barColor"),t===0&&u.get("zeroColor")!==n&&(a=u.get("zeroColor")),o&&(f=o.get(t))?a=f:s&&s.length>i&&(a=s[i]),r.isArray(a)?a[e%a.length]:a},renderRegion:function(e,i){var s=this.values[e],o=this.options,u=this.xaxisOffset,a=[],f=this.range,l=this.stacked,c=this.target,h=e*this.totalBarWidth,p=this.canvasHeightEf,v=this.yoffset,m,g,y,b,w,E,S,x,T,N;s=r.isArray(s)?s:[s],S=s.length,x=s[0],b=d(null,s),N=d(u,s,!0);if(b)return o.get("nullColor")?(y=i?o.get("nullColor"):this.calcHighlightColor(o.get("nullColor"),o),m=v>0?v-1:v,c.drawRect(h,m,this.barWidth-1,0,y,y)):n;w=v;for(E=0;E<S;E++){x=s[E];if(l&&x===u){if(!N||T)continue;T=!0}f>0?g=t.floor(p*(t.abs(x-u)/f))+1:g=1,x<u||x===u&&v===0?(m=w,w+=g):(m=v-g,v-=g),y=this.calcColor(E,x,e),i&&(y=this.calcHighlightColor(y,o)),a.push(c.drawRect(h,m,this.barWidth-1,g-1,y,y))}return a.length===1?a[0]:a}}),r.fn.sparkline.tristate=N=o(r.fn.sparkline._base,S,{type:"tristate",init:function(e,t,i,s,o){var u=parseInt(i.get("barWidth"),10),a=parseInt(i.get("barSpacing"),10);N._super.init.call(this,e,t,i,s,o),this.regionShapes={},this.barWidth=u,this.barSpacing=a,this.totalBarWidth=u+a,this.values=r.map(t,Number),this.width=s=t.length*u+(t.length-1)*a,r.isArray(i.get("colorMap"))?(this.colorMapByIndex=i.get("colorMap"),this.colorMapByValue=null):(this.colorMapByIndex=null,this.colorMapByValue=i.get("colorMap"),this.colorMapByValue&&this.colorMapByValue.get===n&&(this.colorMapByValue=new b(this.colorMapByValue))),this.initTarget()},getRegion:function(e,n,r){return t.floor(n/this.totalBarWidth)},getCurrentRegionFields:function(){var e=this.currentRegion;return{isNull:this.values[e]===n,value:this.values[e],color:this.calcColor(this.values[e],e),offset:e}},calcColor:function(e,t){var n=this.values,r=this.options,i=this.colorMapByIndex,s=this.colorMapByValue,o,u;return s&&(u=s.get(e))?o=u:i&&i.length>t?o=i[t]:n[t]<0?o=r.get("negBarColor"):n[t]>0?o=r.get("posBarColor"):o=r.get("zeroBarColor"),o},renderRegion:function(e,n){var r=this.values,i=this.options,s=this.target,o,u,a,f,l,c;o=s.pixelHeight,a=t.round(o/2),f=e*this.totalBarWidth,r[e]<0?(l=a,u=a-1):r[e]>0?(l=0,u=a-1):(l=a-1,u=2),c=this.calcColor(r[e],e);if(c===null)return;return n&&(c=this.calcHighlightColor(c,i)),s.drawRect(f,l,this.barWidth-1,u-1,c,c)}}),r.fn.sparkline.discrete=C=o(r.fn.sparkline._base,S,{type:"discrete",init:function(e,i,s,o,u){C._super.init.call(this,e,i,s,o,u),this.regionShapes={},this.values=i=r.map(i,Number),this.min=t.min.apply(t,i),this.max=t.max.apply(t,i),this.range=this.max-this.min,this.width=o=s.get("width")==="auto"?i.length*2:this.width,this.interval=t.floor(o/i.length),this.itemWidth=o/i.length,s.get("chartRangeMin")!==n&&(s.get("chartRangeClip")||s.get("chartRangeMin")<this.min)&&(this.min=s.get("chartRangeMin")),s.get("chartRangeMax")!==n&&(s.get("chartRangeClip")||s.get("chartRangeMax")>this.max)&&(this.max=s.get("chartRangeMax")),this.initTarget(),this.target&&(this.lineHeight=s.get("lineHeight")==="auto"?t.round(this.canvasHeight*.3):s.get("lineHeight"))},getRegion:function(e,n,r){return t.floor(n/this.itemWidth)},getCurrentRegionFields:function(){var e=this.currentRegion;return{isNull:this.values[e]===n,value:this.values[e],offset:e}},renderRegion:function(e,n){var r=this.values,i=this.options,s=this.min,o=this.max,u=this.range,f=this.interval,l=this.target,c=this.canvasHeight,h=this.lineHeight,p=c-h,d,v,m,g;return v=a(r[e],s,o),g=e*f,d=t.round(p-p*((v-s)/u)),m=i.get("thresholdColor")&&v<i.get("thresholdValue")?i.get("thresholdColor"):i.get("lineColor"),n&&(m=this.calcHighlightColor(m,i)),l.drawLine(g,d,g,d+h,m)}}),r.fn.sparkline.bullet=k=o(r.fn.sparkline._base,{type:"bullet",init:function(e,r,i,s,o){var u,a,f;k._super.init.call(this,e,r,i,s,o),this.values=r=c(r),f=r.slice(),f[0]=f[0]===null?f[2]:f[0],f[1]=r[1]===null?f[2]:f[1],u=t.min.apply(t,r),a=t.max.apply(t,r),i.get("base")===n?u=u<0?u:0:u=i.get("base"),this.min=u,this.max=a,this.range=a-u,this.shapes={},this.valueShapes={},this.regiondata={},this.width=s=i.get("width")==="auto"?"4.0em":s,this.target=this.$el.simpledraw(s,o,i.get("composite")),r.length||(this.disabled=!0),this.initTarget()},getRegion:function(e,t,r){var i=this.target.getShapeAt(e,t,r);return i!==n&&this.shapes[i]!==n?this.shapes[i]:n},getCurrentRegionFields:function(){var e=this.currentRegion;return{fieldkey:e.substr(0,1),value:this.values[e.substr(1)],region:e}},changeHighlight:function(e){var t=this.currentRegion,n=this.valueShapes[t],r;delete this.shapes[n];switch(t.substr(0,1)){case"r":r=this.renderRange(t.substr(1),e);break;case"p":r=this.renderPerformance(e);break;case"t":r=this.renderTarget(e)}this.valueShapes[t]=r.id,this.shapes[r.id]=t,this.target.replaceWithShape(n,r)},renderRange:function(e,n){var r=this.values[e],i=t.round(this.canvasWidth*((r-this.min)/this.range)),s=this.options.get("rangeColors")[e-2];return n&&(s=this.calcHighlightColor(s,this.options)),this.target.drawRect(0,0,i-1,this.canvasHeight-1,s,s)},renderPerformance:function(e){var n=this.values[1],r=t.round(this.canvasWidth*((n-this.min)/this.range)),i=this.options.get("performanceColor");return e&&(i=this.calcHighlightColor(i,this.options)),this.target.drawRect(0,t.round(this.canvasHeight*.3),r-1,t.round(this.canvasHeight*.4)-1,i,i)},renderTarget:function(e){var n=this.values[0],r=t.round(this.canvasWidth*((n-this.min)/this.range)-this.options.get("targetWidth")/2),i=t.round(this.canvasHeight*.1),s=this.canvasHeight-i*2,o=this.options.get("targetColor");return e&&(o=this.calcHighlightColor(o,this.options)),this.target.drawRect(r,i,this.options.get("targetWidth")-1,s-1,o,o)},render:function(){var e=this.values.length,t=this.target,n,r;if(!k._super.render.call(this))return;for(n=2;n<e;n++)r=this.renderRange(n).append(),this.shapes[r.id]="r"+n,this.valueShapes["r"+n]=r.id;this.values[1]!==null&&(r=this.renderPerformance().append(),this.shapes[r.id]="p1",this.valueShapes.p1=r.id),this.values[0]!==null&&(r=this.renderTarget().append(),this.shapes[r.id]="t0",this.valueShapes.t0=r.id),t.render()}}),r.fn.sparkline.pie=L=o(r.fn.sparkline._base,{type:"pie",init:function(e,n,i,s,o){var u=0,a;L._super.init.call(this,e,n,i,s,o),this.shapes={},this.valueShapes={},this.values=n=r.map(n,Number),i.get("width")==="auto"&&(this.width=this.height);if(n.length>0)for(a=n.length;a--;)u+=n[a];this.total=u,this.initTarget(),this.radius=t.floor(t.min(this.canvasWidth,this.canvasHeight)/2)},getRegion:function(e,t,r){var i=this.target.getShapeAt(e,t,r);return i!==n&&this.shapes[i]!==n?this.shapes[i]:n},getCurrentRegionFields:function(){var e=this.currentRegion;return{isNull:this.values[e]===n,value:this.values[e],percent:this.values[e]/this.total*100,color:this.options.get("sliceColors")[e%this.options.get("sliceColors").length],offset:e}},changeHighlight:function(e){var t=this.currentRegion,n=this.renderSlice(t,e),r=this.valueShapes[t];delete this.shapes[r],this.target.replaceWithShape(r,n),this.valueShapes[t]=n.id,this.shapes[n.id]=t},renderSlice:function(e,r){var i=this.target,s=this.options,o=this.radius,u=s.get("borderWidth"),a=s.get("offset"),f=2*t.PI,l=this.values,c=this.total,h=a?2*t.PI*(a/360):0,p,d,v,m,g;m=l.length;for(v=0;v<m;v++){p=h,d=h,c>0&&(d=h+f*(l[v]/c));if(e===v)return g=s.get("sliceColors")[v%s.get("sliceColors").length],r&&(g=this.calcHighlightColor(g,s)),i.drawPieSlice(o,o,o-u,p,d,n,g);h=d}},render:function(){var e=this.target,r=this.values,i=this.options,s=this.radius,o=i.get("borderWidth"),u,a;if(!L._super.render.call(this))return;o&&e.drawCircle(s,s,t.floor(s-o/2),i.get("borderColor"),n,o).append();for(a=r.length;a--;)r[a]&&(u=this.renderSlice(a).append(),this.valueShapes[a]=u.id,this.shapes[u.id]=a);e.render()}}),r.fn.sparkline.box=A=o(r.fn.sparkline._base,{type:"box",init:function(e,t,n,i,s){A._super.init.call(this,e,t,n,i,s),this.values=r.map(t,Number),this.width=n.get("width")==="auto"?"4.0em":i,this.initTarget(),this.values.length||(this.disabled=1)},getRegion:function(){return 1},getCurrentRegionFields:function(){var e=[{field:"lq",value:this.quartiles[0]},{field:"med",value:this.quartiles[1]},{field:"uq",value:this.quartiles[2]}];return this.loutlier!==n&&e.push({field:"lo",value:this.loutlier}),this.routlier!==n&&e.push({field:"ro",value:this.routlier}),this.lwhisker!==n&&e.push({field:"lw",value:this.lwhisker}),this.rwhisker!==n&&e.push({field:"rw",value:this.rwhisker}),e},render:function(){var e=this.target,r=this.values,i=r.length,s=this.options,o=this.canvasWidth,u=this.canvasHeight,a=s.get("chartRangeMin")===n?t.min.apply(t,r):s.get("chartRangeMin"),l=s.get("chartRangeMax")===n?t.max.apply(t,r):s.get("chartRangeMax"),c=0,h,p,d,v,m,g,y,b,w,E,S;if(!A._super.render.call(this))return;if(s.get("raw"))s.get("showOutliers")&&r.length>5?(p=r[0],h=r[1],v=r[2],m=r[3],g=r[4],y=r[5],b=r[6]):(h=r[0],v=r[1],m=r[2],g=r[3],y=r[4]);else{r.sort(function(e,t){return e-t}),v=f(r,1),m=f(r,2),g=f(r,3),d=g-v;if(s.get("showOutliers")){h=y=n;for(w=0;w<i;w++)h===n&&r[w]>v-d*s.get("outlierIQR")&&(h=r[w]),r[w]<g+d*s.get("outlierIQR")&&(y=r[w]);p=r[0],b=r[i-1]}else h=r[0],y=r[i-1]}this.quartiles=[v,m,g],this.lwhisker=h,this.rwhisker=y,this.loutlier=p,this.routlier=b,S=o/(l-a+1),s.get("showOutliers")&&(c=t.ceil(s.get("spotRadius")),o-=2*t.ceil(s.get("spotRadius")),S=o/(l-a+1),p<h&&e.drawCircle((p-a)*S+c,u/2,s.get("spotRadius"),s.get("outlierLineColor"),s.get("outlierFillColor")).append(),b>y&&e.drawCircle((b-a)*S+c,u/2,s.get("spotRadius"),s.get("outlierLineColor"),s.get("outlierFillColor")).append()),e.drawRect(t.round((v-a)*S+c),t.round(u*.1),t.round((g-v)*S),t.round(u*.8),s.get("boxLineColor"),s.get("boxFillColor")).append(),e.drawLine(t.round((h-a)*S+c),t.round(u/2),t.round((v-a)*S+c),t.round(u/2),s.get("lineColor")).append(),e.drawLine(t.round((h-a)*S+c),t.round(u/4),t.round((h-a)*S+c),t.round(u-u/4),s.get("whiskerColor")).append(),e.drawLine(t.round((y-a)*S+c),t.round(u/2),t.round((g-a)*S+c),t.round(u/2),s.get("lineColor")).append(),e.drawLine(t.round((y-a)*S+c),t.round(u/4),t.round((y-a)*S+c),t.round(u-u/4),s.get("whiskerColor")).append(),e.drawLine(t.round((m-a)*S+c),t.round(u*.1),t.round((m-a)*S+c),t.round(u*.9),s.get("medianColor")).append(),s.get("target")&&(E=t.ceil(s.get("spotRadius")),e.drawLine(t.round((s.get("target")-a)*S+c),t.round(u/2-E),t.round((s.get("target")-a)*S+c),t.round(u/2+E),s.get("targetColor")).append(),e.drawLine(t.round((s.get("target")-a)*S+c-E),t.round(u/2),t.round((s.get("target")-a)*S+c+E),t.round(u/2),s.get("targetColor")).append()),e.render()}}),_=o({init:function(e,t,n,r){this.target=e,this.id=t,this.type=n,this.args=r},append:function(){return this.target.appendShape(this),this}}),D=o({_pxregex:/(\d+)(px)?\s*$/i,init:function(e,t,n){if(!e)return;this.width=e,this.height=t,this.target=n,this.lastShapeId=null,n[0]&&(n=n[0]),r.data(n,"_jqs_vcanvas",this)},drawLine:function(e,t,n,r,i,s){return this.drawShape([[e,t],[n,r]],i,s)},drawShape:function(e,t,n,r){return this._genShape("Shape",[e,t,n,r])},drawCircle:function(e,t,n,r,i,s){return this._genShape("Circle",[e,t,n,r,i,s])},drawPieSlice:function(e,t,n,r,i,s,o){return this._genShape("PieSlice",[e,t,n,r,i,s,o])},drawRect:function(e,t,n,r,i,s){return this._genShape("Rect",[e,t,n,r,i,s])},getElement:function(){return this.canvas},getLastShapeId:function(){return this.lastShapeId},reset:function(){alert("reset not implemented")},_insert:function(e,t){r(t).html(e)},_calculatePixelDims:function(e,t,n){var i;i=this._pxregex.exec(t),i?this.pixelHeight=i[1]:this.pixelHeight=r(n).height(),i=this._pxregex.exec(e),i?this.pixelWidth=i[1]:this.pixelWidth=r(n).width()},_genShape:function(e,t){var n=j++;return t.unshift(n),new _(this,n,e,t)},appendShape:function(e){alert("appendShape not implemented")},replaceWithShape:function(e,t){alert("replaceWithShape not implemented")},insertAfterShape:function(e,t){alert("insertAfterShape not implemented")},removeShapeId:function(e){alert("removeShapeId not implemented")},getShapeAt:function(e,t,n){alert("getShapeAt not implemented")},render:function(){alert("render not implemented")}}),P=o(D,{init:function(t,i,s,o){P._super.init.call(this,t,i,s),this.canvas=e.createElement("canvas"),s[0]&&(s=s[0]),r.data(s,"_jqs_vcanvas",this),r(this.canvas).css({display:"inline-block",width:t,height:i,verticalAlign:"top"}),this._insert(this.canvas,s),this._calculatePixelDims(t,i,this.canvas),this.canvas.width=this.pixelWidth,this.canvas.height=this.pixelHeight,this.interact=o,this.shapes={},this.shapeseq=[],this.currentTargetShapeId=n,r(this.canvas).css({width:this.pixelWidth,height:this.pixelHeight})},_getContext:function(e,t,r){var i=this.canvas.getContext("2d");return e!==n&&(i.strokeStyle=e),i.lineWidth=r===n?1:r,t!==n&&(i.fillStyle=t),i},reset:function(){var e=this._getContext();e.clearRect(0,0,this.pixelWidth,this.pixelHeight),this.shapes={},this.shapeseq=[],this.currentTargetShapeId=n},_drawShape:function(e,t,r,i,s){var o=this._getContext(r,i,s),u,a;o.beginPath(),o.moveTo(t[0][0]+.5,t[0][1]+.5);for(u=1,a=t.length;u<a;u++)o.lineTo(t[u][0]+.5,t[u][1]+.5);r!==n&&o.stroke(),i!==n&&o.fill(),this.targetX!==n&&this.targetY!==n&&o.isPointInPath(this.targetX,this.targetY)&&(this.currentTargetShapeId=e)},_drawCircle:function(e,r,i,s,o,u,a){var f=this._getContext(o,u,a);f.beginPath(),f.arc(r,i,s,0,2*t.PI,!1),this.targetX!==n&&this.targetY!==n&&f.isPointInPath(this.targetX,this.targetY)&&(this.currentTargetShapeId=e),o!==n&&f.stroke(),u!==n&&f.fill()},_drawPieSlice:function(e,t,r,i,s,o,u,a){var f=this._getContext(u,a);f.beginPath(),f.moveTo(t,r),f.arc(t,r,i,s,o,!1),f.lineTo(t,r),f.closePath(),u!==n&&f.stroke(),a&&f.fill(),this.targetX!==n&&this.targetY!==n&&f.isPointInPath(this.targetX,this.targetY)&&(this.currentTargetShapeId=e)},_drawRect:function(e,t,n,r,i,s,o){return this._drawShape(e,[[t,n],[t+r,n],[t+r,n+i],[t,n+i],[t,n]],s,o)},appendShape:function(e){return this.shapes[e.id]=e,this.shapeseq.push(e.id),this.lastShapeId=e.id,e.id},replaceWithShape:function(e,t){var n=this.shapeseq,r;this.shapes[t.id]=t;for(r=n.length;r--;)n[r]==e&&(n[r]=t.id);delete this.shapes[e]},replaceWithShapes:function(e,t){var n=this.shapeseq,r={},i,s,o;for(s=e.length;s--;)r[e[s]]=!0;for(s=n.length;s--;)i=n[s],r[i]&&(n.splice(s,1),delete this.shapes[i],o=s);for(s=t.length;s--;)n.splice(o,0,t[s].id),this.shapes[t[s].id]=t[s]},insertAfterShape:function(e,t){var n=this.shapeseq,r;for(r=n.length;r--;)if(n[r]===e){n.splice(r+1,0,t.id),this.shapes[t.id]=t;return}},removeShapeId:function(e){var t=this.shapeseq,n;for(n=t.length;n--;)if(t[n]===e){t.splice(n,1);break}delete this.shapes[e]},getShapeAt:function(e,t,n){return this.targetX=t,this.targetY=n,this.render(),this.currentTargetShapeId},render:function(){var e=this.shapeseq,t=this.shapes,n=e.length,r=this._getContext(),i,s,o;r.clearRect(0,0,this.pixelWidth,this.pixelHeight);for(o=0;o<n;o++)i=e[o],s=t[i],this["_draw"+s.type].apply(this,s.args);this.interact||(this.shapes={},this.shapeseq=[])}}),H=o(D,{init:function(t,n,i){var s;H._super.init.call(this,t,n,i),i[0]&&(i=i[0]),r.data(i,"_jqs_vcanvas",this),this.canvas=e.createElement("span"),r(this.canvas).css({display:"inline-block",position:"relative",overflow:"hidden",width:t,height:n,margin:"0px",padding:"0px",verticalAlign:"top"}),this._insert(this.canvas,i),this._calculatePixelDims(t,n,this.canvas),this.canvas.width=this.pixelWidth,this.canvas.height=this.pixelHeight,s='<v:group coordorigin="0 0" coordsize="'+this.pixelWidth+" "+this.pixelHeight+'"'+' style="position:absolute;top:0;left:0;width:'+this.pixelWidth+"px;height="+this.pixelHeight+'px;"></v:group>',this.canvas.insertAdjacentHTML("beforeEnd",s),this.group=r(this.canvas).children()[0],this.rendered=!1,this.prerender=""},_drawShape:function(e,t,r,i,s){var o=[],u,a,f,l,c,h,p;for(p=0,h=t.length;p<h;p++)o[p]=""+t[p][0]+","+t[p][1];return u=o.splice(0,1),s=s===n?1:s,a=r===n?' stroked="false" ':' strokeWeight="'+s+'px" strokeColor="'+r+'" ',f=i===n?' filled="false"':' fillColor="'+i+'" filled="true" ',l=o[0]===o[o.length-1]?"x ":"",c='<v:shape coordorigin="0 0" coordsize="'+this.pixelWidth+" "+this.pixelHeight+'" '+' id="jqsshape'+e+'" '+a+f+' style="position:absolute;left:0px;top:0px;height:'+this.pixelHeight+"px;width:"+this.pixelWidth+'px;padding:0px;margin:0px;" '+' path="m '+u+" l "+o.join(", ")+" "+l+'e">'+" </v:shape>",c},_drawCircle:function(e,t,r,i,s,o,u){var a,f,l;return t-=i,r-=i,a=s===n?' stroked="false" ':' strokeWeight="'+u+'px" strokeColor="'+s+'" ',f=o===n?' filled="false"':' fillColor="'+o+'" filled="true" ',l='<v:oval  id="jqsshape'+e+'" '+a+f+' style="position:absolute;top:'+r+"px; left:"+t+"px; width:"+i*2+"px; height:"+i*2+'px"></v:oval>',l},_drawPieSlice:function(e,r,i,s,o,u,a,f){var l,c,h,p,d,v,m,g;if(o===u)return"";u-o===2*t.PI&&(o=0,u=2*t.PI),c=r+t.round(t.cos(o)*s),h=i+t.round(t.sin(o)*s),p=r+t.round(t.cos(u)*s),d=i+t.round(t.sin(u)*s);if(c===p&&h===d){if(u-o<t.PI)return"";c=p=r+s,h=d=i}return c===p&&h===d&&u-o<t.PI?"":(l=[r-s,i-s,r+s,i+s,c,h,p,d],v=a===n?' stroked="false" ':' strokeWeight="1px" strokeColor="'+a+'" ',m=f===n?' filled="false"':' fillColor="'+f+'" filled="true" ',g='<v:shape coordorigin="0 0" coordsize="'+this.pixelWidth+" "+this.pixelHeight+'" '+' id="jqsshape'+e+'" '+v+m+' style="position:absolute;left:0px;top:0px;height:'+this.pixelHeight+"px;width:"+this.pixelWidth+'px;padding:0px;margin:0px;" '+' path="m '+r+","+i+" wa "+l.join(", ")+' x e">'+" </v:shape>",g)},_drawRect:function(e,t,n,r,i,s,o){return this._drawShape(e,[[t,n],[t,n+i],[t+r,n+i],[t+r,n],[t,n]],s,o)},reset:function(){this.group.innerHTML=""},appendShape:function(e){var t=this["_draw"+e.type].apply(this,e.args);return this.rendered?this.group.insertAdjacentHTML("beforeEnd",t):this.prerender+=t,this.lastShapeId=e.id,e.id},replaceWithShape:function(e,t){var n=r("#jqsshape"+e),i=this["_draw"+t.type].apply(this,t.args);n[0].outerHTML=i},replaceWithShapes:function(e,t){var n=r("#jqsshape"+e[0]),i="",s=t.length,o;for(o=0;o<s;o++)i+=this["_draw"+t[o].type].apply(this,t[o].args);n[0].outerHTML=i;for(o=1;o<e.length;o++)r("#jqsshape"+e[o]).remove()},insertAfterShape:function(e,t){var n=r("#jqsshape"+e),i=this["_draw"+t.type].apply(this,t.args);n[0].insertAdjacentHTML("afterEnd",i)},removeShapeId:function(e){var t=r("#jqsshape"+e);this.group.removeChild(t[0])},getShapeAt:function(e,t,n){var r=e.id.substr(8);return r},render:function(){this.rendered||(this.group.innerHTML=this.prerender,this.rendered=!0)}})})}(document,Math),define("download",["jquery","laconic"],function(){(function(e){var t="downloader",n={_init:function(t){return this.each(function(){function u(){return e("<a>")[0].download!=undefined}var n=e(this),r=e.extend({name:"swish-download",ext:"dat"},t),i=r.content_type,s=r.filename||"swish-download.dat",o=r.charset||"charset=UTF-8";if(!u()||!i)i="application/octet-stream";var a="data:"+i+";"+o+",";a+=o=="base64"?r.data:encodeURIComponent(r.data),n.attr("download",s),n.attr("href",a),n.attr("title","Download (use menu for save link as)"),n.text(s),n.addClass("btn btn-primary download"),n.append(e.el.span({"class":"glyphicon glyphicon-download"}))})}};e.fn.downloader=function(r){if(n[r])return n[r].apply(this,Array.prototype.slice.call(arguments,1));if(typeof r=="object"||!r)return n._init.apply(this,arguments);e.error("Method "+r+" does not exist on jQuery."+t)}})(jQuery)}),define("runner",["jquery","config","preferences","cm/lib/codemirror","form","prolog","links","answer","laconic","sparkline","download"],function($,config,preferences,CodeMirror,form,prolog,links){function glyphButton(e,t){var n=$.el.a({href:"#","class":"close btn btn-link btn-sm",title:t},$.el.span({"class":"glyphicon glyphicon-"+e}));return n}(function(e){var t="prologRunners",n={_init:function(n){return this.each(function(){function i(){var t=e.el.span({"class":"glyphicon glyphicon-menu-hamburger"}),r=form.widgets.dropdownButton(t,{divClass:"runners-menu btn-transparent",ulClass:"pull-right",client:n,actions:{"Collapse all":function(){this.find(".prolog-runner").prologRunner("toggleIconic",!0)},"Expand all":function(){this.find(".prolog-runner").prologRunner("toggleIconic",!1)},"Stop all":function(){this.find(".prolog-runner").prologRunner("stop")},Clear:function(){this.prologRunners("clear")}}});return r}var n=e(this),r={};r.stretch=e(e.el.div({"class":"stretch"})),r.inner=e(e.el.div({"class":"inner"})),n.append(i()),n.append(r.stretch),n.append(r.inner),n.on("pane.resize",function(){n.prologRunners("scrollToBottom",!0)}),n.data(t,r)})},run:function(t){var n=this.data("prologRunners");t.iconifyLast&&this.prologRunners("iconifyLast");var r=e.el.div({"class":"prolog-runner"});return n.inner.append(r),e(r).prologRunner(t),this.prologRunners("scrollToBottom"),this},clear:function(){this.find(".prolog-runner").prologRunner("close")},iconifyLast:function(){var t=e(this.inner).children().last();if(t.length==1){var n=t.prologRunner();n.alive()||n.toggleIconic(!0)}return this},scrollToBottom:function(t){return this.each(function(){var n=e(this),r=n.data("prologRunners"),i=r.inner.height(),s=n.height()-i-4-2;if(s>0||t!==!0)r.stretch.height(s>0?s:0),n.scrollTop(i)}),this}};e.fn.prologRunners=function(r){if(n[r])return n[r].apply(this,Array.prototype.slice.call(arguments,1));if(typeof r=="object"||!r)return n._init.apply(this,arguments);e.error("Method "+r+" does not exist on jQuery."+t)}})(jQuery),function($){function RS(e){return $(e).parents(".prolog-runners")}function addAnswer(e,t){var n=e.find(".runner-results");return n.append(t),this}function aliveState(e){switch(e){case"running":case"wait-next":case"wait-input":case"wait-debug":return!0;default:return!1}}function answerTable(e){var t=[{"class":"projection"}];for(i=0;i<e.length;i++)t.push($.el.th({"class":"pl-pvar"},e[i]));t.push($.el.th({"class":"answer-nth"},""));var n=$.el.table({"class":"prolog-answers"},$.el.tbody($.el.tr.apply(this,t)));return n}function runScripts(elem){var scripts=[];elem=$(elem),elem.find("script").each(function(){var e=this.getAttribute("type")||"text/javascript";e=="text/javascript"&&scripts.push(this.textContent)});if(scripts.length>0){var script="(function(node){"+scripts.join("\n")+"})",node=new Node({node:elem[0]});try{eval(script)(node)}catch(e){alert(e)}}}function Node(e){this.my_node=e.node}function breakpoints(e){var t=e.data(pluginName);return $(e).parents(".swish").swish("breakpoints",t.prolog.id)}function registerSources(e){var t=e.options.runner,n=t.data(pluginName);n.query.editor&&$(n.query.editor).prologEditor("pengine",{add:e.id})}function handleCreate(){var e=this.pengine.options.runner,t=e.data(pluginName),n={},r,i=config.swish.residuals_var||"Residuals";registerSources(this.pengine);if(r=breakpoints(e))n.breakpoints=Pengine.stringify(r);t.chunk&&(n.chunk=t.chunk),this.pengine.ask("'$swish wrapper'((\n"+termNoFullStop(t.query.query)+"\n), "+i+")",n),e.prologRunner("setState","running")}function handleSuccess(){var e=this.pengine.options.runner;for(var t=0;t<this.data.length;t++){var n=this.data[t];this.projection&&(n.projection=this.projection),e.prologRunner("renderAnswer",n)}this.time>.1&&addAnswer(e,$.el.div({"class":"cputime"},$.el.span(this.time.toFixed(3)," seconds cpu time"))),e.prologRunner("setState",this.more?"wait-next":"true")}function handleFailure(){var e=this.pengine.options.runner;addAnswer(e,$.el.span({"class":"prolog-false"},"false")),e.prologRunner("setState","false")}function handleStop(){var e=this.pengine.options.runner;e.prologRunner("setState","stopped")}function handlePrompt(){var e=this.pengine.options.runner,t=e.data("prologRunner"),n=this.data||"Please enter a Prolog term";t.wait_for="term";if(typeof n=="object"){if(n.type=="trace")return e.prologRunner("trace",this);if(n.type=="jQuery")return e.prologRunner("jQuery",this);n.type=="console"?(n=n.prompt||"console> ",t.wait_for="line"):n=JSON.stringify(n)}e.prologRunner("setPrompt",n),e.prologRunner("setState","wait-input")}function clickableLocations(e,t){var n=/pengine:\/\/[-0-9a-f]{36}\/src:(\d+)/;return e.replace(n,function(e){var t=e.match(n)[1];return"<a class='goto-error' title='Goto location'><span class='glyphicon glyphicon-hand-right'></span> <b>line <span class='line'>"+t+"</span></b></a>"})}function gotoError(e){var t=$(e.target).closest("a.goto-error"),n=$(e.target).closest(".error-context"),r=n.data("error_context");if(t[0]){var i=parseInt(t.find("span.line").text()),s=t.find("span.file").text();return e.preventDefault(),s?n.closest("body.swish").swish("playFile",{file:s,line:i}):$(r.editor).prologEditor("gotoLine",i),!1}r.location.file?n.closest("body.swish").swish("playFile",r.location):$(r.editor).prologEditor("gotoLine",r.location.line)}function handleOutput(e){var t=e.pengine.options.runner;if(typeof e.data=="string"){var n=t.data(pluginName),r={editor:n.query.editor};e.data=e.data.replace(/'[-0-9a-f]{36}':/g,"");if(e.location){var i=e.location,s="swish://",o;function u(){var n=i.file+":"+i.line+":";i.ch&&(n+=i.ch+":"),n+="\\s*",e.data=clickableLocations(e.data.replace(new RegExp(n,"g"),""),r.editor),o=t.prologRunner("outputHTML",e.data),$(o).addClass("error-context"),$(o).append($.el.span({"class":"glyphicon glyphicon-hand-right"})),$(o).attr("title","Error in program.  Click to show in context"),$(o).on("click",gotoError),$(o).data("error_context",r)}if(i.file.startsWith(s)){var a=i.file.slice(s.length);r.location={file:a,line:i.line},u()}else i.file.startsWith("pengine://")&&(r.location={line:i.line},u(n.query.editor));registerSources(e.pengine),e.error_context=r,e.error_handler=gotoError,$(".swish-event-receiver").trigger("source-error",e)}else{var o=t.prologRunner("outputHTML",clickableLocations(e.data,r.editor));$(o).on("click",gotoError),$(o).data("error_context",r)}}else typeof e.data=="object"?t.prologRunner(e.data.action,e.data):console.log(e.data);RS(t).prologRunners("scrollToBottom")}function handleError(){var e=this.pengine.options.runner,t;this.code=="too_many_pengines"?this.message="Too many open queries.  Please complete some\nqueries by using |Next|, |Stop| or by\nclosing some queries.":typeof this.data=="string"?this.message=this.data.replace(new RegExp("'"+this.pengine.id+"':","g"),""):this.message="Unknown error",e.prologRunner("error",this),e.prologRunner("setState","error")}function handleAbort(){var e=this.pengine.options.runner;e.prologRunner("error","** Execution aborted **"),e.prologRunner("setState","aborted")}function handlePing(){var e=this.pengine.options.runner;e.prologRunner("ping",this.data)}function answerHasOutput(e){return e.variables.length>0||e.residuals}function termNoFullStop(e){return String($.trim(e)).replace(/\.$/,"")}var pluginName="prologRunner",keyBindings={59:"next",186:"next",32:"next",190:"stop",13:"stop",65:"stopOrAbort",27:"stopOrAbort",46:"close",112:"help"},methods={_init:function(e){return this.each(function(){function r(e,n,r){var i=$.el.button({title:n,"class":"rtb-"+r},$.el.span({"class":"glyphicon glyphicon-"+e}));return $(i).on("click",function(){t.prologRunner(r)}),i}function i(){var e=$.el.span({"class":"runner-state show-state idle"});return form.widgets.dropdownButton(e)}function s(){function e(){t.prologRunner("next",1)}function r(){t.prologRunner("next",10)}function i(){t.prologRunner("next",100)}function s(){t.prologRunner("next",1e3)}function o(){n.prolog.stop()}function u(){n.prolog.abort()}function a(e,t){var n=$.el.button(t);return $(n).on("click",e),n}function f(){var e=$.el.input({"class":"prolog-input"}),n=$.el.button("Send");return $(e).keypress(function(n){if(n.which==13&&t.prologRunner("respond",$(e).val()))return $(e).val(""),n.preventDefault(),!1;n.key!="Esc"&&n.stopPropagation()}),$(n).on("click",function(){t.prologRunner("respond",$(e).val())}),{input:e,button:n}}function l(){var e=$.el.span({"class":"sparklines"},"");return e}var c=f(),h=$.el.div({"class":"controller show-state"},$.el.span({"class":"running"},a(u,"Abort")),$.el.span({"class":"wait-next"},a(e,"Next"),a(r,"10"),a(i,"100"),a(s,"1,000")," ",a(o,"Stop")),$.el.span({"class":"wait-input"},a(u,"Abort"),c.button,$.el.span(c.input)),l());return h}var t=$(this),n={};t.addClass("prolog-runner"),e.tabled&&t.addClass("tabled");if(e.title!=0){var o=$.el.span({"class":"query cm-s-prolog"});CodeMirror.runMode(e.query,"prolog",o),t.append($.el.div({"class":"runner-title ui-widget-header"},r("remove-circle","Close","close"),r("minus","Iconify","toggleIconic"),r("download","Download CSV","downloadCSV"),i(),o))}else{var u=glyphButton("remove-circle","Close");t.append(u),$(u).on("click",function(){t.prologRunner("close")})}return e.chunk&&(n.chunk=e.chunk),t.append($.el.div({"class":"runner-results"})),t.append(s()),t.data("prologRunner",n),t.prologRunner("populateActionMenu"),t.keydown(function(e){t.prologRunner("getState")!="wait-input"&&!e.ctrlKey&&!e.altKey&&keyBindings[e.which]&&(e.preventDefault(),t.prologRunner(keyBindings[e.which]))}),t.on("click","a",links.followLink),n.savedFocus=document.activeElement,t.attr("tabindex",-1),t.focus(),n.query=e,n.answers=0,require([config.http.locations.pengines+"/pengines.js"],function(){n.prolog=new Pengine({server:config.http.locations.pengines,runner:t,application:"swish",src:e.source,destroy:!1,format:"json-html",oncreate:handleCreate,onsuccess:handleSuccess,onfailure:handleFailure,onstop:handleStop,onprompt:handlePrompt,onoutput:handleOutput,onping:handlePing,onerror:handleError,onabort:handleAbort}),n.prolog.state="idle",config.swish.ping&&n.prolog.ping!=undefined&&n.prolog.ping(config.swish.ping*1e3)}),this})},renderAnswer:function(e){var t=this.data("prologRunner"),n=++t.answers%2==0;if(t.query.tabled){if(t.answers!=1)return e.projection=t.projection,e.nth=t.answers,$(t.table).prologAnswer(e),this;if(e.projection&&e.projection.length>0){var r=answerTable(e.projection);return addAnswer(this,r),t.table=r,t.projection=e.projection,e.nth=t.answers,$(t.table).prologAnswer(e),this}}var i=$.el.div({"class":"answer "+(n?"even":"odd")},$.el.span({"class":"answer-no"},t.answers));addAnswer(this,i),$(i).prologAnswer(e)},outputHTML:function(e){var t=$.el.span({"class":"output"});return addAnswer(this,t),t.innerHTML=e,runScripts(t),t},downloadButton:function(e){var t=$.el.a({"class":"download"});addAnswer(this,t),$(t).downloader(e)},syntaxError:function(e){var t=this.data(pluginName);return e.data='<pre class="output msg-error">'+e.message+"</pre>",e.location.file=!0,$(t.query.query_editor).prologEditor("highlightError",e),this},error:function(e){var t;if(typeof e=="object"){if(e.code=="died")return addAnswer(this,$.el.div({"class":"RIP",title:"Remote pengine timed out"})),this;if(e.code=="syntax_error"){var n=e.message.match(/^HTTP:DATA:(\d+):(\d+):\s*(.*)/);n&&n.length==4&&(this.prologRunner("syntaxError",{location:{line:parseInt(n[1])-1,ch:parseInt(n[2])},message:n[3]}),t="Cannot run query due to a syntax error (check query window)")}t||(t=e.message)}else t=e;return addAnswer(this,$.el.pre({"class":"prolog-message msg-error"},t)),this},trace:function(e){function i(e){return e.charAt(0).toUpperCase()+e.slice(1)}function s(t,n,r){var i=$.el.button({"class":n,title:t},$.el.span(t));return $(i).on("click",function(t){r!==undefined&&(n+="("+Pengine.stringify(r(t))+")"),e.pengine.respond(n),$(t.target).parent().remove()}),i}var t=this,n=$.el.span({"class":"goal"}),r=e.data;$(n).html(r.goal),addAnswer(this,$.el.div({"class":"prolog-trace"},$.el.span({"class":"depth",style:"width:"+(r.depth*5-1)+"px"}," "),$.el.span({"class":"port "+r.port},i(r.port),":"),n)),r.port=="exception"&&addAnswer(this,$.el.div({"class":"prolog-exception"},r.exception.message)),addAnswer(this,$.el.div({"class":"trace-buttons"},s("Continue","nodebug",function(e){return breakpoints($(e.target).closest(".prolog-runner"))}),s("Step into","continue"),s("Step over","skip"),s("Step out","up"),s("Retry","retry"),s("Abort","abort"))),this.closest(".swish").find(".tabbed").trigger("trace-location",r),this.prologRunner("setState","wait-debug")},setPrompt:function(e){this.find(".controller input").attr("placeholder",e)},jQuery:function(e){var t=e.data,n;if(typeof t.selector=="string")n=$(t.selector);else if(typeof t.selector=="object"){switch(t.selector.root){case"this":root=this;break;case"swish":root=this.closest(".swish")}t.selector.sub==""?n=root:n=root.find(t.selector.sub)}console.log(n);var r=n[t.method].apply(n,t.arguments);console.log(r),e.pengine.respond(Pengine.stringify(r))},respond:function(e){var t=this.data("prologRunner");if(t.wait_for=="term"){s=termNoFullStop(e);if(s=="")return null}else s=Pengine.stringify(e+"\n");return addAnswer(this,$.el.div({"class":"response"},e)),t.prolog.respond(s),this},stop:function(){return this.each(function(){var e=$(this),t=e.data("prologRunner");t.prolog.stop()})},stopOrAbort:function(){return this.each(function(){var e=$(this),t=e.data("prologRunner"),n=e.prologRunner("getState");switch(n){case"running":case"wait-input":t.prolog.abort();break;case"wait-next":t.prolog.stop()}})},next:function(e){return this.each(function(){var t=$(this),n=t.data("prologRunner");n.prolog.next(e),t.prologRunner("setState","running")})},abort:function(){return this.each(function(){var e=$(this),t=e.data("prologRunner");t.prolog.abort()})},close:function(){if(this.length){var e=RS(this);this.each(function(){var e=$(this),t=e.data("prologRunner");e.prologRunner("alive")&&($(".prolog-editor").trigger("pengine-died",t.prolog.id),t.prolog.destroy())}),this.remove(),e.prologRunners("scrollToBottom",!0)}return this},help:function(){$(".swish-event-receiver").trigger("help",{file:"runner.html"})},toggleIconic:function(e){return e==undefined?this.toggleClass("iconic"):e?this.addClass("iconic"):this.removeClass("iconic"),RS(this).prologRunners("scrollToBottom",!0),this},populateActionMenu:function(e){var t=this.find(".runner-title .btn-group.dropdown");return e=$.extend({"Re-run":function(){console.log("Re-Run ",this)}},e),form.widgets.populateMenu(t,this,e),this},downloadCSV:function(e){var t=this.data("prologRunner"),n=t.query.query.replace(/\.\s*$/,"");return prolog.downloadCSV(n,t.query.source,e),this},setState:function(e){var t=this.data("prologRunner");if(!t)return;if(t.prolog.state!=e){var n=this.find(".show-state");n.removeClass(t.prolog.state).addClass(e),t.prolog.state=e,!aliveState(e)&&t.savedFocus?($(t.savedFocus).focus(),t.savedFocus=null):e=="wait-input"&&this.find("input").focus(),aliveState(e)||($(".prolog-editor").trigger("pengine-died",t.prolog.id),t.prolog.destroy())}if(e=="wait-next"||e=="true"){var r=RS(this);setTimeout(function(){r.prologRunners("scrollToBottom")},100)}else RS(this).prologRunners("scrollToBottom");return this},getState:function(){var e=this.data("prologRunner");return e.prolog?e.prolog.state:"idle"},alive:function(){return aliveState(this.prologRunner("getState"))},ping:function(e){var t=this.data("prologRunner");if(t&&t.prolog&&t.prolog.state=="running"){var n=this.find(".sparklines"),r=["global","local","trail"],s=["red","blue","green"],o=["Global ","Local ","Trail "],u=10;t.stacks||(t.stacks={global:{usage:[]},local:{usage:[]},trail:{usage:[]}});for(i=0;i<r.length;i++){var a=r[i],f=e.stacks[a].limit,l=e.stacks[a].usage,c=Math.log10(l/f*1e4);function h(e,t){function r(e){e=e.toString();var t=/(-?\d+)(\d{3})/;while(t.test(e))e=e.replace(t,"$1,$2");return e}var n=Math.round(Math.pow(10,t)/1e4*e);return r(n)}t.stacks[a].limit=f,t.stacks[a].usage.length>=u&&(t.stacks[a].usage=t.stacks[a].usage.slice(1)),t.stacks[a].usage.push(c),n.sparkline(t.stacks[a].usage,{height:n.parent().height(),composite:i>0,chartRangeMin:0,chartRangeMax:4,lineColor:s[i],tooltipPrefix:o[i],tooltipSuffix:" bytes",tooltipChartTitle:i==0?"Stack usage":undefined,numberFormatter:function(e){return h(f,e)}})}}}},node_id=1;Node.prototype.node=function(){return $(this.my_node)},Node.prototype.unique_id=function(){return this.uid||(this.uid=node_id++),this.uid},$.fn.prologRunner=function(e){if(methods[e])return methods[e].apply(this,Array.prototype.slice.call(arguments,1));if(typeof e=="object"||!e)return methods._init.apply(this,arguments);$.error("Method "+e+" does not exist on jQuery."+pluginName)}}(jQuery)}),define("gitty",["jquery","config","form","modal","laconic"],function(e,t,n,r){function i(t,n){function i(e){(t[e]||n[e])&&t[e]!=n[e]&&(r[e]={from:t[e],to:n[e]})}var r={};i("author"),i("title"),i("data"),i("public"),i("example");if(d=o(t.tags,n.tags))r.tags=d;return e.isEmptyObject(r)?null:r}function s(t,n){var r={};for(var i in t)if(t.hasOwnProperty(i)){switch(typeof t[i]){case"object":if(e.isArray(t[i])&&!o(t[i],n[i]))continue;break;case"string":case"boolean":if(n[i]==t[i])continue}r[i]=t[i]}return r}function o(t,n){function s(e,t){var n=[];for(var r=0;r<t.length;r++)e.indexOf(t[r])<0&&n.push(t[r]);return n}var r,i={};return t=t||[],n=n||[],(r=s(t,n)).length>0&&(i.added=r),(r=s(n,t)).length>0&&(i.deleted=r),e.isEmptyObject(i)?null:i}return function(e){var s="gitty",o={_init:function(t){return this.each(function(){function u(t,n,r,i){var s={role:"presentation"},o=[];n&&o.push("active"),i&&o.push("disabled"),o!=[]&&(s.class=o.join(" "));var u=e.el.li(s,e.el.a({href:"#"+r,"data-toggle":"tab"},t));return u}var n=e(this),r=n.data(s)||{},i=t.meta,o;r.commits=[],r.commits[i.commit]=i,r.commit=i.commit,r.editor=t.editor,henabled=!Boolean(i.previous),o=e(e.el.div({"class":"tab-content"})),n.append(e.el.ul({"class":"nav nav-tabs"},u("Meta data",!0,"gitty-meta-data"),u("History",!1,"gitty-history",henabled),u("Changes",!1,"gitty-diff",henabled))),n.append(o),o.append(e.el.div({"class":"tab-pane fade in active gitty-meta-data",id:"gitty-meta-data"})),n.find('[href="#gitty-meta-data"]').on("show.bs.tab",function(e){n.gitty("showMetaData")}),o.append(e.el.div({"class":"tab-pane fade gitty-history",id:"gitty-history"})),n.find('[href="#gitty-history"]').on("show.bs.tab",function(e){n.gitty("showHistory")}),o.append(e.el.div({"class":"tab-pane fade gitty-diff",id:"gitty-diff"})),n.find('[href="#gitty-diff"]').on("show.bs.tab",function(e){n.gitty("showDiff")}),n.data(s,r),n.gitty("showMetaData")})},title:function(t){var n=e.el.span("File ",e.el.span({"class":"filename"},t.name));return t.symbolic!="HEAD"&&t.commit&&e(n).append("@",e.el.span({"class":"sha1 abbrev"},t.commit.substring(0,7))),n},showMetaData:function(){return this.each(function(){var t=e(this),r=t.data(s),i=t.find(".gitty-meta-data"),o,u=r.commits[r.commit];if(r.metaData==r.commit)return;r.metaData=r.commit,i.html(""),o=e.el.form({"class":"form-horizontal"},n.fields.fileName(u.name,u.public,u.example,!0),n.fields.title(u.title),n.fields.author(u.author),n.fields.date(u.time,"Date","date"),n.fields.tags(u.tags)),u.symbolic=="HEAD"&&e(o).append(n.fields.buttons({label:"Update meta data",action:function(e,t){return r.editor.storage("save",t,"only-meta-data"),!1}})),i.append(o)})},showHistory:function(){return this.each(function(){var i=e(this),o=i.data(s),u=i.find(".gitty-history"),a=o.commits[o.commit],f;if(o.history)return;u.html(""),u.append(e.el.table({"class":"table table-striped table-condensed gitty-history","data-click-to-select":!0,"data-single-select":!0},e.el.tr(e.el.th("Comment"),e.el.th("Date"),e.el.th("Author"),e.el.th("Changed")),e.el.tbody())),f=n.widgets.glyphIconButton("glyphicon-play",{title:"Open the highlighted version in SWISH"}),u.append(f),e(f).on("click",function(t){var n=i.find("tr.success");if(n.length==1){var r=n.data("commit");o.commits[r].symbolic=="HEAD"?file=o.commits[r].name:file=r,i.parents(".swish").swish("playFile",file),e("#ajaxModal").modal("hide")}return!1});var l=t.http.locations.web_storage+encodeURI(a.name);e.ajax({url:l,contentType:"application/json",type:"GET",data:{format:"history",depth:6,to:o.commit},success:function(e){i.gitty("fillHistoryTable",e),o.history=o.commit},error:function(e){r.ajaxError(jqXHR)}})})},fillHistoryTable:function(t){function f(t){var n,s,o=e.el.span();if(t.previous){if((n=r.commits[t.previous])&&(s=i(t,n)))for(var u in s)s.hasOwnProperty(u)&&e(o).append(e.el.span({"class":"change-type"},u))}else e(o).append("initial");return o}var n=this,r=this.data(s),o=this.find(".table.gitty-history tbody");for(var u=0;u<t.length;u++){var a=t[u];r.commits[a.commit]||(r.commits[a.commit]=a)}for(var u=0;u<t.length;u++){var a=t[u],l;if(u==t.length-1&&a.previous&&!r.commit[a.previous])break;var c={"data-commit":a.commit};r.commit==a.commit&&(c.class="success"),l=e.el.tr(c,e.el.td({"class":"commit-message"},a.commit_message||"No comment"),e.el.td({"class":"date"},(new Date(a.time*1e3)).toLocaleString()),e.el.td({"class":"author"},a.author||"No author"),e.el.td({"class":"changes"},f(a))),o.append(l)}o.on("click","tr",function(t){var r=e(t.target).parents("tr"),i=r.data("commit");n.gitty("setCommit",i)})},setCommit:function(e){var t=this.data(s),n=this.parent(".modal-content").find("h2");return n.html(""),n.append(this.gitty("title",t.commits[e])),this.find("tr.success").removeClass("success"),this.find("tr[data-commit="+e+"]").addClass("success"),t.commit=e,this},showDiff:function(){return this.each(function(){var n=e(this),i=n.data(s);if(i.diff==i.commit)return;n.find(".gitty-diff").html("");var o=t.http.locations.web_storage+encodeURI(i.commit);e.ajax({url:o,contentType:"application/json",type:"GET",data:{format:"diff"},success:function(e){n.gitty("fillDiff",e),i.diff=i.commit},error:function(e){r.ajaxError(e)}})})},fillDiff:function(e){e.tags&&this.gitty("diffTags",e.tags),e.data&&this.gitty("udiffData",e.data)},diffTags:function(t){function s(t,n){i.append(e.el.span({"class":"diff-tag "+n},t))}var n=this.find(".gitty-diff"),r=e(e.el.div({"class":"diff-tags"},e.el.label("Tags"))),i=e(e.el.span({"class":"diff-tags"}));r.append(i);if(t.deleted.length){i.append("Removed: ");for(var o=0;o<t.deleted.length;o++)s(t.deleted[o],"deleted")}if(t.added.length){i.append(t.deleted.length?", ":"","Added: ");for(var o=0;o<t.added.length;o++)s(t.added[o],"added")}return n.append(r),this},udiffData:function(t){var n=this.find(".gitty-diff"),r=t.split("\n"),i=e(e.el.pre({"class":"udiff"}));for(var s=0;s<r.length;s++){var o=r[s],u={"@":"udiff-hdr"," ":"udiff-ctx","+":"udiff-add","-":"udiff-del"};i.append(e.el.span({"class":u[o.charAt(0)]},o),e.el.br())}n.append(i)}};e.fn.gitty=function(t){if(o[t])return o[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return o._init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery."+s)}}(jQuery),{diffMeta:i,reduceMeta:s,diffTags:o}});var __whitespace={" ":!0,"	":!0,"\n":!0,"\f":!0,"\r":!0},difflib={defaultJunkFunction:function(e){return __whitespace.hasOwnProperty(e)},stripLinebreaks:function(e){return e.replace(/^[\n\r]*|[\n\r]*$/g,"")},stringAsLines:function(e){var t=e.indexOf("\n"),n=e.indexOf("\r"),r=t>-1&&n>-1||n<0?"\n":"\r",i=e.split(r);for(var s=0;s<i.length;s++)i[s]=difflib.stripLinebreaks(i[s]);return i},__reduce:function(e,t,n){if(n!=null)var r=n,i=0;else{if(!t)return null;var r=t[0],i=1}for(;i<t.length;i++)r=e(r,t[i]);return r},__ntuplecomp:function(e,t){var n=Math.max(e.length,t.length);for(var r=0;r<n;r++){if(e[r]<t[r])return-1;if(e[r]>t[r])return 1}return e.length==t.length?0:e.length<t.length?-1:1},__calculate_ratio:function(e,t){return t?2*e/t:1},__isindict:function(e){return function(t){return e.hasOwnProperty(t)}},__dictget:function(e,t,n){return e.hasOwnProperty(t)?e[t]:n},SequenceMatcher:function(e,t,n){this.set_seqs=function(e,t){this.set_seq1(e),this.set_seq2(t)},this.set_seq1=function(e){if(e==this.a)return;this.a=e,this.matching_blocks=this.opcodes=null},this.set_seq2=function(e){if(e==this.b)return;this.b=e,this.matching_blocks=this.opcodes=this.fullbcount=null,this.__chain_b()},this.__chain_b=function(){var e=this.b,t=e.length,n=this.b2j={},r={};for(var i=0;i<e.length;i++){var s=e[i];if(n.hasOwnProperty(s)){var o=n[s];t>=200&&o.length*100>t?(r[s]=1,delete n[s]):o.push(i)}else n[s]=[i]}for(var s in r)r.hasOwnProperty(s)&&delete n[s];var u=this.isjunk,a={};if(u){for(var s in r)r.hasOwnProperty(s)&&u(s)&&(a[s]=1,delete r[s]);for(var s in n)n.hasOwnProperty(s)&&u(s)&&(a[s]=1,delete n[s])}this.isbjunk=difflib.__isindict(a),this.isbpopular=difflib.__isindict(r)},this.find_longest_match=function(e,t,n,r){var i=this.a,s=this.b,o=this.b2j,u=this.isbjunk,a=e,f=n,l=0,c=null,h,p={},d=[];for(var v=e;v<t;v++){var m={},g=difflib.__dictget(o,i[v],d);for(var y in g)if(g.hasOwnProperty(y)){c=g[y];if(c<n)continue;if(c>=r)break;m[c]=h=difflib.__dictget(p,c-1,0)+1,h>l&&(a=v-h+1,f=c-h+1,l=h)}p=m}while(a>e&&f>n&&!u(s[f-1])&&i[a-1]==s[f-1])a--,f--,l++;while(a+l<t&&f+l<r&&!u(s[f+l])&&i[a+l]==s[f+l])l++;while(a>e&&f>n&&u(s[f-1])&&i[a-1]==s[f-1])a--,f--,l++;while(a+l<t&&f+l<r&&u(s[f+l])&&i[a+l]==s[f+l])l++;return[a,f,l]},this.get_matching_blocks=function(){if(this.matching_blocks!=null)return this.matching_blocks;var e=this.a.length,t=this.b.length,n=[[0,e,0,t]],r=[],i,s,o,u,a,f,l,c,h;while(n.length)a=n.pop(),i=a[0],s=a[1],o=a[2],u=a[3],h=this.find_longest_match(i,s,o,u),f=h[0],l=h[1],c=h[2],c&&(r.push(h),i<f&&o<l&&n.push([i,f,o,l]),f+c<s&&l+c<u&&n.push([f+c,s,l+c,u]));r.sort(difflib.__ntuplecomp);var p=0,d=0,v=0,m=0,g,y,b,w=[];for(var E in r)r.hasOwnProperty(E)&&(m=r[E],g=m[0],y=m[1],b=m[2],p+v==g&&d+v==y?v+=b:(v&&w.push([p,d,v]),p=g,d=y,v=b));return v&&w.push([p,d,v]),w.push([e,t,0]),this.matching_blocks=w,this.matching_blocks},this.get_opcodes=function(){if(this.opcodes!=null)return this.opcodes;var e=0,t=0,n=[];this.opcodes=n;var r,i,s,o,u,a=this.get_matching_blocks();for(var f in a)a.hasOwnProperty(f)&&(r=a[f],i=r[0],s=r[1],o=r[2],u="",e<i&&t<s?u="replace":e<i?u="delete":t<s&&(u="insert"),u&&n.push([u,e,i,t,s]),e=i+o,t=s+o,o&&n.push(["equal",i,e,s,t]));return n},this.get_grouped_opcodes=function(e){e||(e=3);var t=this.get_opcodes();t||(t=[["equal",0,1,0,1]]);var n,r,i,s,o,u;t[0][0]=="equal"&&(n=t[0],r=n[0],i=n[1],s=n[2],o=n[3],u=n[4],t[0]=[r,Math.max(i,s-e),s,Math.max(o,u-e),u]),t[t.length-1][0]=="equal"&&(n=t[t.length-1],r=n[0],i=n[1],s=n[2],o=n[3],u=n[4],t[t.length-1]=[r,i,Math.min(s,i+e),o,Math.min(u,o+e)]);var a=e+e,f=[],l=[];for(var c in t)t.hasOwnProperty(c)&&(n=t[c],r=n[0],i=n[1],s=n[2],o=n[3],u=n[4],r=="equal"&&s-i>a&&(f.push([r,i,Math.min(s,i+e),o,Math.min(u,o+e)]),l.push(f),f=[],i=Math.max(i,s-e),o=Math.max(o,u-e)),f.push([r,i,s,o,u]));return f&&(f.length!=1||f[0][0]!="equal")&&l.push(f),l},this.ratio=function(){return matches=difflib.__reduce(function(e,t){return e+t[t.length-1]},this.get_matching_blocks(),0),difflib.__calculate_ratio(matches,this.a.length+this.b.length)},this.quick_ratio=function(){var e,t;if(this.fullbcount==null){this.fullbcount=e={};for(var n=0;n<this.b.length;n++)t=this.b[n],e[t]=difflib.__dictget(e,t,0)+1}e=this.fullbcount;var r={},i=difflib.__isindict(r),s=numb=0;for(var n=0;n<this.a.length;n++)t=this.a[n],i(t)?numb=r[t]:numb=difflib.__dictget(e,t,0),r[t]=numb-1,numb>0&&s++;return difflib.__calculate_ratio(s,this.a.length+this.b.length)},this.real_quick_ratio=function(){var e=this.a.length,t=this.b.length;return _calculate_ratio(Math.min(e,t),e+t)},this.isjunk=n?n:difflib.defaultJunkFunction,this.a=this.b=null,this.set_seqs(e,t)}};define("difflib",function(){}),diffview={buildView:function(e){function a(e,t){var n=document.createElement(e);return n.className=t,n}function f(e,t){var n=document.createElement(e);return n.appendChild(document.createTextNode(t)),n}function l(e,t,n){var r=document.createElement(e);return r.className=t,r.appendChild(document.createTextNode(n)),r}function v(e,t,n,r,i){return t<n?(e.appendChild(f("th",(t+1).toString())),e.appendChild(l("td",i,r[t].replace(/\t/g,"    "))),t+1):(e.appendChild(document.createElement("th")),e.appendChild(a("td","empty")),t)}function m(e,t,n,r,i){e.appendChild(f("th",t==null?"":(t+1).toString())),e.appendChild(f("th",n==null?"":(n+1).toString())),e.appendChild(l("td",i,r[t!=null?t:n].replace(/\t/g,"    ")))}var t=e.baseTextLines,n=e.newTextLines,r=e.opcodes,i=e.baseTextName?e.baseTextName:"Base Text",s=e.newTextName?e.newTextName:"New Text",o=e.contextSize,u=e.viewType==0||e.viewType==1?e.viewType:0;if(t==null)throw"Cannot build diff view; baseTextLines is not defined.";if(n==null)throw"Cannot build diff view; newTextLines is not defined.";if(!r)throw"Canno build diff view; opcodes is not defined.";var c=document.createElement("thead"),h=document.createElement("tr");c.appendChild(h),u?(h.appendChild(document.createElement("th")),h.appendChild(document.createElement("th")),h.appendChild(l("th","texttitle",i+" vs. "+s))):(h.appendChild(document.createElement("th")),h.appendChild(l("th","texttitle",i)),h.appendChild(document.createElement("th")),h.appendChild(l("th","texttitle",s))),c=[c];var p=[],d;for(var g=0;g<r.length;g++){code=r[g],change=code[0];var y=code[1],b=code[2],w=code[3],E=code[4],S=Math.max(b-y,E-w),x=[],T=[];for(var N=0;N<S;N++){if(o&&r.length>1&&(g>0&&N==o||g==0&&N==0)&&change=="equal"){var C=S-(g==0?1:2)*o;if(C>1){x.push(h=document.createElement("tr")),y+=C,w+=C,N+=C-1,h.appendChild(f("th","...")),u||h.appendChild(l("td","skip","")),h.appendChild(f("th","...")),h.appendChild(l("td","skip",""));if(g+1==r.length)break;continue}}x.push(h=document.createElement("tr")),u?change=="insert"?m(h,null,w++,n,change):change=="replace"?(T.push(d=document.createElement("tr")),y<b&&m(h,y++,null,t,"delete"),w<E&&m(d,null,w++,n,"insert")):change=="delete"?m(h,y++,null,t,change):m(h,y++,w++,t,change):(y=v(h,y,b,t,change),w=v(h,w,E,n,change))}for(var N=0;N<x.length;N++)p.push(x[N]);for(var N=0;N<T.length;N++)p.push(T[N])}p.push(h=l("th","author","diff view generated by ")),h.setAttribute("colspan",u?3:4),h.appendChild(d=f("a","jsdifflib")),d.setAttribute("href","http://github.com/cemerick/jsdifflib"),c.push(h=document.createElement("tbody"));for(var g in p)p.hasOwnProperty(g)&&h.appendChild(p[g]);h=a("table","diff"+(u?" inlinediff":""));for(var g in c)c.hasOwnProperty(g)&&h.appendChild(c[g]);return h}},define("diffview",function(){}),define("diff",["jquery","difflib","diffview"],function(){(function(e){var t="diff",n={_init:function(t){return this.each(function(){var n=difflib.stringAsLines(t.base),r=difflib.stringAsLines(t.head),i=new difflib.SequenceMatcher(n,r),s=i.get_opcodes(),o=t.contextSize==undefined?3:t.contextSize;this.appendChild(diffview.buildView({baseTextLines:n,newTextLines:r,opcodes:s,baseTextName:t.baseName||"Base text",newTextName:t.headName||"Current text",contextSize:o,viewType:e("inline").checked?1:0}))})}};e.fn.diff=function(r){if(n[r])return n[r].apply(this,Array.prototype.slice.call(arguments,1));if(typeof r=="object"||!r)return n._init.apply(this,arguments);e.error("Method "+r+" does not exist on jQuery."+t)}})(jQuery)}),define("storage",["jquery","config","modal","form","gitty","history","tabbed","laconic","diff"],function(e,t,n,r,i,s,o){function u(e){return e?e.split(".").slice(0,-1).join("."):null}function a(e){return e?e.split("/").pop():null}function f(t){if(t){var n=t.split("\n"),r=e(e.el.pre({"class":"udiff"}));for(var i=0;i<n.length;i++){var s=n[i],o={"@":"udiff-hdr"," ":"udiff-ctx","+":"udiff-add","-":"udiff-del"};r.append(e.el.span({"class":o[s.charAt(0)]},s),e.el.br())}return r}return e(e.el.div({"class":"udiff"},"No changes"))}function l(t){function s(t,n){r.append(e.el.span({"class":n},t),e.el.br())}var n=t.split("\n"),r=e(e.el.pre({"class":"udiff"})),i=null;for(var o=0;o<n.length;o++){var u=n[o];u=="<<<<<<<"?(s(u,"edit-conflict-sep"),i="edit-conflict-me"):i=="edit-conflict-me"&&u=="======="?(s(u,"edit-conflict-sep"),i="edit-conflict-them"):i=="edit-conflict-them"&&u==">>>>>>>"?(s(u,"edit-conflict-sep"),i=null):i&&s(u,i)}return r}(function(e){function d(e){return e.charAt(0).toUpperCase()+e.slice(1)}function v(t,n){var r=e.el.table({"class":"table table-striped"});e(r).append(e.el.tr(e.el.th("Path"),e.el.td(n.path))),e(r).append(e.el.tr(e.el.th("Modified"),e.el.td((new Date(n.last_modified*1e3)).toLocaleString()))),e(r).append(e.el.tr(e.el.th("Loaded"),e.el.td(n.modified_since_loaded?"yes (modified)":n.loaded?"yes":"no"))),t.append(r)}function m(e,t){return t.error=="file_exists"?e+": file exists: "+t.file:JSON.stringify(t)}var c="storage",h={typeName:"program",markClean:function(e){}},p={_init:function(t){return this.each(function(){function i(t,n){var r=e(t.target);if(r.hasClass("storage")&&r.is(":visible")){var i=r.storage.apply(r,Array.prototype.slice.call(arguments,1));if(i=="propagate")return}t.stopPropagation()}var n=e(this),r=e.extend({},h,t);n.addClass("storage");if(t.title||t.file||t.url){var s=t.file;!s&&t.url&&(s=t.url.split("/").pop()),n.tabbed("title",t.title||u(s),s?s.split(".").pop():"pl")}n.on("source",function(e,t){i(e,"setSource",t)}),n.on("save",function(e,t){i(e,"save",t)}),n.on("download",function(e){i(e,"download")}),n.on("fileInfo",function(e){i(e,"info")}),n.on("diff",function(e){i(e,"diff")}),n.on("revert",function(e){i(e,"revert")}),n.on("activate-tab",function(e){}),e(window).bind("beforeunload",function(e){return n.storage("unload","beforeunload",e)}),n.data(c,r)})},setSource:function(e){function f(e){return e?e.split("/").pop():null}var n=this.data(c),r=o.tabTypes[n.typeName];typeof e=="string"&&(e={data:e});if(e.newTab)return"propagate";if(e.meta&&e.meta.name||e.url){var i=e.meta&&e.meta.name?e.meta.name:e.url,a=i.split(".").pop();if(a!=r.dataType)return"propagate"}if(this.storage("unload","setSource")==0)return!1;e.meta?(n.file=e.meta.name,n.meta=e.meta,n.url=null):(n.file=null,n.meta=null),n.url=e.url||undefined,n.st_type=e.st_type||undefined,n.setValue(e),n.cleanGeneration=n.changeGen(),n.cleanData=e.data,n.cleanCheckpoint=e.cleanCheckpoint||"load";var l=u(n.file)||u(f(e.url))||r.label;return e.url||(e.url=t.http.locations.swish),this.tabbed("title",l,r.dataType),e.noHistory||s.push(e),this},load:function(r){if(r){var i=this,s=this.data(c);e.ajax({url:t.http.locations.web_storage+r,dataType:"text",success:function(e){i.storage("setSource",{data:e,meta:{name:r}})},error:function(e){n.ajaxError(jqXHR)}})}return this},revert:function(){var e=this.data(c);return e.setValue(e.cleanData),e.cleanGeneration=e.changeGen(),e.markClean(!0),this},reload:function(){var r=this,i=r.data(c),s=t.http.locations.web_storage+encodeURI(i.file);return e.ajax({url:s,type:"GET",data:{format:"json"},success:function(e){e.url=s,e.st_type="gitty",e.noHistory=!0,r.storage("setSource",e)},error:function(e){n.ajaxError(e)}}),this},save:function(r,u){var a=this.data(c),f=o.tabTypes[a.typeName],l=t.http.locations.web_storage,h="POST",p=this,d;if(a.st_type!="filesys"&&a.st_type!="external"||!a.url){if(r=="as")return this.storage("saveAs"),this;a.file&&(!r||!r.name||r.name==a.file)&&(l+=encodeURI(a.file),h="PUT");if(u=="only-meta-data"){r=i.reduceMeta(r,a.meta);if(e.isEmptyObject(r)){alert("No change");return}d={update:"meta-data"}}else if(h=="POST")d={data:a.getValue(),type:f.dataType};else if(!a.isClean(a.cleanGeneration))d={data:a.getValue(),type:f.dataType};else if(i.diffTags(a.meta.tags,r.tags)==null){alert("No change");return}return r&&(d.meta=r),a.meta&&(d.previous=a.meta.commit),e.ajax({url:l,dataType:"json",contentType:"application/json",type:h,data:JSON.stringify(d),success:function(e){e.error?n.alert(m("Could not save",e)):(a.meta&&a.meta.example!=e.meta.example&&p.closest(".swish").trigger("examples-changed"),a.file=e.file,a.meta=e.meta,a.st_type="gitty",a.cleanGeneration=a.changeGen(),a.cleanData=a.getValue(),a.cleanCheckpoint="save",a.markClean(!0),n.feedback({html:"Saved",owner:p}),p.tabbed("title",a.meta.name),s.push(e))},error:function(e,t,n){e.status==409?p.storage("resolveEditConflict",JSON.parse(e.responseText)):(alert('Save failed; click "ok" to try again'),p.storage("saveAs"))}}),this}return this.storage("saveURL")},saveAs:function(n){function p(){this.append(e.el.form({"class":"form-horizontal"},r.fields.fileName(f?null:i.file,s.public,s.example),r.fields.title(s.title),r.fields.author(h),a?r.fields.commit_message():undefined,r.fields.tags(s.tags),r.fields.buttons({label:f?"Fork "+l.label:a?"Update "+l.label:"Save "+l.label,action:function(e,t){return u.storage("save",t),!1}})))}var i=this.data(c),s=i.meta||{},u=this,a=Boolean(i.file),f=i.meta&&s.symbolic!="HEAD",l=o.tabTypes[i.typeName],h=t.swish.user?t.swish.user.realname&&t.swish.user.email?t.swish.user.realname+" <"+t.swish.user.email+">":t.swish.user.user:s.author;return s.public===undefined&&(s.public=!0),n=n||{},r.showDialog({title:n.title?n.title:f?"Fork from "+s.commit.substring(0,7):a?"Save new version":"Save "+l.label+" as",body:p}),this},saveURL:function(){var t=this.data(c),r=t.getValue(),i=o.type(t.url)||{},s=this;return t.isClean(t.cleanGeneration)?(alert("No change"),this):(e.ajax({url:t.url,dataType:"json",contentType:i.contentType||"text/plain",type:"PUT",data:r,success:function(e){e.error?n.alert(m("Could not save",e)):(t.cleanGeneration=t.changeGen(),t.cleanData=t.getValue(),t.cleanCheckpoint="save",t.markClean(!0),n.feedback({html:"Saved",owner:s}))},error:function(e){if(e.status==403){var r=t.url;delete t.meta,delete t.st_type,delete t.url,s.storage("saveAs",{title:"<div class='warning'>Could not save to "+r+"</div> Save a copy as"})}else n.ajaxError(e)}}),this)},resolveEditConflict:function(t){function i(){function i(t,n,r,i){var s={role:"presentation"},o=[];n&&o.push("active"),i&&o.push("disabled"),o!=[]&&(s.class=o.join(" "));var u=e.el.li(s,e.el.a({href:"#"+r,"data-toggle":"tab"},t));return u}function s(t,n){tabs.append(e.el.div({"class":"tab-pane fade "+t+" "+n,id:t})),r.find('[href="#'+t+'"]').on("show.bs.tab",function(e){r.storage(t)})}var r=e(this);r.addClass("edit-conflict"),tabs=e(e.el.div({"class":"tab-content"})),r.append(e.el.ul({"class":"nav nav-tabs"},i("My edits",!0,"merge-my-edits"),i("Their edits",!1,"merge-server-edits"),i("Conflicts",!1,"merge-conflicts"))),r.append(tabs),s("merge-my-edits","in active"),s("merge-server-edits",""),s("merge-conflicts",""),r.data("edit-conflict",t),r.storage("merge-my-edits"),r.append(n=e.el.div({"class":"form-group"},e.el.button({name:"merge","class":"btn btn-primary"},"Merge"),e.el.button({name:"discard-my-edits","class":"btn btn-primary"},"Discard my changes"),e.el.button({name:"discard-server-edits","class":"btn btn-primary"},"Discard changes on server"),e.el.button({name:"cancel","class":"btn btn-danger","data-dismiss":"modal"},"Cancel"))),e(n).on("click","button",function(t){return r.storage("editConflictAction",e(t.target).attr("name")),e(t.target).parents(".modal").modal("hide"),t.preventDefault(),!1})}var n;return t.storage=this,r.showDialog({title:"Edit conflict",body:i}),this},"merge-my-edits":function(){var t=e(this).data("edit-conflict");e(this).find(".merge-my-edits").empty().append(f(t.edit.me.data))},"merge-server-edits":function(){var t=e(this).data("edit-conflict");e(this).find(".merge-server-edits").empty().append(f(t.edit.server.data))},"merge-conflicts":function(){var t=e(this).data("edit-conflict"),n=e(this).find(".merge-conflicts");n.empty(),t.patch_status!=0?n.append(l(t.merged)):n.html("No merge conflicts")},editConflictAction:function(t){var n=e(this).data("edit-conflict"),r=e(n.storage).data(c);if(t=="merge")r.setValue(n.merged),r.meta.commit=n.edit.server.to.commit;else if(t=="discard-my-edits")e(n.storage).storage("reload");else if(t=="discard-server-edits"){var r=e(n.storage).data(c);r.meta.commit=n.edit.server.to.commit}},download:function(){var t=this.data(c),n=o.tabTypes[t.typeName],r=t.getValue(),i="data:text/plain;charset=UTF-8,"+encodeURIComponent(r),s=e.el.a({href:i,download:t.file||"swish."+n.dataType});return this.append(s),s.click(),e(s).remove(),this},getData:function(t){var n=[];return t=t||{},this.each(function(){var r=e(this).data(c),i={};i.type=r.type,r.url&&(i.url=r.url);if(r.meta){function s(e){r.meta[e]&&(i[e]=r.meta[e])}s("name"),s("path"),s("modified"),s("loaded"),s("modified_since_loaded"),s("module")}e(this).closest(".tab-pane.active").length==1&&(i.active=!0);if(!t.type||t.name&&t.name.split(".").pop()==t.type){if(t.data){var o=r.getValue();i.modified=o!=r.cleanData;if(t.data==1||i.modified&&t.data=="if_modified")i.data=o}n.push(i)}}),n},match:function(t){for(var n=0;n<this.length;n++){me=e(this[n]);var r=me.data(c);if(t.file&&t.file==r.file)return me;if(t.url&&t.url==r.url)return me}},expose:function(e){var t=this.closest(".tab-pane");if(t.length==1){var r=t.closest(".tabbed");return r.tabbed("show",t.attr("id")),e&&n.feedback({html:e,owner:this}),this}},info:function(){function o(){t.st_type=="gitty"?(t.editor=i,this.gitty(t)):t.st_type=="filesys"?v(this,n):t.st_type||this.append(e.el.p("The source is not associated with a file. ","Use ",e.el.b("Save ...")," to save the source with meta information."))}var t=this.data(c),n=t.meta||{},i=this,s;return t.st_type=="gitty"?s=e().gitty("title",n):t.st_type=="filesys"?s="File system -- "+a(n.path):t.st_type=="external"?s="External -- "+t.url:s="Scratch source",r.showDialog({title:s,body:o}),this},diff:function(){function i(){var r=e.el.div(),i=t.getValue();this.append(r);if(i==t.cleanData)e(r).append(e.el.p("No changes"));else{var s,o=e.el.div({"class":"btn-group diff",role:"group"},e.el.button({name:"close","data-dismiss":"modal","class":"btn btn-primary"},"Close"),s=e.el.button({name:"revert","class":"btn btn-danger","data-dismiss":"modal"},"Revert changes"));e(r).diff({base:t.cleanData,head:i,baseName:n[t.cleanCheckpoint]}),this.append(e.el.div({"class":"wrapper text-center"},o)),e(s).on("click",function(t){e(".swish-event-receiver").trigger("revert")}),this.parents("div.modal-dialog").addClass("modal-wide")}}var t=this.data(c),n={load:"Loaded text","new":"New text",save:"Saved text"};return r.showDialog({title:"Changes since "+n[t.cleanCheckpoint],body:i}),this},unload:function(e,t){var n=this.data(c);if(!n)return undefined;n.meta&&s.addRecent({st_type:"gitty",id:n.meta.name});if(n.cleanData!=n.getValue()){if(e=="beforeunload"){var r="The source editor has unsaved changes.\nThese will be lost if you leave the page";return t=t||window.event,t&&(t.returnValue=r),r}var r="The source editor has unsaved changes.\nThese will be lost"+(e=="setSource"?" if you load a new program":e=="closetab"?" close this tab":"");return confirm(r)}return undefined}};e.fn.storage=function(t){if(p[t])return p[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return p._init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery."+c)}})(jQuery)}),function(e,t){var n=typeof module!="undefined";n&&(e=global);var r="0123456789abcdef".split(""),i=[-2147483648,8388608,32768,128],s=[24,16,8,0],o=[],u=function(e){var t=typeof e!="string";t&&e.constructor==ArrayBuffer&&(e=new Uint8Array(e));var n,u,a,f,l,c=0,h,p=!1,d,v,m,g,y=0,b=0,w=0,E=e.length;n=1732584193,u=4023233417,a=2562383102,f=271733878,l=3285377520;do{o[0]=c,o[16]=o[1]=o[2]=o[3]=o[4]=o[5]=o[6]=o[7]=o[8]=o[9]=o[10]=o[11]=o[12]=o[13]=o[14]=o[15]=0;if(t)for(m=b;y<E&&m<64;++y)o[m>>2]|=e[y]<<s[m++&3];else for(m=b;y<E&&m<64;++y)h=e.charCodeAt(y),h<128?o[m>>2]|=h<<s[m++&3]:h<2048?(o[m>>2]|=(192|h>>6)<<s[m++&3],o[m>>2]|=(128|h&63)<<s[m++&3]):h<55296||h>=57344?(o[m>>2]|=(224|h>>12)<<s[m++&3],o[m>>2]|=(128|h>>6&63)<<s[m++&3],o[m>>2]|=(128|h&63)<<s[m++&3]):(h=65536+((h&1023)<<10|e.charCodeAt(++y)&1023),o[m>>2]|=(240|h>>18)<<s[m++&3],o[m>>2]|=(128|h>>12&63)<<s[m++&3],o[m>>2]|=(128|h>>6&63)<<s[m++&3],o[m>>2]|=(128|h&63)<<s[m++&3]);w+=m-b,b=m-64,y==E&&(o[m>>2]|=i[m&3],++y),c=o[16],y>E&&m<56&&(o[15]=w<<3,p=!0);for(g=16;g<80;++g)d=o[g-3]^o[g-8]^o[g-14]^o[g-16],o[g]=d<<1|d>>>31;var S=n,x=u,T=a,N=f,C=l;for(g=0;g<20;g+=5)v=x&T|~x&N,d=S<<5|S>>>27,C=d+v+C+1518500249+o[g]<<0,x=x<<30|x>>>2,v=S&x|~S&T,d=C<<5|C>>>27,N=d+v+N+1518500249+o[g+1]<<0,S=S<<30|S>>>2,v=C&S|~C&x,d=N<<5|N>>>27,T=d+v+T+1518500249+o[g+2]<<0,C=C<<30|C>>>2,v=N&C|~N&S,d=T<<5|T>>>27,x=d+v+x+1518500249+o[g+3]<<0,N=N<<30|N>>>2,v=T&N|~T&C,d=x<<5|x>>>27,S=d+v+S+1518500249+o[g+4]<<0,T=T<<30|T>>>2;for(;g<40;g+=5)v=x^T^N,d=S<<5|S>>>27,C=d+v+C+1859775393+o[g]<<0,x=x<<30|x>>>2,v=S^x^T,d=C<<5|C>>>27,N=d+v+N+1859775393+o[g+1]<<0,S=S<<30|S>>>2,v=C^S^x,d=N<<5|N>>>27,T=d+v+T+1859775393+o[g+2]<<0,C=C<<30|C>>>2,v=N^C^S,d=T<<5|T>>>27,x=d+v+x+1859775393+o[g+3]<<0,N=N<<30|N>>>2,v=T^N^C,d=x<<5|x>>>27,S=d+v+S+1859775393+o[g+4]<<0,T=T<<30|T>>>2;for(;g<60;g+=5)v=x&T|x&N|T&N,d=S<<5|S>>>27,C=d+v+C-1894007588+o[g]<<0,x=x<<30|x>>>2,v=S&x|S&T|x&T,d=C<<5|C>>>27,N=d+v+N-1894007588+o[g+1]<<0,S=S<<30|S>>>2,v=C&S|C&x|S&x,d=N<<5|N>>>27,T=d+v+T-1894007588+o[g+2]<<0,C=C<<30|C>>>2,v=N&C|N&S|C&S,d=T<<5|T>>>27,x=d+v+x-1894007588+o[g+3]<<0,N=N<<30|N>>>2,v=T&N|T&C|N&C,d=x<<5|x>>>27,S=d+v+S-1894007588+o[g+4]<<0,T=T<<30|T>>>2;for(;g<80;g+=5)v=x^T^N,d=S<<5|S>>>27,C=d+v+C-899497514+o[g]<<0,x=x<<30|x>>>2,v=S^x^T,d=C<<5|C>>>27,N=d+v+N-899497514+o[g+1]<<0,S=S<<30|S>>>2,v=C^S^x,d=N<<5|N>>>27,T=d+v+T-899497514+o[g+2]<<0,C=C<<30|C>>>2,v=N^C^S,d=T<<5|T>>>27,x=d+v+x-899497514+o[g+3]<<0,N=N<<30|N>>>2,v=T^N^C,d=x<<5|x>>>27,S=d+v+S-899497514+o[g+4]<<0,T=T<<30|T>>>2;n=n+S<<0,u=u+x<<0,a=a+T<<0,f=f+N<<0,l=l+C<<0}while(!p);return r[n>>28&15]+r[n>>24&15]+r[n>>20&15]+r[n>>16&15]+r[n>>12&15]+r[n>>8&15]+r[n>>4&15]+r[n&15]+r[u>>28&15]+r[u>>24&15]+r[u>>20&15]+r[u>>16&15]+r[u>>12&15]+r[u>>8&15]+r[u>>4&15]+r[u&15]+r[a>>28&15]+r[a>>24&15]+r[a>>20&15]+r[a>>16&15]+r[a>>12&15]+r[a>>8&15]+r[a>>4&15]+r[a&15]+r[f>>28&15]+r[f>>24&15]+r[f>>20&15]+r[f>>16&15]+r[f>>12&15]+r[f>>8&15]+r[f>>4&15]+r[f&15]+r[l>>28&15]+r[l>>24&15]+r[l>>20&15]+r[l>>16&15]+r[l>>12&15]+r[l>>8&15]+r[l>>4&15]+r[l&15]};if(!e.JS_SHA1_TEST&&typeof module!="undefined"){var a=require("crypto"),f=require("buffer").Buffer;module.exports=function(e){return typeof e=="string"?a.createHash("sha1").update(e,"utf8").digest("hex"):(e.constructor==ArrayBuffer&&(e=new Uint8Array(e)),a.createHash("sha1").update(new f(e)).digest("hex"))}}else e&&(e.sha1=u)}(this),define("sha1",function(){}),define("notebook",["jquery","config","tabbed","form","preferences","modal","prolog","links","laconic","runner","storage","sha1"],function($,config,tabbed,form,preferences,modal,prolog,links){function glyphButton(e,t,n,r,i){i=i||"sm";var s=$.el.a({href:"#","class":"btn btn-"+r+" btn-"+i+" action-"+t,title:n,"data-action":t},$.el.span({"class":"glyphicon glyphicon-"+e}));return s}function imageButton(e,t,n){n=n||"sm";var r=$.el.a({href:"#","class":"btn btn-default btn-image btn-"+n+" action-"+e,title:t,"data-action":e},$.el.span({"class":"image-icon"}));return r}function glyphButtonGlyph(e,t,n){var r=e.find("a[data-action="+t+"] > span.glyphicon");r.removeClass(function(e,t){return t.match(/glyphicon-[-a-z]*/g).join(" ")}).addClass("glyphicon-"+n)}function sep(){return $.el.span({"class":"thin-space"}," ")}function Notebook(e){this.my_cell=e.cell}var cellTypes={program:{label:"Program"},query:{label:"Query"},markdown:{label:"Markdown"},html:{label:"HTML"}};(function(e){function i(t){var n=e(t).find(".nb-cell.active");return n.length==1?n.first():null}function s(t){function n(e){attrs=e.match(/[-a-z]+="[^"]*"/g);if(attrs){var t=e.match(/^<[a-z]* /);for(var n=0;n<attrs.length;n++){var r=attrs[n].split(/=(.*)/);attrs[n]=r[0].toLowerCase()+"="+r[1]}return t[0]+attrs.sort().join(" ")+">"}return e}var r=e(e.el.div(t)).html(),i=[];return r.replace(/(<div [^>]*>|<\/div>)/g,function(e){var t;return e=="</div>"?(t=i.pop(),t?"\n"+e+"\n":e):(t=e.match(/(nb-cell|notebook)/)!=null,i.push(t),t?"\n"+n(e)+"\n":e)}).slice(1)}var t="notebook",n=null,r={_init:function(n){return n=n||{},this.each(function(){function a(){var t=e.el.span({"class":"glyphicon glyphicon-menu-hamburger"}),n=form.widgets.dropdownButton(t,{divClass:"notebook-menu btn-transparent",ulClass:"pull-right",client:r,actions:{"Delete cell":function(){this.notebook("delete")},"Copy cell":function(){this.notebook("copy")},"Paste cell":function(){this.notebook("paste")},"Move cell up":function(){this.notebook("up")},"Move cell down":function(){this.notebook("down")},"Insert cell":function(){this.notebook("insertBelow")},"--":"Notebook actions","Exit fullscreen":function(){this.notebook("fullscreen",!1)}}});return n}var r=e(this),i={},s={},o,u;r.addClass("notebook"),r.addClass("swish-event-receiver"),r.append(o=e.el.div({"class":"nb-toolbar"},glyphButton("trash","delete","Delete cell","warning"),glyphButton("copy","copy","Copy cell","default"),glyphButton("paste","paste","Paste cell below","default"),sep(),glyphButton("chevron-up","up","Move cell up","default"),glyphButton("chevron-down","down","Move cell down","default"),sep(),glyphButton("plus","insertBelow","Insert cell below","primary"),glyphButton("fullscreen","fullscreen","Full screen","default"))),r.append(a()),r.append(e.el.div({"class":"nb-view",tabIndex:"-1"},u=e.el.div({"class":"nb-content"}),e.el.div({"class":"nb-bottom"}))),e(o).on("click","a.btn",function(t){var n=e(t.target).closest("a").data("action");return r.notebook(n),t.preventDefault(),!1}),e(u).on("click",".nb-cell-buttons a.btn",function(t){var n=e(t.target).closest("a"),r=n.closest(".nb-cell"),i=n.data("action");return r.nbCell(i),t.preventDefault(),!1}),r.focusin(function(t){var n=e(t.target).closest(".nb-cell");n.length>0?r.notebook("active",n):e(t.target).closest(".nb-view").length>0&&r.find(".nb-content").children(".nb-cell.active").nbCell("active",!1)}),r.focusout(function(t){e(t.target).closest(".notebook")[0]!=r[0]&&r.find(".nb-content").children(".nb-cell.active").nbCell("active",!1)}),r.on("activate-tab",function(t){if(t.target==r[0]){var n=r.find(".nb-content").children(".nb-cell.program"),i=n.filter(".active"),s=i[0]||n[0];s&&e(s).find(".prolog-editor").prologEditor("makeCurrent"),t.stopPropagation()}}),r.data(t,s);var u=r.find(".notebook-data");if(n.value)r.notebook("value",n.value);else if(u.length>0){function f(e){var t=u.data(e);t&&(i[e]=t)}f("file"),f("url"),f("title"),f("meta"),f("st_type"),r.notebook("value",u.text(),{fullscreen:r.hasClass("fullscreen")}),u.remove()}else r.notebook("placeHolder");r.notebook("setupStorage",i),r.on("data-is-clean",function(t,n){if(e(t.target).hasClass("prolog-editor"))return r.notebook("checkModified"),t.stopPropagation(),!1})})},"delete":function(e){return e=e||i(this),e&&(this.notebook("active",e.next()||e.prev()),e.nbCell("close"),this.notebook("updatePlaceHolder")),this.notebook("checkModified"),this},copy:function(t){t=t||i(this);if(t){var r=e.el.div({"class":"notebook"});e(r).append(e(t).nbCell("saveDOM")),n=s(r)}},paste:function(t){var r=this;t=t||n;if(t){var i=e.el.div();e(i).html(t);var s=e(i).find(".nb-cell");if(s.length>0)return e(i).find(".nb-cell").each(function(){r.notebook("insert",{where:"below",restore:e(this)})}),this;modal.alert("Not a SWISH notebook")}else modal.alert("Clipboard is empty")},up:function(e){return e=e||i(this),e&&(e.insertBefore(e.prev()),this.notebook("checkModified")),this},down:function(e){return e=e||i(this),e&&(e.insertAfter(e.next()),this.notebook("checkModified")),this},insertAbove:function(){return this.notebook("insert",{where:"above"})},insertBelow:function(){return this.notebook("insert",{where:"below",if_visible:true})==0&&modal.alert("<p>New cell would appear outside the visible area of the notebook.<p>Please select the cell below which you want the new cell to appear or scroll to the bottom of the notebook."),this},run:function(e){e=e||i(this),e&&e.nbCell("run")},fullscreen:function(t){return t==undefined&&(t=!this.hasClass("fullscreen")),t?e("body.swish").swish("fullscreen",this):e("body.swish").swish("exitFullscreen"),this},cellType:function(e,t){e=e||i(this),e&&e.nbCell("type",t)},checkModified:function(){var e=this.data("storage"),t=e.cleanGeneration==this.notebook("changeGen");this.notebook("markClean",t)},markClean:function(e){var n=this.data(t);n.clean_signalled!=e&&(n.clean_signalled=e,this.trigger("data-is-clean",e)),e&&this.find(".prolog-editor").prologEditor("setIsClean")},active:function(e,t){if(e){var n=this.find(".nb-content .nb-cell.active");function r(e){e.find(".nb-content .nb-cell.not-for-query").removeClass("not-for-query")}if(e.length==1){if(n.length!=1||e[0]!=n[0])r(this),n.nbCell("active",!1),e.nbCell("active",!0),t&&e.focus()}else r(this),n.nbCell("active",!1)}},insert:function(t){t=t||{};var n=i(this),r=t.cell||e.el.div({"class":"nb-cell"}),s=this.find(".nb-view"),o;t.if_visible&&s.find(".nb-content > div.nb-cell").length>0&&(o=s[0].getBoundingClientRect());if(n)if(t.where=="above"){if(o){var u=n[0].getBoundingClientRect().top;if(u<o.top)return!1}e(r).insertBefore(n)}else{if(o){var a=n[0].getBoundingClientRect().bottom;if(a>o.bottom-20)return!1}e(r).insertAfter(n)}else{var f=this.find(".nb-content");if(o){var l=f[0].getBoundingClientRect().bottom;if(l>o.bottom-20)return!1}f.append(r)}return t.cell||e(r).nbCell(t.restore),this.notebook("updatePlaceHolder"),this.notebook("active",e(r)),this.notebook("checkModified"),this},setupStorage:function(t){var n=this;return t=e.extend(t,{getValue:function(){return n.notebook("value")},setValue:function(e){return n.notebook("setSource",e)},changeGen:function(){return n.notebook("changeGen")},isClean:function(e){var t=n.notebook("changeGen");return e==t},markClean:function(e){n.notebook("markClean",e)},cleanGeneration:this.notebook("changeGen"),cleanData:this.notebook("value"),cleanCheckpoint:"load",typeName:"notebook"}),this.storage(t)},setSource:function(e){typeof e=="string"&&(e={data:e}),this.notebook("value",e.data)},value:function(t,n){n=n||{};if(t==undefined){var r=e.el.div({"class":"notebook"});return this.find(".nb-cell").each(function(){cell=e(this),(!n.skipEmpty||!cell.nbCell("isEmpty"))&&e(r).append(cell.nbCell("saveDOM"))}),s(r)}var i=this,o=this.find(".nb-content"),r=e.el.div();o.html(""),r.innerHTML=t,n.fullscreen==undefined&&(n.fullscreen=e(r).find("div.notebook").hasClass("fullscreen")),n.fullscreen&&(this.removeClass("fullscreen"),this.notebook("fullscreen",!0)),e(r).find(".nb-cell").each(function(){var t=e.el.div({"class":"nb-cell"});o.append(t),e(t).nbCell(e(this))}),this.find(".nb-cell").nbCell("onload"),this.notebook("updatePlaceHolder")},changeGen:function(){var t=[];return this.find(".nb-cell").each(function(){cell=e(this),t.push(cell.nbCell("changeGen"))}),sha1(t.join())},updatePlaceHolder:function(){this.find(".nb-content").children().length==0?this.notebook("placeHolder"):this.find(".nb-placeholder").remove()},placeHolder:function(){var t=e.el.div({"class":"nb-placeholder"});e.ajax({url:config.http.locations.help+"/notebook.html",dataType:"html",success:function(n){e(t).html(n)}}),this.find(".nb-content").append(t)}};tabbed.tabTypes.notebook={dataType:"swinb",typeName:"notebook",label:"Notebook",contentType:"text/x-prolog-notebook",order:200,create:function(t,n){e(t).notebook(n)}},e.fn.notebook=function(n){if(r[n])return r[n].apply(this,Array.prototype.slice.call(arguments,1));if(typeof n=="object"||!n)return r._init.apply(this,arguments);e.error("Method "+n+" does not exist on jQuery."+t)}})(jQuery),function($){function cellText(e){return e.find(".editor").prologEditor("getSource",undefined,!0)}function fileInsertInput(){var e=$('<input type="file" name="file">');return e.on("change",function(e){var t=new FileReader;return t.onload=function(n){var r=$(e.target).closest(".nb-cell"),i=r.closest(".notebook");i.notebook("paste",t.result)&&r.remove()},t.readAsText(e.target.files[0]),e.preventDefault(),!1}),e}function typeMore(){var e=$('<div class="form-more"> <a href="#">more<a></div>');return e.find("a").on("click",function(e){var t=$(e.target).closest(".form-more");t.hide(400),t.next().show(400)}),e[0]}function typeLess(){var e=$('<div class="form-less" style="display:none"> <div><a href="#" class="less">less<a></div></div>');for(var t=0;t<arguments.length;t++)e.append(arguments[t]);return e.find("a.less").on("click",function(e){var t=$(e.target).closest(".form-less");t.hide(400),t.prev().show(400)}),e[0]}var pluginName="nbCell",id=0,methods={_init:function(e){return this.each(function(){var t=$(this),n={},r;t.data(pluginName,n),t.attr("tabIndex",-1),t.attr("id","nbc"+id++);if(e instanceof jQuery)t.nbCell("restoreDOM",e);else{var i=glyphButton("remove-circle","close","Close","default","xs");t.append(i),$(i).addClass("close-select"),$(i).on("click",function(){t.nbCell("close")}),t.append($.el.div({"class":"nb-type-select"},$.el.label("Create a "),r=$.el.div({"class":"btn-group",role:"group"}),$.el.label("cell here.")));for(var s in cellTypes)cellTypes.hasOwnProperty(s)&&$(r).append($.el.button({type:"button","class":"btn btn-default","data-type":s},cellTypes[s].label));$(r).on("click",".btn",function(e){t.nbCell("type",$(e.target).data("type"))}),t.append($.el.div({"class":"nb-type-more"},typeMore(),typeLess($.el.label("Insert notebook from local file "),fileInsertInput()[0])))}})},active:function(e){var t=this.data(pluginName);if(e){this.addClass("active");switch(t.type){case"program":this.find(".editor").prologEditor("makeCurrent");break;case"query":var n=this.prevAll(".program").first().find(".editor");n.length==1&&n.prologEditor("makeCurrent"),this.closest(".notebook").find(".nb-cell.program").not(this.nbCell("program_cells")).addClass("not-for-query")}}else if(this.length>0){this.removeClass("active");switch(t.type){case"markdown":case"html":this.hasClass("runnable")&&this.nbCell("run")}}},type:function(e){var t=this.data(pluginName);return t.type!=e&&(methods.type[e].apply(this),t.type=e,this.addClass(e)),this},run:function(){var e=arguments;return this.each(function(){var t=$(this);if(t.hasClass("runnable")){var n=t.data(pluginName);return methods.run[n.type].apply(t,e)}console.log("Cell is not runnable: ",t)})},runTabled:function(){return this.nbCell("run",{tabled:!0})},onload:function(){var e=arguments;return this.each(function(){var t=$(this),n=t.data(pluginName);methods.onload[n.type]&&methods.onload[n.type].apply(t,e)}),this.nbCell("refresh")},close:function(){return this.find(".prolog-runner").prologRunner("close"),this.remove()},refresh:function(){return this.hasClass("program")&&this.find("a[data-action='background']").attr("title",this.hasClass("background")?"Used for all queries in this notebook":"Used for queries below this cell"),this},getSettings:function(){return{tabled:this.data("tabled")=="true",run:this.data("run")=="onload",chunk:parseInt(this.data("chunk")||"1"),name:this.attr("name")}},settings:function(){function n(){this.append($.el.form({"class":"form-horizontal"},form.fields.checkboxes([{name:"tabled",label:"table results",value:t.tabled,title:"Table results"},{name:"run",label:"run on page load",value:t.run,title:"Run when document is loaded"}]),form.fields.chunk(t.chunk),form.fields.name(t.name||""),form.fields.buttons({label:"Apply",offset:3,action:function(n,r){r.tabled!=t.tabled&&(r.tabled?e.data("tabled","true"):e.removeData("tabled")),r.run!=t.run&&(r.run?e.data("run","onload"):e.removeData("run")),r.chunk!=t.chunk&&(r.chunk!=1?e.data("chunk",""+r.chunk):e.removeData("chunk"));var i=r.name?r.name.trim():"";i!=t.name&&(i?e.attr("name",i):e.attr("name",null)),e.closest(".notebook").notebook("checkModified")}})))}var e=this,t=this.nbCell("getSettings");form.showDialog({title:"Set options for query",body:n})},singleline:function(){return this.toggleClass("singleline"),this.find(".editor").prologEditor("refresh"),glyphButtonGlyph(this,"singleline",this.hasClass("singleline")?"triangle-left":"triangle-bottom"),this.find("a[data-action=singleline]").blur(),this},background:function(){return this.toggleClass("background"),this.find("a[data-action=background]").blur(),this.closest(".notebook").notebook("checkModified"),this.nbCell("refresh"),this},program_cells:function(){var e=this.data(pluginName),t=this.closest(".notebook").find(".nb-cell.program.background");return this.hasClass("program")?this.hasClass("background")||(t=t.add(this)):t=t.add(this.prevAll(".program").first()),t},programs:function(){var e=this.nbCell("program_cells");return e.find(".editor")},isEmpty:function(){return methods.isEmpty[this.data(pluginName).type].call(this)},saveDOM:function(){return methods.saveDOM[this.data(pluginName).type].call(this)},restoreDOM:function(e){function n(e){for(var t in cellTypes)if(cellTypes.hasOwnProperty(t)&&e.hasClass(t))return t}var t=this.data(pluginName);t.type=n(e),methods.restoreDOM[t.type].apply(this,arguments),this.addClass(t.type)},changeGen:function(){var e=this.data(pluginName).type;return e?methods.changeGen[e].call(this):0},text:function(){return cellText(this)}};methods.type.markdown=function(e){var t;e=e||{},e.mode="markdown",this.html(""),this.append(t=$.el.div({"class":"editor"})),$(t).prologEditor(e),this.addClass("runnable")},methods.type.html=function(e){var t;e=e||{},e.mode="htmlmixed",this.html(""),this.append(t=$.el.div({"class":"editor"})),$(t).prologEditor(e),this.addClass("runnable")},methods.type.program=function(e){var t=this,n;e=e||{},e.autoCurrent=!1,e.getSource=function(){var e=t.nbCell("programs");return e.prologEditor("getSource",undefined,!0)},this.html("");var r=$.el.div({"class":"btn-group nb-cell-buttons",role:"group"},glyphButton("triangle-bottom","singleline","Show only first line","default","xs"),imageButton("background","Use as background program","xs"));this.append(r,n=$.el.div({"class":"editor with-buttons"})),e.background&&this.addClass("background"),e.singleline&&this.nbCell("singleline"),$(n).prologEditor(e)},methods.type.query=function(e){function r(t){e[t]!=undefined&&(n.data(t,""+e[t]),delete e[t])}function i(t){e[t]!=undefined&&(n.attr(t,""+e[t]),delete e[t])}function o(e){this.find(".editor.query").prologEditor("wrapSolution",$(e).text())}var t,n=this;this.html(""),e=e||{},e.tabled==undefined&&(e.tabled=preferences.getVal("tabled_results")),r("tabled"),r("chunk"),r("run"),i("name"),e=$.extend({},e,{role:"query",sourceID:function(){return n.nbCell("programs").prologEditor("getSourceID")}});var s=$.el.div({"class":"btn-group nb-cell-buttons",role:"group"},glyphButton("wrench","settings","Settings","default","xs"),glyphButton("play","run","Run query","primary","xs")),u=form.widgets.dropdownButton($.el.span({"class":"glyphicon glyphicon-menu-hamburger"}),{client:n,divClass:"nb-query-menu",actions:{"Aggregate (count all)":o,"--":null,"Order by":o,Distinct:o,Limit:o,"---":null,"Download answers as CSV":function(){var e=cellText(this).replace(/\.\s*$/,""),t=this.nbCell("programs").prologEditor("getSource",undefined,!0),n={},r=this.attr("name");r&&(n.disposition=r),prolog.downloadCSV(e,t,n)}}});this.append(s,$.el.div({"class":"query with-buttons"},u,$.el.span({"class":"prolog-prompt"},"?-"),t=$.el.div({"class":"editor query"}))),$(t).prologEditor(e),this.addClass("runnable")},methods.run.markdown=function(e){function n(e){var t=$(e.target).closest(".nb-cell"),r=t.data("markdownText");t.removeData("markdownText"),methods.type.markdown.call(t,{value:r}),t.off("dblclick",n),t.off("click",links.followLink)}function r(r){t.html(r),t.removeClass("runnable"),t.data("markdownText",e),t.on("dblclick",n),t.on("click","a",links.followLink)}var t=this;e=e||cellText(this),e.trim()!=""?$.ajax({type:"POST",url:config.http.locations.markdown,data:e,contentType:"text/plain; charset=UTF-8",success:r}):r("<div class='nb-placeholder'>Empty markdown cell.  Double click to edit</div>")},methods.run.html=function(htmlText,options){function makeEditable(e){var t=$(e.target).closest(".nb-cell"),n=t.data("htmlText");t.removeData("htmlText"),methods.type.html.call(t,{value:n}),t.off("dblclick",makeEditable),t.off("click",links.followLink)}function runScripts(){if(config.swish.notebook.eval_script==1&&options.eval_script!=0){var scripts=[];cell.find("script").each(function(){var e=this.getAttribute("type")||"text/javascript";e=="text/javascript"&&scripts.push(this.textContent)});if(scripts.length>0){var script="(function(notebook){"+scripts.join("\n")+"})",nb=new Notebook({cell:cell[0]});try{eval(script)(nb)}catch(e){alert(e)}}}}function runHTML(e){cell[0].innerHTML=e,runScripts()}function setHTML(e){runHTML(e),cell.removeClass("runnable"),cell.data("htmlText",htmlText),cell.on("dblclick",makeEditable),cell.on("click","a",links.followLink)}var cell=this;options=options||{};if(options.html==0){runScripts();return}htmlText=(htmlText||cellText(this)).trim(),htmlText!=""?setHTML(htmlText):setHTML("<div class='nb-placeholder'>Empty HTML cell.  Double click to edit</div>")},methods.run.program=function(){modal.alert("Please define a query to run this program")},methods.run.query=function(e){var t=this.nbCell("programs"),n=this.nbCell("getSettings"),r=cellText(this);e=e||{};if(e.bindings){var i="";if(typeof e.bindings=="string")i=e.bindings;else for(var s in e.bindings)e.bindings.hasOwnProperty(s)&&(i&&(i+=", "),i+=s+" = "+Pengine.stringify(e.bindings[s]));i&&(r=i+", ("+prolog.trimFullStop(r)+")")}var o={source:t.prologEditor("getSource",undefined,!0),query:r,tabled:n.tabled||!1,chunk:n.chunk,title:!1,query_editor:this.find(".prolog-editor.query")};t[0]&&(o.editor=t[0]);var u=$.el.div({"class":"prolog-runner"});this.find(".prolog-runner").prologRunner("close"),this.append(u),$(u).prologRunner(o)},methods.onload.query=function(){this.data("run")=="onload"&&this.nbCell("run")},methods.onload.html=function(){return methods.run.html.call(this,undefined,{html:!1,eval_script:!0})},methods.saveDOM.markdown=function(){var e=this.data("markdownText")||cellText(this);return $.el.div({"class":"nb-cell markdown"},e)},methods.saveDOM.html=function(){var e=this.data("htmlText")||cellText(this),t=$.el.div({"class":"nb-cell html"});return $(t).html(e),t},methods.saveDOM.program=function(){function n(n){e.hasClass(n)&&$(t).attr("data-"+n,!0)}var e=this,t=$.el.div({"class":"nb-cell program"},cellText(this));return n("background"),n("singleline"),t},methods.saveDOM.query=function(){function n(e,t){return e!="tabled"||!!t&&t!="false"?!1:!0}function r(r){var i;(i=e.data(r))&&!n(r,i)&&$(t).attr("data-"+r,i)}function i(n){var r;(r=e.attr(n))&&r&&$(t).attr(n,r)}var e=this,t=$.el.div({"class":"nb-cell query"},cellText(this));return r("tabled"),r("chunk"),r("run"),i("name"),t},methods.restoreDOM.markdown=function(e){var t=e.text().trim();this.data("markdownText",t),methods.run.markdown.call(this,t)},methods.restoreDOM.html=function(e){methods.run.html.call(this,e.html(),{eval_script:!1})},methods.restoreDOM.program=function(e){function n(n){var r;if(r=e.data(n))t[n]=r}var t={value:e.text().trim()};n("background"),n("singleline"),methods.type.program.call(this,t)},methods.restoreDOM.query=function(e){function n(n){var r;if(r=e.data(n))n=="chunk"?t.chunk=parseInt(r):t[n]=r}function r(n){var r;if(r=e.attr(n))t[n]=r}var t={value:e.text().trim()};n("tabled"),n("chunk"),n("run"),r("name"),t.tabled==undefined&&(t.tabled=!1),methods.type.query.call(this,t)},methods.changeGen.markdown=function(){var e=this.data("markdownText")||cellText(this);return sha1(e)},methods.changeGen.html=function(){var e=this.data("htmlText")||cellText(this);return sha1(e)},methods.changeGen.program=function(){function n(n,r){t.hasClass(n)&&(e+=r)}var e="",t=this;return n("background","B"),n("singleline","S"),e+="V"+cellText(this),sha1(e)},methods.changeGen.query=function(){function n(n,r){var i;if(i=t.data(n))e+=r+i}function r(n,r){var i;if(i=t.attr(n))e+=r+i}var e="",t=this;return n("tabled","T"),n("chunk","C"),n("run","R"),r("name","N"),e+="V"+cellText(this),sha1(e)},methods.isEmpty.markdown=function(){var e=this.data("markdownText")||cellText(this);return e.trim()==""},methods.isEmpty.html=function(){var e=this.data("htmlText")||cellText(this);return e.trim()==""},methods.isEmpty.program=function(){return cellText(this).trim()==""},methods.isEmpty.query=function(){return cellText(this).trim()==""},$.fn.nbCell=function(e){if(methods[e])return methods[e].apply(this,Array.prototype.slice.call(arguments,1));if(typeof e=="object"||!e)return methods._init.apply(this,arguments);$.error("Method "+e+" does not exist on jQuery."+pluginName)}}(jQuery),Notebook.prototype.swish=function(e){var t=this.cell().nbCell("programs"),n=t.prologEditor("getSource",undefined,!0);return n&&(e.src=n),$.swish(e)},Notebook.prototype.cell=function(e){return e?this.notebook().find('.nb-cell[name="'+e+'"]'):$(this.my_cell)},Notebook.prototype.notebook=function(){return $(this.my_cell).closest(".notebook")},Notebook.prototype.run=function(e,t){var n={};t&&(n.bindings=t),this.cell(e).nbCell("run",n)},Notebook.prototype.submit=function(e,t){var n=this.$(e),r=form.serializeAsObject(n);form.formError(n,null),this.swish({ask:t.predicate+"(("+Pengine.stringify(r)+"))",onerror:function(e){form.formError(n,e)},onsuccess:t.onsuccess})},Notebook.prototype.$=function(e){return this.cell().find(e)}}),define("navbar",["jquery","preferences","laconic"],function(e,t){(function(e){function i(n,r,i){if(i=="--")n.append(e.el.li({"class":"divider"}));else if(typeof i=="function"){var s,o;if(i.typeIcon)s=e.el.a(e.el.span({"class":"dropdown-icon type-icon "+i.typeIcon}),r);else if((o=r.indexOf("("))>0){var u=r.substr(o);s=e.el.a({"class":"accelerated"},r.substr(0,o).trim(),e.el.span({"class":"accell-spacer"},u),e.el.span({"class":"accell-text"},u))}else s=e.el.a(r);e(s).data("action",i),i.name&&e(s).attr("id",i.name),n.append(e.el.li(s))}else if(i.type=="checkbox"){var a=e(e.el.input({type:"checkbox"}));i.preference!==undefined?(a.addClass("swish-event-receiver"),t.getVal(i.preference)&&a.prop("checked",!0),a.on("click",function(){t.setVal(i.preference,e(this).prop("checked"))}),a.on("preference",function(e){e.name==i.preference&&a.prop("checked",e.value)})):(i.checked&&a.prop("checked",i.checked),a.on("click",function(){i.action(e(this).prop("checked"))})),n.append(e.el.li({"class":"checkbox"},a[0],e.el.span(r)))}else if(i.type=="submenu"){var f=e.el.ul({"class":"dropdown-menu sub-menu"});n.append(e.el.li(e.el.a({"class":"trigger right-caret"},r),f)),i.action&&e(f).data("action",i.action);if(i.items)for(var o=0;o<i.items.length;o++)e(f).append(e.el.li(e.el.a(i.items[o])));i.update&&e(f).on("update",function(e){i.update.call(e.target)})}else alert("Unknown navbar item")}function s(t,n){return t.find(".dropdown-menu").filter(function(){return e(this).attr("name")==n})}function o(t,n){if(!e(t).hasClass("trigger")){var r=e(t).data("action")||e(t).parents("ul").data("action");return a.call(t,n),r?(n.preventDefault(),r.call(t,n)):e(t).hasClass("trigger")&&u.call(t,n),!1}u.call(t,n)}function u(t){var n=e(this).next(),r=e(this).parent().parent();(e(this).hasClass("left-caret")||e(this).hasClass("right-caret"))&&e(this).toggleClass("right-caret left-caret"),r.find(".left-caret").not(this).toggleClass("right-caret left-caret"),r.find(".sub-menu:visible").not(n).hide(),n.trigger("update"),n.toggle(),t.stopPropagation()}function a(t){var n=e(this).closest(".dropdown");n.find(".left-caret").toggleClass("right-caret left-caret"),n.find(".sub-menu:visible").hide()}var n="navbar",r={_init:function(t){return this.each(function(){var n=e(this),r={};for(var i in t)t.hasOwnProperty(i)&&(n.navbar("appendDropdown",i),n.navbar("populateDropdown",i,t[i]));n.on("click","a",function(e){o(this,e)})})},appendDropdown:function(t){var n=this.children(".nav.navbar-nav"),r=e.el.ul({name:t,"class":"dropdown-menu"}),i=e.el.li({"class":"dropdown"},e.el.a({"class":"dropdown-toggle","data-toggle":"dropdown"},t,e.el.b({"class":"caret"})),r);return n.append(i),this},populateDropdown:function(e,t){if(typeof t=="function")t(this,e);else{var n=s(this,e);for(var r in t)t.hasOwnProperty(r)&&i(n,r,t[r])}},clearDropdown:function(e){var t=s(this,e);return t.html(""),this},extendDropdown:function(e,t,n){var r=s(this,e);i(r,t,n)}};e.fn.navbar=function(t){if(r[t])return r[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return r._init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery."+n)}})(jQuery)}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/addon/hint/templates-hint",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function r(e,t){return e.slice(0,t.length).toUpperCase()==t.toUpperCase()}function i(e){}function s(e){var t=e.template;return document.createTextNode(t.name)}function u(){this.marked=[],this.selectableMarkers=[],this.varIndex=-1}function a(e){return e._templateStack?e._templateStack.length:0}function f(e){this.name=e.name,this.description=e.description,this.text=e.text,e.varTemplates&&(this.varTemplates=e.varTemplates),e.template!=null?this.source=e.template:e.tokens!=null&&(this._tokens=e.tokens)}function l(e){var t=[],n=!1,r=null,i="";for(var s=0;s<e.length;s++){var o=e.charAt(s);if(o=="\n")i!=""&&t.push(i),i="",t.push(o),r=null;else{var u=!0;if(n)o=="}"&&(n=!1,u=!1,i=="cursor"?t.push({cursor:!0}):i=="line_selection"?t.push({line_selection:!0}):t.push({variable:i}),i="");else if(o=="$"&&s+1<=e.length){s++;var a=e.charAt(s);a=="{"&&(n=!0,u=!1,i!=""&&t.push(i),i="")}u&&r!="$"?(i+=o,r=o):r=null}}return i!=""&&t.push(i),t}function c(e,t){var n=e.findMarksAt(t.from);if(n)for(var r=0;r<n.length;r++){var i=n[r];if(i._templateVar)return i}return null}function h(e,t){var n=e._templateState;if(!t.origin||!n||n.updating)return;try{n.updating=!0;var r=c(e,t);if(r==null)g(e);else{var i=r.find(),s=e.getRange(i.from,i.to);for(var o=0;o<n.marked.length;o++){var u=n.marked[o];if(u!=r&&u._templateVar==r._templateVar){var a=u.find();e.replaceRange(s,a.from,a.to)}}}}finally{n.updating=!1}}function p(e){i("template","endCompletion()",a(e)),a(e)&&g(e,!0)}function d(e,t){var n=e._templateState;if(n.selectableMarkers.length>0){n.varIndex++;if(n.varIndex>=n.selectableMarkers.length){if(t){m(e);return}n.varIndex=0}var r=n.selectableMarkers[n.varIndex],i=r.find();e.setSelection(i.from,i.to);var s=r._templateVar;for(var o=0;o<n.marked.length;o++){var u=n.marked[o];u==r?(u.className="",u.startStyle="",u.endStyle=""):u._templateVar==r._templateVar?(u.className="CodeMirror-templates-variable-selected",u.startStyle="",u.endStyle=""):(u.className="CodeMirror-templates-variable",u.startStyle="CodeMirror-templates-variable-start",u.endStyle="CodeMirror-templates-variable-end")}e.refresh()}else m(e)}function v(t){function s(e,t){return e.ch==t.ch&&e.line==t.line}var n=t._templateState,r=n.selectableMarkers[n.varIndex],i={state:n};t._hintTemplateMarker&&(i.marker=t._hintTemplateMarker),t._templateStack||(t._templateStack=[]),t._templateStack.push(i),delete t._templateState,t._hintTemplateMarker=r;var o=r.find(),u=t.listSelections();u.length==1&&s(u[0].anchor,o.from)&&s(u[0].head,o.to)&&t.replaceRange("☰",o.from,o.to),e.commands.autocomplete(t)}function m(e){var t=e._templateState.cursor;if(t!=null){var n=t.find();n!=null&&e.setSelection(n,n)}g(e)}function g(e,t){function r(){i("template","Canceled?");for(var t=0;t<n.marked.length;t++){var r=n.marked[t];if(r==e._hintTemplateMarker){var s=r.find();s&&e.getRange(s.from,s.to)=="☰"&&e.replaceRange(r._templateVar,s.from,s.to)}}}var n=e._templateState;if(n){i("template","Uninstall, clearing: ",n.marked.length);for(var s=0;s<n.marked.length;s++)n.marked[s].clear();n.cursor!=null&&n.cursor.clear(),n.marked.length=0,n.selectableMarkers.length=0}else i("template","Uninstall, no state");if(e._templateStack&&e._templateStack.length>0){i("template","Popping from level",e._templateStack.length);var u=e._templateStack.pop();n=e._templateState=u.state,t&&e._hintTemplateMarker&&r(),u.marker?e._hintTemplateMarker=u.marker:delete e._hintTemplateMarker}else i("template","Leaving template mode"),e.off("change",h),e.off("endCompletion",p),e.removeKeyMap(o),delete e._templateState,delete e._hintTemplateMarker}var t=[],n=e.Pos;e.templatesHint={};var o={Tab:d,Enter:function(e){d(e,!0)},Esc:g,"Ctrl-Space":v};f.prototype.tokens=function(){return this._tokens==null&&(this._tokens=l(this.source)),this._tokens},f.prototype.content=function(){if(this._content==null){var e=this.tokens(),t="";for(var n=0;n<e.length;n++){var r=e[n];typeof r=="string"?t+=r:r.variable&&(t+=r.variable)}this._content=t}return this._content},f.prototype.insert=function(e,t){var r=this,s=a(e);i("template","Insert, nested",s,"template",r);if(e._templateState||s)i("template","Uninstall from insert()",s),g(e);if(r.text){e.replaceRange(r.text,t.from,t.to);return}var f=new u;e._templateState=f;var l=this.tokens(),c="",v=t.from.line,m=t.from.ch,y=[],b=[],w=null;for(var E=0;E<l.length;E++){var S=l[E];if(typeof S=="string")c+=S,S=="\n"?(v++,m=0):m+=S.length;else if(S.variable){c+=S.variable;var x=n(v,m),T=n(v,m+S.variable.length),N=b[S.variable]!=0;m+=S.variable.length,y.push({from:x,to:T,variable:S.variable,selectable:N}),b[S.variable]=!1}else S.cursor&&(w=n(v,m))}var x=t.from,T=t.to,C=x.line;e.replaceRange(c,x,T);for(var E=0;E<y.length;E++){function k(e){return r.varTemplates&&r.varTemplates[e]?r.varTemplates[e]:undefined}var L=y[E],x=L.from,T=L.to,A=e.markText(x,T,{className:"CodeMirror-templates-variable",startStyle:"CodeMirror-templates-variable-start",endStyle:"CodeMirror-templates-variable-end",inclusiveLeft:!0,inclusiveRight:!0,clearWhenEmpty:!1,_templateVar:L.variable,_templates:k(L.variable)});f.marked.push(A),L.selectable==1&&f.selectableMarkers.push(A)}w!=null&&(f.cursor=e.setBookmark(w));var O=c.split("\n");for(var M=1;M<O.length;M++){var _=C+M;e.indentLine(_)}s||(e.on("change",h),i("template","Installing endCompletion"),e.on("endCompletion",p),e.addKeyMap(o)),d(e,!0)},e.templatesHint.getCompletions=function(n,i,s){var o=n.doc.mode.name,u=t[o];if(u)for(var a=0;a<u.length;a++){var f=u[a];if(r(f.name,s)){var l=f.name;f.description&&(l+="- "+f.description);var c="CodeMirror-hint-template";f.className&&(c=f.className);var h={className:c,text:l,template:f};h.data=h,h.hint=function(e,t,n){n.template.insert(e,t)},h.info=function(t){var r=t.template.content();if(e.runMode){var i=document.createElement("div");return i.className="cm-s-default",n.options&&n.options.theme&&(i.className="cm-s-"+n.options.theme),e.runMode(r,n.getMode().name,i),i}return r},i.push(h)}}},e.templatesHint.Template=f,e.templatesHint.addTemplates=function(e){var n=e.context;if(n){var r=t[n];r||(r=[],t[n]=r),e.templates.forEach(function(e){r.push(new f(e))})}}}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/mode/prolog/prolog-template-hint",["../../lib/codemirror","../../addon/hint/templates-hint","jquery","config","laconic"],e):e(CodeMirror)}(function(e,t,n,r){function s(e){function r(e){var n=/[-+?:^@!]*([A-Z][A-Za-z_0-9]*)/g,r=/\bis\s+(det|nondet|semidet|fail|multi)$/;t.template||(t.template=e.replace(n,"$${$1}").replace(r,""),t.template.match(/\${cursor}/)||(t.template+="${cursor}")),t.displayText||(t.displayText=e);if(!t.varTemplates){var s=e.match(/:[A-Z][A-Za-z_0-9]*/g);if(s&&s.length>0){var o={};for(var u=0;u<s.length;u++)o[s[u].substring(1)]=i;t.varTemplates=o}}}var t=this,s=["template","displayText","text",{from:"summary",to:"description"},"className","varTemplates"];if(typeof e=="string")this.displayText=e,this.text=e;else{for(var o=0;o<s.length;o++){var u=s[o];typeof u=="string"?e[u]&&(this[u]=e[u]):e[u.from]&&(this[u.to]=e[u.from])}e.mode&&r(e.mode),e.classes&&(e.className=e.classes.join(" "))}this.render=function(e,t,r){n(e).append(r.displayText)},this.info=function(e){return e.description}}function o(t,n,r){function f(e,t){return e.slice(0,t.length)==t}var o=n.token.string,u=[],a=i;t._hintTemplateMarker&&(o=="☰"&&(o=""),a=t._hintTemplateMarker._templates);var l=o.length>0&&!o.match(/\w/);if(a)for(var c=0;c<a.length;c++){var h=a[c];if(typeof h=="string")f(h,o)&&u.push(new s(h));else{var p=["name","mode","template","text"];if(l)h.name&&h.name.indexOf(o)>=0&&u.push(new s(h));else for(var d=0;d<p.length;d++)if(h[p[d]]){f(h[p[d]],o)&&u.push(new s(h));break}}}if(u.length==0){var v=e.hint.anyword,m=o==""&&t._hintTemplateMarker?{word:/[A-Z][A-Za-z0-9_]*/}:r,g=v(t,m);for(var c=0;c<g.list.length;c++)u.push(new s(g.list[c]))}return{list:u,from:n.position.from,to:n.position.to}}function u(t,n,r){var i=a(t),s=o(t,i,r);e.attachContextInfo(s),n(s)}function a(t){var n=t.getCursor(),r=t.getTokenAt(n),i=e.innerMode(t.getMode(),r.state);if(i.mode.name!="prolog")return null;var s={from:new e.Pos(n.line,r.start),to:new e.Pos(n.line,r.end)};return{token:r,position:s}}var i=r.swish.templates||[];return s.prototype.hint=function(t,n,r){var i=new e.templatesHint.Template(this);i.insert(t,n)},u.async=!0,e.registerHelper("hint","prologTemplate",u),{getHints:u,getState:a}}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/mode/prolog/prolog",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("prolog",function(t,n){function r(e,t,n){return t.tokenize=n,n(e,t)}function p(e,t,n){if(n>0){while(n-->0)if(!t.test(e.next()))return!1}else while(t.test(e.peek()))e.next();return!0}function d(e){var t=e.next();if(o.test(t))return!0;switch(t){case"u":if(i.unicodeEscape)return p(e,a,4);return!1;case"U":if(i.unicodeEscape)return p(e,a,8);return!1;case null:return!0;case"c":return e.eatSpace(),!0;case"x":return p(e,a,2)}return u.test(t)?p(e,u,-1)?(e.peek()=="\\"&&e.next(),!0):!1:!1}function v(e,t,n){var r;while((r=e.next())!=null){if(r==n&&n!=e.peek())return t.nesting.pop(),!1;if(r=="\\"&&!d(e))return!1}return i.multiLineQuoted}function m(e){return e.nesting.slice(-1)[0]}function g(e){var t=m(e);t?t.arg==0?t.arg=1:t.type=="control"&&(e.goalStart=!1):e.goalStart=!1}function y(e){var t=m(e);t&&!t.alignment&&t.arg!=undefined&&(t.arg==0?t.alignment=t.leftCol?t.leftCol+4:t.column+4:t.alignment=t.column+1)}function b(e){var t=m(e);t?t.arg?t.arg++:t.type=="control"&&(e.goalStart=!0):e.goalStart=!0}function w(e){var t=m(e);return t?t.type=="control"?!0:!1:e.inBody}function x(e,t,n){return E=e,S=n,t}function T(e){return e.eol()||/[\s%]/.test(e.peek())?!0:!1}function N(e,t){var n=e.next();if(n=="(")return t.lastType=="functor"?(t.nesting.push({functor:t.functorName,column:e.column(),leftCol:t.functorColumn,arg:0}),delete t.functorName,delete t.functorColumn):t.nesting.push({type:"control",closeColumn:e.column(),alignment:e.column()+4}),x("solo",null,"(");if(n=="{"&&t.lastType=="tag")return t.nesting.push({tag:t.tagName,column:e.column(),leftCol:t.tagColumn,arg:0}),delete t.tagName,delete t.tagColumn,x("dict_open",null);if(n=="/"&&e.eat("*"))return r(e,t,L);if(n=="%")return e.skipToEnd(),x("comment","comment");g(t);if(l.test(n)){switch(n){case")":t.nesting.pop();break;case"]":return t.nesting.pop(),x("list_close",null);case"}":var s=m(t),o=s&&s.tag?"dict_close":"brace_term_close";return t.nesting.pop(),x(o,null);case",":e.eol()&&(t.commaAtEOL=!0),b(t);case";":w(t)&&(t.goalStart=!0);break;case"[":return t.nesting.push({type:"list",closeColumn:e.column(),alignment:e.column()+2}),x("list_open",null);case"{":return i.quasiQuotations&&e.eat("|")?(t.nesting.push({type:"quasi-quotation",alignment:e.column()+1}),x("qq_open","qq_open")):(t.nesting.push({type:"curly",closeColumn:e.column(),alignment:e.column()+2}),x("brace_term_open",null));case"|":if(i.quasiQuotations){if(e.eat("|"))return t.tokenize=k,x("qq_sep","qq_sep");if(e.eat("}"))return t.nesting.pop(),x("qq_close","qq_close")}w(t)&&(t.goalStart=!0)}return x("solo",null,n)}if(n=='"'||n=="'"||n=="`")return t.nesting.push({type:"quoted",alignment:e.column()+1}),r(e,t,C(n));if(n=="0"){if(e.eat(/x/i))return e.eatWhile(/[\da-f]/i),x("number","number");if(e.eat(/o/i))return e.eatWhile(/[0-7]/i),x("number","number");if(e.eat(/'/)){var u=e.next();return u=="\\"&&!d(e)?x("error","error"):x("code","code")}}if(/\d/.test(n)||/[+-]/.test(n)&&e.eat(/\d/))return i.groupedIntegers?e.match(/^\d*((_|\s+)\d+)*(?:\.\d+)?(?:[eE][+\-]?\d+)?/):e.match(/^\d*(?:\.\d+)?(?:[eE][+\-]?\d+)?/),x(n=="-"?"neg-number":n=="+"?"pos-number":"number");if(f.test(n)){e.eatWhile(f);var a=e.current();if(a=="."&&T(e))return m(t)?x("fullstop","error",a):x("fullstop","fullstop",a);return c.test(a)?x("neck","neck",a):w(t)&&h.test(a)?(t.goalStart=!0,x("symbol","operator",a)):x("symbol","operator",a)}e.eatWhile(/[\w_]/);var p=e.current();if(e.peek()=="{"&&i.dicts)return t.tagName=p,t.tagColumn=e.column(),x("tag","tag",p);if(n=="_"){if(p.length==1)return x("var","anon",p);var v=p.charAt(1);return v==v.toUpperCase()?x("var","var-2",p):x("var","var",p)}return n==n.toUpperCase()?x("var","var",p):e.peek()=="("?(t.functorName=p,t.functorColumn=e.column(),x("functor","functor",p)):x("atom","atom",p)}function C(e){return function(t,n){if(!v(t,n,e)){n.tokenize=N;if(t.peek()=="("){var r=t.current();return n.functorName=r,x("functor","functor",r)}if(t.peek()=="{"&&i.dicts){var r=t.current();return n.tagName=r,x("tag","tag",r)}}return x(s[e],s[e])}}function k(e,t){var n=!1,r;while(r=e.next()){if(r=="}"&&n){t.tokenize=N,e.backUp(2);break}n=r=="|"}return x("qq_content","qq_content")}function L(e,t){var n=!1,r;while(r=e.next()){if(r=="/"&&n){t.tokenize=N;break}n=r=="*"}return x("comment","comment")}var i={quasiQuotations:!0,dicts:!0,unicodeEscape:!0,multiLineQuoted:!0,groupedIntegers:!0},s={'"':"string","'":"qatom","`":"bqstring"},o=/[abref\\'"nrtsv]/,u=/[0-7]/,a=/[0-9a-fA-F]/,f=/[-#$&*+./:<=>?@\\^~]/,l=/[[\]{}(),;|!]/,c=/^(:-|-->)$/,h=/^(,|;|->|\*->|\\+|\|)$/,E,S;return{startState:function(){return{tokenize:N,inBody:!1,goalStart:!1,lastType:null,nesting:new Array,curTerm:null,curToken:null}},token:function(e,t){var r;t.curTerm==null&&n.metainfo&&(t.curTerm=0,t.curToken=0),e.sol()&&delete t.commaAtEOL;if(t.tokenize==N&&e.eatSpace())return e.eol()&&y(t),null;var i=t.tokenize(e,t);return e.eol()&&y(t),E=="neck"?(t.inBody=!0,t.goalStart=!0):E=="fullstop"&&(t.inBody=!1,t.goalStart=!1),t.lastType=E,typeof n.enrich=="function"&&(i=n.enrich(e,t,E,S,i)),i},indent:function(t,n){if(t.tokenize==L)return e.Pass;var r;return(r=m(t))?r.closeColumn&&!t.commaAtEOL?r.closeColumn:r.alignment:t.inBody?4:0},theme:"prolog",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"%"}}),e.defineMIME("text/x-prolog","prolog")}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/mode/prolog/prolog_keys",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.commands.prologStartIfThenElse=function(t){var n=t.getCursor("start"),r=t.getTokenAt(n,!0);if(r.state.goalStart==1){t.replaceSelection("(   ","end");return}return e.Pass},e.commands.prologStartThen=function(t){function i(e){var t=e.nesting.length;return t>0?e.nesting[t-1]:null}function s(e){var t=i(e);return t?t.type=="control"?!0:!1:e.inBody}var n=t.getCursor("start"),r=t.getTokenAt(n,!0);if(n.ch==r.end&&r.type=="operator"&&r.string=="-"&&s(r.state)){t.replaceSelection(">  ","end");return}return e.Pass},e.commands.prologStartElse=function(t){var n=t.getCursor("start"),r=t.getTokenAt(n,!0);if(r.start==0&&n.ch==r.end&&!/\S/.test(r.string)){t.replaceSelection(";   ","end");return}return e.Pass},e.defineOption("prologKeys",null,function(t,n,r){r&&r!=e.Init&&t.removeKeyMap("prolog");if(n){var i={name:"prolog","'('":"prologStartIfThenElse","'>'":"prologStartThen","';'":"prologStartElse","Ctrl-L":"refreshHighlight"};t.addKeyMap(i)}})}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/mode/prolog/prolog_query",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.commands.prologFireQuery=function(t){var n=t.lineCount(),r=t.getLine(n-1).length,i=t.getTokenAt({line:n,ch:r},!0);return i.type=="fullstop"?t.prologFireQuery(t.getValue()):e.Pass},e.defineOption("prologQuery",null,function(t,n,r){r&&r!=e.Init&&t.removeKeyMap("prologQuery");if(typeof n=="function"){var i={name:"prologQuery",Enter:"prologFireQuery","Ctrl-Enter":"newlineAndIndent"};t.addKeyMap(i),t.prologFireQuery=n}})}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/mode/prolog/prolog_server",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function r(e){typeof e=="object"&&(this.enabled=e.enabled||!1,this.role=e.role||"source",e.sourceID&&(this.sourceID=e.sourceID),this.url={change:e.url+"change",tokens:e.url+"tokens",leave:e.url+"leave",info:e.url+"info"},this.delay=e.delay?e.delay:t,this.generationFromServer=-1,this.tmo=null)}function i(e,t){var n=e.state.prologHighlightServer;if(n==null||n.url==null||!n.enabled)return;n.tmo&&e.askRefresh(),n.changes!==undefined&&n.changes.push(t);if(t.origin=="setValue"||n.generationFromServer==-1)n.changes=undefined,e.serverAssistedHighlight()}function s(e){var t=e.state.prologHighlightServer;if(t==null||t.url==null||t.uuid==null)return;var n=t.uuid;delete t.uuid,$.ajax({url:t.url.leave,async:!1,contentType:"application/json",type:"POST",dataType:"json",data:JSON.stringify({uuid:n})})}function o(){var e=(new Date).getTime(),t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=(e+Math.random()*16)%16|0;return e=Math.floor(e/16),(t=="x"?n:n&7|8).toString(16)});return t}function f(e,t,n,r,i){function o(e){var t=s.metainfo[e.curTerm];if(!t)return null;var n=t[e.curToken];return n?n:null}function f(){t.outOfSync||(console.log("Mismatch: ("+r+") "+n+"/"+d.type),t.outOfSync={okToken:t.curToken,okTerm:t.curTerm,skippedTerms:0,skippedTokens:[]}),s.editor.askRefresh()}function l(){var e=t.outOfSync,n={curToken:e.okToken,curTerm:e.okTerm};return e.skippedTerms,null}function c(t){var n;if(r==t)return!0;if((n=t.lastIndexOf(r,1))>=0){var i=t.substring(r.length+n);for(var s=0;s<i.length;s++)if(!e.eat(i.charAt(s)))return e.backUp(s),!1;return!0}return!1}function h(e){var t=e.slice(-1)[0];return t&&t.type=="quoted"}function p(e,t){if(e){if(!u[n])return r&&e.text==r?(t.curToken++,e.type):i;if(e.text&&r)return c(e.text)?(t.curToken++,e.type):undefined;if(u[n]==a[e.type])return n=="fullstop"?(t.curTerm++,t.curToken=0):h(t.nesting)||t.curToken++,e.type;if(u[n]==e.base)return t.curToken++,e.type;if(n=="qatom"&&a[e.type]=="atom")return t.curToken++,e.type;if(n=="number"&&e.type=="meta")return t.curToken++,e.type;if(n=="neg-number"&&e.text&&e.text=="-")return t.curToken+=2,"number";if(n=="pos-number"&&e.text&&e.text=="+")return t.curToken+=2,"number"}return undefined}var s=this;if(t.curTerm!=null){var d,v;if(t.syntax_error)return n=="fullstop"&&(s.editor.askRefresh(),delete t.syntax_error),i;if(t.outOfSync){var m=t.outOfSync;if(m.skippedTerms<=3){m.skippedTokens.push({type:n,style:i,content:r});if(v=l())return v;n=="fullstop"&&(m.skippedTokens=[],m.skippedTerms++)}return i}return(d=o(t))?(v=p(d,t))!==undefined?v:d.type=="syntax_error"?(t.syntax_error=!0,t.curToken=0,t.curTerm++,i):(f(),i+" outofsync"):(s.editor.askRefresh(),i)}return i}var t=1e3,n=1e3;e.defineOption("prologHighlightServer",!1,function(e,t,n){function o(){s(e)}e.state.prologHighlightServer?t==null?(s(e),e.off("change",i),window.removeEventListener("unload",o),delete e.state.prologHighlightServer,e.setOption("mode",{name:"prolog"})):t.enabled!=n.enabled&&(e.state.prologHighlightServer.enabled=t.enabled,t.enabled?(e.on("change",i),window.addEventListener("unload",o),e.lineCount()>0&&e.serverAssistedHighlight(!0)):(s(e),e.off("change",i),window.removeEventListener("unload",o),e.setOption("mode",{name:"prolog"}))):t&&(e.state.prologHighlightServer=new r(t),e.state.prologHighlightServer.enabled&&(e.on("change",i),window.addEventListener("unload",o),e.lineCount()>0&&e.serverAssistedHighlight(!0)))}),e.prototype.askRefresh=function(e){var t=this,n=t.state.prologHighlightServer;if(n==null)return;e===undefined&&(e=n.delay),n.tmo&&clearTimeout(n.tmo),n.tmo=setTimeout(function(){t.serverAssistedHighlight()},e)},e.prototype.serverAssistedHighlight=function(e){function s(){var e=t.getOption("mode");return typeof e!="object"?e={name:"prolog",enrich:f,editor:t}:e.enrich||(e.enrich=f,e.editor=t),e}var t=this,r=t.state.prologHighlightServer,i={};r.tmo=null;if(r==null||r.url==null||!r.enabled||t.isClean(r.generationFromServer)&&!e)return;if(r.uuid)i.uuid=r.uuid,r.changes==undefined?(i.text=t.getValue(),i.text.length>n&&(r.changes=[])):(i.changes=r.changes,r.changes=[]);else{i.text=t.getValue();if(i.text.trim()=="")return;r.uuid=o(),i.uuid=r.uuid}i.role=r.role,typeof r.sourceID=="function"&&(i.sourceID=r.sourceID()),r.generationFromServer=t.changeGeneration(),$.ajax({url:r.url.tokens,dataType:"json",contentType:"application/json",type:"POST",data:JSON.stringify(i),success:function(e,n){var r=s();r.metainfo=e.tokens,t.setOption("mode",r)},error:function(e){e.status==409&&delete r.uuid}})},e.commands.refreshHighlight=function(e){e.serverAssistedHighlight(!0)};var u={"var":"var",atom:"atom",qatom:"qatom",bqstring:"string",symbol:"atom",functor:"functor",tag:"tag",number:"number",string:"string",code:"number","neg-number":"number","pos-number":"number",list_open:"list_open",list_close:"list_close",qq_open:"qq_open",qq_sep:"qq_sep",qq_close:"qq_close",dict_open:"dict_open",dict_close:"dict_close",brace_term_open:"brace_term_open",brace_term_close:"brace_term_close",neck:"neck",fullstop:"fullstop"},a={"var":"var",singleton:"var",uatom:"var",atom:"atom",qatom:"qatom",string:"string",codes:"string",chars:"string",functor:"functor",tag:"tag",control:"atom",meta:"atom",op_type:"atom","int":"number","float":"number",key:"atom",sep:"atom",ext_quant:"atom",expanded:"expanded",comment_string:"string",identifier:"atom",delimiter:"atom",module:"atom",head_exported:"atom",head_public:"atom",head_extern:"atom",head_dynamic:"atom",head_multifile:"atom",head_unreferenced:"atom",head_hook:"atom",head_meta:"atom",head_constraint:"atom",head_imported:"atom",head_built_in:"atom",head_iso:"atom",head_def_iso:"atom",head_def_swi:"atom",head:"atom",goal_built_in:"atom",goal_imported:"atom",goal_autoload:"atom",goal_global:"atom",goal_undefined:"atom",goal_thread_local:"atom",goal_dynamic:"atom",goal_multifile:"atom",goal_expanded:"atom",goal_extern:"atom",goal_recursion:"atom",goal_meta:"atom",goal_foreign:"atom",goal_local:"atom",goal_constraint:"atom",goal_not_callable:"atom",xpce_method:"functor",xpce_class_builtin:"atom",xpce_class_lib:"atom",xpce_class_user:"atom",xpce_class_undef:"atom",option_name:"atom",no_option_name:"atom",flag_name:"atom",no_flag_name:"atom",file_no_depends:"atom",file:"atom",nofile:"atom",list_open:"list_open",list_close:"list_close",qq_open:"qq_open",qq_sep:"qq_sep",qq_close:"qq_close",qq_type:"atom",dict_open:"dict_open",dict_close:"dict_close",brace_term_open:"brace_term_open",brace_term_close:"brace_term_close",neck:"neck",fullstop:"fullstop",string_terminal:"string",html:"functor",entity:"atom",html_attribute:"functor",sgml_attr_function:"atom",http_location_for_id:"atom",http_no_location_for_id:"atom"};e.prototype.getEnrichedToken=function(e){if(e.state.curTerm!=null&&e.state.curToken!=null){var t=this.getOption("mode"),n;if(t.metainfo&&(n=t.metainfo[e.state.curTerm]))return n[e.state.curToken-1]}return undefined},e.prototype.tokenInfo=function(e,t){var n=this.state.prologHighlightServer;return t||(t=$($.el.span({"class":"token-info"},"..."))),$.ajax({url:n.url.info,data:e,success:function(e){t.html(e)}}),t[0]},e.prototype.getTokenReferences=function(e){function n(e,t){if(t&&t.indexOf("swish://")==0)return e.file=t.substring(8),!0}var t=[];switch(e.type){case"goal_local":var r={title:"Source for "+e.text+"/"+e.arity,line:e.line,regex:new RegExp("\\b"+RegExp.escape(e.text),"g"),showAllMatches:!0};n(r,e.file),t.push(r);break;case"file":var r={};n(r,e.path)&&(r.title="Included file "+r.file,t.push(r))}return t}}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/mode/xml/xml",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1};e.defineMode("xml",function(r,i){function c(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();if(r=="<")return e.eat("!")?e.eat("[")?e.match("CDATA[")?n(d("atom","]]>")):null:e.match("--")?n(d("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(v(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=d("meta","?>"),"meta"):(f=e.eat("/")?"closeTag":"openTag",t.tokenize=h,"tag bracket");if(r=="&"){var i;return e.eat("#")?e.eat("x")?i=e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):i=e.eatWhile(/[\d]/)&&e.eat(";"):i=e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),i?"atom":"error"}return e.eatWhile(/[^&<]/),null}function h(e,t){var n=e.next();if(n==">"||n=="/"&&e.eat(">"))return t.tokenize=c,f=n==">"?"endTag":"selfcloseTag","tag bracket";if(n=="=")return f="equals",null;if(n=="<"){t.tokenize=c,t.state=b,t.tagName=t.tagStart=null;var r=t.tokenize(e,t);return r?r+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=p(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function p(e){var t=function(t,n){while(!t.eol())if(t.next()==e){n.tokenize=h;break}return"string"};return t.isInAttribute=!0,t}function d(e,t){return function(n,r){while(!n.eol()){if(n.match(t)){r.tokenize=c;break}n.next()}return e}}function v(e){return function(t,n){var r;while((r=t.next())!=null){if(r=="<")return n.tokenize=v(e+1),n.tokenize(t,n);if(r==">"){if(e==1){n.tokenize=c;break}return n.tokenize=v(e-1),n.tokenize(t,n)}}return"meta"}}function m(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n;if(o.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)this.noIndent=!0}function g(e){e.context&&(e.context=e.context.prev)}function y(e,t){var n;for(;;){if(!e.context)return;n=e.context.tagName;if(!o.contextGrabbers.hasOwnProperty(n)||!o.contextGrabbers[n].hasOwnProperty(t))return;g(e)}}function b(e,t,n){return e=="openTag"?(n.tagStart=t.column(),w):e=="closeTag"?E:b}function w(e,t,n){return e=="word"?(n.tagName=t.current(),l="tag",T):(l="error",w)}function E(e,t,n){if(e=="word"){var r=t.current();return n.context&&n.context.tagName!=r&&o.implicitlyClosed.hasOwnProperty(n.context.tagName)&&g(n),n.context&&n.context.tagName==r||o.matchClosing===!1?(l="tag",S):(l="tag error",x)}return l="error",x}function S(e,t,n){return e!="endTag"?(l="error",S):(g(n),b)}function x(e,t,n){return l="error",S(e,t,n)}function T(e,t,n){if(e=="word")return l="attribute",N;if(e=="endTag"||e=="selfcloseTag"){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,e=="selfcloseTag"||o.autoSelfClosers.hasOwnProperty(r)?y(n,r):(y(n,r),n.context=new m(n,r,i==n.indented)),b}return l="error",T}function N(e,t,n){return e=="equals"?C:(o.allowMissing||(l="error"),T(e,t,n))}function C(e,t,n){return e=="string"?k:e=="word"&&o.allowUnquoted?(l="string",T):(l="error",T(e,t,n))}function k(e,t,n){return e=="string"?k:T(e,t,n)}var s=r.indentUnit,o={},u=i.htmlMode?t:n;for(var a in u)o[a]=u[a];for(var a in i)o[a]=i[a];var f,l;return c.isInText=!0,{startState:function(e){var t={tokenize:c,state:b,indented:e||0,tagName:null,tagStart:null,context:null};return e!=null&&(t.baseIndent=e),t},token:function(e,t){!t.tagName&&e.sol()&&(t.indented=e.indentation());if(e.eatSpace())return null;f=null;var n=t.tokenize(e,t);return(n||f)&&n!="comment"&&(l=null,t.state=t.state(f||n,e,t),l&&(n=l=="error"?n+" error":l)),n},indent:function(t,n,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+s;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=h&&t.tokenize!=c)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return o.multilineTagIndentPastTag!==!1?t.tagStart+t.tagName.length+2:t.tagStart+s*(o.multilineTagIndentFactor||1);if(o.alignCDATA&&/<!\[CDATA\[/.test(n))return 0;var u=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(u&&u[1])while(i){if(i.tagName==u[2]){i=i.prev;break}if(!o.implicitlyClosed.hasOwnProperty(i.tagName))break;i=i.prev}else if(u)while(i){var a=o.contextGrabbers[i.tagName];if(!a||!a.hasOwnProperty(u[2]))break;i=i.prev}while(i&&i.prev&&!i.startOfLine)i=i.prev;return i?i.indent+s:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:o.htmlMode?"html":"xml",helperType:o.htmlMode?"html":"xml",skipAttribute:function(e){e.state==C&&(e.state=T)}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/mode/meta",["../lib/codemirror"],e):e(CodeMirror)}(function(e){e.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["pgp"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists.txt$/},{name:"CoffeeScript",mime:"text/x-coffeescript",mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history).md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"null",mode:"jinja2"},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mime:"text/n-triples",mode:"ntriples",ext:["nt"]},{name:"Objective C",mime:"text/x-objectivec",mode:"clike",ext:["m","mm"],alias:["objective-c","objc"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mime:"application/x-httpd-php",mode:"php",ext:["php","php3","php4","php5","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mime:"text/x-sh",mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki ",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]}];for(var t=0;t<e.modeInfo.length;t++){var n=e.modeInfo[t];n.mimes&&(n.mime=n.mimes[0])}e.findModeByMIME=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.mime==t)return r;if(r.mimes)for(var i=0;i<r.mimes.length;i++)if(r.mimes[i]==t)return r}},e.findModeByExtension=function(t){for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.ext)for(var i=0;i<r.ext.length;i++)if(r.ext[i]==t)return r}},e.findModeByFileName=function(t){for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.file&&r.file.test(t))return r}var i=t.lastIndexOf("."),s=i>-1&&t.substring(i+1,t.length);if(s)return e.findModeByExtension(s)},e.findModeByName=function(t){t=t.toLowerCase();for(var n=0;n<e.modeInfo.length;n++){var r=e.modeInfo[n];if(r.name.toLowerCase()==t)return r;if(r.alias)for(var i=0;i<r.alias.length;i++)if(r.alias[i].toLowerCase()==t)return r}}}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror"),require("../xml/xml"),require("../meta")):typeof define=="function"&&define.amd?define("cm/mode/markdown/markdown",["../../lib/codemirror","../xml/xml","../meta"],e):e(CodeMirror)}(function(e){e.defineMode("markdown",function(t,n){function s(n){if(e.findModeByName){var r=e.findModeByName(n);r&&(n=r.mime||r.mimes[0])}var i=e.getMode(t,n);return i.name=="null"?null:i}function v(e,t,n){return t.f=t.inline=n,n(e,t)}function m(e,t,n){return t.f=t.block=n,n(e,t)}function g(e){return!e||!/\S/.test(e.string)}function y(e){return e.linkTitle=!1,e.em=!1,e.strong=!1,e.strikethrough=!1,e.quote=0,e.indentedCode=!1,i&&e.f==w&&(e.f=N,e.block=b),e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.prevLine=e.thisLine,e.thisLine=null,null}function b(t,r){var i=t.sol(),u=r.list!==!1,p=r.indentedCode;r.indentedCode=!1,u&&(r.indentationDiff>=0?(r.indentationDiff<4&&(r.indentation-=r.indentationDiff),r.list=null):r.indentation>0?r.list=null:r.list=!1);var m=null;if(r.indentationDiff>=4)return t.skipToEnd(),p||g(r.prevLine)?(r.indentation-=4,r.indentedCode=!0,o.code):null;if(t.eatSpace())return null;if((m=t.match(c))&&m[1].length<=6)return r.header=m[1].length,n.highlightFormatting&&(r.formatting="header"),r.f=r.inline,x(r);if(!g(r.prevLine)&&!r.quote&&!u&&!p&&(m=t.match(h)))return r.header=m[0].charAt(0)=="="?1:2,n.highlightFormatting&&(r.formatting="header"),r.f=r.inline,x(r);if(t.eat(">"))return r.quote=i?1:r.quote+1,n.highlightFormatting&&(r.formatting="quote"),t.eatSpace(),x(r);if(t.peek()==="[")return v(t,r,O);if(t.match(a,!0))return r.hr=!0,o.hr;if(m=t.match(f)){var y=m[1]?"ol":"ul";r.indentation=t.column()+t.current().length,r.list=!0;while(r.listStack&&t.column()<r.listStack[r.listStack.length-1])r.listStack.pop();return r.listStack.push(r.indentation),n.taskLists&&t.match(l,!1)&&(r.taskList=!0),r.f=r.inline,n.highlightFormatting&&(r.formatting=["list","list-"+y]),x(r)}return n.fencedCodeBlocks&&(m=t.match(d,!0))?(r.fencedChars=m[1],r.localMode=s(m[2]),r.localMode&&(r.localState=e.startState(r.localMode)),r.f=r.block=E,n.highlightFormatting&&(r.formatting="code-block"),r.code=-1,x(r)):v(t,r,r.inline)}function w(t,n){var s=r.token(t,n.htmlState);if(!i){var o=e.innerMode(r,n.htmlState);if(o.mode.name=="xml"&&o.state.tagStart===null&&!o.state.context&&o.state.tokenize.isInText||n.md_inside&&t.current().indexOf(">")>-1)n.f=N,n.block=b,n.htmlState=null}return s}function E(e,t){return t.fencedChars&&e.match(t.fencedChars,!1)?(t.localMode=t.localState=null,t.f=t.block=S,null):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),o.code)}function S(e,t){e.match(t.fencedChars),t.block=b,t.f=N,t.fencedChars=null,n.highlightFormatting&&(t.formatting="code-block"),t.code=1;var r=x(t);return t.code=0,r}function x(e){var t=[];if(e.formatting){t.push(o.formatting),typeof e.formatting=="string"&&(e.formatting=[e.formatting]);for(var r=0;r<e.formatting.length;r++)t.push(o.formatting+"-"+e.formatting[r]),e.formatting[r]==="header"&&t.push(o.formatting+"-"+e.formatting[r]+"-"+e.header),e.formatting[r]==="quote"&&(!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(o.formatting+"-"+e.formatting[r]+"-"+e.quote):t.push("error"))}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;e.linkHref?t.push(o.linkHref,"url"):(e.strong&&t.push(o.strong),e.em&&t.push(o.em),e.strikethrough&&t.push(o.strikethrough),e.linkText&&t.push(o.linkText),e.code&&t.push(o.code),e.image&&t.push(o.image),e.imageAltText&&t.push(o.imageAltText,"link"),e.imageMarker&&t.push(o.imageMarker)),e.header&&t.push(o.header,o.header+"-"+e.header),e.quote&&(t.push(o.quote),!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(o.quote+"-"+e.quote):t.push(o.quote+"-"+n.maxBlockquoteDepth));if(e.list!==!1){var i=(e.listStack.length-1)%3;i?i===1?t.push(o.list2):t.push(o.list3):t.push(o.list1)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function T(e,t){return e.match(p,!0)?x(t):undefined}function N(t,i){var s=i.text(t,i);if(typeof s!="undefined")return s;if(i.list)return i.list=null,x(i);if(i.taskList){var u=t.match(l,!0)[1]!=="x";return u?i.taskOpen=!0:i.taskClosed=!0,n.highlightFormatting&&(i.formatting="task"),i.taskList=!1,x(i)}i.taskOpen=!1,i.taskClosed=!1;if(i.header&&t.match(/^#+$/,!0))return n.highlightFormatting&&(i.formatting="header"),x(i);var a=t.sol(),f=t.next();if(i.linkTitle){i.linkTitle=!1;var c=f;f==="("&&(c=")"),c=(c+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");var h="^\\s*(?:[^"+c+"\\\\]+|\\\\\\\\|\\\\.)"+c;if(t.match(new RegExp(h),!0))return o.linkHref}if(f==="`"){var p=i.formatting;n.highlightFormatting&&(i.formatting="code"),t.eatWhile("`");var d=t.current().length;if(i.code==0)return i.code=d,x(i);if(d==i.code){var v=x(i);return i.code=0,v}return i.formatting=p,x(i)}if(i.code)return x(i);if(f==="\\"){t.next();if(n.highlightFormatting){var g=x(i),y=o.formatting+"-escape";return g?g+" "+y:y}}if(f==="!"&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return i.imageMarker=!0,i.image=!0,n.highlightFormatting&&(i.formatting="image"),x(i);if(f==="["&&i.imageMarker)return i.imageMarker=!1,i.imageAltText=!0,n.highlightFormatting&&(i.formatting="image"),x(i);if(f==="]"&&i.imageAltText){n.highlightFormatting&&(i.formatting="image");var g=x(i);return i.imageAltText=!1,i.image=!1,i.inline=i.f=k,g}if(f==="["&&t.match(/[^\]]*\](\(.*\)| ?\[.*?\])/,!1)&&!i.image)return i.linkText=!0,n.highlightFormatting&&(i.formatting="link"),x(i);if(f==="]"&&i.linkText&&t.match(/\(.*?\)| ?\[.*?\]/,!1)){n.highlightFormatting&&(i.formatting="link");var g=x(i);return i.linkText=!1,i.inline=i.f=k,g}if(f==="<"&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){i.f=i.inline=C,n.highlightFormatting&&(i.formatting="link");var g=x(i);return g?g+=" ":g="",g+o.linkInline}if(f==="<"&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){i.f=i.inline=C,n.highlightFormatting&&(i.formatting="link");var g=x(i);return g?g+=" ":g="",g+o.linkEmail}if(f==="<"&&t.match(/^(!--|\w)/,!1)){var b=t.string.indexOf(">",t.pos);if(b!=-1){var E=t.string.substring(t.start,b);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(E)&&(i.md_inside=!0)}return t.backUp(1),i.htmlState=e.startState(r),m(t,i,w)}if(f==="<"&&t.match(/^\/\w*?>/))return i.md_inside=!1,"tag";var S=!1;if(!n.underscoresBreakWords&&f==="_"&&t.peek()!=="_"&&t.match(/(\w)/,!1)){var T=t.pos-2;if(T>=0){var N=t.string.charAt(T);N!=="_"&&N.match(/(\w)/,!1)&&(S=!0)}}if(f==="*"||f==="_"&&!S){if(!a||t.peek()!==" "){if(i.strong===f&&t.eat(f)){n.highlightFormatting&&(i.formatting="strong");var v=x(i);return i.strong=!1,v}if(!i.strong&&t.eat(f))return i.strong=f,n.highlightFormatting&&(i.formatting="strong"),x(i);if(i.em===f){n.highlightFormatting&&(i.formatting="em");var v=x(i);return i.em=!1,v}if(!i.em)return i.em=f,n.highlightFormatting&&(i.formatting="em"),x(i)}}else if(f===" ")if(t.eat("*")||t.eat("_")){if(t.peek()===" ")return x(i);t.backUp(1)}if(n.strikethrough)if(f==="~"&&t.eatWhile(f)){if(i.strikethrough){n.highlightFormatting&&(i.formatting="strikethrough");var v=x(i);return i.strikethrough=!1,v}if(t.match(/^[^\s]/,!1))return i.strikethrough=!0,n.highlightFormatting&&(i.formatting="strikethrough"),x(i)}else if(f===" "&&t.match(/^~~/,!0)){if(t.peek()===" ")return x(i);t.backUp(2)}return f===" "&&(t.match(/ +$/,!1)?i.trailingSpace++:i.trailingSpace&&(i.trailingSpaceNewLine=!0)),x(i)}function C(e,t){var r=e.next();if(r===">"){t.f=t.inline=N,n.highlightFormatting&&(t.formatting="link");var i=x(t);return i?i+=" ":i="",i+o.linkInline}return e.match(/^[^>]+/,!0),o.linkInline}function k(e,t){if(e.eatSpace())return null;var r=e.next();return r==="("||r==="["?(t.f=t.inline=A(r==="("?")":"]",0),n.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,x(t)):"error"}function A(e){return function(t,r){var i=t.next();if(i===e){r.f=r.inline=N,n.highlightFormatting&&(r.formatting="link-string");var s=x(r);return r.linkHref=!1,s}return t.match(L[e]),r.linkHref=!0,x(r)}}function O(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=M,e.next(),n.highlightFormatting&&(t.formatting="link"),t.linkText=!0,x(t)):v(e,t,N)}function M(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=_,n.highlightFormatting&&(t.formatting="link");var r=x(t);return t.linkText=!1,r}return e.match(/^([^\]\\]|\\.)+/,!0),o.linkText}function _(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),e.peek()===undefined?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=N,o.linkHref+" url")}var r=e.getMode(t,"text/html"),i=r.name=="null";n.highlightFormatting===undefined&&(n.highlightFormatting=!1),n.maxBlockquoteDepth===undefined&&(n.maxBlockquoteDepth=0),n.underscoresBreakWords===undefined&&(n.underscoresBreakWords=!0),n.taskLists===undefined&&(n.taskLists=!1),n.strikethrough===undefined&&(n.strikethrough=!1),n.tokenTypeOverrides===undefined&&(n.tokenTypeOverrides={});var o={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough"};for(var u in o)o.hasOwnProperty(u)&&n.tokenTypeOverrides[u]&&(o[u]=n.tokenTypeOverrides[u]);var a=/^([*\-_])(?:\s*\1){2,}\s*$/,f=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,l=/^\[(x| )\](?=\s)/,c=n.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,h=/^ *(?:\={1,}|-{1,})\s*$/,p=/^[^#!\[\]*_\\<>` "'(~]+/,d=new RegExp("^("+(n.fencedCodeBlocks===!0?"~~~+|```+":n.fencedCodeBlocks)+")[ \\t]*([\\w+#-]*)"),L={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\\]]|\\.)*\])*?(?=\])/},D={startState:function(){return{f:b,prevLine:null,thisLine:null,block:b,htmlState:null,indentation:0,inline:N,text:T,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,fencedChars:null}},copyState:function(t){return{f:t.f,prevLine:t.prevLine,thisLine:t.thisLine,block:t.block,htmlState:t.htmlState&&e.copyState(r,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkTitle:t.linkTitle,code:t.code,em:t.em,strong:t.strong,strikethrough:t.strikethrough,header:t.header,hr:t.hr,taskList:t.taskList,list:t.list,listStack:t.listStack.slice(0),quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside,fencedChars:t.fencedChars}},token:function(e,t){t.formatting=!1;if(e!=t.thisLine){var n=t.header||t.hr;t.header=0,t.hr=!1;if(e.match(/^\s*$/,!0)||n){y(t);if(!n)return null;t.prevLine=null}t.prevLine=t.thisLine,t.thisLine=e,t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.f=t.block;var r=e.match(/^\s*/,!0)[0].replace(/\t/g,"    ").length;t.indentationDiff=Math.min(r-t.indentation,4),t.indentation=t.indentation+t.indentationDiff;if(r>0)return null}return t.f(e,t)},innerMode:function(e){return e.block==w?{state:e.htmlState,mode:r}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:D}},blankLine:y,getType:x,closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return D},"xml"),e.defineMIME("text/x-markdown","markdown")}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/addon/edit/matchbrackets",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function i(e,t,i,o){var u=e.getLineHandle(t.line),a=t.ch-1,f=a>=0&&r[u.text.charAt(a)]||r[u.text.charAt(++a)];if(!f)return null;var l=f.charAt(1)==">"?1:-1;if(i&&l>0!=(a==t.ch))return null;var c=e.getTokenTypeAt(n(t.line,a+1)),h=s(e,n(t.line,a+(l>0?1:0)),l,c||null,o);return h==null?null:{from:n(t.line,a),to:h&&h.pos,match:h&&h.ch==f.charAt(0),forward:l>0}}function s(e,t,i,s,o){var u=o&&o.maxScanLineLength||1e4,a=o&&o.maxScanLines||1e3,f=[],l=o&&o.bracketRegex?o.bracketRegex:/[(){}[\]]/,c=i>0?Math.min(t.line+a,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-a);for(var h=t.line;h!=c;h+=i){var p=e.getLine(h);if(!p)continue;var d=i>0?0:p.length-1,v=i>0?p.length:-1;if(p.length>u)continue;h==t.line&&(d=t.ch-(i<0?1:0));for(;d!=v;d+=i){var m=p.charAt(d);if(l.test(m)&&(s===undefined||e.getTokenTypeAt(n(h,d+1))==s)){var g=r[m];if(g.charAt(1)==">"==i>0)f.push(m);else{if(!f.length)return{pos:n(h,d),ch:m};f.pop()}}}}return h-i==(i>0?e.lastLine():e.firstLine())?!1:null}function o(e,r,s){var o=e.state.matchBrackets.maxHighlightLineLength||1e3,u=[],a=e.listSelections();for(var f=0;f<a.length;f++){var l=a[f].empty()&&i(e,a[f].head,!1,s);if(l&&e.getLine(l.from.line).length<=o){var c=l.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";u.push(e.markText(l.from,n(l.from.line,l.from.ch+1),{className:c})),l.to&&e.getLine(l.to.line).length<=o&&u.push(e.markText(l.to,n(l.to.line,l.to.ch+1),{className:c}))}}if(u.length){t&&e.state.focused&&e.focus();var h=function(){e.operation(function(){for(var e=0;e<u.length;e++)u[e].clear()})};if(!r)return h;setTimeout(h,800)}}function a(e){e.operation(function(){u&&(u(),u=null),u=o(e,!1,e.state.matchBrackets)})}var t=/MSIE \d/.test(navigator.userAgent)&&(document.documentMode==null||document.documentMode<8),n=e.Pos,r={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},u=null;e.defineOption("matchBrackets",!1,function(t,n,r){r&&r!=e.Init&&(t.off("cursorActivity",a),u&&(u(),u=null)),n&&(t.state.matchBrackets=typeof n=="object"?n:{},t.on("cursorActivity",a))}),e.defineExtension("matchBrackets",function(){o(this,!0)}),e.defineExtension("findMatchingBracket",function(e,t,n){return i(this,e,t,n)}),e.defineExtension("scanForBracket",function(e,t,n,r){return s(this,e,t,n,r)})}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/addon/comment/continuecomment",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function r(t){if(t.getOption("disableInput"))return e.Pass;var n=t.listSelections(),r,s=[];for(var o=0;o<n.length;o++){var u=n[o].head,a=t.getTokenAt(u);if(a.type!="comment")return e.Pass;var f=e.innerMode(t.getMode(),a.state).mode;if(!r)r=f;else if(r!=f)return e.Pass;var l=null;if(r.blockCommentStart&&r.blockCommentContinue){var c=a.string.indexOf(r.blockCommentEnd),h=t.getRange(e.Pos(u.line,0),e.Pos(u.line,a.end)),p;if(!(c!=-1&&c==a.string.length-r.blockCommentEnd.length&&u.ch>=c))if(a.string.indexOf(r.blockCommentStart)==0){l=h.slice(0,a.start);if(!/^\s*$/.test(l)){l="";for(var d=0;d<a.start;++d)l+=" "}}else(p=h.indexOf(r.blockCommentContinue))!=-1&&p+r.blockCommentContinue.length>a.start&&/^\s*$/.test(h.slice(0,p))&&(l=h.slice(0,p));l!=null&&(l+=r.blockCommentContinue)}if(l==null&&r.lineComment&&i(t)){var v=t.getLine(u.line),p=v.indexOf(r.lineComment);p>-1&&(l=v.slice(0,p),/\S/.test(l)?l=null:l+=r.lineComment+v.slice(p+r.lineComment.length).match(/^\s*/)[0])}if(l==null)return e.Pass;s[o]="\n"+l}t.operation(function(){for(var e=n.length-1;e>=0;e--)t.replaceRange(s[e],n[e].from(),n[e].to(),"+insert")})}function i(e){var t=e.getOption("continueComments");return t&&typeof t=="object"?t.continueLineComment!==!1:!0}var t=["clike","css","javascript"];for(var n=0;n<t.length;++n)e.extendMode(t[n],{blockCommentContinue:" * "});e.defineOption("continueComments",null,function(t,n,i){i&&i!=e.Init&&t.removeKeyMap("continueComment");if(n){var s="Enter";typeof n=="string"?s=n:typeof n=="object"&&n.key&&(s=n.key);var o={name:"continueComment"};o[s]=r,t.addKeyMap(o)}})}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/addon/comment/comment",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function i(e){var t=e.search(n);return t==-1?0:t}function s(e,t,n){return/\bstring\b/.test(e.getTokenTypeAt(r(t.line,0)))&&!/^[\'\"`]/.test(n)}var t={},n=/[^\s\u00a0]/,r=e.Pos;e.commands.toggleComment=function(e){e.toggleComment()},e.defineExtension("toggleComment",function(e){e||(e=t);var n=this,i=Infinity,s=this.listSelections(),o=null;for(var u=s.length-1;u>=0;u--){var a=s[u].from(),f=s[u].to();if(a.line>=i)continue;f.line>=i&&(f=r(i,0)),i=a.line,o==null?n.uncomment(a,f,e)?o="un":(n.lineComment(a,f,e),o="line"):o=="un"?n.uncomment(a,f,e):n.lineComment(a,f,e)}}),e.defineExtension("lineComment",function(e,o,u){u||(u=t);var a=this,f=a.getModeAt(e),l=a.getLine(e.line);if(l==null||s(a,e,l))return;var c=u.lineComment||f.lineComment;if(!c){if(u.blockCommentStart||f.blockCommentStart)u.fullLines=!0,a.blockComment(e,o,u);return}var h=Math.min(o.ch!=0||o.line==e.line?o.line+1:o.line,a.lastLine()+1),p=u.padding==null?" ":u.padding,d=u.commentBlankLines||e.line==o.line;a.operation(function(){if(u.indent){var t=null;for(var s=e.line;s<h;++s){var o=a.getLine(s),f=o.slice(0,i(o));if(t==null||t.length>f.length)t=f}for(var s=e.line;s<h;++s){var o=a.getLine(s),l=t.length;if(!d&&!n.test(o))continue;o.slice(0,l)!=t&&(l=i(o)),a.replaceRange(t+c+p,r(s,0),r(s,l))}}else for(var s=e.line;s<h;++s)(d||n.test(a.getLine(s)))&&a.replaceRange(c+p,r(s,0))})}),e.defineExtension("blockComment",function(e,i,s){s||(s=t);var o=this,u=o.getModeAt(e),a=s.blockCommentStart||u.blockCommentStart,f=s.blockCommentEnd||u.blockCommentEnd;if(!a||!f){(s.lineComment||u.lineComment)&&s.fullLines!=0&&o.lineComment(e,i,s);return}if(/\bcomment\b/.test(o.getTokenTypeAt(r(e.line,0))))return;var l=Math.min(i.line,o.lastLine());l!=e.line&&i.ch==0&&n.test(o.getLine(l))&&--l;var c=s.padding==null?" ":s.padding;if(e.line>l)return;o.operation(function(){if(s.fullLines!=0){var t=n.test(o.getLine(l));o.replaceRange(c+f,r(l)),o.replaceRange(a+c,r(e.line,0));var h=s.blockCommentLead||u.blockCommentLead;if(h!=null)for(var p=e.line+1;p<=l;++p)(p!=l||t)&&o.replaceRange(h+c,r(p,0))}else o.replaceRange(f,i),o.replaceRange(a,e)})}),e.defineExtension("uncomment",function(e,i,s){s||(s=t);var o=this,u=o.getModeAt(e),a=Math.min(i.ch!=0||i.line==e.line?i.line:i.line-1,o.lastLine()),f=Math.min(e.line,a),l=s.lineComment||u.lineComment,c=[],h=s.padding==null?" ":s.padding,p;e:{if(!l)break e;for(var d=f;d<=a;++d){var v=o.getLine(d),m=v.indexOf(l);m>-1&&!/comment/.test(o.getTokenTypeAt(r(d,m+1)))&&(m=-1);if(m==-1&&n.test(v))break e;if(m>-1&&n.test(v.slice(0,m)))break e;c.push(v)}o.operation(function(){for(var e=f;e<=a;++e){var t=c[e-f],n=t.indexOf(l),i=n+l.length;if(n<0)continue;t.slice(i,i+h.length)==h&&(i+=h.length),p=!0,o.replaceRange("",r(e,n),r(e,i))}});if(p)return!0}var g=s.blockCommentStart||u.blockCommentStart,y=s.blockCommentEnd||u.blockCommentEnd;if(!g||!y)return!1;var b=s.blockCommentLead||u.blockCommentLead,w=o.getLine(f),E=w.indexOf(g);if(E==-1)return!1;var S=a==f?w:o.getLine(a),x=S.indexOf(y,a==f?E+g.length:0);x==-1&&f!=a&&(S=o.getLine(--a),x=S.indexOf(y));if(x==-1||!/comment/.test(o.getTokenTypeAt(r(f,E+1)))||!/comment/.test(o.getTokenTypeAt(r(a,x+1))))return!1;var T=w.lastIndexOf(g,e.ch),N=T==-1?-1:w.slice(0,e.ch).indexOf(y,T+g.length);if(T!=-1&&N!=-1&&N+y.length!=e.ch)return!1;N=S.indexOf(y,i.ch);var C=S.slice(i.ch).lastIndexOf(g,N-i.ch);return T=N==-1||C==-1?-1:i.ch+C,N!=-1&&T!=-1&&T!=i.ch?!1:(o.operation(function(){o.replaceRange("",r(a,x-(h&&S.slice(x-h.length,x)==h?h.length:0)),r(a,x+y.length));var e=E+g.length;h&&w.slice(e,e+h.length)==h&&(e+=h.length),o.replaceRange("",r(f,E),r(f,e));if(b)for(var t=f+1;t<=a;++t){var i=o.getLine(t),s=i.indexOf(b);if(s==-1||n.test(i.slice(0,s)))continue;var u=s+b.length;h&&i.slice(u,u+h.length)==h&&(u+=h.length),o.replaceRange("",r(t,s),r(t,u))}}),!0)})}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/addon/hint/show-hint",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function r(e,t){this.cm=e,this.options=t,this.widget=null,this.debounce=0,this.tick=0,this.startPos=this.cm.getCursor("start"),this.startLen=this.cm.getLine(this.startPos.line).length-this.cm.getSelection().length;var n=this;e.on("cursorActivity",this.activityFunc=function(){n.cursorActivity()})}function o(t,n){var r=e.cmpPos(n.from,t.from);return r>0&&t.to.ch-t.from.ch!=n.to.ch-n.from.ch}function u(e,t,n){var r=e.options.hintOptions,i={};for(var s in v)i[s]=v[s];if(r)for(var s in r)r[s]!==undefined&&(i[s]=r[s]);if(n)for(var s in n)n[s]!==undefined&&(i[s]=n[s]);return i.hint.resolve&&(i.hint=i.hint.resolve(e,t)),i}function a(e){return typeof e=="string"?e:e.text}function f(e,t){function s(e,r){var s;typeof r!="string"?s=function(e){return r(e,t)}:n.hasOwnProperty(r)?s=n[r]:s=r,i[e]=s}var n={Up:function(){t.moveFocus(-1)},Down:function(){t.moveFocus(1)},PageUp:function(){t.moveFocus(-t.menuSize()+1,!0)},PageDown:function(){t.moveFocus(t.menuSize()-1,!0)},Home:function(){t.setFocus(0)},End:function(){t.setFocus(t.length-1)},Enter:t.pick,Tab:t.pick,Esc:t.close},r=e.options.customKeys,i=r?{}:n;if(r)for(var o in r)r.hasOwnProperty(o)&&s(o,r[o]);var u=e.options.extraKeys;if(u)for(var o in u)u.hasOwnProperty(o)&&s(o,u[o]);return i}function l(e,t){while(t&&t!=e){if(t.nodeName.toUpperCase()==="LI"&&t.parentNode==e)return t;t=t.parentNode}}function c(r,i){this.completion=r,this.data=i,this.picked=!1;var s=this,o=r.cm,u=this.hints=document.createElement("ul");u.className="CodeMirror-hints",this.selectedHint=i.selectedHint||0;var c=i.list;for(var h=0;h<c.length;++h){var p=u.appendChild(document.createElement("li")),d=c[h],v=t+(h!=this.selectedHint?"":" "+n);d.className!=null&&(v=d.className+" "+v),p.className=v,d.render?d.render(p,i,d):p.appendChild(document.createTextNode(d.displayText||a(d))),p.hintId=h}var m=o.cursorCoords(r.options.alignWithWord?i.from:null),g=m.left,y=m.bottom,b=!0;u.style.left=g+"px",u.style.top=y+"px";var w=window.innerWidth||Math.max(document.body.offsetWidth,document.documentElement.offsetWidth),E=window.innerHeight||Math.max(document.body.offsetHeight,document.documentElement.offsetHeight);(r.options.container||document.body).appendChild(u);var S=u.getBoundingClientRect(),x=S.bottom-E,T=u.scrollHeight>u.clientHeight+1,N=o.getScrollInfo();if(x>0){var C=S.bottom-S.top,k=m.top-(m.bottom-S.top);if(k-C>0)u.style.top=(y=m.top-C)+"px",b=!1;else if(C>E){u.style.height=E-5+"px",u.style.top=(y=m.bottom-S.top)+"px";var L=o.getCursor();i.from.ch!=L.ch&&(m=o.cursorCoords(L),u.style.left=(g=m.left)+"px",S=u.getBoundingClientRect())}}var A=S.right-w;A>0&&(S.right-S.left>w&&(u.style.width=w-5+"px",A-=S.right-S.left-w),u.style.left=(g=m.left-A)+"px");if(T)for(var O=u.firstChild;O;O=O.nextSibling)O.style.paddingRight=o.display.nativeBarWidth+"px";o.addKeyMap(this.keyMap=f(r,{moveFocus:function(e,t){s.changeActive(s.selectedHint+e,t)},setFocus:function(e){s.changeActive(e)},menuSize:function(){return s.screenAmount()},length:c.length,close:function(){r.close()},pick:function(){s.pick()},data:i}));if(r.options.closeOnUnfocus){var M;o.on("blur",this.onBlur=function(){M=setTimeout(function(){r.close()},100)}),o.on("focus",this.onFocus=function(){clearTimeout(M)})}return o.on("scroll",this.onScroll=function(){var e=o.getScrollInfo(),t=o.getWrapperElement().getBoundingClientRect(),n=y+N.top-e.top,i=n-(window.pageYOffset||(document.documentElement||document.body).scrollTop);b||(i+=u.offsetHeight);if(i<=t.top||i>=t.bottom)return r.close();u.style.top=n+"px",u.style.left=g+N.left-e.left+"px"}),e.on(u,"dblclick",function(e){var t=l(u,e.target||e.srcElement);t&&t.hintId!=null&&(s.changeActive(t.hintId),s.pick())}),e.on(u,"click",function(e){var t=l(u,e.target||e.srcElement);t&&t.hintId!=null&&(s.changeActive(t.hintId),r.options.completeOnSingleClick&&s.pick())}),e.on(u,"mousedown",function(){setTimeout(function(){o.focus()},20)}),e.signal(i,"select",c[0],u.firstChild),!0}function h(e,t){if(!e.somethingSelected())return t;var n=[];for(var r=0;r<t.length;r++)t[r].supportsSelection&&n.push(t[r]);return n}function p(e,t,n,r){if(e.async)e(t,r,n);else{var i=e(t,n);i&&i.then?i.then(r):r(i)}}function d(t,n){var r=t.getHelpers(n,"hint"),i;if(r.length){var s=function(e,t,n){function s(r){if(r==i.length)return t(null);p(i[r],e,n,function(e){e&&e.list.length>0?t(e):s(r+1)})}var i=h(e,r);s(0)};return s.async=!0,s.supportsSelection=!0,s}return(i=t.getHelper(t.getCursor(),"hintWords"))?function(t){return e.hint.fromList(t,{words:i})}:e.hint.anyword?function(t,n){return e.hint.anyword(t,n)}:function(){}}var t="CodeMirror-hint",n="CodeMirror-hint-active";e.showHint=function(e,t,n){if(!t)return e.showHint(n);n&&n.async&&(t.async=!0);var r={hint:t};if(n)for(var i in n)r[i]=n[i];return e.showHint(r)},e.defineExtension("showHint",function(t){t=u(this,this.getCursor("start"),t);var n=this.listSelections();if(n.length>1)return;if(this.somethingSelected()){if(!t.hint.supportsSelection)return;for(var i=0;i<n.length;i++)if(n[i].head.line!=n[i].anchor.line)return}this.state.completionActive&&this.state.completionActive.close();var s=this.state.completionActive=new r(this,t);if(!s.options.hint)return;e.signal(this,"startCompletion",this),s.update(!0)});var i=window.requestAnimationFrame||function(e){return setTimeout(e,1e3/60)},s=window.cancelAnimationFrame||clearTimeout;r.prototype={close:function(){if(!this.active())return;this.cm.state.completionActive=null,this.tick=null,this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&e.signal(this.data,"close"),this.widget&&this.widget.close(),e.signal(this.cm,"endCompletion",this.cm)},active:function(){return this.cm.state.completionActive==this},pick:function(t,n){var r=t.list[n];r.hint?r.hint(this.cm,t,r):this.cm.replaceRange(a(r),r.from||t.from,r.to||t.to,"complete"),e.signal(t,"pick",r),this.close()},cursorActivity:function(){this.debounce&&(s(this.debounce),this.debounce=0);var e=this.cm.getCursor(),t=this.cm.getLine(e.line);if(e.line!=this.startPos.line||t.length-e.ch!=this.startLen-this.startPos.ch||e.ch<this.startPos.ch||this.cm.somethingSelected()||e.ch&&this.options.closeCharacters.test(t.charAt(e.ch-1)))this.close();else{var n=this;this.debounce=i(function(){n.update()}),this.widget&&this.widget.disable()}},update:function(e){if(this.tick==null)return;var t=this,n=++this.tick;p(this.options.hint,this.cm,this.options,function(r){t.tick==n&&t.finishUpdate(r,e)})},finishUpdate:function(t,n){this.data&&e.signal(this.data,"update");var r=this.widget&&this.widget.picked||n&&this.options.completeSingle;this.widget&&this.widget.close();if(t&&this.data&&o(this.data,t))return;this.data=t,t&&t.list.length&&(r&&t.list.length==1?this.pick(t,0):(this.widget=new c(this,t),e.signal(t,"shown")))}},c.prototype={close:function(){if(this.completion.widget!=this)return;this.completion.widget=null,this.hints.parentNode.removeChild(this.hints),this.completion.cm.removeKeyMap(this.keyMap);var e=this.completion.cm;this.completion.options.closeOnUnfocus&&(e.off("blur",this.onBlur),e.off("focus",this.onFocus)),e.off("scroll",this.onScroll)},disable:function(){this.completion.cm.removeKeyMap(this.keyMap);var e=this;this.keyMap={Enter:function(){e.picked=!0}},this.completion.cm.addKeyMap(this.keyMap)},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(t,r){t>=this.data.list.length?t=r?this.data.list.length-1:0:t<0&&(t=r?0:this.data.list.length-1);if(this.selectedHint==t)return;var i=this.hints.childNodes[this.selectedHint];i.className=i.className.replace(" "+n,""),i=this.hints.childNodes[this.selectedHint=t],i.className+=" "+n,i.offsetTop<this.hints.scrollTop?this.hints.scrollTop=i.offsetTop-3:i.offsetTop+i.offsetHeight>this.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=i.offsetTop+i.offsetHeight-this.hints.clientHeight+3),e.signal(this.data,"select",this.data.list[this.selectedHint],i)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}},e.registerHelper("hint","auto",{resolve:d}),e.registerHelper("hint","fromList",function(t,n){var r=t.getCursor(),i=t.getTokenAt(r),s=e.Pos(r.line,i.end);if(i.string&&/\w/.test(i.string[i.string.length-1]))var o=i.string,u=e.Pos(r.line,i.start);else var o="",u=s;var a=[];for(var f=0;f<n.words.length;f++){var l=n.words[f];l.slice(0,o.length)==o&&a.push(l)}if(a.length)return{list:a,from:u,to:s}}),e.commands.autocomplete=e.showHint;var v={hint:e.hint.auto,completeSingle:!0,alignWithWord:!0,closeCharacters:/[\s()\[\]{};:>,]/,closeOnUnfocus:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null};e.defineOption("hintOptions",null)}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/addon/hint/anyword-hint",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){var t=/[\w$]+/,n=500;e.registerHelper("hint","anyword",function(r,i){var s=i&&i.word||t,o=i&&i.range||n,u=r.getCursor(),a=r.getLine(u.line),f=u.ch,l=f;while(l&&s.test(a.charAt(l-1)))--l;var c=l!=f&&a.slice(l,f),h=i&&i.list||[],p={},d=new RegExp(s.source,"g");for(var v=-1;v<=1;v+=2){var m=u.line,g=Math.min(Math.max(m+v*o,r.firstLine()),r.lastLine())+v;for(;m!=g;m+=v){var y=r.getLine(m),b;while(b=d.exec(y)){if(m==u.line&&b[0]===c)continue;(!c||b[0].lastIndexOf(c,0)==0)&&!Object.prototype.hasOwnProperty.call(p,b[0])&&(p[b[0]]=!0,h.push(b[0]))}}}return{list:h,from:e.Pos(u.line,l),to:e.Pos(u.line,f)}})}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/addon/display/placeholder",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function n(e){t(e);var n=e.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.className="CodeMirror-placeholder";var r=e.getOption("placeholder");typeof r=="string"&&(r=document.createTextNode(r)),n.appendChild(r),e.display.lineSpace.insertBefore(n,e.display.lineSpace.firstChild)}function r(e){s(e)&&n(e)}function i(e){var r=e.getWrapperElement(),i=s(e);r.className=r.className.replace(" CodeMirror-empty","")+(i?" CodeMirror-empty":""),i?n(e):t(e)}function s(e){return e.lineCount()===1&&e.getLine(0)===""}e.defineOption("placeholder","",function(n,s,o){var u=o&&o!=e.Init;if(s&&!u)n.on("blur",r),n.on("change",i),n.on("swapDoc",i),i(n);else if(!s&&u){n.off("blur",r),n.off("change",i),n.off("swapDoc",i),t(n);var a=n.getWrapperElement();a.className=a.className.replace(" CodeMirror-empty","")}s&&!n.hasFocus()&&r(n)})}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/addon/runmode/runmode",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.runMode=function(t,n,r,i){var s=e.getMode(e.defaults,n),o=/MSIE \d/.test(navigator.userAgent),u=o&&(document.documentMode==null||document.documentMode<9);if(r.appendChild){var a=i&&i.tabSize||e.defaults.tabSize,f=r,l=0;f.innerHTML="",r=function(e,t){if(e=="\n"){f.appendChild(document.createTextNode(u?"\r":e)),l=0;return}var n="";for(var r=0;;){var i=e.indexOf("	",r);if(i==-1){n+=e.slice(r),l+=e.length-r;break}l+=i-r,n+=e.slice(r,i);var s=a-l%a;l+=s;for(var o=0;o<s;++o)n+=" ";r=i+1}if(t){var c=f.appendChild(document.createElement("span"));c.className="cm-"+t.replace(/ +/g," cm-"),c.appendChild(document.createTextNode(n))}else f.appendChild(document.createTextNode(n))}}var c=e.splitLines(t),h=i&&i.state||e.startState(s);for(var p=0,d=c.length;p<d;++p){p&&r("\n");var v=new e.StringStream(c[p]);!v.string&&s.blankLine&&s.blankLine(h);while(!v.eol()){var m=s.token(v,h);r(v.current(),m,p,v.start,h),v.start=v.pos}}}}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/addon/search/searchcursor",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function n(e,n,i,s){this.atOccurrence=!1,this.doc=e,s==null&&typeof n=="string"&&(s=!1),i=i?e.clipPos(i):t(0,0),this.pos={from:i,to:i};if(typeof n!="string")n.global||(n=new RegExp(n.source,n.ignoreCase?"ig":"g")),this.matches=function(r,i){if(r){n.lastIndex=0;var s=e.getLine(i.line).slice(0,i.ch),o=0,u,a;for(;;){n.lastIndex=o;var f=n.exec(s);if(!f)break;u=f,a=u.index,o=u.index+(u[0].length||1);if(o==s.length)break}var l=u&&u[0].length||0;l||(a==0&&s.length==0?u=undefined:a!=e.getLine(i.line).length&&l++)}else{n.lastIndex=i.ch;var s=e.getLine(i.line),u=n.exec(s),l=u&&u[0].length||0,a=u&&u.index;a+l!=s.length&&!l&&(l=1)}if(u&&l)return{from:t(i.line,a),to:t(i.line,a+l),match:u}};else{var o=n;s&&(n=n.toLowerCase());var u=s?function(e){return e.toLowerCase()}:function(e){return e},a=n.split("\n");if(a.length==1)n.length?this.matches=function(i,s){if(i){var a=e.getLine(s.line).slice(0,s.ch),f=u(a),l=f.lastIndexOf(n);if(l>-1)return l=r(a,f,l),{from:t(s.line,l),to:t(s.line,l+o.length)}}else{var a=e.getLine(s.line).slice(s.ch),f=u(a),l=f.indexOf(n);if(l>-1)return l=r(a,f,l)+s.ch,{from:t(s.line,l),to:t(s.line,l+o.length)}}}:this.matches=function(){};else{var f=o.split("\n");this.matches=function(n,r){var i=a.length-1;if(n){if(r.line-(a.length-1)<e.firstLine())return;if(u(e.getLine(r.line).slice(0,f[i].length))!=a[a.length-1])return;var s=t(r.line,f[i].length);for(var o=r.line-1,l=i-1;l>=1;--l,--o)if(a[l]!=u(e.getLine(o)))return;var c=e.getLine(o),h=c.length-f[0].length;if(u(c.slice(h))!=a[0])return;return{from:t(o,h),to:s}}if(r.line+(a.length-1)>e.lastLine())return;var c=e.getLine(r.line),h=c.length-f[0].length;if(u(c.slice(h))!=a[0])return;var p=t(r.line,h);for(var o=r.line+1,l=1;l<i;++l,++o)if(a[l]!=u(e.getLine(o)))return;if(u(e.getLine(o).slice(0,f[i].length))!=a[i])return;return{from:p,to:t(o,f[i].length)}}}}}function r(e,t,n){if(e.length==t.length)return n;for(var r=Math.min(n,e.length);;){var i=e.slice(0,r).toLowerCase().length;if(i<n)++r;else{if(!(i>n))return r;--r}}}var t=e.Pos;n.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){function i(e){var r=t(e,0);return n.pos={from:r,to:r},n.atOccurrence=!1,!1}var n=this,r=this.doc.clipPos(e?this.pos.from:this.pos.to);for(;;){if(this.pos=this.matches(e,r))return this.atOccurrence=!0,this.pos.match||!0;if(e){if(!r.line)return i(0);r=t(r.line-1,this.doc.getLine(r.line-1).length)}else{var s=this.doc.lineCount();if(r.line==s-1)return i(s);r=t(r.line+1,0)}}},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(n,r){if(!this.atOccurrence)return;var i=e.splitLines(n);this.doc.replaceRange(i,this.pos.from,this.pos.to,r),this.pos.to=t(this.pos.from.line+i.length-1,i[i.length-1].length+(i.length==1?this.pos.from.ch:0))}},e.defineExtension("getSearchCursor",function(e,t,r){return new n(this.doc,e,t,r)}),e.defineDocExtension("getSearchCursor",function(e,t,r){return new n(this,e,t,r)}),e.defineExtension("selectMatches",function(t,n){var r=[],i=this.getSearchCursor(t,this.getCursor("from"),n);while(i.findNext()){if(e.cmpPos(i.to(),this.getCursor("to"))>0)break;r.push({anchor:i.from(),head:i.to()})}r.length&&this.setSelections(r,0)})}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/addon/dialog/dialog",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,n){var r=e.getWrapperElement(),i;return i=r.appendChild(document.createElement("div")),n?i.className="CodeMirror-dialog CodeMirror-dialog-bottom":i.className="CodeMirror-dialog CodeMirror-dialog-top",typeof t=="string"?i.innerHTML=t:i.appendChild(t),i}function n(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}e.defineExtension("openDialog",function(r,i,s){function f(e){if(typeof e=="string")l.value=e;else{if(u)return;u=!0,o.parentNode.removeChild(o),a.focus(),s.onClose&&s.onClose(o)}}s||(s={}),n(this,null);var o=t(this,r,s.bottom),u=!1,a=this,l=o.getElementsByTagName("input")[0],c;if(l)l.focus(),s.value&&(l.value=s.value,s.selectValueOnOpen!==!1&&l.select()),s.onInput&&e.on(l,"input",function(e){s.onInput(e,l.value,f)}),s.onKeyUp&&e.on(l,"keyup",function(e){s.onKeyUp(e,l.value,f)}),e.on(l,"keydown",function(t){if(s&&s.onKeyDown&&s.onKeyDown(t,l.value,f))return;if(t.keyCode==27||s.closeOnEnter!==!1&&t.keyCode==13)l.blur(),e.e_stop(t),f();t.keyCode==13&&i(l.value,t)}),s.closeOnBlur!==!1&&e.on(l,"blur",f);else if(c=o.getElementsByTagName("button")[0])e.on(c,"click",function(){f(),a.focus()}),s.closeOnBlur!==!1&&e.on(c,"blur",f),c.focus();return f}),e.defineExtension("openConfirm",function(r,i,s){function c(){if(a)return;a=!0,o.parentNode.removeChild(o),f.focus()}n(this,null);var o=t(this,r,s&&s.bottom),u=o.getElementsByTagName("button"),a=!1,f=this,l=1;u[0].focus();for(var h=0;h<u.length;++h){var p=u[h];(function(t){e.on(p,"click",function(n){e.e_preventDefault(n),c(),t&&t(f)})})(i[h]),e.on(p,"blur",function(){--l,setTimeout(function(){l<=0&&c()},200)}),e.on(p,"focus",function(){++l})}}),e.defineExtension("openNotification",function(r,i){function f(){if(o)return;o=!0,clearTimeout(u),s.parentNode.removeChild(s)}n(this,f);var s=t(this,r,i&&i.bottom),o=!1,u,a=i&&typeof i.duration!="undefined"?i.duration:5e3;return e.on(s,"click",function(t){e.e_preventDefault(t),f()}),a&&(u=setTimeout(f,a)),f})}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror"),require("./searchcursor"),require("../dialog/dialog")):typeof define=="function"&&define.amd?define("cm/addon/search/search",["../../lib/codemirror","./searchcursor","../dialog/dialog"],e):e(CodeMirror)}(function(e){function t(e,t){return typeof e=="string"?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),t?"gi":"g"):e.global||(e=new RegExp(e.source,e.ignoreCase?"gi":"g")),{token:function(t){e.lastIndex=t.pos;var n=e.exec(t.string);if(n&&n.index==t.pos)return t.pos+=n[0].length||1,"searching";n?t.pos=n.index:t.skipToEnd()}}}function n(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function r(e){return e.state.search||(e.state.search=new n)}function i(e){return typeof e=="string"&&e==e.toLowerCase()}function s(e,t,n){return e.getSearchCursor(t,n,i(t))}function o(e,t,n,r,i){e.openDialog(t,r,{value:n,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){v(e)},onKeyDown:i})}function u(e,t,n,r,i){e.openDialog?e.openDialog(t,i,{value:r,selectValueOnOpen:!0}):i(prompt(n,r))}function a(e,t,n,r){e.openConfirm?e.openConfirm(t,r):confirm(n)&&r[0]()}function f(e){return e.replace(/\\(.)/g,function(e,t){return t=="n"?"\n":t=="r"?"\r":t})}function l(e){var t=e.match(/^\/(.*)\/([a-z]*)$/);if(t)try{e=new RegExp(t[1],t[2].indexOf("i")==-1?"":"i")}catch(n){}else e=f(e);if(typeof e=="string"?e=="":e.test(""))e=/x^/;return e}function h(e,n,r){n.queryText=r,n.query=l(r),e.removeOverlay(n.overlay,i(n.query)),n.overlay=t(n.query,i(n.query)),e.addOverlay(n.overlay),e.showMatchesOnScrollbar&&(n.annotate&&(n.annotate.clear(),n.annotate=null),n.annotate=e.showMatchesOnScrollbar(n.query,i(n.query)))}function p(t,n,i,s){var a=r(t);if(a.query)return d(t,n);var f=t.getSelection()||a.lastQuery;if(i&&t.openDialog){var l=null,p=function(n,r){e.e_stop(r);if(!n)return;n!=a.queryText&&(h(t,a,n),a.posFrom=a.posTo=t.getCursor()),l&&(l.style.opacity=1),d(t,r.shiftKey,function(e,n){var r;n.line<3&&document.querySelector&&(r=t.display.wrapper.querySelector(".CodeMirror-dialog"))&&r.getBoundingClientRect().bottom-4>t.cursorCoords(n,"window").top&&((l=r).style.opacity=.4)})};o(t,c,f,p,function(n,i){var s=e.keyName(n),o=e.keyMap[t.getOption("keyMap")][s];o||(o=t.getOption("extraKeys")[s]);if(o=="findNext"||o=="findPrev"||o=="findPersistentNext"||o=="findPersistentPrev")e.e_stop(n),h(t,r(t),i),t.execCommand(o);else if(o=="find"||o=="findPersistent")e.e_stop(n),p(i,n)}),s&&f&&(h(t,a,f),d(t,n))}else u(t,c,"Search for:",f,function(e){e&&!a.query&&t.operation(function(){h(t,a,e),a.posFrom=a.posTo=t.getCursor(),d(t,n)})})}function d(t,n,i){t.operation(function(){var o=r(t),u=s(t,o.query,n?o.posFrom:o.posTo);if(!u.find(n)){u=s(t,o.query,n?e.Pos(t.lastLine()):e.Pos(t.firstLine(),0));if(!u.find(n))return}t.setSelection(u.from(),u.to()),t.scrollIntoView({from:u.from(),to:u.to()},20),o.posFrom=u.from(),o.posTo=u.to(),i&&i(u.from(),u.to())})}function v(e){e.operation(function(){var t=r(e);t.lastQuery=t.query;if(!t.query)return;t.query=t.queryText=null,e.removeOverlay(t.overlay),t.annotate&&(t.annotate.clear(),t.annotate=null)})}function b(e,t,n){e.operation(function(){for(var r=s(e,t);r.findNext();)if(typeof t!="string"){var i=e.getRange(r.from(),r.to()).match(t);r.replace(n.replace(/\$(\d)/g,function(e,t){return i[t]}))}else r.replace(n)})}function w(e,t){if(e.getOption("readOnly"))return;var n=e.getSelection()||r(e).lastQuery,i=t?"Replace all:":"Replace:";u(e,i+m,i,n,function(n){if(!n)return;n=l(n),u(e,g,"Replace with:","",function(r){r=f(r);if(t)b(e,n,r);else{v(e);var i=s(e,n,e.getCursor("from")),o=function(){var t=i.from(),f;if(!(f=i.findNext())){i=s(e,n);if(!(f=i.findNext())||t&&i.from().line==t.line&&i.from().ch==t.ch)return}e.setSelection(i.from(),i.to()),e.scrollIntoView({from:i.from(),to:i.to()}),a(e,y,"Replace?",[function(){u(f)},o,function(){b(e,n,r)}])},u=function(e){i.replace(typeof n=="string"?r:r.replace(/\$(\d)/g,function(t,n){return e[n]})),o()};o()}})})}var c='Search: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',m=' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',g='With: <input type="text" style="width: 10em" class="CodeMirror-search-field"/>',y="Replace? <button>Yes</button> <button>No</button> <button>All</button> <button>Stop</button>";e.commands.find=function(e){v(e),p(e)},e.commands.findPersistent=function(e){v(e),p(e,!1,!0)},e.commands.findPersistentNext=function(e){p(e,!1,!0,!0)},e.commands.findPersistentPrev=function(e){p(e,!0,!0,!0)},e.commands.findNext=p,e.commands.findPrev=function(e){p(e,!0)},e.commands.clearSearch=v,e.commands.replace=w,e.commands.replaceAll=function(e){w(e,!0)}}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror"),require("../dialog/dialog")):typeof define=="function"&&define.amd?define("cm/addon/search/jump-to-line",["../../lib/codemirror","../dialog/dialog"],e):e(CodeMirror)}(function(e){function t(e,t,n,r,i){e.openDialog?e.openDialog(t,i,{value:r,selectValueOnOpen:!0}):i(prompt(n,r))}function r(e,t){var n=Number(t);return/^[-+]/.test(t)?e.getCursor().line+n:n-1}var n='Jump to line: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use line:column or scroll% syntax)</span>';e.commands.jumpToLine=function(e){var i=e.getCursor();t(e,n,"Jump to line:",i.line+1+":"+i.ch,function(t){if(!t)return;var n;if(n=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(t))e.setCursor(r(e,n[1]),Number(n[2]));else if(n=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(t)){var s=Math.round(e.lineCount()*Number(n[1])/100);/^[-+]/.test(n[1])&&(s=i.line+s+1),e.setCursor(s-1,i.ch)}else(n=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(t))&&e.setCursor(r(e,n[1]),i.ch)})},e.keyMap["default"]["Alt-G"]="jumpToLine"}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/addon/hover/text-hover",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){(function(){function n(t,n){function i(t){if(!r.parentNode)return e.off(document,"mousemove",i);r.style.top=Math.max(0,t.clientY-r.offsetHeight-5)+"px",r.style.left=t.clientX+5+"px"}var r=document.createElement("div");return r.className="CodeMirror-hover-tooltip",typeof n=="string"&&(n=document.createTextNode(n)),r.appendChild(n),document.body.appendChild(r),e.on(document,"mousemove",i),i(t),r.style.opacity!=null&&(r.style.opacity=1),r}function r(e){e.parentNode&&e.parentNode.removeChild(e)}function i(e){if(!e.parentNode)return;e.style.opacity==null&&r(e),e.style.opacity=0,setTimeout(function(){r(e)},600)}function s(r,s,o,u,a){function l(){e.off(o,"mouseout",l),e.off(o,"click",l),o.className=o.className.replace(t,""),f&&(i(f),f=null),a.removeKeyMap(u.keyMap)}var f=n(r,s),c=setInterval(function(){if(f)for(var e=o;;e=e.parentNode){if(e==document.body)return;if(!e){l();break}}if(!f)return clearInterval(c)},400);e.on(o,"mouseout",l),e.on(o,"click",l),u.keyMap={Esc:l},a.addKeyMap(u.keyMap)}function o(e,t){this.options=t,this.timeout=null,t.delay?this.onMouseOver=function(t){a(e,t)}:this.onMouseOver=function(t){f(e,t)},this.keyMap=null}function u(t,n){if(n instanceof Function)return{getTextHover:n};if(!n||n===!0)n={};n.getTextHover||(n.getTextHover=t.getHelper(e.Pos(0,0),"textHover"));if(!n.getTextHover)throw new Error("Required option 'getTextHover' missing (text-hover addon)");return n}function a(e,t){var n=e.state.textHover,r=n.options.delay;clearTimeout(n.timeout);if(t.srcElement){var i={srcElement:t.srcElement,clientX:t.clientX,clientY:t.clientY};t=i}n.timeout=setTimeout(function(){f(e,t)},r)}function f(e,n){var r=n.target||n.srcElement;if(r){var i=e.state.textHover,o=h(e,n),u=i.options.getTextHover(e,o,n);u&&(r.className+=t,typeof u=="function"?u(s,o,n,r,i,e):s(n,u,r,i,e))}}function l(t,n,r){r&&r!=e.Init&&(e.off(t.getWrapperElement(),"mouseover",t.state.textHover.onMouseOver),delete t.state.textHover);if(n){var i=t.state.textHover=new o(t,u(t,n));e.on(t.getWrapperElement(),"mouseover",i.onMouseOver)}}function h(e,t){var n=t.target||t.srcElement,r=n.innerText||n.textContent;for(var i=0;i<c.length;i+=2){var s=e.coordsChar({left:t.clientX+c[i],top:t.clientY+c[i+1]}),o=e.getTokenAt(s);if(o&&o.string===r)return{token:o,pos:s}}}var t=" CodeMirror-hover",c=[0,0,0,5,0,-5,5,0,-5,0];e.defineOption("textHover",!1,l)})()}),define("cm/addon/hover/prolog-hover",["../../lib/codemirror","jquery","laconic"],function(e,t){function i(e){return t.el.span({"class":"pred-name"},e.text+"/"+e.arity)}function s(e,t,r){n[r]=t}function o(e,t){var r;return n[e.file]?n[e.file]:(r=e.file.lastIndexOf("/"))?e.file.substring(r+1):e.file}function u(e,n,r){return n&&n.file?t.el.div(a(e)+" included from ",t.el.span({"class":"file-path"},n.file)):n&&n.line?a(e)+" defined in line "+n.line:"Locally defined "+e}function a(e){return e[0].toUpperCase()+e.slice(1)}var n={},r={goal_built_in:function(e,n){return e?t.el.div(i(e),n.tokenInfo(e)):"Built-in predicate"},goal_global:function(e,n){return e?t.el.div(i(e),n.tokenInfo(e)):"Global predicate"},goal_autoload:function(e,n){return e?t.el.div(i(e)," (autoload from ",o(e,n),"): ",n.tokenInfo(e)):"Autoloaded predicate"},goal_imported:function(e,n){return e?t.el.div(i(e)," (imported from ",o(e,n),"): ",n.tokenInfo(e)):"Imported predicate"},goal_recursion:"Recursive call",goal_dynamic:"Dynamic predicate",goal_undefined:"Undefined predicate",goal_local:function(e,t){return u("predicate",e,t)},goal_constraint:function(e,t){return u("CHR constraint",e,t)},head_unreferenced:"Predicate is not called",unused_import:"Imported predicate is not used",undefined_import:"Imported predicate is not defined",head_constraint:"CHR constraint",file:function(e,n){return e?(s(n,e.text,e.path),t.el.div("File: ",t.el.span({"class":"file-path"},e.path))):"File name"},file_no_depends:function(e,n){return e?(s(n,e.text,e.path),t.el.div("File: ",t.el.span({"class":"file-path"},e.path),t.el.div({"class":"hover-remark"},"does not resolve any dependencies"))):"File name (does not resolve any dependencies)"},error:function(e,n){return e&&e.expected?t.el.div("error: ",t.el.strong(e.expected)," expected"):"error"},singleton:"Variable appearing only once",codes:"List of Unicode code points (integers)",chars:"List of one-character atoms",string:"Packed string (SWI7, use `text` for a list of codes)",qatom:"Quoted atom",uatom:"Uppercase atom due to var_prefix flag",tag:"Tag of a SWI7 dict",ext_quant:"Existential quantification operator",instantiation_error:"No variable allowed here",string_terminal:"Terminal (DCG)",head:null,control:null,fullstop:null,"var":null,"int":null,"float":null,number:null,atom:null,functor:null,comment:null,neck:null,operator:null,sep:null,list_open:null,list_close:null,dict_open:null,dict_close:null};e.registerHelper("textHover","prolog",function(e,n,i){if(n){var s=n.token,o=r[s.type],u;if(o===undefined)return(u=e.getEnrichedToken(s))?u.summary&&u.info==="ask"?t.el.div(u.summary,e.tokenInfo(u)):u.summary?t.el.div(u.summary):t.el.div(s.type):t.el.div(s.type);if(typeof o=="function"){var a=o(e.getEnrichedToken(s),e);return typeof a=="string"?t.el.div(a):a}if(typeof o=="string")return t.el.div(o)}return null})}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/addon/hint/show-context-info",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){var t=null;e.attachContextInfo=function(n){e.on(n,"select",function(e,n){n=n.parentNode;var r=null;e.info&&(r=e.info(e));if(r){var i=n.getBoundingClientRect();t==null&&(t=document.createElement("div"),t.className="CodeMirror-hints-contextInfo",document.body.appendChild(t)),t.innerHTML="",t.style.top=n.style.top,t.style.left=i.right+"px",typeof r=="string"?t.innerHTML=r:t.appendChild(r),t.style.display="block"}else t!=null&&(t.innerHTML="",t.style.display="none")}),e.on(n,"close",function(){t!=null&&t.parentNode.removeChild(t),t=null})},e.showContextInfo=function(t){return function(n,r,i){i||(i=r);var s=t(n,i);return e.attachContextInfo(s),s}}}),function(e){typeof exports=="object"&&typeof module=="object"?e(require("../lib/codemirror")):typeof define=="function"&&define.amd?define("cm/keymap/emacs",["../lib/codemirror"],e):e(CodeMirror)}(function(e){function n(e,t){return e.line==t.line&&e.ch==t.ch}function i(e){r.push(e),r.length>50&&r.shift()}function s(e){if(!r.length)return i(e);r[r.length-1]+=e}function o(e){return r[r.length-(e?Math.min(e,1):1)]||""}function u(){return r.length>1&&r.pop(),o()}function f(e,t,r,o,u){u==null&&(u=e.getRange(t,r)),o&&a&&a.cm==e&&n(t,a.pos)&&e.isClean(a.gen)?s(u):i(u),e.replaceRange("",t,r,"+delete"),o?a={cm:e,pos:t,gen:e.changeGeneration()}:a=null}function l(e,t,n){return e.findPosH(t,n,"char",!0)}function c(e,t,n){return e.findPosH(t,n,"word",!0)}function h(e,t,n){return e.findPosV(t,n,"line",e.doc.sel.goalColumn)}function p(e,t,n){return e.findPosV(t,n,"page",e.doc.sel.goalColumn)}function d(e,n,r){var i=n.line,s=e.getLine(i),o=/\S/.test(r<0?s.slice(0,n.ch):s.slice(n.ch)),u=e.firstLine(),a=e.lastLine();for(;;){i+=r;if(i<u||i>a)return e.clipPos(t(i-r,r<0?0:null));s=e.getLine(i);var f=/\S/.test(s);if(f)o=!0;else if(o)return t(i,0)}}function v(e,n,r){var i=n.line,s=n.ch,o=e.getLine(n.line),u=!1;for(;;){var a=o.charAt(s+(r<0?-1:0));if(!a){if(i==(r<0?e.firstLine():e.lastLine()))return t(i,s);o=e.getLine(i+r);if(!/\S/.test(o))return t(i,s);i+=r,s=r<0?o.length:0;continue}if(u&&/[!?.]/.test(a))return t(i,s+(r>0?1:0));u||(u=/\w/.test(a)),s+=r}}function m(e,r,i){var s;if(e.findMatchingBracket&&(s=e.findMatchingBracket(r,!0))&&s.match&&(s.forward?1:-1)==i)return i>0?t(s.to.line,s.to.ch+1):s.to;for(var o=!0;;o=!1){var u=e.getTokenAt(r),a=t(r.line,i<0?u.start:u.end);if(!(o&&i>0&&u.end==r.ch||!/\w/.test(u.string)))return a;var f=e.findPosH(a,i,"char");if(n(a,f))return r;r=f}}function g(e,t){var n=e.state.emacsPrefix;return n?(C(e),n=="-"?-1:Number(n)):t?null:1}function y(e){var t=typeof e=="string"?function(t){t.execCommand(e)}:e;return function(e){var n=g(e);t(e);for(var r=1;r<n;++r)t(e)}}function b(e,t,r,i){var s=g(e);s<0&&(i=-i,s=-s);for(var o=0;o<s;++o){var u=r(e,t,i);if(n(u,t))break;t=u}return t}function w(e,t){var n=function(n){n.extendSelection(b(n,n.getCursor(),e,t))};return n.motion=!0,n}function E(e,t,n){var r=e.listSelections(),i,s=r.length;while(s--)i=r[s].head,f(e,i,b(e,i,t,n),!0)}function S(e){if(e.somethingSelected()){var t=e.listSelections(),n,r=t.length;while(r--)n=t[r],f(e,n.anchor,n.head);return!0}}function x(e,t){if(e.state.emacsPrefix){t!="-"&&(e.state.emacsPrefix+=t);return}e.state.emacsPrefix=t,e.on("keyHandled",N),e.on("inputRead",k)}function N(e,t){!e.state.emacsPrefixMap&&!T.hasOwnProperty(t)&&C(e)}function C(e){e.state.emacsPrefix=null,e.off("keyHandled",N),e.off("inputRead",k)}function k(e,t){var n=g(e);if(n>1&&t.origin=="+input"){var r=t.text.join("\n"),i="";for(var s=1;s<n;++s)i+=r;e.replaceSelection(i)}}function L(e){e.state.emacsPrefixMap=!0,e.addKeyMap(j),e.on("keyHandled",A),e.on("inputRead",A)}function A(e,t){if(!(typeof t!="string"||!/^\d$/.test(t)&&t!="Ctrl-U"))return;e.removeKeyMap(j),e.state.emacsPrefixMap=!1,e.off("keyHandled",A),e.off("inputRead",A)}function O(e){e.setCursor(e.getCursor()),e.setExtending(!e.getExtending()),e.on("change",function(){e.setExtending(!1)})}function M(e){e.setExtending(!1),e.setCursor(e.getCursor())}function _(e,t,n){e.openDialog?e.openDialog(t+': <input type="text" style="width: 10em"/>',n,{bottom:!0}):n(prompt(t,""))}function D(e,t){var n=e.getCursor(),r=e.findPosH(n,1,"word");e.replaceRange(t(e.getRange(n,r)),n,r),e.setCursor(r)}function P(e){var n=e.getCursor(),r=n.line,i=n.ch,s=[];while(r>=e.firstLine()){var o=e.getLine(r);for(var u=i==null?o.length:i;u>0;){var i=o.charAt(--u);if(i==")")s.push("(");else if(i=="]")s.push("[");else if(i=="}")s.push("{");else if(/[\(\{\[]/.test(i)&&(!s.length||s.pop()!=i))return e.extendSelection(t(r,u))}--r,i=null}}function H(e){e.execCommand("clearSearch"),M(e)}function F(e){j[e]=function(t){x(t,e)},B["Ctrl-"+e]=function(t){x(t,e)},T["Ctrl-"+e]=!0}var t=e.Pos,r=[],a=null,T={"Alt-G":!0,"Ctrl-X":!0,"Ctrl-Q":!0,"Ctrl-U":!0},B=e.keyMap.emacs=e.normalizeKeyMap({"Ctrl-W":function(e){f(e,e.getCursor("start"),e.getCursor("end"))},"Ctrl-K":y(function(e){var n=e.getCursor(),r=e.clipPos(t(n.line)),i=e.getRange(n,r);/\S/.test(i)||(i+="\n",r=t(n.line+1,0)),f(e,n,r,!0,i)}),"Alt-W":function(e){i(e.getSelection()),M(e)},"Ctrl-Y":function(e){var t=e.getCursor();e.replaceRange(o(g(e)),t,t,"paste"),e.setSelection(t,e.getCursor())},"Alt-Y":function(e){e.replaceSelection(u(),"around","paste")},"Ctrl-Space":O,"Ctrl-Shift-2":O,"Ctrl-F":w(l,1),"Ctrl-B":w(l,-1),Right:w(l,1),Left:w(l,-1),"Ctrl-D":function(e){E(e,l,1)},Delete:function(e){S(e)||E(e,l,1)},"Ctrl-H":function(e){E(e,l,-1)},Backspace:function(e){S(e)||E(e,l,-1)},"Alt-F":w(c,1),"Alt-B":w(c,-1),"Alt-D":function(e){E(e,c,1)},"Alt-Backspace":function(e){E(e,c,-1)},"Ctrl-N":w(h,1),"Ctrl-P":w(h,-1),Down:w(h,1),Up:w(h,-1),"Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd",End:"goLineEnd",Home:"goLineStart","Alt-V":w(p,-1),"Ctrl-V":w(p,1),PageUp:w(p,-1),PageDown:w(p,1),"Ctrl-Up":w(d,-1),"Ctrl-Down":w(d,1),"Alt-A":w(v,-1),"Alt-E":w(v,1),"Alt-K":function(e){E(e,v,1)},"Ctrl-Alt-K":function(e){E(e,m,1)},"Ctrl-Alt-Backspace":function(e){E(e,m,-1)},"Ctrl-Alt-F":w(m,1),"Ctrl-Alt-B":w(m,-1),"Shift-Ctrl-Alt-2":function(e){var t=e.getCursor();e.setSelection(b(e,t,m,1),t)},"Ctrl-Alt-T":function(e){var t=m(e,e.getCursor(),-1),n=m(e,t,1),r=m(e,n,1),i=m(e,r,-1);e.replaceRange(e.getRange(i,r)+e.getRange(n,i)+e.getRange(t,n),t,r)},"Ctrl-Alt-U":y(P),"Alt-Space":function(e){var n=e.getCursor(),r=n.ch,i=n.ch,s=e.getLine(n.line);while(r&&/\s/.test(s.charAt(r-1)))--r;while(i<s.length&&/\s/.test(s.charAt(i)))++i;e.replaceRange(" ",t(n.line,r),t(n.line,i))},"Ctrl-O":y(function(e){e.replaceSelection("\n","start")}),"Ctrl-T":y(function(e){e.execCommand("transposeChars")}),"Alt-C":y(function(e){D(e,function(e){var t=e.search(/\w/);return t==-1?e:e.slice(0,t)+e.charAt(t).toUpperCase()+e.slice(t+1).toLowerCase()})}),"Alt-U":y(function(e){D(e,function(e){return e.toUpperCase()})}),"Alt-L":y(function(e){D(e,function(e){return e.toLowerCase()})}),"Alt-;":"toggleComment","Ctrl-/":y("undo"),"Shift-Ctrl--":y("undo"),"Ctrl-Z":y("undo"),"Cmd-Z":y("undo"),"Shift-Alt-,":"goDocStart","Shift-Alt-.":"goDocEnd","Ctrl-S":"findNext","Ctrl-R":"findPrev","Ctrl-G":H,"Shift-Alt-5":"replace","Alt-/":"autocomplete","Ctrl-J":"newlineAndIndent",Enter:!1,Tab:"indentAuto","Alt-G G":function(e){var t=g(e,!0);if(t!=null&&t>0)return e.setCursor(t-1);_(e,"Goto line",function(t){var n;t&&!isNaN(n=Number(t))&&n==(n|0)&&n>0&&e.setCursor(n-1)})},"Ctrl-X Tab":function(e){e.indentSelection(g(e,!0)||e.getOption("indentUnit"))},"Ctrl-X Ctrl-X":function(e){e.setSelection(e.getCursor("head"),e.getCursor("anchor"))},"Ctrl-X Ctrl-S":"save","Ctrl-X Ctrl-W":"save","Ctrl-X S":"saveAll","Ctrl-X F":"open","Ctrl-X U":y("undo"),"Ctrl-X K":"close","Ctrl-X Delete":function(e){f(e,e.getCursor(),v(e,e.getCursor(),1),!0)},"Ctrl-X H":"selectAll","Ctrl-Q Tab":y("insertTab"),"Ctrl-U":L}),j={"Ctrl-G":C};for(var I=0;I<10;++I)F(String(I));F("-")}),define("editor",["cm/lib/codemirror","config","preferences","form","cm/mode/prolog/prolog-template-hint","modal","tabbed","prolog","storage","cm/mode/prolog/prolog","cm/mode/prolog/prolog_keys","cm/mode/prolog/prolog_query","cm/mode/prolog/prolog_server","cm/mode/markdown/markdown","cm/addon/edit/matchbrackets","cm/addon/comment/continuecomment","cm/addon/comment/comment","cm/addon/hint/show-hint","cm/addon/hint/anyword-hint","cm/addon/display/placeholder","cm/addon/runmode/runmode","cm/addon/search/search","cm/addon/search/searchcursor","cm/addon/search/jump-to-line","cm/addon/dialog/dialog","cm/addon/hover/text-hover","cm/addon/hover/prolog-hover","cm/addon/hint/templates-hint","cm/addon/hint/show-context-info","jquery","laconic","cm/keymap/emacs"],function(e,t,n,r,i,s,o,u){function a(e,t){var n=[];t=t||"",n.push("<style>\n");for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];n.push(t,r,"{");for(var s in i)i.hasOwnProperty(s)&&n.push(s,":",i[s],";");n.push("}\n")}n.push("</style>\n"),$("body").append(n.join(""))}(function(r){var a="prologEditor",f={prolog:{mode:"prolog",role:"source",placeholder:"Your Prolog rules and facts go here ...",lineNumbers:!0,autoCurrent:!0,save:!1,theme:"prolog",matchBrackets:!0,textHover:!0,prologKeys:!0,extraKeys:{"Ctrl-Space":"autocomplete","Alt-/":"autocomplete"},hintOptions:{hint:i.getHints,completeSingle:!1}},markdown:{mode:"markdown",placeholder:"Your markdown block goes here ...",lineWrapping:!0,save:!1}},l={query:{mode:"prolog",role:"query",placeholder:"Your query goes here ...",lineNumbers:!1,lineWrapping:!0,save:!1}},c,h={_init:function(i){return this.each(function(){var s=r(this),o={},u={},c;i=i||{},i.mode=i.mode||"prolog";var h=r.extend({},f[i.mode]);i.role&&l[i.role]&&(h=r.extend(h,l[i.role])),h=r.extend(h,i),n.getVal("emacs-keybinding")&&(h.keyMap="emacs");if(h.mode=="prolog"){u.role=h.role,h.getSource&&(u.getSource=h.getSource),t.http.locations.cm_highlight&&(h.prologHighlightServer={url:t.http.locations.cm_highlight,role:h.role,enabled:n.getVal("semantic-highlighting")},h.sourceID&&(h.prologHighlightServer.sourceID=h.sourceID),h.extraKeys["Ctrl-R"]="refreshHighlight"),h.role=="source"&&(h.continueComments="Enter",h.gutters=["Prolog-breakpoints"]),u.long_click={};function p(e){var t=u.long_click,n=e.clientX-t.clientX,r=e.clientY-t.clientY;Math.sqrt(n*n+r*r)>5&&d()}function d(){s.off("mousemove",p);var e=u.long_click;e.timeout&&(clearTimeout(e.timeout),e.target=undefined,e.timeout=undefined)}s.on("mousedown",".CodeMirror-code",function(e){var t=u.long_click;t.clientX=e.clientX,t.clientY=e.clientY,s.on("mousemove",p),u.long_click.timeout=setTimeout(function(){d(),s.prologEditor("contextAction")},500)}),s.on("mouseup",function(e){d()})}if(c=s.children("textarea")[0]){function v(e){var t=r(c).data(e);t&&(o[e]=t)}v("file"),v("url"),v("title"),v("meta"),v("st_type"),u.cm=e.fromTextArea(c,h)}else h.value||(h.value=s.text()),u.cm=e(s[0],h);s.data(a,u),s.prologEditor("loadMode",h.mode),s.addClass("swish-event-receiver"),s.addClass("prolog-editor"),s.on("preference",function(e,t){s.prologEditor("preference",t)}),s.on("print",function(){u.role!="query"&&s.prologEditor("print")}),s.on("clearMessages",function(e){s.prologEditor("clearMessages")}),s.on("edit-command",function(e,t){s.prologEditor("execCommand",t)}),u.cm.on("blur",function(e){s.prologEditor("execCommand","prepare")}),h.save&&(o.typeName=h.typeName||"program",s.prologEditor("setupStorage",o)),h.mode=="prolog"&&u.role=="source"&&(s.on("activate-tab",function(e){h.autoCurrent&&s.prologEditor("makeCurrent"),u.cm.refresh()}),s.on("source-error",function(e,t){s.prologEditor("highlightError",t)}),s.on("pengine-died",function(e,t){if(u.pengines){var n=u.pengines.indexOf(t);n>=0&&u.pengines.splice(n,1)}u.traceMark&&u.traceMark.pengine==t&&(u.traceMark.clear(),u.traceMark=null)}),u.cm.on("gutterClick",function(e,t){function i(){return r('<span class="breakpoint-marker">&#9679;</span>')[0]}var n=e.lineInfo(t);n.gutterMarkers?e.setGutterMarker(t,"Prolog-breakpoints",null):e.setGutterMarker(t,"Prolog-breakpoints",i())})),u.cm.on("change",function(e,t){var n;if(t.origin=="setValue")n=!0;else{var r=s.data("storage"),i=r?r.cleanGeneration:u.cleanGeneration;n=u.cm.isClean(i)}s.prologEditor("markClean",n)})})},getOption:function(e){return this.data(a)[e]},setKeybinding:function(e){e=e||"default",this.data(a).cm.options.keyMap=e},loadMode:function(t){var n=this.data(a);return e.modes[t]?t!=n.mode&&n.cm.setOption("mode",t):require(["cm/mode/"+t+"/"+t],function(){n.cm.setOption("mode",t)}),this},isPengineSource:function(){var e=r(this).data(a);if(e&&e.role=="source"){var t=r(this).data("storage");if(t&&t.meta)if(t.meta.loaded||t.meta.module)return!1}return this},getBreakpoints:function(e){var t=[];return this.each(function(){var n=r(this).data(a),i=[],s=0,o=n.cm,u=o.firstLine(),f=o.lastLine();for(;u<f;u++){var l=o.lineInfo(u);l.gutterMarkers&&i.push(s+u+1)}if(i.length>0){var c;if(n.pengines&&n.pengines.indexOf(e)>=0)c="pengine://"+e+"/src";else{var h=r(this).data("storage");h&&(c="swish://"+h.file)}c&&t.push({file:c,breakpoints:i})}}),t},getSource:function(e,t){var n=[];return this.each(function(){if(r(this).prologEditor("isPengineSource")){var i=r(this).data(a);if(i)if(!e||e==i.role){var s;typeof i.getSource=="function"&&!t?s=i.getSource():s=i.cm.getValue(),n.push(s)}}}),n.join("\n\n")},getSourceEx:function(){var e={value:this.data(a).cm.getValue()},t=this.prologEditor("getBreakpoints");return t.length>0&&(e.breakpoints=t),e},getSourceID:function(){var e=[];return this.each(function(){var t=r(this).data(a);t&&t.cm&&t.cm.state.prologHighlightServer?e.push(t.cm.state.prologHighlightServer.uuid):e.push(null)}),e},setSource:function(e,t){typeof e=="string"&&(e={data:e});if(this.data("storage")&&t!=1)this.storage("setSource",e);else{var n=this.data(a);n.cm.setValue(e.data);if(e.line||e.prompt)n.cm.refresh(),e.line?this.prologEditor("gotoLine",e.line,e):this.prologEditor("showTracePort",e.prompt);n.role=="source"&&r(".swish-event-receiver").trigger("program-loaded",this)}return this},makeCurrent:function(){return r(".swish-event-receiver").trigger("current-program",this),this},markClean:function(e){var t=this.data(a);t.clean_signalled!=e&&(t.clean_signalled=e,this.trigger("data-is-clean",e))},setIsClean:function(){return this.each(function(){var e=r(this),t=e.data(a);t.cleanGeneration=t.cm.changeGeneration()})},pengine:function(e){var t=this.data(a);if(t){if(e.add)return t.pengines=t.pengines||[],t.pengines.indexOf(e.add)<0&&t.pengines.push(e.add),this;if(e.has)return t.pengines&&t.pengines.indexOf(e.has)>=0}},print:function(n){function o(e){var t=r.el.iframe({src:"about:blank"});r("body").append(t),r("body",t.contentWindow.document).append(e),t.contentWindow.print()}var i=r.el.pre({"class":"cm-s-prolog"});return n||(n=this.prologEditor("getSource")),e.runMode(n,"prolog",i),r.ajax({url:t.http.locations.swish+"js/codemirror/theme/prolog.css",dataType:"text",success:function(e){o(r.el.div(r.el.style(e),i))},error:function(e){s.ajaxError(e)}}),this},preference:function(e){var t=this.data(a);return e.name=="semantic-highlighting"&&t.cm.setOption("prologHighlightServer",{enabled:e.value}),e.name=="emacs-keybinding"&&(e.value==1?t.cm.setOption("keyMap","emacs"):t.cm.setOption("keyMap","default")),this},highlightError:function(e){if(e.location.file&&(e.location.file==1||this.prologEditor("isMyFile",e.location.file))){var t=this.data(a),n;e.location.ch&&(left=t.cm.charCoords({line:e.location.line-1,ch:e.location.ch-1},"local").left,n=r.el.div({"class":"source-msg-charmark"},r.el.span({"class":"glyphicon glyphicon-chevron-up"})),r(n).css("padding-left",left+"px"));var i=r.el.div({"class":"source-msg error error-context",title:"Error message.  Click to remove"},n,r(e.data)[0],r.el.span({"class":"glyphicon glyphicon-remove-circle"})),s=t.cm.addLineWidget(e.location.line-1,i);e.error_context&&r(i).data("error_context",e.error_context),r(i).on("click",function(t){if(e.error_handler&&e.error_handler(t)==0)return;s.clear()}),r(i).data("cm-widget",s)}return this},refreshHighlight:function(){var e=this.data(a);return e.cm.serverAssistedHighlight(!0),this},refresh:function(){var e=this.data(a);return e&&e.cm.refresh(),this},clearMessages:function(){return this.find(".source-msg").each(function(){r(this).data("cm-widget").clear()}),this.prologEditor("showTracePort",null),this},execCommand:function(e){if(e=="prepare")c=this[0];else if(c==this[0]){elem=r(c);var t=elem.data(a);t.cm.execCommand(e),elem.find(".Codemirror-dialog input").focus()}return this},isMyFile:function(e){var t="swish://";if(e.startsWith("pengine://")){var n=this.data(a);if(n.pengines&&(id=e.split("/")[2])&&n.pengines.indexOf(id)>=0)return!0}if(e.startsWith(t)){var r=this.data("storage");if(r&&e.slice(t.length)==r.file)return!0}return!1},showTracePort:function(e){if(this.length==0)return this;var t=this.data(a);t.traceMark&&(t.traceMark.clear(),t.traceMark=null);if(!(e&&e.source&&e.source.file))return this;var n=e.source.file;if(this.prologEditor("isMyFile",n)){if(e.source.from&&e.source.to){var r=t.cm.charOffsetToPos(e.source.from),i=t.cm.charOffsetToPos(e.source.to);this.is(":visible")||this.storage("expose","trace"),r&&i&&(t.traceMark=t.cm.markText(r,i,{className:"trace "+e.port}),t.traceMark.pengine=e.pengine,t.cm.scrollIntoView(r,50))}return this}},getExamples:function(e,t){var n=e?e:this.prologEditor("getSource"),i,s=[];if(r.trim(n)=="")return null;t==0?i=[e]:i=n.match(/\/\*\* *<?examples>?[\s\S]*?\*\//igm);if(i)for(var o=0;o<i.length;o++){var u=i[o].match(/^ *\?-[\s\S]*?[^-#$&*+./:<=>?@\\^~]\.\s/gm);if(u)for(var a=0;a<u.length;a++){var f=u[a].replace(/^ *\?-\s*/,"").replace(/\s*$/,"");s.push(f)}}return s},search:function(e,t){var n=this.data(a).cm,r=n.firstLine(),i=n.lastLine(),s=[];for(var o=r;o<=i;o++){var u=n.getLine(o);if(u.search(e)>=0){s.push({line:o+1,text:u});if(t.max&&t.max===s.length)return s}}return s},gotoLine:function(e,t){function o(e){if(e._searchMarkers!==undefined){for(var t=0;t<e._searchMarkers.length;t++)e._searchMarkers[t].clear();e.off("cursorActivity",o)}e._searchMarkers=[]}var n=this.data(a),r=n.cm,i=0,s;o(r),t=t||{},s=t.regex,e-=1,s&&(i=r.getLine(e).search(s),i<0&&(i=0)),r.setCursor({line:e,ch:i});var u=r.getScrollInfo().clientHeight,f=r.charCoords({line:e,ch:0},"local");r.scrollTo(null,(f.top+f.bottom-u)/2);if(s){function l(e,t){var n;while(n=s.exec(r.getLine(e)))r._searchMarkers.push(r.markText({line:e,ch:n.index},{line:e,ch:n.index+n[0].length},{className:t,clearOnEnter:!0,clearWhenEmpty:!0,title:"Search match"}))}l(e,"CodeMirror-search-match");if(t.showAllMatches){var c=r.getViewport();for(var h=c.from;h<c.to;h++)h!=e&&l(h,"CodeMirror-search-alt-match")}r._searchMarkers.length>0&&r.on("cursorActivity",o)}else r._searchMarkers.push(r.markText({line:e,ch:0},{line:e,ch:r.getLine(e).length},{className:"CodeMirror-search-match",clearOnEnter:!0,clearWhenEmpty:!0,title:"Target line"}));return this},changeGen:function(){return this.data(a).cm.changeGeneration()},isClean:function(e){return this.data(a).cm.isClean(e)},setupStorage:function(e){var t=this.data(a),n=this;return e.setValue=function(e){n.prologEditor("setSource",e,!0)},e.getValue=function(){return t.cm.getValue()},e.changeGen=function(){return t.cm.changeGeneration()},e.isClean=function(e){return t.cm.isClean(e)},e.markClean=function(e){n.prologEditor("markClean",e)},e.cleanGeneration=t.cm.changeGeneration(),e.cleanData=t.cm.getValue(),e.cleanCheckpoint="load",this.storage(e),this},contextAction:function(){var e=this,t=this.data(a),n=t.cm.getCursor(),i=t.cm.getTokenAt(n,!0),o=t.cm.getEnrichedToken(i),u=t.cm.getTokenReferences(o);if(u&&u.length>0){var f=r.el.ul(),l=r.el.div({"class":"goto-source"},r.el.div("Go to"),f),c=r.el.div({"class":"edit-modal"},r.el.div({"class":"mask"}),l);for(var h=0;h<u.length;h++){var p=u[h];r(f).append(r.el.li(r.el.a({"data-locindex":h},p.title)))}var d=t.cm.cursorCoords(!0);r(l).css({top:d.bottom,left:d.left}),r("body").append(c),r(c).on("click",function(n){var i=r(n.target).data("locindex");r(c).remove();if(i!==undefined){var o=u[i];if(o.file)e.closest(".swish").swish("playFile",o);else{var a;t.role=="query"?(a=e.closest(".prolog-query-editor").queryEditor("getProgramEditor"),a[0]||s.alert("No related program editor")):a=e,a&&a[0]&&a.prologEditor("gotoLine",o.line,o).focus()}}}),r(c).show()}return this},variables:function(t,n){function o(e){r(i).find(e).each(function(){var e=r(this).text();s.indexOf(e)<0&&s.push(e)})}var i=r.el.span({"class":"query cm-s-prolog"}),s=[];return e.runMode(t,"prolog",i),o("span.cm-var"),n&&o("span.cm-var-2"),s},wrapSolution:function(e){function i(e,r){return n.prologEditor("setSource",e+"("+t+")"+r+".").focus(),n}function s(e){var t=[];for(var n=0;n<r.length;n++)t.push("asc("+r[n]+")");return t.join(",")}var t=u.trimFullStop(this.prologEditor("getSource","query")),n=this,r=this.prologEditor("variables",t);switch(e){case"Aggregate (count all)":return i("aggregate_all(count, ",", Count)");case"Order by":return i("order_by(["+s(r)+"], ",")");case"Distinct":return i("distinct(["+r.join(",")+"], ",")");case"Limit":return i("limit(10, ",")");case"Time":return i("time(",")");case"Debug (trace)":return i("trace, ","");default:alert('Unknown wrapper: "'+e+'"')}}};o.tabTypes.program={dataType:"pl",typeName:"program",label:"Program",contentType:"text/x-prolog",order:100,create:function(e,t){r(e).addClass("prolog-editor").prologEditor(r.extend({save:!0},t)).prologEditor("makeCurrent")}};if(t.swish.tab_types){var p={save:!0,lineNumbers:!0};for(var d=0;d<t.swish.tab_types.length;d++){var v=t.swish.tab_types[d];if(v.editor){var m=r.extend({typeName:v.typeName},p,v.editor);v.create=function(e){r(e).addClass("prolog-editor").prologEditor(m)},o.tabTypes[v.typeName]=v}}}r.fn.prologEditor=function(e){if(h[e])return h[e].apply(this,Array.prototype.slice.call(arguments,1));if(typeof e=="object"||!e)return h._init.apply(this,arguments);r.error("Method "+e+" does not exist on jQuery."+a)}})(jQuery),e.prototype.charOffsetToPos=function(e){var t=this.firstLine(),n=this.lastLine(),r=0;for(;t<n;t++){var i=this.getLine(t);if(r<=e&&r+i.length>=e)return{line:t,ch:e-r};r+=i.length+1}},e.keyMap.emacs.Enter="newlineAndIndent",t.swish.cm_style&&a(t.swish.cm_style,".cm-s-prolog span.cm-"),t.swish.cm_hover_style&&a(t.swish.cm_hover_style,".CodeMirror-hover-tooltip ")}),define("query",["jquery","config","preferences","cm/lib/codemirror","laconic","editor"],function(e,t,n,r){(function(e){function o(t){return e(t).parents(".prolog-query-editor")}function u(t,n,r){var i=e.el.div({"class":"btn-group dropup"},e.el.button({"class":"btn btn-default btn-xs dropdown-toggle "+t,"data-toggle":"dropdown"},n,e.el.span({"class":"caret"})),e.el.ul({"class":"dropdown-menu "+t}));return e(i).on("click","a",function(){o(this).queryEditor("setQuery",e(this).text())}),i}function a(t){function i(t){var r=t.examples();e.isArray(r)&&o(n).queryEditor("setExamples",r,!0)}var n=u("examples","Examples",t),r=e(n).find("ul");if(typeof t.examples=="function")e(n).mousedown(function(e){e.which==1&&i(t)});else if(t.examples){var s=t.examples;for(var a=0;a<s.length;a++)r.append(e.el.li(e.el.a(s[a])))}return n}function f(e){return u("history","History",e)}function l(t){var n="aggregate",r=t.aggregates||["Aggregate (count all)","--","Order by","Distinct","Limit","--","Time","Debug (trace)"],i,s=e.el.div({"class":"btn-group dropup"},e.el.button({"class":"btn btn-default btn-xs dropdown-toggle "+n,"data-toggle":"dropdown"},"Solutions",e.el.span({"class":"caret"})),i=e.el.ul({"class":"dropdown-menu "+n}));for(var u=0;u<r.length;u++){var a=r[u];a=="--"?e(i).append(e.el.li({"class":"divider"})):e(i).append(e.el.li(e.el.a(a)))}return e(s).on("click","a",function(){o(this).find(".query").prologEditor("wrapSolution",e(this).text())}),s}function c(t){var n=e.el.button({"class":"run-btn-query","class":"btn btn-default btn-primary btn-xs"},"Run!");return e(n).on("click",function(){o(this).queryEditor("run",undefined,h(this))}),n}function h(t){return e(t).parent().find("input").prop("checked")}function p(r){var i=n.getVal("tabled_results"),s={type:"checkbox",name:"table"};i===undefined&&(i=t.swish.tabled_results),i&&(s.checked="checked");var o=e.el.input(s),u=e.el.span({"class":"run-chk-table"},o," table results");return e(o).on("change",function(t){n.setVal("tabled_results",e(t.target).prop("checked"))}),u}var r="queryEditor",i={maxHistoryLength:50},s={_init:function(t){return this.each(function(){function h(){return e(u).find("input").prop("checked")}var n=e(this),s=e.extend({},i,t),o=e.el.div({"class":"query"}),u=p(s);n.addClass("prolog-query-editor swish-event-receiver reactive-size"),n.append(o,e.el.div({"class":"prolog-prompt"},"?-"),e.el.div({"class":"query-buttons"},e.el.span({"class":"buttons-left"},a(s),f(s),l(s)),e.el.span({"class":"buttons-right"},u,c(s)))),e(o).append(n.children("textarea")).prologEditor({role:"query",sourceID:function(){return s.sourceID()},prologQuery:function(e){n.queryEditor("run",e,h())}}),n.data(r,s),e(o).prologEditor("getSource","query")||(typeof s.examples=="object"?s.examples[0]&&e(o).prologEditor("setSource",s.examples[0]):n[r]("setProgramEditor",e(s.editor),!0)),n.on("current-program",function(t,i){n[r]("setProgramEditor",e(i))}),n.on("program-loaded",function(t,r){if(e(s.editor).data("prologEditor")==e(r).data("prologEditor")){var i=s.examples();n.queryEditor("setQuery",i&&i[0]?i[0]:"")}})})},setProgramEditor:function(t,n){var i=this.data(r);if(i.editor==t[0]&&!n)return this;i.editor=t[0];if(i.editor){i.examples=function(){var n=t.prologEditor("getExamples")||[],r=t.parents(".swish").swish("examples",!0)||[];return e.isArray(r)&&n.concat(r),n},t.prologEditor("isPengineSource")?i.source=function(){var n=t.prologEditor("getSource","source"),r=e(".background.prolog.source").text();return r&&(n+="\n%@background@\n"+r),n}:i.source="",i.sourceID=function(){return t.prologEditor("getSourceID")};var s=i.examples();s&&s[0]&&this.queryEditor("isClean")?this.queryEditor("setQuery",s[0]):t.prologEditor("refreshHighlight")}else i.examples=""},getProgramEditor:function(){var t=this.data(r);return t.editor?e(t.editor):e()},setExamples:function(t,n){function i(e){var t;if((t=r.data("examples"))&&t.length==e.length){for(var n=0;n<t.length;n++)if(t[n]!=e[n])return!1;return!0}return!1}var r=this.find("ul.examples");t||(t=[]),n===undefined&&(n=!0);if(n&&i(t))return this;n===!0&&r.html("");for(var s=0;s<t.length;s++)r.append(e.el.li(e.el.a(t[s])));return r.data("examples",t.slice(0)),this},addHistory:function(t){function i(){return n.children().filter(function(){return e(this).text()==t})}var n=this.find("ul.history"),r=this.data("queryEditor");if(t){var s;(s=i())&&s.remove(),n.children().length>=r.maxHistoryLength&&n.children().first().remove(),n.append(e.el.li(e.el.a(t)))}return this},setQuery:function(e){var t=this.data(r);return t.cleanGen=this.find(".query").prologEditor("setSource",e).focus().prologEditor("changeGen"),this},isClean:function(){var e=this.data(r);return!this.queryEditor("getQuery")||e.cleanGen&&this.find(".query").prologEditor("isClean",e.cleanGen)},getQuery:function(){return this.find(".query").prologEditor("getSource","query")},run:function(t,n){var r=this.data("queryEditor");t===undefined&&(t=this.queryEditor("getQuery")),t=e.trim(t);if(!t)return e(".swish-event-receiver").trigger("help",{file:"query.html"}),this;e(".swish-event-receiver").trigger("clearMessages");var i={query:t,editor:r.editor,query_editor:this.find(".query")};return typeof r.source=="function"?i.source=r.source(t):typeof r.source=="string"&&(i.source=r.source),n&&(i.tabled=!0),this.queryEditor("addHistory",t),r.runner.prologRunners("run",i),this}};e.fn.queryEditor=function(t){if(s[t])return s[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return s._init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery."+r)}})(jQuery)}),define("term",["jquery"],function(){function e(){$(this).next().toggleClass("fold"),$(this).remove()}$(document).on("click",".pl-functor, .pl-infix",function(){var t=$(this).parent();$(t).toggleClass("fold"),$(t).before('<span class="pl-ellipsis">...</span>').prev().click(e)})}),!function(){function i(e){return e&&(e.ownerDocument||e.document||e).documentElement}function s(e){return e&&(e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView)}function p(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function d(e){return e===null?NaN:+e}function v(e){return!isNaN(e)}function m(e){return{left:function(t,n,r,i){arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);while(r<i){var s=r+i>>>1;e(t[s],n)<0?r=s+1:i=s}return r},right:function(t,n,r,i){arguments.length<3&&(r=0),arguments.length<4&&(i=t.length);while(r<i){var s=r+i>>>1;e(t[s],n)>0?i=s:r=s+1}return r}}}function y(e){return e.length}function w(e){var t=1;while(e*t%1)t*=10;return t}function E(e,t){for(var n in t)Object.defineProperty(e.prototype,n,{value:t[n],enumerable:!1})}function S(){this._=Object.create(null)}function N(e){return(e+="")===x||e[0]===T?T+e:e}function C(e){return(e+="")[0]===T?e.slice(1):e}function k(e){return N(e)in this._}function L(e){return(e=N(e))in this._&&delete this._[e]}function A(){var e=[];for(var t in this._)e.push(C(t));return e}function O(){var e=0;for(var t in this._)++e;return e}function M(){for(var e in this._)return!1;return!0}function _(){this._=Object.create(null)}function D(e){return e}function P(e,t,n){return function(){var r=n.apply(t,arguments);return r===t?e:r}}function H(e,t){if(t in e)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var n=0,r=B.length;n<r;++n){var i=B[n]+t;if(i in e)return i}}function j(){}function F(){}function I(e){function r(){var n=t,r=-1,i=n.length,s;while(++r<i)(s=n[r].on)&&s.apply(this,arguments);return e}var t=[],n=new S;return r.on=function(r,i){var s=n.get(r),o;return arguments.length<2?s&&s.on:(s&&(s.on=null,t=t.slice(0,o=t.indexOf(s)).concat(t.slice(o+1)),n.remove(r)),i&&t.push(n.set(r,{on:i})),e)},r}function q(){e.event.preventDefault()}function R(){var t=e.event,n;while(n=t.sourceEvent)t=n;return t}function U(t){var n=new F,r=0,i=arguments.length;while(++r<i)n[arguments[r]]=I(n);return n.of=function(r,i){return function(s){try{var o=s.sourceEvent=e.event;s.target=t,e.event=s,n[s.type].apply(r,i)}finally{e.event=o}}},n}function X(e){return W(e,K),e}function Q(e){return typeof e=="function"?e:function(){return V(e,this)}}function G(e){return typeof e=="function"?e:function(){return $(e,this)}}function et(t,n){function r(){this.removeAttribute(t)}function i(){this.removeAttributeNS(t.space,t.local)}function s(){this.setAttribute(t,n)}function o(){this.setAttributeNS(t.space,t.local,n)}function u(){var e=n.apply(this,arguments);e==null?this.removeAttribute(t):this.setAttribute(t,e)}function a(){var e=n.apply(this,arguments);e==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}return t=e.ns.qualify(t),n==null?t.local?i:r:typeof n=="function"?t.local?a:u:t.local?o:s}function tt(e){return e.trim().replace(/\s+/g," ")}function nt(t){return new RegExp("(?:^|\\s+)"+e.requote(t)+"(?:\\s+|$)","g")}function rt(e){return(e+"").trim().split(/^|\s+/)}function it(e,t){function r(){var r=-1;while(++r<n)e[r](this,t)}function i(){var r=-1,i=t.apply(this,arguments);while(++r<n)e[r](this,i)}e=rt(e).map(st);var n=e.length;return typeof t=="function"?i:r}function st(e){var t=nt(e);return function(n,r){if(i=n.classList)return r?i.add(e):i.remove(e);var i=n.getAttribute("class")||"";r?(t.lastIndex=0,t.test(i)||n.setAttribute("class",tt(i+" "+e))):n.setAttribute("class",tt(i.replace(t," ")))}}function ot(e,t,n){function r(){this.style.removeProperty(e)}function i(){this.style.setProperty(e,t,n)}function s(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}return t==null?r:typeof t=="function"?s:i}function ut(e,t){function n(){delete this[e]}function r(){this[e]=t}function i(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}return t==null?n:typeof t=="function"?i:r}function at(t){function n(){var e=this.ownerDocument,n=this.namespaceURI;return n===Y&&e.documentElement.namespaceURI===Y?e.createElement(t):e.createElementNS(n,t)}function r(){return this.ownerDocument.createElementNS(t.space,t.local)}return typeof t=="function"?t:(t=e.ns.qualify(t)).local?r:n}function ft(){var e=this.parentNode;e&&e.removeChild(this)}function lt(e){return{__data__:e}}function ct(e){return function(){return J(this,e)}}function ht(e){return arguments.length||(e=p),function(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}}function pt(e,t){for(var n=0,r=e.length;n<r;n++)for(var i=e[n],s=0,o=i.length,u;s<o;s++)(u=i[s])&&t(u,s,n);return e}function dt(e){return W(e,vt),e}function mt(e){var t,n;return function(r,i,s){var o=e[s].update,u=o.length,a;s!=n&&(n=s,t=0),i>=t&&(t=i+1);while(!(a=o[t])&&++t<u);return a}}function gt(t,r,i){function f(){var e=this[s];e&&(this.removeEventListener(t,e,e.$),delete this[s])}function l(){var e=u(r,n(arguments));f.call(this),this.addEventListener(t,this[s]=e,e.$=i),e._=r}function c(){var n=new RegExp("^__on([^.]+)"+e.requote(t)+"$"),r;for(var i in this)if(r=i.match(n)){var s=this[i];this.removeEventListener(r[1],s,s.$),delete this[i]}}var s="__on"+t,o=t.indexOf("."),u=bt;o>0&&(t=t.slice(0,o));var a=yt.get(t);return a&&(t=a,u=wt),o?r?l:f:r?j:c}function bt(t,n){return function(r){var i=e.event;e.event=r,n[0]=this.__data__;try{t.apply(this,n)}finally{e.event=i}}}function wt(e,t){var n=bt(e,t);return function(e){var t=this,r=e.relatedTarget;(!r||r!==t&&!(r.compareDocumentPosition(t)&8))&&n.call(t,e)}}function xt(t){var n=".dragsuppress-"+ ++St,r="click"+n,o=e.select(s(t)).on("touchmove"+n,q).on("dragstart"+n,q).on("selectstart"+n,q);Et==null&&(Et="onselectstart"in t?!1:H(t.style,"userSelect"));if(Et){var u=i(t).style,a=u[Et];u[Et]="none"}return function(e){o.on(n,null),Et&&(u[Et]=a);if(e){var t=function(){o.on(r,null)};o.on(r,function(){q(),t()},!0),setTimeout(t,0)}}}function Nt(t,n){n.changedTouches&&(n=n.changedTouches[0]);var r=t.ownerSVGElement||t;if(r.createSVGPoint){var i=r.createSVGPoint();if(Tt<0){var o=s(t);if(o.scrollX||o.scrollY){r=e.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var u=r[0][0].getScreenCTM();Tt=!u.f&&!u.e,r.remove()}}return Tt?(i.x=n.pageX,i.y=n.pageY):(i.x=n.clientX,i.y=n.clientY),i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}var a=t.getBoundingClientRect();return[n.clientX-a.left-t.clientLeft,n.clientY-a.top-t.clientTop]}function Ct(){return e.event.changedTouches[0].identifier}function Ht(e){return e>0?1:e<0?-1:0}function Bt(e,t,n){return(t[0]-e[0])*(n[1]-e[1])-(t[1]-e[1])*(n[0]-e[0])}function jt(e){return e>1?0:e<-1?At:Math.acos(e)}function Ft(e){return e>1?_t:e<-1?-_t:Math.asin(e)}function It(e){return((e=Math.exp(e))-1/e)/2}function qt(e){return((e=Math.exp(e))+1/e)/2}function Rt(e){return((e=Math.exp(2*e))-1)/(e+1)}function Ut(e){return(e=Math.sin(e/2))*e}function Kt(){}function Qt(e,t,n){return this instanceof Qt?void (this.h=+e,this.s=+t,this.l=+n):arguments.length<2?e instanceof Qt?new Qt(e.h,e.s,e.l):bn(""+e,wn,Qt):new Qt(e,t,n)}function Yt(e,t,n){function s(e){return e>360?e-=360:e<0&&(e+=360),e<60?r+(i-r)*e/60:e<180?i:e<240?r+(i-r)*(240-e)/60:r}function o(e){return Math.round(s(e)*255)}var r,i;return e=isNaN(e)?0:(e%=360)<0?e+360:e,t=isNaN(t)?0:t<0?0:t>1?1:t,n=n<0?0:n>1?1:n,i=n<=.5?n*(1+t):n+t-n*t,r=2*n-i,new dn(o(e+120),o(e),o(e-120))}function Zt(t,n,r){return this instanceof Zt?void (this.h=+t,this.c=+n,this.l=+r):arguments.length<2?t instanceof Zt?new Zt(t.h,t.c,t.l):t instanceof nn?ln(t.l,t.a,t.b):ln((t=En((t=e.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new Zt(t,n,r)}function tn(e,t,n){return isNaN(e)&&(e=0),isNaN(t)&&(t=0),new nn(n,Math.cos(e*=Dt)*t,Math.sin(e)*t)}function nn(e,t,n){return this instanceof nn?void (this.l=+e,this.a=+t,this.b=+n):arguments.length<2?e instanceof nn?new nn(e.l,e.a,e.b):e instanceof Zt?tn(e.h,e.c,e.l):En((e=dn(e)).r,e.g,e.b):new nn(e,t,n)}function fn(e,t,n){var r=(e+16)/116,i=r+t/500,s=r-n/200;return i=cn(i)*sn,r=cn(r)*on,s=cn(s)*un,new dn(pn(3.2404542*i-1.5371385*r-.4985314*s),pn(-0.969266*i+1.8760108*r+.041556*s),pn(.0556434*i-.2040259*r+1.0572252*s))}function ln(e,t,n){return e>0?new Zt(Math.atan2(n,t)*Pt,Math.sqrt(t*t+n*n),e):new Zt(NaN,NaN,e)}function cn(e){return e>.206893034?e*e*e:(e-4/29)/7.787037}function hn(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29}function pn(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))}function dn(e,t,n){return this instanceof dn?void (this.r=~~e,this.g=~~t,this.b=~~n):arguments.length<2?e instanceof dn?new dn(e.r,e.g,e.b):bn(""+e,dn,Yt):new dn(e,t,n)}function vn(e){return new dn(e>>16,e>>8&255,e&255)}function mn(e){return vn(e)+""}function yn(e){return e<16?"0"+Math.max(0,e).toString(16):Math.min(255,e).toString(16)}function bn(e,t,n){var r=0,i=0,s=0,o,u,a;o=/([a-z]+)\((.*)\)/.exec(e=e.toLowerCase());if(o){u=o[2].split(",");switch(o[1]){case"hsl":return n(parseFloat(u[0]),parseFloat(u[1])/100,parseFloat(u[2])/100);case"rgb":return t(xn(u[0]),xn(u[1]),xn(u[2]))}}return(a=Tn.get(e))?t(a.r,a.g,a.b):(e!=null&&e.charAt(0)==="#"&&!isNaN(a=parseInt(e.slice(1),16))&&(e.length===4?(r=(a&3840)>>4,r=r>>4|r,i=a&240,i=i>>4|i,s=a&15,s=s<<4|s):e.length===7&&(r=(a&16711680)>>16,i=(a&65280)>>8,s=a&255)),t(r,i,s))}function wn(e,t,n){var r=Math.min(e/=255,t/=255,n/=255),i=Math.max(e,t,n),s=i-r,o,u,a=(i+r)/2;return s?(u=a<.5?s/(i+r):s/(2-i-r),e==i?o=(t-n)/s+(t<n?6:0):t==i?o=(n-e)/s+2:o=(e-t)/s+4,o*=60):(o=NaN,u=a>0&&a<1?0:o),new Qt(o,u,a)}function En(e,t,n){e=Sn(e),t=Sn(t),n=Sn(n);var r=hn((.4124564*e+.3575761*t+.1804375*n)/sn),i=hn((.2126729*e+.7151522*t+.072175*n)/on),s=hn((.0193339*e+.119192*t+.9503041*n)/un);return nn(116*i-16,500*(r-i),200*(i-s))}function Sn(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function xn(e){var t=parseFloat(e);return e.charAt(e.length-1)==="%"?Math.round(t*2.55):t}function Nn(e){return typeof e=="function"?e:function(){return e}}function Cn(e){return function(t,n,r){return arguments.length===2&&typeof n=="function"&&(r=n,n=null),kn(t,n,e,r)}}function kn(t,r,i,s){function c(){var e=f.status,t;if(!e&&An(f)||e>=200&&e<300||e===304){try{t=i.call(o,f)}catch(n){u.error.call(o,n);return}u.load.call(o,t)}else u.error.call(o,f)}var o={},u=e.dispatch("beforesend","progress","load","error"),a={},f=new XMLHttpRequest,l=null;return this.XDomainRequest&&!("withCredentials"in f)&&/^(http(s)?:)?\/\//.test(t)&&(f=new XDomainRequest),"onload"in f?f.onload=f.onerror=c:f.onreadystatechange=function(){f.readyState>3&&c()},f.onprogress=function(t){var n=e.event;e.event=t;try{u.progress.call(o,f)}finally{e.event=n}},o.header=function(e,t){return e=(e+"").toLowerCase(),arguments.length<2?a[e]:(t==null?delete a[e]:a[e]=t+"",o)},o.mimeType=function(e){return arguments.length?(r=e==null?null:e+"",o):r},o.responseType=function(e){return arguments.length?(l=e,o):l},o.response=function(e){return i=e,o},["get","post"].forEach(function(e){o[e]=function(){return o.send.apply(o,[e].concat(n(arguments)))}}),o.send=function(e,n,i){arguments.length===2&&typeof n=="function"&&(i=n,n=null),f.open(e,t,!0),r!=null&&!("accept"in a)&&(a.accept=r+",*/*");if(f.setRequestHeader)for(var s in a)f.setRequestHeader(s,a[s]);return r!=null&&f.overrideMimeType&&f.overrideMimeType(r),l!=null&&(f.responseType=l),i!=null&&o.on("error",i).on("load",function(e){i(null,e)}),u.beforesend.call(o,f),f.send(n==null?null:n),o},o.abort=function(){return f.abort(),o},e.rebind(o,u,"on"),s==null?o:o.get(Ln(s))}function Ln(e){return e.length===1?function(t,n){e(t==null?n:null)}:e}function An(e){var t=e.responseType;return t&&t!=="text"?e.response:e.responseText}function Hn(e,t,n){var r=arguments.length;r<2&&(t=0),r<3&&(n=Date.now());var i=n+t,s={c:e,t:i,n:null};return Mn?Mn.n=s:On=s,Mn=s,_n||(Dn=clearTimeout(Dn),_n=1,Pn(Bn)),s}function Bn(){var e=jn(),t=Fn()-e;t>24?(isFinite(t)&&(clearTimeout(Dn),Dn=setTimeout(Bn,t)),_n=0):(_n=1,Pn(Bn))}function jn(){var e=Date.now(),t=On;while(t)e>=t.t&&t.c(e-t.t)&&(t.c=null),t=t.n;return e}function Fn(){var e,t=On,n=Infinity;while(t)t.c?(t.t<n&&(n=t.t),t=(e=t).n):t=e?e.n=t.n:On=t.n;return Mn=e,n}function In(e,t){return t-(e?Math.ceil(Math.log(e)/Math.LN10):1)}function Rn(e,t){var n=Math.pow(10,b(8-t)*3);return{scale:t>8?function(e){return e/n}:function(e){return e*n},symbol:e}}function Un(t){var n=t.decimal,r=t.thousands,i=t.grouping,s=t.currency,o=i&&r?function(e,t){var n=e.length,s=[],o=0,u=i[0],a=0;while(n>0&&u>0){a+u+1>t&&(u=Math.max(1,t-a)),s.push(e.substring(n-=u,n+u));if((a+=u+1)>t)break;u=i[o=(o+1)%i.length]}return s.reverse().join(r)}:D;return function(t){var r=zn.exec(t),i=r[1]||" ",u=r[2]||">",a=r[3]||"-",f=r[4]||"",l=r[5],c=+r[6],h=r[7],p=r[8],d=r[9],v=1,m="",g="",y=!1,b=!0;p&&(p=+p.substring(1));if(l||i==="0"&&u==="=")l=i="0",u="=";switch(d){case"n":h=!0,d="g";break;case"%":v=100,g="%",d="f";break;case"p":v=100,g="%",d="r";break;case"b":case"o":case"x":case"X":f==="#"&&(m="0"+d.toLowerCase());case"c":b=!1;case"d":y=!0,p=0;break;case"s":v=-1,d="r"}f==="$"&&(m=s[0],g=s[1]),d=="r"&&!p&&(d="g");if(p!=null)if(d=="g")p=Math.max(1,Math.min(21,p));else if(d=="e"||d=="f")p=Math.max(0,Math.min(20,p));d=Wn.get(d)||Xn;var w=l&&h;return function(t){var r=g;if(y&&t%1)return"";var s=t<0||t===0&&1/t<0?(t=-t,"-"):a==="-"?"":a;if(v<0){var f=e.formatPrefix(t,p);t=f.scale(t),r=f.symbol+g}else t*=v;t=d(t,p);var E=t.lastIndexOf("."),S,x;if(E<0){var T=b?t.lastIndexOf("e"):-1;T<0?(S=t,x=""):(S=t.substring(0,T),x=t.substring(T))}else S=t.substring(0,E),x=n+t.substring(E+1);!l&&h&&(S=o(S,Infinity));var N=m.length+S.length+x.length+(w?0:s.length),C=N<c?(new Array(N=c-N+1)).join(i):"";return w&&(S=o(C+S,C.length?c-x.length:Infinity)),s+=m,t=S+x,(u==="<"?s+t+C:u===">"?C+s+t:u==="^"?C.substring(0,N>>=1)+s+t+C.substring(N):s+(w?t:C+t))+r}}}function Xn(e){return e+""}function Jn(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Qn(e,t,n){function r(t){var n=e(t),r=s(n,1);return t-n<r-t?n:r}function i(n){return t(n=e(new $n(n-1)),1),n}function s(e,n){return t(e=new $n(+e),n),e}function o(e,r,s){var o=i(e),u=[];if(s>1)while(o<r)n(o)%s||u.push(new Date(+o)),t(o,1);else while(o<r)u.push(new Date(+o)),t(o,1);return u}function u(e,t,n){try{$n=Jn;var r=new Jn;return r._=e,o(r,t,n)}finally{$n=Date}}e.floor=e,e.round=r,e.ceil=i,e.offset=s,e.range=o;var a=e.utc=Gn(e);return a.floor=a,a.round=Gn(r),a.ceil=Gn(i),a.offset=Gn(s),a.range=u,e}function Gn(e){return function(t,n){try{$n=Jn;var r=new Jn;return r._=t,e(r,n)._}finally{$n=Date}}}function Yn(t){function l(e){function n(n){var r=[],i=-1,s=0,o,u,a;while(++i<t)if(e.charCodeAt(i)===37){r.push(e.slice(s,i)),(u=Zn[o=e.charAt(++i)])!=null&&(o=e.charAt(++i));if(a=E[o])o=a(n,u==null?o==="e"?" ":"0":u);r.push(o),s=i+1}return r.push(e.slice(s,i)),r.join("")}var t=e.length;return n.parse=function(t){var n={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},r=c(n,e,t,0);if(r!=t.length)return null;"p"in n&&(n.H=n.H%12+n.p*12);var i=n.Z!=null&&$n!==Jn,s=new(i?Jn:$n);return"j"in n?s.setFullYear(n.y,0,n.j):"W"in n||"U"in n?("w"in n||(n.w="W"in n?1:0),s.setFullYear(n.y,0,1),s.setFullYear(n.y,0,"W"in n?(n.w+6)%7+n.W*7-(s.getDay()+5)%7:n.w+n.U*7-(s.getDay()+6)%7)):s.setFullYear(n.y,n.m,n.d),s.setHours(n.H+(n.Z/100|0),n.M+n.Z%100,n.S,n.L),i?s._:s},n.toString=function(){return e},n}function c(e,t,n,r){var i,s,o,u=0,a=t.length,f=n.length;while(u<a){if(r>=f)return-1;i=t.charCodeAt(u++);if(i===37){o=t.charAt(u++),s=S[o in Zn?t.charAt(u++):o];if(!s||(r=s(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}function x(e,t,n){v.lastIndex=0;var r=v.exec(t.slice(n));return r?(e.w=m.get(r[0].toLowerCase()),n+r[0].length):-1}function T(e,t,n){p.lastIndex=0;var r=p.exec(t.slice(n));return r?(e.w=d.get(r[0].toLowerCase()),n+r[0].length):-1}function N(e,t,n){b.lastIndex=0;var r=b.exec(t.slice(n));return r?(e.m=w.get(r[0].toLowerCase()),n+r[0].length):-1}function C(e,t,n){g.lastIndex=0;var r=g.exec(t.slice(n));return r?(e.m=y.get(r[0].toLowerCase()),n+r[0].length):-1}function k(e,t,n){return c(e,E.c.toString(),t,n)}function L(e,t,n){return c(e,E.x.toString(),t,n)}function A(e,t,n){return c(e,E.X.toString(),t,n)}function O(e,t,n){var r=h.get(t.slice(n,n+=2).toLowerCase());return r==null?-1:(e.p=r,n)}var n=t.dateTime,r=t.date,i=t.time,s=t.periods,o=t.days,u=t.shortDays,a=t.months,f=t.shortMonths;l.utc=function(e){function n(e){try{$n=Jn;var n=new $n;return n._=e,t(n)}finally{$n=Date}}var t=l(e);return n.parse=function(e){try{$n=Jn;var n=t.parse(e);return n&&n._}finally{$n=Date}},n.toString=t.toString,n},l.multi=l.utc.multi=Er;var h=e.map(),p=rr(o),d=ir(o),v=rr(u),m=ir(u),g=rr(a),y=ir(a),b=rr(f),w=ir(f);s.forEach(function(e,t){h.set(e.toLowerCase(),t)});var E={a:function(e){return u[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return f[e.getMonth()]},B:function(e){return a[e.getMonth()]},c:l(n),d:function(e,t){return nr(e.getDate(),t,2)},e:function(e,t){return nr(e.getDate(),t,2)},H:function(e,t){return nr(e.getHours(),t,2)},I:function(e,t){return nr(e.getHours()%12||12,t,2)},j:function(e,t){return nr(1+Vn.dayOfYear(e),t,3)},L:function(e,t){return nr(e.getMilliseconds(),t,3)},m:function(e,t){return nr(e.getMonth()+1,t,2)},M:function(e,t){return nr(e.getMinutes(),t,2)},p:function(e){return s[+(e.getHours()>=12)]},S:function(e,t){return nr(e.getSeconds(),t,2)},U:function(e,t){return nr(Vn.sundayOfYear(e),t,2)},w:function(e){return e.getDay()},W:function(e,t){return nr(Vn.mondayOfYear(e),t,2)},x:l(r),X:l(i),y:function(e,t){return nr(e.getFullYear()%100,t,2)},Y:function(e,t){return nr(e.getFullYear()%1e4,t,4)},Z:br,"%":function(){return"%"}},S={a:x,A:T,b:N,B:C,c:k,d:pr,e:pr,H:vr,I:vr,j:dr,L:yr,m:hr,M:mr,p:O,S:gr,U:or,w:sr,W:ur,x:L,X:A,y:fr,Y:ar,Z:lr,"%":wr};return l}function nr(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",s=i.length;return r+(s<n?(new Array(n-s+1)).join(t)+i:i)}function rr(t){return new RegExp("^(?:"+t.map(e.requote).join("|")+")","i")}function ir(e){var t=new S,n=-1,r=e.length;while(++n<r)t.set(e[n].toLowerCase(),n);return t}function sr(e,t,n){er.lastIndex=0;var r=er.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function or(e,t,n){er.lastIndex=0;var r=er.exec(t.slice(n));return r?(e.U=+r[0],n+r[0].length):-1}function ur(e,t,n){er.lastIndex=0;var r=er.exec(t.slice(n));return r?(e.W=+r[0],n+r[0].length):-1}function ar(e,t,n){er.lastIndex=0;var r=er.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function fr(e,t,n){er.lastIndex=0;var r=er.exec(t.slice(n,n+2));return r?(e.y=cr(+r[0]),n+r[0].length):-1}function lr(e,t,n){return/^[+-]\d{4}$/.test(t=t.slice(n,n+5))?(e.Z=-t,n+5):-1}function cr(e){return e+(e>68?1900:2e3)}function hr(e,t,n){er.lastIndex=0;var r=er.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function pr(e,t,n){er.lastIndex=0;var r=er.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function dr(e,t,n){er.lastIndex=0;var r=er.exec(t.slice(n,n+3));return r?(e.j=+r[0],n+r[0].length):-1}function vr(e,t,n){er.lastIndex=0;var r=er.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function mr(e,t,n){er.lastIndex=0;var r=er.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function gr(e,t,n){er.lastIndex=0;var r=er.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function yr(e,t,n){er.lastIndex=0;var r=er.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function br(e){var t=e.getTimezoneOffset(),n=t>0?"-":"+",r=b(t)/60|0,i=b(t)%60;return n+nr(r,"0",2)+nr(i,"0",2)}function wr(e,t,n){tr.lastIndex=0;var r=tr.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Er(e){var t=e.length,n=-1;while(++n<t)e[n][0]=this(e[n][0]);return function(t){var n=0,r=e[n];while(!r[1](t))r=e[++n];return r[0](t)}}function xr(){}function Nr(e,t,n){var r=n.s=e+t,i=r-e,s=r-i;n.t=e-s+(t-i)}function Cr(e,t){e&&Lr.hasOwnProperty(e.type)&&Lr[e.type](e,t)}function Ar(e,t,n){var r=-1,i=e.length-n,s;t.lineStart();while(++r<i)s=e[r],t.point(s[0],s[1],s[2]);t.lineEnd()}function Or(e,t){var n=-1,r=e.length;t.polygonStart();while(++n<r)Ar(e[n],t,1);t.polygonEnd()}function Pr(){function s(e,t){e*=Dt,t=t*Dt/2+At/4;var s=e-n,o=s>=0?1:-1,u=o*s,a=Math.cos(t),f=Math.sin(t),l=i*f,c=r*a+l*Math.cos(u),h=l*o*Math.sin(u);_r.add(Math.atan2(h,c)),n=e,r=a,i=f}var e,t,n,r,i;Dr.point=function(o,u){Dr.point=s,n=(e=o)*Dt,r=Math.cos(u=(t=u)*Dt/2+At/4),i=Math.sin(u)},Dr.lineEnd=function(){s(e,t)}}function Hr(e){var t=e[0],n=e[1],r=Math.cos(n);return[r*Math.cos(t),r*Math.sin(t),Math.sin(n)]}function Br(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function jr(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function Fr(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Ir(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function qr(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function Rr(e){return[Math.atan2(e[1],e[0]),Ft(e[2])]}function Ur(e,t){return b(e[0]-t[0])<kt&&b(e[1]-t[1])<kt}function ti(e,t){e*=Dt;var n=Math.cos(t*=Dt);ni(n*Math.cos(e),n*Math.sin(e),Math.sin(t))}function ni(e,t,n){++zr,Xr+=(e-Xr)/zr,Vr+=(t-Vr)/zr,$r+=(n-$r)/zr}function ri(){function r(r,i){r*=Dt;var s=Math.cos(i*=Dt),o=s*Math.cos(r),u=s*Math.sin(r),a=Math.sin(i),f=Math.atan2(Math.sqrt((f=t*a-n*u)*f+(f=n*o-e*a)*f+(f=e*u-t*o)*f),e*o+t*u+n*a);Wr+=f,Jr+=f*(e+(e=o)),Kr+=f*(t+(t=u)),Qr+=f*(n+(n=a)),ni(e,t,n)}var e,t,n;ei.point=function(i,s){i*=Dt;var o=Math.cos(s*=Dt);e=o*Math.cos(i),t=o*Math.sin(i),n=Math.sin(s),ei.point=r,ni(e,t,n)}}function ii(){ei.point=ti}function si(){function s(e,t){e*=Dt;var s=Math.cos(t*=Dt),o=s*Math.cos(e),u=s*Math.sin(e),a=Math.sin(t),f=r*a-i*u,l=i*o-n*a,c=n*u-r*o,h=Math.sqrt(f*f+l*l+c*c),p=n*o+r*u+i*a,d=h&&-jt(p)/h,v=Math.atan2(h,p);Gr+=d*f,Yr+=d*l,Zr+=d*c,Wr+=v,Jr+=v*(n+(n=o)),Kr+=v*(r+(r=u)),Qr+=v*(i+(i=a)),ni(n,r,i)}var e,t,n,r,i;ei.point=function(o,u){e=o,t=u,ei.point=s,o*=Dt;var a=Math.cos(u*=Dt);n=a*Math.cos(o),r=a*Math.sin(o),i=Math.sin(u),ni(n,r,i)},ei.lineEnd=function(){s(e,t),ei.lineEnd=ii,ei.point=ti}}function oi(e,t){function n(n,r){return n=e(n,r),t(n[0],n[1])}return e.invert&&t.invert&&(n.invert=function(n,r){return n=t.invert(n,r),n&&e.invert(n[0],n[1])}),n}function ui(){return!0}function ai(e,t,n,r,i){var s=[],o=[];e.forEach(function(e){if((t=e.length-1)<=0)return;var t,n=e[0],r=e[t];if(Ur(n,r)){i.lineStart();for(var u=0;u<t;++u)i.point((n=e[u])[0],n[1]);i.lineEnd();return}var a=new li(n,e,null,!0),f=new li(n,null,a,!1);a.o=f,s.push(a),o.push(f),a=new li(r,e,null,!1),f=new li(r,null,a,!0),a.o=f,s.push(a),o.push(f)}),o.sort(t),fi(s),fi(o);if(!s.length)return;for(var u=0,a=n,f=o.length;u<f;++u)o[u].e=a=!a;var l=s[0],c,h;for(;;){var p=l,d=!0;while(p.v)if((p=p.n)===l)return;c=p.z,i.lineStart();do{p.v=p.o.v=!0;if(p.e){if(d)for(var u=0,f=c.length;u<f;++u)i.point((h=c[u])[0],h[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((h=c[u])[0],h[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 fi(e){if(!(t=e.length))return;var t,n=0,r=e[0],i;while(++n<t)r.n=i=e[n],i.p=r,r=i;r.n=i=e[0],i.p=r}function li(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function ci(t,n,r,i){return function(s,o){function l(e,n){var r=s(e,n);t(e=r[0],n=r[1])&&o.point(e,n)}function c(e,t){var n=s(e,t);u.point(n[0],n[1])}function h(){f.point=c,u.lineStart()}function p(){f.point=l,u.lineEnd()}function w(e,t){b.push([e,t]);var n=s(e,t);m.point(n[0],n[1])}function E(){m.lineStart(),b=[]}function S(){w(b[0][0],b[0][1]),m.lineEnd();var e=m.clean(),t=v.buffer(),n,r=t.length;b.pop(),y.push(b),b=null;if(!r)return;if(e&1){n=t[0];var r=n.length-1,i=-1,s;if(r>0){g||(o.polygonStart(),g=!0),o.lineStart();while(++i<r)o.point((s=n[i])[0],s[1]);o.lineEnd()}return}r>1&&e&2&&t.push(t.pop().concat(t.shift())),d.push(t.filter(hi))}var u=n(o),a=s.invert(i[0],i[1]),f={point:l,lineStart:h,lineEnd:p,polygonStart:function(){f.point=w,f.lineStart=E,f.lineEnd=S,d=[],y=[]},polygonEnd:function(){f.point=l,f.lineStart=h,f.lineEnd=p,d=e.merge(d);var t=bi(a,y);d.length?(g||(o.polygonStart(),g=!0),ai(d,di,t,r,o)):t&&(g||(o.polygonStart(),g=!0),o.lineStart(),r(null,null,1,o),o.lineEnd()),g&&(o.polygonEnd(),g=!1),d=y=null},sphere:function(){o.polygonStart(),o.lineStart(),r(null,null,1,o),o.lineEnd(),o.polygonEnd()}},d,v=pi(),m=n(v),g=!1,y,b;return f}}function hi(e){return e.length>1}function pi(){var e=[],t;return{lineStart:function(){e.push(t=[])},point:function(e,n){t.push([e,n])},lineEnd:j,buffer:function(){var n=e;return e=[],t=null,n},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function di(e,t){return((e=e.x)[0]<0?e[1]-_t-kt:_t-e[1])-((t=t.x)[0]<0?t[1]-_t-kt:_t-t[1])}function mi(e){var t=NaN,n=NaN,r=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(s,o){var u=s>0?At:-At,a=b(s-t);b(a-At)<kt?(e.point(t,n=(n+o)/2>0?_t:-_t),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(u,n),e.point(s,n),i=0):r!==u&&a>=At&&(b(t-r)<kt&&(t-=r*kt),b(s-u)<kt&&(s-=u*kt),n=gi(t,n,s,o),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(u,n),i=0),e.point(t=s,n=o),r=u},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-i}}}function gi(e,t,n,r){var i,s,o=Math.sin(e-n);return b(o)>kt?Math.atan((Math.sin(t)*(s=Math.cos(r))*Math.sin(n)-Math.sin(r)*(i=Math.cos(t))*Math.sin(e))/(i*s*o)):(t+r)/2}function yi(e,t,n,r){var i;if(e==null)i=n*_t,r.point(-At,i),r.point(0,i),r.point(At,i),r.point(At,0),r.point(At,-i),r.point(0,-i),r.point(-At,-i),r.point(-At,0),r.point(-At,i);else if(b(e[0]-t[0])>kt){var s=e[0]<t[0]?At:-At;i=n*s/2,r.point(-s,i),r.point(0,i),r.point(s,i)}else r.point(t[0],t[1])}function bi(e,t){var n=e[0],r=e[1],i=[Math.sin(n),-Math.cos(n),0],s=0,o=0;_r.reset();for(var u=0,a=t.length;u<a;++u){var f=t[u],l=f.length;if(!l)continue;var c=f[0],h=c[0],p=c[1]/2+At/4,d=Math.sin(p),v=Math.cos(p),m=1;for(;;){m===l&&(m=0),e=f[m];var g=e[0],y=e[1]/2+At/4,b=Math.sin(y),w=Math.cos(y),E=g-h,S=E>=0?1:-1,x=S*E,T=x>At,N=d*b;_r.add(Math.atan2(N*S*Math.sin(x),v*w+N*Math.cos(x))),s+=T?E+S*Ot:E;if(T^h>=n^g>=n){var C=jr(Hr(c),Hr(e));qr(C);var k=jr(i,C);qr(k);var L=(T^E>=0?-1:1)*Ft(k[2]);if(r>L||r===L&&(C[0]||C[1]))o+=T^E>=0?1:-1}if(!(m++))break;h=g,d=b,v=w,c=e}}return(s<-kt||s<kt&&_r<-kt)^o&1}function wi(e){function s(e,n){return Math.cos(e)*Math.cos(n)>t}function o(e){var t,i,o,f,l;return{lineStart:function(){f=o=!1,l=1},point:function(c,h){var p=[c,h],d,v=s(c,h),m=n?v?0:a(c,h):v?a(c+(c<0?At:-At),h):0;!t&&(f=o=v)&&e.lineStart();if(v!==o){d=u(t,p);if(Ur(t,d)||Ur(p,d))p[0]+=kt,p[1]+=kt,v=s(p[0],p[1])}if(v!==o)l=0,v?(e.lineStart(),d=u(p,t),e.point(d[0],d[1])):(d=u(t,p),e.point(d[0],d[1]),e.lineEnd()),t=d;else if(r&&t&&n^v){var g;!(m&i)&&(g=u(p,t,!0))&&(l=0,n?(e.lineStart(),e.point(g[0][0],g[0][1]),e.point(g[1][0],g[1][1]),e.lineEnd()):(e.point(g[1][0],g[1][1]),e.lineEnd(),e.lineStart(),e.point(g[0][0],g[0][1])))}v&&(!t||!Ur(t,p))&&e.point(p[0],p[1]),t=p,o=v,i=m},lineEnd:function(){o&&e.lineEnd(),t=null},clean:function(){return l|(f&&o)<<1}}}function u(e,n,r){var i=Hr(e),s=Hr(n),o=[1,0,0],u=jr(i,s),a=Br(u,u),f=u[0],l=a-f*f;if(!l)return!r&&e;var c=t*a/l,h=-t*f/l,p=jr(o,u),d=Ir(o,c),v=Ir(u,h);Fr(d,v);var m=p,g=Br(d,m),y=Br(m,m),w=g*g-y*(Br(d,d)-1);if(w<0)return;var E=Math.sqrt(w),S=Ir(m,(-g-E)/y);Fr(S,d),S=Rr(S);if(!r)return S;var x=e[0],T=n[0],N=e[1],C=n[1],k;T<x&&(k=x,x=T,T=k);var L=T-x,A=b(L-At)<kt,O=A||L<kt;!A&&C<N&&(k=N,N=C,C=k);if(O?A?N+C>0^S[1]<(b(S[0]-x)<kt?N:C):N<=S[1]&&S[1]<=C:L>At^(x<=S[0]&&S[0]<=T)){var M=Ir(m,(-g+E)/y);return Fr(M,d),[S,Rr(M)]}}function a(t,r){var i=n?e:At-e,s=0;return t<-i?s|=1:t>i&&(s|=2),r<-i?s|=4:r>i&&(s|=8),s}var t=Math.cos(e),n=t>0,r=b(t)>kt,i=rs(e,6*Dt);return ci(s,o,i,n?[0,-e]:[-At,e-At])}function Ei(e,t,n,r){return function(i){var s=i.a,o=i.b,u=s.x,a=s.y,f=o.x,l=o.y,c=0,h=1,p=f-u,d=l-a,v;v=e-u;if(!p&&v>0)return;v/=p;if(p<0){if(v<c)return;v<h&&(h=v)}else if(p>0){if(v>h)return;v>c&&(c=v)}v=n-u;if(!p&&v<0)return;v/=p;if(p<0){if(v>h)return;v>c&&(c=v)}else if(p>0){if(v<c)return;v<h&&(h=v)}v=t-a;if(!d&&v>0)return;v/=d;if(d<0){if(v<c)return;v<h&&(h=v)}else if(d>0){if(v>h)return;v>c&&(c=v)}v=r-a;if(!d&&v<0)return;v/=d;if(d<0){if(v>h)return;v>c&&(c=v)}else if(d>0){if(v<c)return;v<h&&(h=v)}return c>0&&(i.a={x:u+c*p,y:a+c*d}),h<1&&(i.b={x:u+h*p,y:a+h*d}),i}}function xi(t,n,r,i){function s(e,i){return b(e[0]-t)<kt?i>0?0:3:b(e[0]-r)<kt?i>0?2:1:b(e[1]-n)<kt?i>0?1:0:i>0?3:2}function o(e,t){return u(e.x,t.x)}function u(e,t){var n=s(e,1),r=s(t,1);return n!==r?n-r:n===0?t[1]-e[1]:n===1?e[0]-t[0]:n===2?e[1]-t[1]:t[0]-e[0]}return function(a){function m(e){var t=0,n=p.length,r=e[1];for(var i=0;i<n;++i)for(var s=1,o=p[i],u=o.length,a=o[0],f;s<u;++s)f=o[s],a[1]<=r?f[1]>r&&Bt(a,f,e)>0&&++t:f[1]<=r&&Bt(a,f,e)<0&&--t,a=f;return t!==0}function g(e,o,a,f){var l=0,c=0;if(e==null||(l=s(e,a))!==(c=s(o,a))||u(e,o)<0^a>0){do f.point(l===0||l===3?t:r,l>1?i:n);while((l=(l+a+4)%4)!==c)}else f.point(o[0],o[1])}function y(e,s){return t<=e&&e<=r&&n<=s&&s<=i}function b(e,t){y(e,t)&&a.point(e,t)}function L(){v.point=O,p&&p.push(d=[]),C=!0,N=!1,x=T=NaN}function A(){h&&(O(w,E),S&&N&&l.rejoin(),h.push(l.buffer())),v.point=b,N&&a.lineEnd()}function O(e,t){e=Math.max(-Si,Math.min(Si,e)),t=Math.max(-Si,Math.min(Si,t));var n=y(e,t);p&&d.push([e,t]);if(C)w=e,E=t,S=n,C=!1,n&&(a.lineStart(),a.point(e,t));else if(n&&N)a.point(e,t);else{var r={a:{x:x,y:T},b:{x:e,y:t}};c(r)?(N||(a.lineStart(),a.point(r.a.x,r.a.y)),a.point(r.b.x,r.b.y),n||a.lineEnd(),k=!1):n&&(a.lineStart(),a.point(e,t),k=!1)}x=e,T=t,N=n}var f=a,l=pi(),c=Ei(t,n,r,i),h,p,d,v={point:b,lineStart:L,lineEnd:A,polygonStart:function(){a=l,h=[],p=[],k=!0},polygonEnd:function(){a=f,h=e.merge(h);var n=m([t,i]),r=k&&n,s=h.length;if(r||s)a.polygonStart(),r&&(a.lineStart(),g(null,null,1,a),a.lineEnd()),s&&ai(h,o,n,g,a),a.polygonEnd();h=p=d=null}},w,E,S,x,T,N,C,k;return v}}function Ti(e){var t=0,n=At/3,r=Ki(e),i=r(t,n);return i.parallels=function(e){return arguments.length?r(t=e[0]*At/180,n=e[1]*At/180):[t/At*180,n/At*180]},i}function Ni(e,t){function o(e,t){var n=Math.sqrt(i-2*r*Math.sin(t))/r;return[n*Math.sin(e*=r),s-n*Math.cos(e)]}var n=Math.sin(e),r=(n+Math.sin(t))/2,i=1+n*(2*r-n),s=Math.sqrt(i)/r;return o.invert=function(e,t){var n=s-t;return[Math.atan2(e,n)/r,Ft((i-(e*e+n*n)*r*r)/(2*r))]},o}function Ai(){function i(e,t){ki+=r*e-n*t,n=e,r=t}var e,t,n,r;Li.point=function(s,o){Li.point=i,e=n=s,t=r=o},Li.lineEnd=function(){i(e,t)}}function Hi(e,t){e<Oi&&(Oi=e),e>_i&&(_i=e),t<Mi&&(Mi=t),t>Di&&(Di=t)}function Bi(){function r(n,r){t.push("M",n,",",r,e)}function i(e,r){t.push("M",e,",",r),n.point=s}function s(e,n){t.push("L",e,",",n)}function o(){n.point=r}function u(){t.push("Z")}var e=ji(4.5),t=[],n={point:r,lineStart:function(){n.point=i},lineEnd:o,polygonStart:function(){n.lineEnd=u},polygonEnd:function(){n.lineEnd=o,n.point=r},pointRadius:function(t){return e=ji(t),n},result:function(){if(t.length){var e=t.join("");return t=[],e}}};return n}function ji(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+ -2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}function Ii(e,t){Xr+=e,Vr+=t,++$r}function qi(){function n(n,r){var i=n-e,s=r-t,o=Math.sqrt(i*i+s*s);Jr+=o*(e+n)/2,Kr+=o*(t+r)/2,Qr+=o,Ii(e=n,t=r)}var e,t;Fi.point=function(r,i){Fi.point=n,Ii(e=r,t=i)}}function Ri(){Fi.point=Ii}function Ui(){function i(e,t){var i=e-n,s=t-r,o=Math.sqrt(i*i+s*s);Jr+=o*(n+e)/2,Kr+=o*(r+t)/2,Qr+=o,o=r*e-n*t,Gr+=o*(n+e),Yr+=o*(r+t),Zr+=o*3,Ii(n=e,r=t)}var e,t,n,r;Fi.point=function(s,o){Fi.point=i,Ii(e=n=s,t=r=o)},Fi.lineEnd=function(){i(e,t)}}function zi(e){function r(n,r){e.moveTo(n+t,r),e.arc(n,r,t,0,Ot)}function i(t,r){e.moveTo(t,r),n.point=s}function s(t,n){e.lineTo(t,n)}function o(){n.point=r}function u(){e.closePath()}var t=4.5,n={point:r,lineStart:function(){n.point=i},lineEnd:o,polygonStart:function(){n.lineEnd=u},polygonEnd:function(){n.lineEnd=o,n.point=r},pointRadius:function(e){return t=e,n},result:j};return n}function Wi(e){function i(e){return(r?o:s)(e)}function s(t){return $i(t,function(n,r){n=e(n,r),t.point(n[0],n[1])})}function o(t){function y(n,r){n=e(n,r),t.point(n[0],n[1])}function b(){h=NaN,g.point=w,t.lineStart()}function w(n,i){var s=Hr([n,i]),o=e(n,i);u(h,p,c,d,v,m,h=o[0],p=o[1],c=n,d=s[0],v=s[1],m=s[2],r,t),t.point(h,p)}function E(){g.point=y,t.lineEnd()}function S(){b(),g.point=x,g.lineEnd=T}function x(e,t){w(n=e,i=t),s=h,o=p,a=d,f=v,l=m,g.point=w}function T(){u(h,p,c,d,v,m,s,o,n,a,f,l,r,t),g.lineEnd=E,E()}var n,i,s,o,a,f,l,c,h,p,d,v,m,g={point:y,lineStart:b,lineEnd:E,polygonStart:function(){t.polygonStart(),g.lineStart=S},polygonEnd:function(){t.polygonEnd(),g.lineStart=b}};return g}function u(r,i,s,o,a,f,l,c,h,p,d,v,m,g){var y=l-r,w=c-i,E=y*y+w*w;if(E>4*t&&m--){var S=o+p,x=a+d,T=f+v,N=Math.sqrt(S*S+x*x+T*T),C=Math.asin(T/=N),k=b(b(T)-1)<kt||b(s-h)<kt?(s+h)/2:Math.atan2(x,S),L=e(k,C),A=L[0],O=L[1],M=A-r,_=O-i,D=w*M-y*_;if(D*D/E>t||b((y*M+w*_)/E-.5)>.3||o*p+a*d+f*v<n)u(r,i,s,o,a,f,A,O,k,S/=N,x/=N,T,m,g),g.point(A,O),u(A,O,k,S,x,T,l,c,h,p,d,v,m,g)}}var t=.5,n=Math.cos(30*Dt),r=16;return i.precision=function(e){return arguments.length?(r=(t=e*e)>0&&16,i):Math.sqrt(t)},i}function Xi(e){var t=Wi(function(t,n){return e([t*Pt,n*Pt])});return function(e){return Qi(t(e))}}function Vi(e){this.stream=e}function $i(e,t){return{point:t,sphere:function(){e.sphere()},lineStart:function(){e.lineStart()},lineEnd:function(){e.lineEnd()},polygonStart:function(){e.polygonStart()},polygonEnd:function(){e.polygonEnd()}}}function Ji(e){return Ki(function(){return e})()}function Ki(t){function E(e){return e=i(e[0]*Dt,e[1]*Dt),[e[0]*o+d,v-e[1]*o]}function S(e){return e=i.invert((e[0]-d)/o,(v-e[1])/o),e&&[e[0]*Pt,e[1]*Pt]}function x(){i=oi(r=Zi(c,h,p),n);var e=n(f,l);return d=u-e[0]*o,v=a+e[1]*o,T()}function T(){return w&&(w.valid=!1,w=null),E}var n,r,i,s=Wi(function(e,t){return e=n(e,t),[e[0]*o+d,v-e[1]*o]}),o=150,u=480,a=250,f=0,l=0,c=0,h=0,p=0,d,v,m=vi,g=D,y=null,b=null,w;return E.stream=function(e){return w&&(w.valid=!1),w=Qi(m(r,s(g(e)))),w.valid=!0,w},E.clipAngle=function(e){return arguments.length?(m=e==null?(y=e,vi):wi((y=+e)*Dt),T()):y},E.clipExtent=function(e){return arguments.length?(b=e,g=e?xi(e[0][0],e[0][1],e[1][0],e[1][1]):D,T()):b},E.scale=function(e){return arguments.length?(o=+e,x()):o},E.translate=function(e){return arguments.length?(u=+e[0],a=+e[1],x()):[u,a]},E.center=function(e){return arguments.length?(f=e[0]%360*Dt,l=e[1]%360*Dt,x()):[f*Pt,l*Pt]},E.rotate=function(e){return arguments.length?(c=e[0]%360*Dt,h=e[1]%360*Dt,p=e.length>2?e[2]%360*Dt:0,x()):[c*Pt,h*Pt,p*Pt]},e.rebind(E,s,"precision"),function(){return n=t.apply(this,arguments),E.invert=n.invert&&S,x()}}function Qi(e){return $i(e,function(t,n){e.point(t*Dt,n*Dt)})}function Gi(e,t){return[e,t]}function Yi(e,t){return[e>At?e-Ot:e<-At?e+Ot:e,t]}function Zi(e,t,n){return e?t||n?oi(ts(e),ns(t,n)):ts(e):t||n?ns(t,n):Yi}function es(e){return function(t,n){return t+=e,[t>At?t-Ot:t<-At?t+Ot:t,n]}}function ts(e){var t=es(e);return t.invert=es(-e),t}function ns(e,t){function o(e,t){var o=Math.cos(t),u=Math.cos(e)*o,a=Math.sin(e)*o,f=Math.sin(t),l=f*n+u*r;return[Math.atan2(a*i-l*s,u*n-f*r),Ft(l*i+a*s)]}var n=Math.cos(e),r=Math.sin(e),i=Math.cos(t),s=Math.sin(t);return o.invert=function(e,t){var o=Math.cos(t),u=Math.cos(e)*o,a=Math.sin(e)*o,f=Math.sin(t),l=f*i-a*s;return[Math.atan2(a*i+f*s,u*n+l*r),Ft(l*n-u*r)]},o}function rs(e,t){var n=Math.cos(e),r=Math.sin(e);return function(i,s,o,u){var a=o*t;if(i!=null){i=is(n,i),s=is(n,s);if(o>0?i<s:i>s)i+=o*Ot}else i=e+o*Ot,s=e-.5*a;for(var f,l=i;o>0?l>s:l<s;l-=a)u.point((f=Rr([n,-r*Math.cos(l),-r*Math.sin(l)]))[0],f[1])}}function is(e,t){var n=Hr(t);n[0]-=e,qr(n);var r=jt(-n[1]);return((-n[2]<0?-r:r)+2*Math.PI-kt)%(2*Math.PI)}function ss(t,n,r){var i=e.range(t,n-kt,r).concat(n);return function(e){return i.map(function(t){return[e,t]})}}function os(t,n,r){var i=e.range(t,n-kt,r).concat(n);return function(e){return i.map(function(t){return[t,e]})}}function us(e){return e.source}function as(e){return e.target}function fs(e,t,n,r){var i=Math.cos(t),s=Math.sin(t),o=Math.cos(r),u=Math.sin(r),a=i*Math.cos(e),f=i*Math.sin(e),l=o*Math.cos(n),c=o*Math.sin(n),h=2*Math.asin(Math.sqrt(Ut(r-t)+i*o*Ut(n-e))),p=1/Math.sin(h),d=h?function(e){var t=Math.sin(e*=h)*p,n=Math.sin(h-e)*p,r=n*a+t*l,i=n*f+t*c,o=n*s+t*u;return[Math.atan2(i,r)*Pt,Math.atan2(o,Math.sqrt(r*r+i*i))*Pt]}:function(){return[e*Pt,t*Pt]};return d.distance=h,d}function hs(){function r(r,i){var s=Math.sin(i*=Dt),o=Math.cos(i),u=b((r*=Dt)-e),a=Math.cos(u);ls+=Math.atan2(Math.sqrt((u=o*Math.sin(u))*u+(u=n*s-t*o*a)*u),t*s+n*o*a),e=r,t=s,n=o}var e,t,n;cs.point=function(i,s){e=i*Dt,t=Math.sin(s*=Dt),n=Math.cos(s),cs.point=r},cs.lineEnd=function(){cs.point=cs.lineEnd=j}}function ps(e,t){function n(t,n){var r=Math.cos(t),i=Math.cos(n),s=e(r*i);return[s*i*Math.sin(t),s*Math.sin(n)]}return n.invert=function(e,n){var r=Math.sqrt(e*e+n*n),i=t(r),s=Math.sin(i),o=Math.cos(i);return[Math.atan2(e*s,r*o),Math.asin(r&&n*s/r)]},n}function ms(e,t){function o(e,t){s>0?t<-_t+kt&&(t=-_t+kt):t>_t-kt&&(t=_t-kt);var n=s/Math.pow(r(t),i);return[n*Math.sin(i*e),s-n*Math.cos(i*e)]}var n=Math.cos(e),r=function(e){return Math.tan(At/4+e/2)},i=e===t?Math.sin(e):Math.log(n/Math.cos(t))/Math.log(r(t)/r(e)),s=n*Math.pow(r(e),i)/i;return i?(o.invert=function(e,t){var n=s-t,r=Ht(i)*Math.sqrt(e*e+n*n);return[Math.atan2(e,n)/i,2*Math.atan(Math.pow(s/r,1/i))-_t]},o):bs}function gs(e,t){function s(e,t){var n=i-t;return[n*Math.sin(r*e),i-n*Math.cos(r*e)]}var n=Math.cos(e),r=e===t?Math.sin(e):(n-Math.cos(t))/(t-e),i=n/r+e;return b(r)<kt?Gi:(s.invert=function(e,t){var n=i-t;return[Math.atan2(e,n)/r,i-Ht(r)*Math.sqrt(e*e+n*n)]},s)}function bs(e,t){return[e,Math.log(Math.tan(At/4+t/2))]}function ws(e){var t=Ji(e),n=t.scale,r=t.translate,i=t.clipExtent,s;return t.scale=function(){var e=n.apply(t,arguments);return e===t?s?t.clipExtent(null):t:e},t.translate=function(){var e=r.apply(t,arguments);return e===t?s?t.clipExtent(null):t:e},t.clipExtent=function(e){var o=i.apply(t,arguments);if(o===t){if(s=e==null){var u=At*n(),a=r();i([[a[0]-u,a[1]-u],[a[0]+u,a[1]+u]])}}else s&&(o=null);return o},t.clipExtent(null)}function xs(e,t){return[Math.log(Math.tan(At/4+t/2)),-e]}function Ts(e){return e[0]}function Ns(e){return e[1]}function Cs(e){var t=e.length,n=[0,1],r=2;for(var i=2;i<t;i++){while(r>1&&Bt(e[n[r-2]],e[n[r-1]],e[i])<=0)--r;n[r++]=i}return n.slice(0,r)}function ks(e,t){return e[0]-t[0]||e[1]-t[1]}function As(e,t,n){return(n[0]-t[0])*(e[1]-t[1])<(n[1]-t[1])*(e[0]-t[0])}function Os(e,t,n,r){var i=e[0],s=n[0],o=t[0]-i,u=r[0]-s,a=e[1],f=n[1],l=t[1]-a,c=r[1]-f,h=(u*(a-f)-c*(i-s))/(c*o-u*l);return[i+h*o,a+h*l]}function Ms(e){var t=e[0],n=e[e.length-1];return!(t[0]-n[0]||t[1]-n[1])}function Is(){oo(this),this.edge=this.site=this.circle=null}function qs(e){var t=Hs.pop()||new Is;return t.site=e,t}function Rs(e){Gs(e),Ps.remove(e),Hs.push(e),oo(e)}function Us(e){var t=e.circle,n=t.x,r=t.cy,i={x:n,y:r},s=e.P,o=e.N,u=[e];Rs(e);var a=s;while(a.circle&&b(n-a.circle.x)<kt&&b(r-a.circle.cy)<kt)s=a.P,u.unshift(a),Rs(a),a=s;u.unshift(a),Gs(a);var f=o;while(f.circle&&b(n-f.circle.x)<kt&&b(r-f.circle.cy)<kt)o=f.N,u.push(f),Rs(f),f=o;u.push(f),Gs(f);var l=u.length,c;for(c=1;c<l;++c)f=u[c],a=u[c-1],ro(f.edge,a.site,f.site,i);a=u[0],f=u[l-1],f.edge=to(a.site,f.site,null,i),Qs(a),Qs(f)}function zs(e){var t=e.x,n=e.y,r,i,s,o,u=Ps._;while(u){s=Ws(u,n)-t;if(s>kt)u=u.L;else{o=t-Xs(u,n);if(!(o>kt)){s>-kt?(r=u.P,i=u):o>-kt?(r=u,i=u.N):r=i=u;break}if(!u.R){r=u;break}u=u.R}}var a=qs(e);Ps.insert(r,a);if(!r&&!i)return;if(r===i){Gs(r),i=qs(r.site),Ps.insert(a,i),a.edge=i.edge=to(r.site,a.site),Qs(r),Qs(i);return}if(!i){a.edge=to(r.site,a.site);return}Gs(r),Gs(i);var f=r.site,l=f.x,c=f.y,h=e.x-l,p=e.y-c,d=i.site,v=d.x-l,m=d.y-c,g=2*(h*m-p*v),y=h*h+p*p,b=v*v+m*m,w={x:(m*y-p*b)/g+l,y:(h*b-v*y)/g+c};ro(i.edge,f,d,w),a.edge=to(f,e,null,w),i.edge=to(e,d,null,w),Qs(r),Qs(i)}function Ws(e,t){var n=e.site,r=n.x,i=n.y,s=i-t;if(!s)return r;var o=e.P;if(!o)return-Infinity;n=o.site;var u=n.x,a=n.y,f=a-t;if(!f)return u;var l=u-r,c=1/s-1/f,h=l/f;return c?(-h+Math.sqrt(h*h-2*c*(l*l/(-2*f)-a+f/2+i-s/2)))/c+r:(r+u)/2}function Xs(e,t){var n=e.N;if(n)return Ws(n,t);var r=e.site;return r.y===t?r.x:Infinity}function Vs(e){this.site=e,this.edges=[]}function $s(e){var t=e[0][0],n=e[1][0],r=e[0][1],i=e[1][1],s,o,u,a,f=Ds,l=f.length,c,h,p,d,v,m;while(l--){c=f[l];if(!c||!c.prepare())continue;p=c.edges,d=p.length,h=0;while(h<d){m=p[h].end(),u=m.x,a=m.y,v=p[++h%d].start(),s=v.x,o=v.y;if(b(u-s)>kt||b(a-o)>kt)p.splice(h,0,new io(no(c.site,m,b(u-t)<kt&&i-a>kt?{x:t,y:b(s-t)<kt?o:i}:b(a-i)<kt&&n-u>kt?{x:b(o-i)<kt?s:n,y:i}:b(u-n)<kt&&a-r>kt?{x:n,y:b(s-n)<kt?o:r}:b(a-r)<kt&&u-t>kt?{x:b(o-r)<kt?s:t,y:r}:null),c.site,null)),++d}}}function Js(e,t){return t.angle-e.angle}function Ks(){oo(this),this.x=this.y=this.arc=this.site=this.cy=null}function Qs(e){var t=e.P,n=e.N;if(!t||!n)return;var r=t.site,i=e.site,s=n.site;if(r===s)return;var o=i.x,u=i.y,a=r.x-o,f=r.y-u,l=s.x-o,c=s.y-u,h=2*(a*c-f*l);if(h>=-Lt)return;var p=a*a+f*f,d=l*l+c*c,v=(c*p-f*d)/h,m=(a*d-l*p)/h,c=m+u,g=Fs.pop()||new Ks;g.arc=e,g.site=i,g.x=v+o,g.y=c+Math.sqrt(v*v+m*m),g.cy=c,e.circle=g;var y=null,b=js._;while(b)if(g.y<b.y||g.y===b.y&&g.x<=b.x){if(!b.L){y=b.P;break}b=b.L}else{if(!b.R){y=b;break}b=b.R}js.insert(y,g),y||(Bs=g)}function Gs(e){var t=e.circle;t&&(t.P||(Bs=t.N),js.remove(t),Fs.push(t),oo(t),e.circle=null)}function Ys(e){var t=_s,n=Ei(e[0][0],e[0][1],e[1][0],e[1][1]),r=t.length,i;while(r--){i=t[r];if(!Zs(i,e)||!n(i)||b(i.a.x-i.b.x)<kt&&b(i.a.y-i.b.y)<kt)i.a=i.b=null,t.splice(r,1)}}function Zs(e,t){var n=e.b;if(n)return!0;var r=e.a,i=t[0][0],s=t[1][0],o=t[0][1],u=t[1][1],a=e.l,f=e.r,l=a.x,c=a.y,h=f.x,p=f.y,d=(l+h)/2,v=(c+p)/2,m,g;if(p===c){if(d<i||d>=s)return;if(l>h){if(!r)r={x:d,y:o};else if(r.y>=u)return;n={x:d,y:u}}else{if(!r)r={x:d,y:u};else if(r.y<o)return;n={x:d,y:o}}}else{m=(l-h)/(p-c),g=v-m*d;if(m<-1||m>1)if(l>h){if(!r)r={x:(o-g)/m,y:o};else if(r.y>=u)return;n={x:(u-g)/m,y:u}}else{if(!r)r={x:(u-g)/m,y:u};else if(r.y<o)return;n={x:(o-g)/m,y:o}}else if(c<p){if(!r)r={x:i,y:m*i+g};else if(r.x>=s)return;n={x:s,y:m*s+g}}else{if(!r)r={x:s,y:m*s+g};else if(r.x<i)return;n={x:i,y:m*i+g}}}return e.a=r,e.b=n,!0}function eo(e,t){this.l=e,this.r=t,this.a=this.b=null}function to(e,t,n,r){var i=new eo(e,t);return _s.push(i),n&&ro(i,e,t,n),r&&ro(i,t,e,r),Ds[e.i].edges.push(new io(i,e,t)),Ds[t.i].edges.push(new io(i,t,e)),i}function no(e,t,n){var r=new eo(e,null);return r.a=t,r.b=n,_s.push(r),r}function ro(e,t,n,r){!e.a&&!e.b?(e.a=r,e.l=t,e.r=n):e.l===n?e.b=r:e.a=r}function io(e,t,n){var r=e.a,i=e.b;this.edge=e,this.site=t,this.angle=n?Math.atan2(n.y-t.y,n.x-t.x):e.l===t?Math.atan2(i.x-r.x,r.y-i.y):Math.atan2(r.x-i.x,i.y-r.y)}function so(){this._=null}function oo(e){e.U=e.C=e.L=e.R=e.P=e.N=null}function uo(e,t){var n=t,r=t.R,i=n.U;i?i.L===n?i.L=r:i.R=r:e._=r,r.U=i,n.U=r,n.R=r.L,n.R&&(n.R.U=n),r.L=n}function ao(e,t){var n=t,r=t.L,i=n.U;i?i.L===n?i.L=r:i.R=r:e._=r,r.U=i,n.U=r,n.L=r.R,n.L&&(n.L.U=n),r.R=n}function fo(e){while(e.L)e=e.L;return e}function lo(e,t){var n=e.sort(co).pop(),r,i,s;_s=[],Ds=new Array(e.length),Ps=new so,js=new so;for(;;){s=Bs;if(n&&(!s||n.y<s.y||n.y===s.y&&n.x<s.x)){if(n.x!==r||n.y!==i)Ds[n.i]=new Vs(n),zs(n),r=n.x,i=n.y;n=e.pop()}else{if(!s)break;Us(s.arc)}}t&&(Ys(t),$s(t));var o={cells:Ds,edges:_s};return Ps=js=_s=Ds=null,o}function co(e,t){return t.y-e.y||t.x-e.x}function po(e,t,n){return(e.x-n.x)*(t.y-e.y)-(e.x-t.x)*(n.y-e.y)}function vo(e){return e.x}function mo(e){return e.y}function go(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function yo(e,t,n,r,i,s){if(!e(t,n,r,i,s)){var o=(n+i)*.5,u=(r+s)*.5,a=t.nodes;a[0]&&yo(e,a[0],n,r,o,u),a[1]&&yo(e,a[1],o,r,i,u),a[2]&&yo(e,a[2],n,u,o,s),a[3]&&yo(e,a[3],o,u,i,s)}}function bo(e,t,n,r,i,s,o){var u=Infinity,a;return function f(e,l,c,h,p){if(l>s||c>o||h<r||p<i)return;if(d=e.point){var d,v=t-e.x,m=n-e.y,g=v*v+m*m;if(g<u){var y=Math.sqrt(u=g);r=t-y,i=n-y,s=t+y,o=n+y,a=d}}var b=e.nodes,w=(l+h)*.5,E=(c+p)*.5,S=t>=w,x=n>=E;for(var T=x<<1|S,N=T+4;T<N;++T)if(e=b[T&3])switch(T&3){case 0:f(e,l,c,w,E);break;case 1:f(e,w,c,h,E);break;case 2:f(e,l,E,w,p);break;case 3:f(e,w,E,h,p)}}(e,r,i,s,o),a}function wo(t,n){t=e.rgb(t),n=e.rgb(n);var r=t.r,i=t.g,s=t.b,o=n.r-r,u=n.g-i,a=n.b-s;return function(e){return"#"+yn(Math.round(r+o*e))+yn(Math.round(i+u*e))+yn(Math.round(s+a*e))}}function Eo(e,t){var n={},r={},i;for(i in e)i in t?n[i]=Co(e[i],t[i]):r[i]=e[i];for(i in t)i in e||(r[i]=t[i]);return function(e){for(i in n)r[i]=n[i](e);return r}}function So(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function xo(e,t){var n=To.lastIndex=No.lastIndex=0,r,i,s,o=-1,u=[],a=[];e+="",t+="";while((r=To.exec(e))&&(i=No.exec(t)))(s=i.index)>n&&(s=t.slice(n,s),u[o]?u[o]+=s:u[++o]=s),(r=r[0])===(i=i[0])?u[o]?u[o]+=i:u[++o]=i:(u[++o]=null,a.push({i:o,x:So(r,i)})),n=No.lastIndex;return n<t.length&&(s=t.slice(n),u[o]?u[o]+=s:u[++o]=s),u.length<2?a[0]?(t=a[0].x,function(e){return t(e)+""}):function(){return t}:(t=a.length,function(e){for(var n=0,r;n<t;++n)u[(r=a[n]).i]=r.x(e);return u.join("")})}function Co(t,n){var r=e.interpolators.length,i;while(--r>=0&&!(i=e.interpolators[r](t,n)));return i}function ko(e,t){var n=[],r=[],i=e.length,s=t.length,o=Math.min(e.length,t.length),u;for(u=0;u<o;++u)n.push(Co(e[u],t[u]));for(;u<i;++u)r[u]=e[u];for(;u<s;++u)r[u]=t[u];return function(e){for(u=0;u<o;++u)r[u]=n[u](e);return r}}function Mo(e){return function(t){return t<=0?0:t>=1?1:e(t)}}function _o(e){return function(t){return 1-e(1-t)}}function Do(e){return function(t){return.5*(t<.5?e(2*t):2-e(2-2*t))}}function Po(e){return e*e}function Ho(e){return e*e*e}function Bo(e){if(e<=0)return 0;if(e>=1)return 1;var t=e*e,n=t*e;return 4*(e<.5?n:3*(e-t)+n-.75)}function jo(e){return function(t){return Math.pow(t,e)}}function Fo(e){return 1-Math.cos(e*_t)}function Io(e){return Math.pow(2,10*(e-1))}function qo(e){return 1-Math.sqrt(1-e*e)}function Ro(e,t){var n;return arguments.length<2&&(t=.45),arguments.length?n=t/Ot*Math.asin(1/e):(e=1,n=t/4),function(r){return 1+e*Math.pow(2,-10*r)*Math.sin((r-n)*Ot/t)}}function Uo(e){return e||(e=1.70158),function(t){return t*t*((e+1)*t-e)}}function zo(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}function Wo(t,n){t=e.hcl(t),n=e.hcl(n);var r=t.h,i=t.c,s=t.l,o=n.h-r,u=n.c-i,a=n.l-s;return isNaN(u)&&(u=0,i=isNaN(i)?n.c:i),isNaN(o)?(o=0,r=isNaN(r)?n.h:r):o>180?o-=360:o<-180&&(o+=360),function(e){return tn(r+o*e,i+u*e,s+a*e)+""}}function Xo(t,n){t=e.hsl(t),n=e.hsl(n);var r=t.h,i=t.s,s=t.l,o=n.h-r,u=n.s-i,a=n.l-s;return isNaN(u)&&(u=0,i=isNaN(i)?n.s:i),isNaN(o)?(o=0,r=isNaN(r)?n.h:r):o>180?o-=360:o<-180&&(o+=360),function(e){return Yt(r+o*e,i+u*e,s+a*e)+""}}function Vo(t,n){t=e.lab(t),n=e.lab(n);var r=t.l,i=t.a,s=t.b,o=n.l-r,u=n.a-i,a=n.b-s;return function(e){return fn(r+o*e,i+u*e,s+a*e)+""}}function $o(e,t){return t-=e,function(n){return Math.round(e+t*n)}}function Jo(e){var t=[e.a,e.b],n=[e.c,e.d],r=Qo(t),i=Ko(t,n),s=Qo(Go(n,t,-i))||0;t[0]*n[1]<n[0]*t[1]&&(t[0]*=-1,t[1]*=-1,r*=-1,i*=-1),this.rotate=(r?Math.atan2(t[1],t[0]):Math.atan2(-n[0],n[1]))*Pt,this.translate=[e.e,e.f],this.scale=[r,s],this.skew=s?Math.atan2(i,s)*Pt:0}function Ko(e,t){return e[0]*t[0]+e[1]*t[1]}function Qo(e){var t=Math.sqrt(Ko(e,e));return t&&(e[0]/=t,e[1]/=t),t}function Go(e,t,n){return e[0]+=n*t[0],e[1]+=n*t[1],e}function Zo(e){return e.length?e.pop()+",":""}function eu(e,t,n,r){if(e[0]!==t[0]||e[1]!==t[1]){var i=n.push("translate(",null,",",null,")");r.push({i:i-4,x:So(e[0],t[0])},{i:i-2,x:So(e[1],t[1])})}else(t[0]||t[1])&&n.push("translate("+t+")")}function tu(e,t,n,r){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),r.push({i:n.push(Zo(n)+"rotate(",null,")")-2,x:So(e,t)})):t&&n.push(Zo(n)+"rotate("+t+")")}function nu(e,t,n,r){e!==t?r.push({i:n.push(Zo(n)+"skewX(",null,")")-2,x:So(e,t)}):t&&n.push(Zo(n)+"skewX("+t+")")}function ru(e,t,n,r){if(e[0]!==t[0]||e[1]!==t[1]){var i=n.push(Zo(n)+"scale(",null,",",null,")");r.push({i:i-4,x:So(e[0],t[0])},{i:i-2,x:So(e[1],t[1])})}else(t[0]!==1||t[1]!==1)&&n.push(Zo(n)+"scale("+t+")")}function iu(t,n){var r=[],i=[];return t=e.transform(t),n=e.transform(n),eu(t.translate,n.translate,r,i),tu(t.rotate,n.rotate,r,i),nu(t.skew,n.skew,r,i),ru(t.scale,n.scale,r,i),t=n=null,function(e){var t=-1,n=i.length,s;while(++t<n)r[(s=i[t]).i]=s.x(e);return r.join("")}}function su(e,t){return t=(t-=e=+e)||1/t,function(n){return(n-e)/t}}function ou(e,t){return t=(t-=e=+e)||1/t,function(n){return Math.max(0,Math.min(1,(n-e)/t))}}function uu(e){var t=e.source,n=e.target,r=fu(t,n),i=[t];while(t!==r)t=t.parent,i.push(t);var s=i.length;while(n!==r)i.splice(s,0,n),n=n.parent;return i}function au(e){var t=[],n=e.parent;while(n!=null)t.push(e),e=n,n=n.parent;return t.push(e),t}function fu(e,t){if(e===t)return e;var n=au(e),r=au(t),i=n.pop(),s=r.pop(),o=null;while(i===s)o=i,i=n.pop(),s=r.pop();return o}function lu(e){e.fixed|=2}function cu(e){e.fixed&=-7}function hu(e){e.fixed|=4,e.px=e.x,e.py=e.y}function pu(e){e.fixed&=-5}function du(e,t,n){var r=0,i=0;e.charge=0;if(!e.leaf){var s=e.nodes,o=s.length,u=-1,a;while(++u<o){a=s[u];if(a==null)continue;du(a,t,n),e.charge+=a.charge,r+=a.charge*a.cx,i+=a.charge*a.cy}}if(e.point){e.leaf||(e.point.x+=Math.random()-.5,e.point.y+=Math.random()-.5);var f=t*n[e.point.index];e.charge+=e.pointCharge=f,r+=f*e.point.x,i+=f*e.point.y}e.cx=r/e.charge,e.cy=i/e.charge}function yu(t,n){return e.rebind(t,n,"sort","children","value"),t.nodes=t,t.links=Tu,t}function bu(e,t){var n=[e];while((e=n.pop())!=null){t(e);if((i=e.children)&&(r=i.length)){var r,i;while(--r>=0)n.push(i[r])}}}function wu(e,t){var n=[e],r=[];while((e=n.pop())!=null){r.push(e);if((o=e.children)&&(s=o.length)){var i=-1,s,o;while(++i<s)n.push(o[i])}}while((e=r.pop())!=null)t(e)}function Eu(e){return e.children}function Su(e){return e.value}function xu(e,t){return t.value-e.value}function Tu(t){return e.merge(t.map(function(e){return(e.children||[]).map(function(t){return{source:e,target:t}})}))}function Cu(e){return e.x}function ku(e){return e.y}function Lu(e,t,n){e.y0=t,e.y=n}function Mu(t){return e.range(t.length)}function _u(e){var t=-1,n=e[0].length,r=[];while(++t<n)r[t]=0;return r}function Du(e){var t=1,n=0,r=e[0][1],i,s=e.length;for(;t<s;++t)(i=e[t][1])>r&&(n=t,r=i);return n}function Pu(e){return e.reduce(Hu,0)}function Hu(e,t){return e+t[1]}function Bu(e,t){return ju(e,Math.ceil(Math.log(t.length)/Math.LN2+1))}function ju(e,t){var n=-1,r=+e[0],i=(e[1]-r)/t,s=[];while(++n<=t)s[n]=i*n+r;return s}function Fu(t){return[e.min(t),e.max(t)]}function Iu(e,t){return e.value-t.value}function qu(e,t){var n=e._pack_next;e._pack_next=t,t._pack_prev=e,t._pack_next=n,n._pack_prev=t}function Ru(e,t){e._pack_next=t,t._pack_prev=e}function Uu(e,t){var n=t.x-e.x,r=t.y-e.y,i=e.r+t.r;return.999*i*i>n*n+r*r}function zu(e){function p(e){n=Math.min(e.x-e.r,n),r=Math.max(e.x+e.r,r),i=Math.min(e.y-e.r,i),s=Math.max(e.y+e.r,s)}if(!(t=e.children)||!(h=t.length))return;var t,n=Infinity,r=-Infinity,i=Infinity,s=-Infinity,o,u,a,f,l,c,h;t.forEach(Wu),o=t[0],o.x=-o.r,o.y=0,p(o);if(h>1){u=t[1],u.x=u.r,u.y=0,p(u);if(h>2){a=t[2],$u(o,u,a),p(a),qu(o,a),o._pack_prev=a,qu(a,u),u=o._pack_next;for(f=3;f<h;f++){$u(o,u,a=t[f]);var d=0,v=1,m=1;for(l=u._pack_next;l!==u;l=l._pack_next,v++)if(Uu(l,a)){d=1;break}if(d==1)for(c=o._pack_prev;c!==l._pack_prev;c=c._pack_prev,m++)if(Uu(c,a))break;d?(v<m||v==m&&u.r<o.r?Ru(o,u=l):Ru(o=c,u),f--):(qu(o,a),u=a,p(a))}}}var g=(n+r)/2,y=(i+s)/2,b=0;for(f=0;f<h;f++)a=t[f],a.x-=g,a.y-=y,b=Math.max(b,a.r+Math.sqrt(a.x*a.x+a.y*a.y));e.r=b,t.forEach(Xu)}function Wu(e){e._pack_next=e._pack_prev=e}function Xu(e){delete e._pack_next,delete e._pack_prev}function Vu(e,t,n,r){var i=e.children;e.x=t+=r*e.x,e.y=n+=r*e.y,e.r*=r;if(i){var s=-1,o=i.length;while(++s<o)Vu(i[s],t,n,r)}}function $u(e,t,n){var r=e.r+n.r,i=t.x-e.x,s=t.y-e.y;if(r&&(i||s)){var o=t.r+n.r,u=i*i+s*s;o*=o,r*=r;var a=.5+(r-o)/(2*u),f=Math.sqrt(Math.max(0,2*o*(r+u)-(r-=u)*r-o*o))/(2*u);n.x=e.x+a*i+f*s,n.y=e.y+a*s-f*i}else n.x=e.x+r,n.y=e.y}function Ju(e,t){return e.parent==t.parent?1:2}function Ku(e){var t=e.children;return t.length?t[0]:e.t}function Qu(e){var t=e.children,n;return(n=t.length)?t[n-1]:e.t}function Gu(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}function Yu(e){var t=0,n=0,r=e.children,i=r.length,s;while(--i>=0)s=r[i],s.z+=t,s.m+=t,t+=s.s+(n+=s.c)}function Zu(e,t,n){return e.a.parent===t.parent?e.a:n}function ea(t){return 1+e.max(t,function(e){return e.y})}function ta(e){return e.reduce(function(e,t){return e+t.x},0)/e.length}function na(e){var t=e.children;return t&&t.length?na(t[0]):e}function ra(e){var t=e.children,n;return t&&(n=t.length)?ra(t[n-1]):e}function ia(e){return{x:e.x,y:e.y,dx:e.dx,dy:e.dy}}function sa(e,t){var n=e.x+t[3],r=e.y+t[0],i=e.dx-t[1]-t[3],s=e.dy-t[0]-t[2];return i<0&&(n+=i/2,i=0),s<0&&(r+=s/2,s=0),{x:n,y:r,dx:i,dy:s}}function oa(e){var t=e[0],n=e[e.length-1];return t<n?[t,n]:[n,t]}function ua(e){return e.rangeExtent?e.rangeExtent():oa(e.range())}function aa(e,t,n,r){var i=n(e[0],e[1]),s=r(t[0],t[1]);return function(e){return s(i(e))}}function fa(e,t){var n=0,r=e.length-1,i=e[n],s=e[r],o;return s<i&&(o=n,n=r,r=o,o=i,i=s,s=o),e[n]=t.floor(i),e[r]=t.ceil(s),e}function la(e){return e?{floor:function(t){return Math.floor(t/e)*e},ceil:function(t){return Math.ceil(t/e)*e}}:ca}function ha(t,n,r,i){var s=[],o=[],u=0,a=Math.min(t.length,n.length)-1;t[a]<t[0]&&(t=t.slice().reverse(),n=n.slice().reverse());while(++u<=a)s.push(r(t[u-1],t[u])),o.push(i(n[u-1],n[u]));return function(n){var r=e.bisect(t,n,1,a)-1;return o[r](s[r](n))}}function pa(e,t,n,r){function o(){var o=Math.min(e.length,t.length)>2?ha:aa,a=r?ou:su;return i=o(e,t,a,n),s=o(t,e,a,Co),u}function u(e){return i(e)}var i,s;return u.invert=function(e){return s(e)},u.domain=function(t){return arguments.length?(e=t.map(Number),o()):e},u.range=function(e){return arguments.length?(t=e,o()):t},u.rangeRound=function(e){return u.range(e).interpolate($o)},u.clamp=function(e){return arguments.length?(r=e,o()):r},u.interpolate=function(e){return arguments.length?(n=e,o()):n},u.ticks=function(t){return ga(e,t)},u.tickFormat=function(t,n){return ya(e,t,n)},u.nice=function(t){return va(e,t),o()},u.copy=function(){return pa(e,t,n,r)},o()}function da(t,n){return e.rebind(t,n,"range","rangeRound","interpolate","clamp")}function va(e,t){return fa(e,la(ma(e,t)[2])),fa(e,la(ma(e,t)[2])),e}function ma(e,t){t==null&&(t=10);var n=oa(e),r=n[1]-n[0],i=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),s=t/r*i;return s<=.15?i*=10:s<=.35?i*=5:s<=.75&&(i*=2),n[0]=Math.ceil(n[0]/i)*i,n[1]=Math.floor(n[1]/i)*i+i*.5,n[2]=i,n}function ga(t,n){return e.range.apply(e,ma(t,n))}function ya(t,n,r){var i=ma(t,n);if(r){var s=zn.exec(r);s.shift();if(s[8]==="s"){var o=e.formatPrefix(Math.max(b(i[0]),b(i[1])));return s[7]||(s[7]="."+wa(o.scale(i[2]))),s[8]="f",r=e.format(s.join("")),function(e){return r(o.scale(e))+o.symbol}}s[7]||(s[7]="."+Ea(s[8],i)),r=s.join("")}else r=",."+wa(i[2])+"f";return e.format(r)}function wa(e){return-Math.floor(Math.log(e)/Math.LN10+.01)}function Ea(e,t){var n=wa(t[2]);return e in ba?Math.abs(n-wa(Math.max(b(t[0]),b(t[1]))))+ +(e!=="e"):n-(e==="%")*2}function Sa(t,n,r,i){function s(e){return(r?Math.log(e<0?0:e):-Math.log(e>0?0:-e))/Math.log(n)}function o(e){return r?Math.pow(n,e):-Math.pow(n,-e)}function u(e){return t(s(e))}return u.invert=function(e){return o(t.invert(e))},u.domain=function(e){return arguments.length?(r=e[0]>=0,t.domain((i=e.map(Number)).map(s)),u):i},u.base=function(e){return arguments.length?(n=+e,t.domain(i.map(s)),u):n},u.nice=function(){var e=fa(i.map(s),r?Math:Ta);return t.domain(e),i=e.map(o),u},u.ticks=function(){var e=oa(i),t=[],u=e[0],a=e[1],f=Math.floor(s(u)),l=Math.ceil(s(a)),c=n%1?2:n;if(isFinite(l-f)){if(r){for(;f<l;f++)for(var h=1;h<c;h++)t.push(o(f)*h);t.push(o(f))}else{t.push(o(f));for(;f++<l;)for(var h=c-1;h>0;h--)t.push(o(f)*h)}for(f=0;t[f]<u;f++);for(l=t.length;t[l-1]>a;l--);t=t.slice(f,l)}return t},u.tickFormat=function(t,r){if(!arguments.length)return xa;arguments.length<2?r=xa:typeof r!="function"&&(r=e.format(r));var i=Math.max(1,n*t/u.ticks().length);return function(e){var t=e/o(Math.round(s(e)));return t*n<n-.5&&(t*=n),t<=i?r(e):""}},u.copy=function(){return Sa(t.copy(),n,r,i)},da(u,t)}function Na(e,t,n){function s(t){return e(r(t))}var r=Ca(t),i=Ca(1/t);return s.invert=function(t){return i(e.invert(t))},s.domain=function(t){return arguments.length?(e.domain((n=t.map(Number)).map(r)),s):n},s.ticks=function(e){return ga(n,e)},s.tickFormat=function(e,t){return ya(n,e,t)},s.nice=function(e){return s.domain(va(n,e))},s.exponent=function(o){return arguments.length?(r=Ca(t=o),i=Ca(1/t),e.domain(n.map(r)),s):t},s.copy=function(){return Na(e.copy(),t,n)},da(s,e)}function Ca(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function ka(t,n){function o(e){return i[((r.get(e)||(n.t==="range"?r.set(e,t.push(e)):NaN))-1)%i.length]}function u(n,r){return e.range(t.length).map(function(e){return n+r*e})}var r,i,s;return o.domain=function(e){if(!arguments.length)return t;t=[],r=new S;var i=-1,s=e.length,u;while(++i<s)r.has(u=e[i])||r.set(u,t.push(u));return o[n.t].apply(o,n.a)},o.range=function(e){return arguments.length?(i=e,s=0,n={t:"range",a:arguments},o):i},o.rangePoints=function(e,r){arguments.length<2&&(r=0);var a=e[0],f=e[1],l=t.length<2?(a=(a+f)/2,0):(f-a)/(t.length-1+r);return i=u(a+l*r/2,l),s=0,n={t:"rangePoints",a:arguments},o},o.rangeRoundPoints=function(e,r){arguments.length<2&&(r=0);var a=e[0],f=e[1],l=t.length<2?(a=f=Math.round((a+f)/2),0):(f-a)/(t.length-1+r)|0;return i=u(a+Math.round(l*r/2+(f-a-(t.length-1+r)*l)/2),l),s=0,n={t:"rangeRoundPoints",a:arguments},o},o.rangeBands=function(e,r,a){arguments.length<2&&(r=0),arguments.length<3&&(a=r);var f=e[1]<e[0],l=e[f-0],c=e[1-f],h=(c-l)/(t.length-r+2*a);return i=u(l+h*a,h),f&&i.reverse(),s=h*(1-r),n={t:"rangeBands",a:arguments},o},o.rangeRoundBands=function(e,r,a){arguments.length<2&&(r=0),arguments.length<3&&(a=r);var f=e[1]<e[0],l=e[f-0],c=e[1-f],h=Math.floor((c-l)/(t.length-r+2*a));return i=u(l+Math.round((c-l-(t.length-r)*h)/2),h),f&&i.reverse(),s=Math.round(h*(1-r)),n={t:"rangeRoundBands",a:arguments},o},o.rangeBand=function(){return s},o.rangeExtent=function(){return oa(n.a[0])},o.copy=function(){return ka(t,n)},o.domain(t)}function _a(t,n){function i(){var i=0,o=n.length;r=[];while(++i<o)r[i-1]=e.quantile(t,i/o);return s}function s(t){if(!isNaN(t=+t))return n[e.bisect(r,t)]}var r;return s.domain=function(e){return arguments.length?(t=e.map(d).filter(v).sort(p),i()):t},s.range=function(e){return arguments.length?(n=e,i()):n},s.quantiles=function(){return r},s.invertExtent=function(e){return e=n.indexOf(e),e<0?[NaN,NaN]:[e>0?r[e-1]:t[0],e<r.length?r[e]:t[t.length-1]]},s.copy=function(){return _a(t,n)},i()}function Da(e,t,n){function s(t){return n[Math.max(0,Math.min(i,Math.floor(r*(t-e))))]}function o(){return r=n.length/(t-e),i=n.length-1,s}var r,i;return s.domain=function(n){return arguments.length?(e=+n[0],t=+n[n.length-1],o()):[e,t]},s.range=function(e){return arguments.length?(n=e,o()):n},s.invertExtent=function(t){return t=n.indexOf(t),t=t<0?NaN:t/r+e,[t,t+1/r]},s.copy=function(){return Da(e,t,n)},o()}function Pa(t,n){function r(r){if(r<=r)return n[e.bisect(t,r)]}return r.domain=function(e){return arguments.length?(t=e,r):t},r.range=function(e){return arguments.length?(n=e,r):n},r.invertExtent=function(e){return e=n.indexOf(e),[t[e-1],t[e]]},r.copy=function(){return Pa(t,n)},r}function Ha(e){function t(e){return+e}return t.invert=t,t.domain=t.range=function(n){return arguments.length?(e=n.map(t),t):e},t.ticks=function(t){return ga(e,t)},t.tickFormat=function(t,n){return ya(e,t,n)},t.copy=function(){return Ha(e)},t}function Ba(){return 0}function Fa(e){return e.innerRadius}function Ia(e){return e.outerRadius}function qa(e){return e.startAngle}function Ra(e){return e.endAngle}function Ua(e){return e&&e.padAngle}function za(e,t,n,r){return(e-n)*t-(t-r)*e>0?0:1}function Wa(e,t,n,r,i){var s=e[0]-t[0],o=e[1]-t[1],u=(i?r:-r)/Math.sqrt(s*s+o*o),a=u*o,f=-u*s,l=e[0]+a,c=e[1]+f,h=t[0]+a,p=t[1]+f,d=(l+h)/2,v=(c+p)/2,m=h-l,g=p-c,y=m*m+g*g,b=n-r,w=l*p-h*c,E=(g<0?-1:1)*Math.sqrt(Math.max(0,b*b*y-w*w)),S=(w*g-m*E)/y,x=(-w*m-g*E)/y,T=(w*g+m*E)/y,N=(-w*m+g*E)/y,C=S-d,k=x-v,L=T-d,A=N-v;return C*C+k*k>L*L+A*A&&(S=T,x=N),[[S-a,x-f],[S*n/b,x*n/b]]}function Xa(e){function u(s){function d(){u.push("M",i(e(a),o))}var u=[],a=[],f=-1,l=s.length,c,h=Nn(t),p=Nn(n);while(++f<l)r.call(this,c=s[f],f)?a.push([+h.call(this,c,f),+p.call(this,c,f)]):a.length&&(d(),a=[]);return a.length&&d(),u.length?u.join(""):null}var t=Ts,n=Ns,r=ui,i=$a,s=i.key,o=.7;return u.x=function(e){return arguments.length?(t=e,u):t},u.y=function(e){return arguments.length?(n=e,u):n},u.defined=function(e){return arguments.length?(r=e,u):r},u.interpolate=function(e){return arguments.length?(typeof e=="function"?s=i=e:s=(i=Va.get(e)||$a).key,u):s},u.tension=function(e){return arguments.length?(o=e,u):o},u}function $a(e){return e.length>1?e.join("L"):e+"Z"}function Ja(e){return e.join("L")+"Z"}function Ka(e){var t=0,n=e.length,r=e[0],i=[r[0],",",r[1]];while(++t<n)i.push("H",(r[0]+(r=e[t])[0])/2,"V",r[1]);return n>1&&i.push("H",r[0]),i.join("")}function Qa(e){var t=0,n=e.length,r=e[0],i=[r[0],",",r[1]];while(++t<n)i.push("V",(r=e[t])[1],"H",r[0]);return i.join("")}function Ga(e){var t=0,n=e.length,r=e[0],i=[r[0],",",r[1]];while(++t<n)i.push("H",(r=e[t])[0],"V",r[1]);return i.join("")}function Ya(e,t){return e.length<4?$a(e):e[1]+tf(e.slice(1,-1),nf(e,t))}function Za(e,t){return e.length<3?Ja(e):e[0]+tf((e.push(e[0]),e),nf([e[e.length-2]].concat(e,[e[1]]),t))}function ef(e,t){return e.length<3?$a(e):e[0]+tf(e,nf(e,t))}function tf(e,t){if(t.length<1||e.length!=t.length&&e.length!=t.length+2)return $a(e);var n=e.length!=t.length,r="",i=e[0],s=e[1],o=t[0],u=o,a=1;n&&(r+="Q"+(s[0]-o[0]*2/3)+","+(s[1]-o[1]*2/3)+","+s[0]+","+s[1],i=e[1],a=2);if(t.length>1){u=t[1],s=e[a],a++,r+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(s[0]-u[0])+","+(s[1]-u[1])+","+s[0]+","+s[1];for(var f=2;f<t.length;f++,a++)s=e[a],u=t[f],r+="S"+(s[0]-u[0])+","+(s[1]-u[1])+","+s[0]+","+s[1]}if(n){var l=e[a];r+="Q"+(s[0]+u[0]*2/3)+","+(s[1]+u[1]*2/3)+","+l[0]+","+l[1]}return r}function nf(e,t){var n=[],r=(1-t)/2,i,s=e[0],o=e[1],u=1,a=e.length;while(++u<a)i=s,s=o,o=e[u],n.push([r*(o[0]-i[0]),r*(o[1]-i[1])]);return n}function rf(e){if(e.length<3)return $a(e);var t=1,n=e.length,r=e[0],i=r[0],s=r[1],o=[i,i,i,(r=e[1])[0]],u=[s,s,s,r[1]],a=[i,",",s,"L",af(cf,o),",",af(cf,u)];e.push(e[n-1]);while(++t<=n)r=e[t],o.shift(),o.push(r[0]),u.shift(),u.push(r[1]),hf(a,o,u);return e.pop(),a.push("L",r),a.join("")}function sf(e){if(e.length<4)return $a(e);var t=[],n=-1,r=e.length,i,s=[0],o=[0];while(++n<3)i=e[n],s.push(i[0]),o.push(i[1]);t.push(af(cf,s)+","+af(cf,o)),--n;while(++n<r)i=e[n],s.shift(),s.push(i[0]),o.shift(),o.push(i[1]),hf(t,s,o);return t.join("")}function of(e){var t,n=-1,r=e.length,i=r+4,s,o=[],u=[];while(++n<4)s=e[n%r],o.push(s[0]),u.push(s[1]);t=[af(cf,o),",",af(cf,u)],--n;while(++n<i)s=e[n%r],o.shift(),o.push(s[0]),u.shift(),u.push(s[1]),hf(t,o,u);return t.join("")}function uf(e,t){var n=e.length-1;if(n){var r=e[0][0],i=e[0][1],s=e[n][0]-r,o=e[n][1]-i,u=-1,a,f;while(++u<=n)a=e[u],f=u/n,a[0]=t*a[0]+(1-t)*(r+f*s),a[1]=t*a[1]+(1-t)*(i+f*o)}return rf(e)}function af(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function hf(e,t,n){e.push("C",af(ff,t),",",af(ff,n),",",af(lf,t),",",af(lf,n),",",af(cf,t),",",af(cf,n))}function pf(e,t){return(t[1]-e[1])/(t[0]-e[0])}function df(e){var t=0,n=e.length-1,r=[],i=e[0],s=e[1],o=r[0]=pf(i,s);while(++t<n)r[t]=(o+(o=pf(i=s,s=e[t+1])))/2;return r[t]=o,r}function vf(e){var t=[],n,r,i,s,o=df(e),u=-1,a=e.length-1;while(++u<a)n=pf(e[u],e[u+1]),b(n)<kt?o[u]=o[u+1]=0:(r=o[u]/n,i=o[u+1]/n,s=r*r+i*i,s>9&&(s=n*3/Math.sqrt(s),o[u]=s*r,o[u+1]=s*i));u=-1;while(++u<=a)s=(e[Math.min(a,u+1)][0]-e[Math.max(0,u-1)][0])/(6*(1+o[u]*o[u])),t.push([s||0,o[u]*s||0]);return t}function mf(e){return e.length<3?$a(e):e[0]+tf(e,vf(e))}function gf(e){var t,n=-1,r=e.length,i,s;while(++n<r)t=e[n],i=t[0],s=t[1]-_t,t[0]=i*Math.cos(s),t[1]=i*Math.sin(s);return e}function yf(e){function c(u){function x(){c.push("M",o(e(p),l),f,a(e(h.reverse()),l),"Z")}var c=[],h=[],p=[],d=-1,v=u.length,m,g=Nn(t),y=Nn(r),b=t===n?function(){return E}:Nn(n),w=r===i?function(){return S}:Nn(i),E,S;while(++d<v)s.call(this,m=u[d],d)?(h.push([E=+g.call(this,m,d),S=+y.call(this,m,d)]),p.push([+b.call(this,m,d),+w.call(this,m,d)])):h.length&&(x(),h=[],p=[]);return h.length&&x(),c.length?c.join(""):null}var t=Ts,n=Ts,r=0,i=Ns,s=ui,o=$a,u=o.key,a=o,f="L",l=.7;return c.x=function(e){return arguments.length?(t=n=e,c):n},c.x0=function(e){return arguments.length?(t=e,c):t},c.x1=function(e){return arguments.length?(n=e,c):n},c.y=function(e){return arguments.length?(r=i=e,c):i},c.y0=function(e){return arguments.length?(r=e,c):r},c.y1=function(e){return arguments.length?(i=e,c):i},c.defined=function(e){return arguments.length?(s=e,c):s},c.interpolate=function(e){return arguments.length?(typeof e=="function"?u=o=e:u=(o=Va.get(e)||$a).key,a=o.reverse||o,f=o.closed?"M":"L",c):u},c.tension=function(e){return arguments.length?(l=e,c):l},c}function bf(e){return e.radius}function wf(e){return[e.x,e.y]}function Ef(e){return function(){var t=e.apply(this,arguments),n=t[0],r=t[1]-_t;return[n*Math.cos(r),n*Math.sin(r)]}}function Sf(){return 64}function xf(){return"circle"}function Tf(e){var t=Math.sqrt(e/At);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+ -t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}function Af(e){return function(){var t,n,r;(t=this[e])&&(r=t[n=t.active])&&(r.timer.c=null,r.timer.t=NaN,--t.count?delete t[n]:delete this[e],t.active+=.5,r.event&&r.event.interrupt.call(this,this.__data__,r.index))}}function Of(e,t,n){return W(e,Mf),e.namespace=t,e.id=n,e}function Hf(e,t,n,r){var i=e.id,s=e.namespace;return pt(e,typeof n=="function"?function(e,o,u){e[s][i].tween.set(t,r(n.call(e,e.__data__,o,u)))}:(n=r(n),function(e){e[s][i].tween.set(t,n)}))}function Bf(e){return e==null&&(e=""),function(){this.textContent=e}}function jf(e){return e==null?"__transition__":"__transition_"+e+"__"}function Ff(e,t,n,r,i){function h(e){var t=o.delay;a.t=t+u;if(t<=e)return p(e-t);a.c=p}function p(n){var i=s.active,h=s[i];h&&(h.timer.c=null,h.timer.t=NaN,--s.count,delete s[i],h.event&&h.event.interrupt.call(e,e.__data__,h.index));for(var p in s)if(+p<r){var v=s[p];v.timer.c=null,v.timer.t=NaN,--s.count,delete s[p]}a.c=d,Hn(function(){return a.c&&d(n||1)&&(a.c=null,a.t=NaN),1},0,u),s.active=r,o.event&&o.event.start.call(e,e.__data__,t),c=[],o.tween.forEach(function(n,r){(r=r.call(e,e.__data__,t))&&c.push(r)}),l=o.ease,f=o.duration}function d(i){var u=i/f,a=l(u),h=c.length;while(h>0)c[--h].call(e,a);if(u>=1)return o.event&&o.event.end.call(e,e.__data__,t),--s.count?delete s[r]:delete e[n],1}var s=e[n]||(e[n]={active:0,count:0}),o=s[r],u,a,f,l,c;o||(u=i.time,a=Hn(h,0,u),o=s[r]={tween:new S,time:u,timer:a,delay:i.delay,duration:i.duration,ease:i.ease,index:t},i=null,++s.count)}function Rf(e,t,n){e.attr("transform",function(e){var r=t(e);return"translate("+(isFinite(r)?r:n(e))+",0)"})}function Uf(e,t,n){e.attr("transform",function(e){var r=t(e);return"translate(0,"+(isFinite(r)?r:n(e))+")"})}function Jf(e){return e.toISOString()}function Kf(t,n,r){function i(e){return t(e)}function s(t,r){var i=t[1]-t[0],s=i/r,o=e.bisect(Gf,s);return o==Gf.length?[n.year,ma(t.map(function(e){return e/31536e6}),r)[2]]:o?n[s/Gf[o-1]<Gf[o]/s?o-1:o]:[el,ma(t,r)[2]]}return i.invert=function(e){return Qf(t.invert(e))},i.domain=function(e){return arguments.length?(t.domain(e),i):t.domain().map(Qf)},i.nice=function(e,t){function u(n){return!isNaN(n)&&!e.range(n,Qf(+n+1),t).length}var n=i.domain(),r=oa(n),o=e==null?s(r,10):typeof e=="number"&&s(r,e);return o&&(e=o[0],t=o[1]),i.domain(fa(n,t>1?{floor:function(t){while(u(t=e.floor(t)))t=Qf(t-1);return t},ceil:function(t){while(u(t=e.ceil(t)))t=Qf(+t+1);return t}}:e))},i.ticks=function(e,t){var n=oa(i.domain()),r=e==null?s(n,10):typeof e=="number"?s(n,e):!e.range&&[{range:e},t];return r&&(e=r[0],t=r[1]),e.range(n[0],Qf(+n[1]+1),t<1?1:t)},i.tickFormat=function(){return r},i.copy=function(){return Kf(t.copy(),n,r)},da(i,t)}function Qf(e){return new Date(e)}function rl(e){return JSON.parse(e.responseText)}function il(e){var t=r.createRange();return t.selectNode(r.body),t.createContextualFragment(e.responseText)}var e={version:"3.5.17"},t=[].slice,n=function(e){return t.call(e)},r=this.document;if(r)try{n(r.documentElement.childNodes)[0].nodeType}catch(o){n=function(e){var t=e.length,n=new Array(t);while(t--)n[t]=e[t];return n}}Date.now||(Date.now=function(){return+(new Date)});if(r)try{r.createElement("DIV").style.setProperty("opacity",0,"")}catch(u){var a=this.Element.prototype,f=a.setAttribute,l=a.setAttributeNS,c=this.CSSStyleDeclaration.prototype,h=c.setProperty;a.setAttribute=function(e,t){f.call(this,e,t+"")},a.setAttributeNS=function(e,t,n){l.call(this,e,t,n+"")},c.setProperty=function(e,t,n){h.call(this,e,t+"",n)}}e.ascending=p,e.descending=function(e,t){return t<e?-1:t>e?1:t>=e?0:NaN},e.min=function(e,t){var n=-1,r=e.length,i,s;if(arguments.length===1){while(++n<r)if((s=e[n])!=null&&s>=s){i=s;break}while(++n<r)(s=e[n])!=null&&i>s&&(i=s)}else{while(++n<r)if((s=t.call(e,e[n],n))!=null&&s>=s){i=s;break}while(++n<r)(s=t.call(e,e[n],n))!=null&&i>s&&(i=s)}return i},e.max=function(e,t){var n=-1,r=e.length,i,s;if(arguments.length===1){while(++n<r)if((s=e[n])!=null&&s>=s){i=s;break}while(++n<r)(s=e[n])!=null&&s>i&&(i=s)}else{while(++n<r)if((s=t.call(e,e[n],n))!=null&&s>=s){i=s;break}while(++n<r)(s=t.call(e,e[n],n))!=null&&s>i&&(i=s)}return i},e.extent=function(e,t){var n=-1,r=e.length,i,s,o;if(arguments.length===1){while(++n<r)if((s=e[n])!=null&&s>=s){i=o=s;break}while(++n<r)(s=e[n])!=null&&(i>s&&(i=s),o<s&&(o=s))}else{while(++n<r)if((s=t.call(e,e[n],n))!=null&&s>=s){i=o=s;break}while(++n<r)(s=t.call(e,e[n],n))!=null&&(i>s&&(i=s),o<s&&(o=s))}return[i,o]},e.sum=function(e,t){var n=0,r=e.length,i,s=-1;if(arguments.length===1)while(++s<r)v(i=+e[s])&&(n+=i);else while(++s<r)v(i=+t.call(e,e[s],s))&&(n+=i);return n},e.mean=function(e,t){var n=0,r=e.length,i,s=-1,o=r;if(arguments.length===1)while(++s<r)v(i=d(e[s]))?n+=i:--o;else while(++s<r)v(i=d(t.call(e,e[s],s)))?n+=i:--o;if(o)return n/o},e.quantile=function(e,t){var n=(e.length-1)*t+1,r=Math.floor(n),i=+e[r-1],s=n-r;return s?i+s*(e[r]-i):i},e.median=function(t,n){var r=[],i=t.length,s,o=-1;if(arguments.length===1)while(++o<i)v(s=d(t[o]))&&r.push(s);else while(++o<i)v(s=d(n.call(t,t[o],o)))&&r.push(s);if(r.length)return e.quantile(r.sort(p),.5)},e.variance=function(e,t){var n=e.length,r=0,i,s,o=0,u=-1,a=0;if(arguments.length===1)while(++u<n)v(i=d(e[u]))&&(s=i-r,r+=s/++a,o+=s*(i-r));else while(++u<n)v(i=d(t.call(e,e[u],u)))&&(s=i-r,r+=s/++a,o+=s*(i-r));if(a>1)return o/(a-1)},e.deviation=function(){var t=e.variance.apply(this,arguments);return t?Math.sqrt(t):t};var g=m(p);e.bisectLeft=g.left,e.bisect=e.bisectRight=g.right,e.bisector=function(e){return m(e.length===1?function(t,n){return p(e(t),n)}:e)},e.shuffle=function(e,t,n){(r=arguments.length)<3&&(n=e.length,r<2&&(t=0));var r=n-t,i,s;while(r)s=Math.random()*r--|0,i=e[r+t],e[r+t]=e[s+t],e[s+t]=i;return e},e.permute=function(e,t){var n=t.length,r=new Array(n);while(n--)r[n]=e[t[n]];return r},e.pairs=function(e){var t=0,n=e.length-1,r,i=e[0],s=new Array(n<0?0:n);while(t<n)s[t]=[r=i,i=e[++t]];return s},e.transpose=function(t){if(!(o=t.length))return[];for(var n=-1,r=e.min(t,y),i=new Array(r);++n<r;)for(var s=-1,o,u=i[n]=new Array(o);++s<o;)u[s]=t[s][n];return i},e.zip=function(){return e.transpose(arguments)},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t},e.values=function(e){var t=[];for(var n in e)t.push(e[n]);return t},e.entries=function(e){var t=[];for(var n in e)t.push({key:n,value:e[n]});return t},e.merge=function(e){var t=e.length,n,r=-1,i=0,s,o;while(++r<t)i+=e[r].length;s=new Array(i);while(--t>=0){o=e[t],n=o.length;while(--n>=0)s[--i]=o[n]}return s};var b=Math.abs;e.range=function(e,t,n){arguments.length<3&&(n=1,arguments.length<2&&(t=e,e=0));if((t-e)/n===Infinity)throw new Error("infinite range");var r=[],i=w(b(n)),s=-1,o;e*=i,t*=i,n*=i;if(n<0)while((o=e+n*++s)>t)r.push(o/i);else while((o=e+n*++s)<t)r.push(o/i);return r},e.map=function(e,t){var n=new S;if(e instanceof S)e.forEach(function(e,t){n.set(e,t)});else if(Array.isArray(e)){var r=-1,i=e.length,s;if(arguments.length===1)while(++r<i)n.set(r,e[r]);else while(++r<i)n.set(t.call(e,s=e[r],r),s)}else for(var o in e)n.set(o,e[o]);return n};var x="__proto__",T="\0";E(S,{has:k,get:function(e){return this._[N(e)]},set:function(e,t){return this._[N(e)]=t},remove:L,keys:A,values:function(){var e=[];for(var t in this._)e.push(this._[t]);return e},entries:function(){var e=[];for(var t in this._)e.push({key:C(t),value:this._[t]});return e},size:O,empty:M,forEach:function(e){for(var t in this._)e.call(this,C(t),this._[t])}}),e.nest=function(){function o(e,r,u){if(u>=n.length)return s?s.call(t,r):i?r.sort(i):r;var a=-1,f=r.length,l=n[u++],c,h,p,d=new S,v;while(++a<f)(v=d.get(c=l(h=r[a])))?v.push(h):d.set(c,[h]);return e?(h=e(),p=function(t,n){h.set(t,o(e,n,u))}):(h={},p=function(t,n){h[t]=o(e,n,u)}),d.forEach(p),h}function u(e,t){if(t>=n.length)return e;var i=[],s=r[t++];return e.forEach(function(e,n){i.push({key:e,values:u(n,t)})}),s?i.sort(function(e,t){return s(e.key,t.key)}):i}var t={},n=[],r=[],i,s;return t.map=function(e,t){return o(t,e,0)},t.entries=function(t){return u(o(e.map,t,0),0)},t.key=function(e){return n.push(e),t},t.sortKeys=function(e){return r[n.length-1]=e,t},t.sortValues=function(e){return i=e,t},t.rollup=function(e){return s=e,t},t},e.set=function(e){var t=new _;if(e)for(var n=0,r=e.length;n<r;++n)t.add(e[n]);return t},E(_,{has:k,add:function(e){return this._[N(e+="")]=!0,e},remove:L,values:A,size:O,empty:M,forEach:function(e){for(var t in this._)e.call(this,C(t))}}),e.behavior={},e.rebind=function(e,t){var n=1,r=arguments.length,i;while(++n<r)e[i=arguments[n]]=P(e,t,t[i]);return e};var B=["webkit","ms","moz","Moz","o","O"];e.dispatch=function(){var e=new F,t=-1,n=arguments.length;while(++t<n)e[arguments[t]]=I(e);return e},F.prototype.on=function(e,t){var n=e.indexOf("."),r="";n>=0&&(r=e.slice(n+1),e=e.slice(0,n));if(e)return arguments.length<2?this[e].on(r):this[e].on(r,t);if(arguments.length===2){if(t==null)for(e in this)this.hasOwnProperty(e)&&this[e].on(r,null);return this}},e.event=null,e.requote=function(e){return e.replace(z,"\\$&")};var z=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,W={}.__proto__?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)e[n]=t[n]},V=function(e,t){return t.querySelector(e)},$=function(e,t){return t.querySelectorAll(e)},J=function(e,t){var n=e.matches||e[H(e,"matchesSelector")];return J=function(e,t){return n.call(e,t)},J(e,t)};typeof Sizzle=="function"&&(V=function(e,t){return Sizzle(e,t)[0]||null},$=Sizzle,J=Sizzle.matchesSelector),e.selection=function(){return e.select(r.documentElement)};var K=e.selection.prototype=[];K.select=function(e){var t=[],n,r,i,s;e=Q(e);for(var o=-1,u=this.length;++o<u;){t.push(n=[]),n.parentNode=(i=this[o]).parentNode;for(var a=-1,f=i.length;++a<f;)(s=i[a])?(n.push(r=e.call(s,s.__data__,a,o)),r&&"__data__"in s&&(r.__data__=s.__data__)):n.push(null)}return X(t)},K.selectAll=function(e){var t=[],r,i;e=G(e);for(var s=-1,o=this.length;++s<o;)for(var u=this[s],a=-1,f=u.length;++a<f;)if(i=u[a])t.push(r=n(e.call(i,i.__data__,a,s))),r.parentNode=i;return X(t)};var Y="http://www.w3.org/1999/xhtml",Z={svg:"http://www.w3.org/2000/svg",xhtml:Y,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};e.ns={prefix:Z,qualify:function(e){var t=e.indexOf(":"),n=e;return t>=0&&(n=e.slice(0,t))!=="xmlns"&&(e=e.slice(t+1)),Z.hasOwnProperty(n)?{space:Z[n],local:e}:e}},K.attr=function(t,n){if(arguments.length<2){if(typeof t=="string"){var r=this.node();return t=e.ns.qualify(t),t.local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}for(n in t)this.each(et(n,t[n]));return this}return this.each(et(t,n))},K.classed=function(e,t){if(arguments.length<2){if(typeof e=="string"){var n=this.node(),r=(e=rt(e)).length,i=-1;if(t=n.classList){while(++i<r)if(!t.contains(e[i]))return!1}else{t=n.getAttribute("class");while(++i<r)if(!nt(e[i]).test(t))return!1}return!0}for(t in e)this.each(it(t,e[t]));return this}return this.each(it(e,t))},K.style=function(e,t,n){var r=arguments.length;if(r<3){if(typeof e!="string"){r<2&&(t="");for(n in e)this.each(ot(n,e[n],t));return this}if(r<2){var i=this.node();return s(i).getComputedStyle(i,null).getPropertyValue(e)}n=""}return this.each(ot(e,t,n))},K.property=function(e,t){if(arguments.length<2){if(typeof e=="string")return this.node()[e];for(t in e)this.each(ut(t,e[t]));return this}return this.each(ut(e,t))},K.text=function(e){return arguments.length?this.each(typeof e=="function"?function(){var t=e.apply(this,arguments);this.textContent=t==null?"":t}:e==null?function(){this.textContent=""}:function(){this.textContent=e}):this.node().textContent},K.html=function(e){return arguments.length?this.each(typeof e=="function"?function(){var t=e.apply(this,arguments);this.innerHTML=t==null?"":t}:e==null?function(){this.innerHTML=""}:function(){this.innerHTML=e}):this.node().innerHTML},K.append=function(e){return e=at(e),this.select(function(){return this.appendChild(e.apply(this,arguments))})},K.insert=function(e,t){return e=at(e),t=Q(t),this.select(function(){return this.insertBefore(e.apply(this,arguments),t.apply(this,arguments)||null)})},K.remove=function(){return this.each(ft)},K.data=function(e,t){function o(e,n){var r,i=e.length,s=n.length,o=Math.min(i,s),l=new Array(s),c=new Array(s),h=new Array(i),p,d;if(t){var v=new S,m=new Array(i),g;for(r=-1;++r<i;)if(p=e[r])v.has(g=t.call(p,p.__data__,r))?h[r]=p:v.set(g,p),m[r]=g;for(r=-1;++r<s;)(p=v.get(g=t.call(n,d=n[r],r)))?p!==!0&&(l[r]=p,p.__data__=d):c[r]=lt(d),v.set(g,!0);for(r=-1;++r<i;)r in m&&v.get(m[r])!==!0&&(h[r]=e[r])}else{for(r=-1;++r<o;)p=e[r],d=n[r],p?(p.__data__=d,l[r]=p):c[r]=lt(d);for(;r<s;++r)c[r]=lt(n[r]);for(;r<i;++r)h[r]=e[r]}c.update=l,c.parentNode=l.parentNode=h.parentNode=e.parentNode,u.push(c),a.push(l),f.push(h)}var n=-1,r=this.length,i,s;if(!arguments.length){e=new Array(r=(i=this[0]).length);while(++n<r)if(s=i[n])e[n]=s.__data__;return e}var u=dt([]),a=X([]),f=X([]);if(typeof e=="function")while(++n<r)o(i=this[n],e.call(i,i.parentNode.__data__,n));else while(++n<r)o(i=this[n],e);return a.enter=function(){return u},a.exit=function(){return f},a},K.datum=function(e){return arguments.length?this.property("__data__",e):this.property("__data__")},K.filter=function(e){var t=[],n,r,i;typeof e!="function"&&(e=ct(e));for(var s=0,o=this.length;s<o;s++){t.push(n=[]),n.parentNode=(r=this[s]).parentNode;for(var u=0,a=r.length;u<a;u++)(i=r[u])&&e.call(i,i.__data__,u,s)&&n.push(i)}return X(t)},K.order=function(){for(var e=-1,t=this.length;++e<t;)for(var n=this[e],r=n.length-1,i=n[r],s;--r>=0;)if(s=n[r])i&&i!==s.nextSibling&&i.parentNode.insertBefore(s,i),i=s;return this},K.sort=function(e){e=ht.apply(this,arguments);for(var t=-1,n=this.length;++t<n;)this[t].sort(e);return this.order()},K.each=function(e){return pt(this,function(t,n,r){e.call(t,t.__data__,n,r)})},K.call=function(e){var t=n(arguments);return e.apply(t[0]=this,t),this},K.empty=function(){return!this.node()},K.node=function(){for(var e=0,t=this.length;e<t;e++)for(var n=this[e],r=0,i=n.length;r<i;r++){var s=n[r];if(s)return s}return null},K.size=function(){var e=0;return pt(this,function(){++e}),e};var vt=[];e.selection.enter=dt,e.selection.enter.prototype=vt,vt.append=K.append,vt.empty=K.empty,vt.node=K.node,vt.call=K.call,vt.size=K.size,vt.select=function(e){var t=[],n,r,i,s,o;for(var u=-1,a=this.length;++u<a;){i=(s=this[u]).update,t.push(n=[]),n.parentNode=s.parentNode;for(var f=-1,l=s.length;++f<l;)(o=s[f])?(n.push(i[f]=r=e.call(s.parentNode,o.__data__,f,u)),r.__data__=o.__data__):n.push(null)}return X(t)},vt.insert=function(e,t){return arguments.length<2&&(t=mt(this)),K.insert.call(this,e,t)},e.select=function(e){var t;return typeof e=="string"?(t=[V(e,r)],t.parentNode=r.documentElement):(t=[e],t.parentNode=i(e)),X([t])},e.selectAll=function(e){var t;return typeof e=="string"?(t=n($(e,r)),t.parentNode=r.documentElement):(t=n(e),t.parentNode=null),X([t])},K.on=function(e,t,n){var r=arguments.length;if(r<3){if(typeof e!="string"){r<2&&(t=!1);for(n in e)this.each(gt(n,e[n],t));return this}if(r<2)return(r=this.node()["__on"+e])&&r._;n=!1}return this.each(gt(e,t,n))};var yt=e.map({mouseenter:"mouseover",mouseleave:"mouseout"});r&&yt.forEach(function(e){"on"+e in r&&yt.remove(e)});var Et,St=0;e.mouse=function(e){return Nt(e,R())};var Tt=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;e.touch=function(e,t,n){arguments.length<3&&(n=t,t=R().changedTouches);if(t)for(var r=0,i=t.length,s;r<i;++r)if((s=t[r]).identifier===n)return Nt(e,s)},e.behavior.drag=function(){function o(){this.on("mousedown.drag",r).on("touchstart.drag",i)}function u(r,i,s,o,u){return function(){function b(){var e=i(l,p),t,n;if(!e)return;t=e[0]-y[0],n=e[1]-y[1],h|=t|n,y=e,c({type:"drag",x:e[0]+v[0],y:e[1]+v[1],dx:t,dy:n})}function w(){if(!i(l,p))return;m.on(o+d,null).on(u+d,null),g(h),c({type:"dragend"})}var a=this,f=e.event.target.correspondingElement||e.event.target,l=a.parentNode,c=t.of(a,arguments),h=0,p=r(),d=".drag"+(p==null?"":"-"+p),v,m=e.select(s(f)).on(o+d,b).on(u+d,w),g=xt(f),y=i(l,p);n?(v=n.apply(a,arguments),v=[v.x-y[0],v.y-y[1]]):v=[0,0],c({type:"dragstart"})}}var t=U(o,"drag","dragstart","dragend"),n=null,r=u(j,e.mouse,s,"mousemove","mouseup"),i=u(Ct,e.touch,D,"touchmove","touchend");return o.origin=function(e){return arguments.length?(n=e,o):n},e.rebind(o,t,"on")},e.touches=function(e,t){return arguments.length<2&&(t=R().touches),t?n(t).map(function(t){var n=Nt(e,t);return n.identifier=t.identifier,n}):[]};var kt=1e-6,Lt=kt*kt,At=Math.PI,Ot=2*At,Mt=Ot-kt,_t=At/2,Dt=At/180,Pt=180/At,zt=Math.SQRT2,Wt=2,Xt=4;e.interpolateZoom=function(e,t){var n=e[0],r=e[1],i=e[2],s=t[0],o=t[1],u=t[2],a=s-n,f=o-r,l=a*a+f*f,c,h;if(l<Lt)h=Math.log(u/i)/zt,c=function(e){return[n+e*a,r+e*f,i*Math.exp(zt*e*h)]};else{var p=Math.sqrt(l),d=(u*u-i*i+Xt*l)/(2*i*Wt*p),v=(u*u-i*i-Xt*l)/(2*u*Wt*p),m=Math.log(Math.sqrt(d*d+1)-d),g=Math.log(Math.sqrt(v*v+1)-v);h=(g-m)/zt,c=function(e){var t=e*h,s=qt(m),o=i/(Wt*p)*(s*Rt(zt*t+m)-It(m));return[n+o*a,r+o*f,i*s/qt(zt*t+m)]}}return c.duration=h*1e3,c},e.behavior.zoom=function(){function S(e){e.on(c,_).on(Jt+".zoom",P).on("dblclick.zoom",H).on(v,D)}function x(e){return[(e[0]-t.x)/t.k,(e[1]-t.y)/t.k]}function T(e){return[e[0]*t.k+t.x,e[1]*t.k+t.y]}function N(e){t.k=Math.max(a[0],Math.min(a[1],e))}function C(e,n){n=T(n),t.x+=e[0]-n[0],t.y+=e[1]-n[1]}function k(n,r,s,o){n.__chart__={x:t.x,y:t.y,k:t.k},N(Math.pow(2,o)),C(i=r,s),n=e.select(n),f>0&&(n=n.transition().duration(f)),n.call(S.event)}function L(){b&&b.domain(y.range().map(function(e){return(e-t.x)/t.k}).map(y.invert)),E&&E.domain(w.range().map(function(e){return(e-t.y)/t.k}).map(w.invert))}function A(e){l++||e({type:"zoomstart"})}function O(e){L(),e({type:"zoom",scale:t.k,translate:[t.x,t.y]})}function M(e){--l||(e({type:"zoomend"}),i=null)}function _(){function a(){r=1,C(e.mouse(t),o),O(n)}function f(){i.on(h,null).on(p,null),u(r),M(n)}var t=this,n=g.of(t,arguments),r=0,i=e.select(s(t)).on(h,a).on(p,f),o=x(e.mouse(t)),u=xt(t);Lf.call(t),A(n)}function D(){function d(){var r=e.touches(n);return o=t.k,r.forEach(function(e){e.identifier in i&&(i[e.identifier]=x(e))}),r}function y(){var r=e.event.target;e.select(r).on(a,b).on(f,w),l.push(r);var o=e.event.changedTouches;for(var u=0,c=o.length;u<c;++u)i[o[u].identifier]=null;var h=d(),p=Date.now();if(h.length===1){if(p-m<500){var v=h[0];k(n,v,i[v.identifier],Math.floor(Math.log(t.k)/Math.LN2)+1),q()}m=p}else if(h.length>1){var v=h[0],g=h[1],y=v[0]-g[0],E=v[1]-g[1];s=y*y+E*E}}function b(){var t=e.touches(n),u,a,f,l;Lf.call(n);for(var c=0,h=t.length;c<h;++c,l=null){f=t[c];if(l=i[f.identifier]){if(a)break;u=f,a=l}}if(l){var p=(p=f[0]-u[0])*p+(p=f[1]-u[1])*p,d=s&&Math.sqrt(p/s);u=[(u[0]+f[0])/2,(u[1]+f[1])/2],a=[(a[0]+l[0])/2,(a[1]+l[1])/2],N(d*o)}m=null,C(u,a),O(r)}function w(){if(e.event.touches.length){var t=e.event.changedTouches;for(var n=0,s=t.length;n<s;++n)delete i[t[n].identifier];for(var o in i)return void d()}e.selectAll(l).on(u,null),h.on(c,_).on(v,D),p(),M(r)}var n=this,r=g.of(n,arguments),i={},s=0,o,u=".zoom-"+e.event.changedTouches[0].identifier,a="touchmove"+u,f="touchend"+u,l=[],h=e.select(n),p=xt(n);y(),A(r),h.on(c,null).on(v,y)}function P(){var r=g.of(this,arguments);d?clearTimeout(d):(Lf.call(this),n=x(i=o||e.mouse(this)),A(r)),d=setTimeout(function(){d=null,M(r)},50),q(),N(Math.pow(2,$t()*.002)*t.k),C(i,n),O(r)}function H(){var n=e.mouse(this),r=Math.log(t.k)/Math.LN2;k(this,n,x(n),e.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}var t={x:0,y:0,k:1},n,i,o,u=[960,500],a=Vt,f=250,l=0,c="mousedown.zoom",h="mousemove.zoom",p="mouseup.zoom",d,v="touchstart.zoom",m,g=U(S,"zoomstart","zoom","zoomend"),y,b,w,E;return Jt||(Jt="onwheel"in r?($t=function(){return-e.event.deltaY*(e.event.deltaMode?120:1)},"wheel"):"onmousewheel"in r?($t=function(){return e.event.wheelDelta},"mousewheel"):($t=function(){return-e.event.detail},"MozMousePixelScroll")),S.event=function(n){n.each(function(){var n=g.of(this,arguments),r=t;Df?e.select(this).transition().each("start.zoom",function(){t=this.__chart__||{x:0,y:0,k:1},A(n)}).tween("zoom:zoom",function(){var s=u[0],o=u[1],a=i?i[0]:s/2,f=i?i[1]:o/2,l=e.interpolateZoom([(a-t.x)/t.k,(f-t.y)/t.k,s/t.k],[(a-r.x)/r.k,(f-r.y)/r.k,s/r.k]);return function(e){var r=l(e),i=s/r[2];this.__chart__=t={x:a-r[0]*i,y:f-r[1]*i,k:i},O(n)}}).each("interrupt.zoom",function(){M(n)}).each("end.zoom",function(){M(n)}):(this.__chart__=t,A(n),O(n),M(n))})},S.translate=function(e){return arguments.length?(t={x:+e[0],y:+e[1],k:t.k},L(),S):[t.x,t.y]},S.scale=function(e){return arguments.length?(t={x:t.x,y:t.y,k:null},N(+e),L(),S):t.k},S.scaleExtent=function(e){return arguments.length?(a=e==null?Vt:[+e[0],+e[1]],S):a},S.center=function(e){return arguments.length?(o=e&&[+e[0],+e[1]],S):o},S.size=function(e){return arguments.length?(u=e&&[+e[0],+e[1]],S):u},S.duration=function(e){return arguments.length?(f=+e,S):f},S.x=function(e){return arguments.length?(b=e,y=e.copy(),t={x:0,y:0,k:1},S):b},S.y=function(e){return arguments.length?(E=e,w=e.copy(),t={x:0,y:0,k:1},S):E},e.rebind(S,g,"on")};var Vt=[0,Infinity],$t,Jt;e.color=Kt,Kt.prototype.toString=function(){return this.rgb()+""},e.hsl=Qt;var Gt=Qt.prototype=new Kt;Gt.brighter=function(e){return e=Math.pow(.7,arguments.length?e:1),new Qt(this.h,this.s,this.l/e)},Gt.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new Qt(this.h,this.s,e*this.l)},Gt.rgb=function(){return Yt(this.h,this.s,this.l)},e.hcl=Zt;var en=Zt.prototype=new Kt;en.brighter=function(e){return new Zt(this.h,this.c,Math.min(100,this.l+rn*(arguments.length?e:1)))},en.darker=function(e){return new Zt(this.h,this.c,Math.max(0,this.l-rn*(arguments.length?e:1)))},en.rgb=function(){return tn(this.h,this.c,this.l).rgb()},e.lab=nn;var rn=18,sn=.95047,on=1,un=1.08883,an=nn.prototype=new Kt;an.brighter=function(e){return new nn(Math.min(100,this.l+rn*(arguments.length?e:1)),this.a,this.b)},an.darker=function(e){return new nn(Math.max(0,this.l-rn*(arguments.length?e:1)),this.a,this.b)},an.rgb=function(){return fn(this.l,this.a,this.b)},e.rgb=dn;var gn=dn.prototype=new Kt;gn.brighter=function(e){e=Math.pow(.7,arguments.length?e:1);var t=this.r,n=this.g,r=this.b,i=30;return!t&&!n&&!r?new dn(i,i,i):(t&&t<i&&(t=i),n&&n<i&&(n=i),r&&r<i&&(r=i),new dn(Math.min(255,t/e),Math.min(255,n/e),Math.min(255,r/e)))},gn.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new dn(e*this.r,e*this.g,e*this.b)},gn.hsl=function(){return wn(this.r,this.g,this.b)},gn.toString=function(){return"#"+yn(this.r)+yn(this.g)+yn(this.b)};var Tn=e.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});Tn.forEach(function(e,t){Tn.set(e,vn(t))}),e.functor=Nn,e.xhr=Cn(D),e.dsv=function(e,t){function i(e,n,r){arguments.length<3&&(r=n,n=null);var i=kn(e,t,n==null?s:o(n),r);return i.row=function(e){return arguments.length?i.response((n=e)==null?s:o(e)):n},i}function s(e){return i.parse(e.responseText)}function o(e){return function(t){return i.parse(t.responseText,e)}}function u(t){return t.map(a).join(e)}function a(e){return n.test(e)?'"'+e.replace(/\"/g,'""')+'"':e}var n=new RegExp('["'+e+"\n]"),r=e.charCodeAt(0);return i.parse=function(e,t){var n;return i.parseRows(e,function(e,r){if(n)return n(e,r-1);var i=new Function("d","return {"+e.map(function(e,t){return JSON.stringify(e)+": d["+t+"]"}).join(",")+"}");n=t?function(e,n){return t(i(e),n)}:i})},i.parseRows=function(e,t){function c(){if(u>=o)return i;if(l)return l=!1,n;var t=u;if(e.charCodeAt(t)===34){var s=t;while(s++<o)if(e.charCodeAt(s)===34){if(e.charCodeAt(s+1)!==34)break;++s}u=s+2;var a=e.charCodeAt(s+1);return a===13?(l=!0,e.charCodeAt(s+2)===10&&++u):a===10&&(l=!0),e.slice(t+1,s).replace(/""/g,'"')}while(u<o){var a=e.charCodeAt(u++),f=1;if(a===10)l=!0;else if(a===13)l=!0,e.charCodeAt(u)===10&&(++u,++f);else if(a!==r)continue;return e.slice(t,u-f)}return e.slice(t)}var n={},i={},s=[],o=e.length,u=0,a=0,f,l;while((f=c())!==i){var h=[];while(f!==n&&f!==i)h.push(f),f=c();if(t&&(h=t(h,a++))==null)continue;s.push(h)}return s},i.format=function(t){if(Array.isArray(t[0]))return i.formatRows(t);var n=new _,r=[];return t.forEach(function(e){for(var t in e)n.has(t)||r.push(n.add(t))}),[r.map(a).join(e)].concat(t.map(function(t){return r.map(function(e){return a(t[e])}).join(e)})).join("\n")},i.formatRows=function(e){return e.map(u).join("\n")},i},e.csv=e.dsv(",","text/csv"),e.tsv=e.dsv("	","text/tab-separated-values");var On,Mn,_n,Dn,Pn=this[H(this,"requestAnimationFrame")]||function(e){setTimeout(e,17)};e.timer=function(){Hn.apply(this,arguments)},e.timer.flush=function(){jn(),Fn()},e.round=function(e,t){return t?Math.round(e*(t=Math.pow(10,t)))/t:Math.round(e)};var qn=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(Rn);e.formatPrefix=function(t,n){var r=0;if(t=+t)t<0&&(t*=-1),n&&(t=e.round(t,In(t,n))),r=1+Math.floor(1e-12+Math.log(t)/Math.LN10),r=Math.max(-24,Math.min(24,Math.floor((r-1)/3)*3));return qn[8+r/3]};var zn=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Wn=e.map({b:function(e){return e.toString(2)},c:function(e){return String.fromCharCode(e)},o:function(e){return e.toString(8)},x:function(e){return e.toString(16)},X:function(e){return e.toString(16).toUpperCase()},g:function(e,t){return e.toPrecision(t)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},r:function(t,n){return(t=e.round(t,In(t,n))).toFixed(Math.max(0,Math.min(20,In(t*(1+1e-15),n))))}}),Vn=e.time={},$n=Date;Jn.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(){Kn.setUTCDate.apply(this._,arguments)},setDay:function(){Kn.setUTCDay.apply(this._,arguments)},setFullYear:function(){Kn.setUTCFullYear.apply(this._,arguments)},setHours:function(){Kn.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Kn.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Kn.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Kn.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Kn.setUTCSeconds.apply(this._,arguments)},setTime:function(){Kn.setTime.apply(this._,arguments)}};var Kn=Date.prototype;Vn.year=Qn(function(e){return e=Vn.day(e),e.setMonth(0,1),e},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e){return e.getFullYear()}),Vn.years=Vn.year.range,Vn.years.utc=Vn.year.utc.range,Vn.day=Qn(function(e){var t=new $n(2e3,0);return t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t},function(e,t){e.setDate(e.getDate()+t)},function(e){return e.getDate()-1}),Vn.days=Vn.day.range,Vn.days.utc=Vn.day.utc.range,Vn.dayOfYear=function(e){var t=Vn.year(e);return Math.floor((e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(e,t){t=7-t;var n=Vn[e]=Qn(function(e){return(e=Vn.day(e)).setDate(e.getDate()-(e.getDay()+t)%7),e},function(e,t){e.setDate(e.getDate()+Math.floor(t)*7)},function(e){var n=Vn.year(e).getDay();return Math.floor((Vn.dayOfYear(e)+(n+t)%7)/7)-(n!==t)});Vn[e+"s"]=n.range,Vn[e+"s"].utc=n.utc.range,Vn[e+"OfYear"]=function(e){var n=Vn.year(e).getDay();return Math.floor((Vn.dayOfYear(e)+(n+t)%7)/7)}}),Vn.week=Vn.sunday,Vn.weeks=Vn.sunday.range,Vn.weeks.utc=Vn.sunday.utc.range,Vn.weekOfYear=Vn.sundayOfYear;var Zn={"-":"",_:" ",0:"0"},er=/^\s*\d+/,tr=/^%/;e.locale=function(e){return{numberFormat:Un(e),timeFormat:Yn(e)}};var Sr=e.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"]});e.format=Sr.numberFormat,e.geo={},xr.prototype={s:0,t:0,add:function(e){Nr(e,this.t,Tr),Nr(Tr.s,this.s,this),this.s?this.t+=Tr.t:this.s=Tr.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var Tr=new xr;e.geo.stream=function(e,t){e&&kr.hasOwnProperty(e.type)?kr[e.type](e,t):Cr(e,t)};var kr={Feature:function(e,t){Cr(e.geometry,t)},FeatureCollection:function(e,t){var n=e.features,r=-1,i=n.length;while(++r<i)Cr(n[r].geometry,t)}},Lr={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){var n=e.coordinates,r=-1,i=n.length;while(++r<i)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){Ar(e.coordinates,t,0)},MultiLineString:function(e,t){var n=e.coordinates,r=-1,i=n.length;while(++r<i)Ar(n[r],t,0)},Polygon:function(e,t){Or(e.coordinates,t)},MultiPolygon:function(e,t){var n=e.coordinates,r=-1,i=n.length;while(++r<i)Or(n[r],t)},GeometryCollection:function(e,t){var n=e.geometries,r=-1,i=n.length;while(++r<i)Cr(n[r],t)}};e.geo.area=function(t){return Mr=0,e.geo.stream(t,Dr),Mr};var Mr,_r=new xr,Dr={sphere:function(){Mr+=4*At},point:j,lineStart:j,lineEnd:j,polygonStart:function(){_r.reset(),Dr.lineStart=Pr},polygonEnd:function(){var e=2*_r;Mr+=e<0?4*At+e:e,Dr.lineStart=Dr.lineEnd=Dr.point=j}};e.geo.bounds=function(){function p(e,s){l.push(c=[t=e,r=e]),s<n&&(n=s),s>i&&(i=s)}function d(e,o){var u=Hr([e*Dt,o*Dt]);if(a){var f=jr(a,u),l=[f[1],-f[0],0],c=jr(l,f);qr(c),c=Rr(c);var h=e-s,d=h>0?1:-1,v=c[0]*Pt*d,m=b(h)>180;if(m^(d*s<v&&v<d*e)){var g=c[1]*Pt;g>i&&(i=g)}else if(v=(v+360)%360-180,m^(d*s<v&&v<d*e)){var g=-c[1]*Pt;g<n&&(n=g)}else o<n&&(n=o),o>i&&(i=o);m?e<s?E(t,e)>E(t,r)&&(r=e):E(e,r)>E(t,r)&&(t=e):r>=t?(e<t&&(t=e),e>r&&(r=e)):e>s?E(t,e)>E(t,r)&&(r=e):E(e,r)>E(t,r)&&(t=e)}else p(e,o);a=u,s=e}function v(){h.point=d}function m(){c[0]=t,c[1]=r,h.point=p,a=null}function g(e,t){if(a){var n=e-s;f+=b(n)>180?n+(n>0?360:-360):n}else o=e,u=t;Dr.point(e,t),d(e,t)}function y(){Dr.lineStart()}function w(){g(o,u),Dr.lineEnd(),b(f)>kt&&(t=-(r=180)),c[0]=t,c[1]=r,a=null}function E(e,t){return(t-=e)<0?t+360:t}function S(e,t){return e[0]-t[0]}function x(e,t){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}var t,n,r,i,s,o,u,a,f,l,c,h={point:p,lineStart:v,lineEnd:m,polygonStart:function(){h.point=g,h.lineStart=y,h.lineEnd=w,f=0,Dr.polygonStart()},polygonEnd:function(){Dr.polygonEnd(),h.point=p,h.lineStart=v,h.lineEnd=m,_r<0?(t=-(r=180),n=-(i=90)):f>kt?i=90:f<-kt&&(n=-90),c[0]=t,c[1]=r}};return function(s){i=r=-(t=n=Infinity),l=[],e.geo.stream(s,h);var o=l.length;if(o){l.sort(S);for(var u=1,a=l[0],f,p=[a];u<o;++u)f=l[u],x(f[0],a)||x(f[1],a)?(E(a[0],f[1])>E(a[0],a[1])&&(a[1]=f[1]),E(f[0],a[1])>E(a[0],a[1])&&(a[0]=f[0])):p.push(a=f);var d=-Infinity,v;for(var o=p.length-1,u=0,a=p[o],f;u<=o;a=f,++u)f=p[u],(v=E(a[1],f[0]))>d&&(d=v,t=f[0],r=a[1])}return l=c=null,t===Infinity||n===Infinity?[[NaN,NaN],[NaN,NaN]]:[[t,n],[r,i]]}}(),e.geo.centroid=function(t){zr=Wr=Xr=Vr=$r=Jr=Kr=Qr=Gr=Yr=Zr=0,e.geo.stream(t,ei);var n=Gr,r=Yr,i=Zr,s=n*n+r*r+i*i;if(s<Lt){n=Jr,r=Kr,i=Qr,Wr<kt&&(n=Xr,r=Vr,i=$r),s=n*n+r*r+i*i;if(s<Lt)return[NaN,NaN]}return[Math.atan2(r,n)*Pt,Ft(i/Math.sqrt(s))*Pt]};var zr,Wr,Xr,Vr,$r,Jr,Kr,Qr,Gr,Yr,Zr,ei={sphere:j,point:ti,lineStart:ri,lineEnd:ii,polygonStart:function(){ei.lineStart=si},polygonEnd:function(){ei.lineStart=ri}},vi=ci(ui,mi,yi,[-At,-At/2]),Si=1e9;e.geo.clipExtent=function(){var e,t,n,r,i,s,o={stream:function(e){return i&&(i.valid=!1),i=s(e),i.valid=!0,i},extent:function(u){return arguments.length?(s=xi(e=+u[0][0],t=+u[0][1],n=+u[1][0],r=+u[1][1]),i&&(i.valid=!1,i=null),o):[[e,t],[n,r]]}};return o.extent([[0,0],[960,500]])},(e.geo.conicEqualArea=function(){return Ti(Ni)}).raw=Ni,e.geo.albers=function(){return e.geo.conicEqualArea().rotate([96,0]).center([-0.6,38.7]).parallels([29.5,45.5]).scale(1070)},e.geo.albersUsa=function(){function f(e){var t=e[0],n=e[1];return i=null,(o(t,n),i)||(u(t,n),i)||a(t,n),i}var t=e.geo.albers(),n=e.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),r=e.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),i,s={point:function(e,t){i=[e,t]}},o,u,a;return f.invert=function(e){var i=t.scale(),s=t.translate(),o=(e[0]-s[0])/i,u=(e[1]-s[1])/i;return(u>=.12&&u<.234&&o>=-0.425&&o<-0.214?n:u>=.166&&u<.234&&o>=-0.214&&o<-0.115?r:t).invert(e)},f.stream=function(e){var i=t.stream(e),s=n.stream(e),o=r.stream(e);return{point:function(e,t){i.point(e,t),s.point(e,t),o.point(e,t)},sphere:function(){i.sphere(),s.sphere(),o.sphere()},lineStart:function(){i.lineStart(),s.lineStart(),o.lineStart()},lineEnd:function(){i.lineEnd(),s.lineEnd(),o.lineEnd()},polygonStart:function(){i.polygonStart(),s.polygonStart(),o.polygonStart()},polygonEnd:function(){i.polygonEnd(),s.polygonEnd(),o.polygonEnd()}}},f.precision=function(e){return arguments.length?(t.precision(e),n.precision(e),r.precision(e),f):t.precision()},f.scale=function(e){return arguments.length?(t.scale(e),n.scale(e*.35),r.scale(e),f.translate(t.translate())):t.scale()},f.translate=function(e){if(!arguments.length)return t.translate();var i=t.scale(),l=+e[0],c=+e[1];return o=t.translate(e).clipExtent([[l-.455*i,c-.238*i],[l+.455*i,c+.238*i]]).stream(s).point,u=n.translate([l-.307*i,c+.201*i]).clipExtent([[l-.425*i+kt,c+.12*i+kt],[l-.214*i-kt,c+.234*i-kt]]).stream(s).point,a=r.translate([l-.205*i,c+.212*i]).clipExtent([[l-.214*i+kt,c+.166*i+kt],[l-.115*i-kt,c+.234*i-kt]]).stream(s).point,f},f.scale(1070)};var Ci,ki,Li={point:j,lineStart:j,lineEnd:j,polygonStart:function(){ki=0,Li.lineStart=Ai},polygonEnd:function(){Li.lineStart=Li.lineEnd=Li.point=j,Ci+=b(ki/2)}},Oi,Mi,_i,Di,Pi={point:Hi,lineStart:j,lineEnd:j,polygonStart:j,polygonEnd:j},Fi={point:Ii,lineStart:qi,lineEnd:Ri,polygonStart:function(){Fi.lineStart=Ui},polygonEnd:function(){Fi.point=Ii,Fi.lineStart=qi,Fi.lineEnd=Ri}};e.geo.path=function(){function u(n){if(n){typeof t=="function"&&s.pointRadius(+t.apply(this,arguments));if(!o||!o.valid)o=i(s);e.geo.stream(n,o)}return s.result()}function a(){return o=null,u}var t=4.5,n,r,i,s,o;return u.area=function(t){return Ci=0,e.geo.stream(t,i(Li)),Ci},u.centroid=function(t){return Xr=Vr=$r=Jr=Kr=Qr=Gr=Yr=Zr=0,e.geo.stream(t,i(Fi)),Zr?[Gr/Zr,Yr/Zr]:Qr?[Jr/Qr,Kr/Qr]:$r?[Xr/$r,Vr/$r]:[NaN,NaN]},u.bounds=function(t){return _i=Di=-(Oi=Mi=Infinity),e.geo.stream(t,i(Pi)),[[Oi,Mi],[_i,Di]]},u.projection=function(e){return arguments.length?(i=(n=e)?e.stream||Xi(e):D,a()):n},u.context=function(e){return arguments.length?(s=(r=e)==null?new Bi:new zi(e),typeof t!="function"&&s.pointRadius(t),a()):r},u.pointRadius=function(e){return arguments.length?(t=typeof e=="function"?e:(s.pointRadius(+e),+e),u):t},u.projection(e.geo.albersUsa()).context(null)},e.geo.transform=function(e){return{stream:function(t){var n=new Vi(t);for(var r in e)n[r]=e[r];return n}}},Vi.prototype={point:function(e,t){this.stream.point(e,t)},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()}},e.geo.projection=Ji,e.geo.projectionMutator=Ki,(e.geo.equirectangular=function(){return Ji(Gi)}).raw=Gi.invert=Gi,e.geo.rotation=function(e){function t(t){return t=e(t[0]*Dt,t[1]*Dt),t[0]*=Pt,t[1]*=Pt,t}return e=Zi(e[0]%360*Dt,e[1]*Dt,e.length>2?e[2]*Dt:0),t.invert=function(t){return t=e.invert(t[0]*Dt,t[1]*Dt),t[0]*=Pt,t[1]*=Pt,t},t},Yi.invert=Gi,e.geo.circle=function(){function i(){var t=typeof e=="function"?e.apply(this,arguments):e,n=Zi(-t[0]*Dt,-t[1]*Dt,0).invert,i=[];return r(null,null,1,{point:function(e,t){i.push(e=n(e,t)),e[0]*=Pt,e[1]*=Pt}}),{type:"Polygon",coordinates:[i]}}var e=[0,0],t,n=6,r;return i.origin=function(t){return arguments.length?(e=t,i):e},i.angle=function(e){return arguments.length?(r=rs((t=+e)*Dt,n*Dt),i):t},i.precision=function(e){return arguments.length?(r=rs(t*Dt,(n=+e)*Dt),i):n},i.angle(90)},e.geo.distance=function(e,t){var n=(t[0]-e[0])*Dt,r=e[1]*Dt,i=t[1]*Dt,s=Math.sin(n),o=Math.cos(n),u=Math.sin(r),a=Math.cos(r),f=Math.sin(i),l=Math.cos(i),c;return Math.atan2(Math.sqrt((c=l*s)*c+(c=a*f-u*l*o)*c),u*f+a*l*o)},e.geo.graticule=function(){function y(){return{type:"MultiLineString",coordinates:w()}}function w(){return e.range(Math.ceil(i/c)*c,r,c).map(v).concat(e.range(Math.ceil(a/h)*h,u,h).map(m)).concat(e.range(Math.ceil(n/f)*f,t,f).filter(function(e){return b(e%c)>kt}).map(p)).concat(e.range(Math.ceil(o/l)*l,s,l).filter(function(e){return b(e%h)>kt}).map(d))}var t,n,r,i,s,o,u,a,f=10,l=f,c=90,h=360,p,d,v,m,g=2.5;return y.lines=function(){return w().map(function(e){return{type:"LineString",coordinates:e}})},y.outline=function(){return{type:"Polygon",coordinates:[v(i).concat(m(u).slice(1),v(r).reverse().slice(1),m(a).reverse().slice(1))]}},y.extent=function(e){return arguments.length?y.majorExtent(e).minorExtent(e):y.minorExtent()},y.majorExtent=function(e){return arguments.length?(i=+e[0][0],r=+e[1][0],a=+e[0][1],u=+e[1][1],i>r&&(e=i,i=r,r=e),a>u&&(e=a,a=u,u=e),y.precision(g)):[[i,a],[r,u]]},y.minorExtent=function(e){return arguments.length?(n=+e[0][0],t=+e[1][0],o=+e[0][1],s=+e[1][1],n>t&&(e=n,n=t,t=e),o>s&&(e=o,o=s,s=e),y.precision(g)):[[n,o],[t,s]]},y.step=function(e){return arguments.length?y.majorStep(e).minorStep(e):y.minorStep()},y.majorStep=function(e){return arguments.length?(c=+e[0],h=+e[1],y):[c,h]},y.minorStep=function(e){return arguments.length?(f=+e[0],l=+e[1],y):[f,l]},y.precision=function(e){return arguments.length?(g=+e,p=ss(o,s,90),d=os(n,t,g),v=ss(a,u,90),m=os(i,r,g),y):g},y.majorExtent([[-180,-90+kt],[180,90-kt]]).minorExtent([[-180,-80-kt],[180,80+kt]])},e.geo.greatArc=function(){function s(){return{type:"LineString",coordinates:[n||t.apply(this,arguments),i||r.apply(this,arguments)]}}var t=us,n,r=as,i;return s.distance=function(){return e.geo.distance(n||t.apply(this,arguments),i||r.apply(this,arguments))},s.source=function(e){return arguments.length?(t=e,n=typeof e=="function"?null:e,s):t},s.target=function(e){return arguments.length?(r=e,i=typeof e=="function"?null:e,s):r},s.precision=function(){return arguments.length?s:0},s},e.geo.interpolate=function(e,t){return fs(e[0]*Dt,e[1]*Dt,t[0]*Dt,t[1]*Dt)},e.geo.length=function(t){return ls=0,e.geo.stream(t,cs),ls};var ls,cs={sphere:j,point:j,lineStart:hs,lineEnd:j,polygonStart:j,polygonEnd:j},ds=ps(function(e){return Math.sqrt(2/(1+e))},function(e){return 2*Math.asin(e/2)});(e.geo.azimuthalEqualArea=function(){return Ji(ds)}).raw=ds;var vs=ps(function(e){var t=Math.acos(e);return t&&t/Math.sin(t)},D);(e.geo.azimuthalEquidistant=function(){return Ji(vs)}).raw=vs,(e.geo.conicConformal=function(){return Ti(ms)}).raw=ms,(e.geo.conicEquidistant=function(){return Ti(gs)}).raw=gs;var ys=ps(function(e){return 1/e},Math.atan);(e.geo.gnomonic=function(){return Ji(ys)}).raw=ys,bs.invert=function(e,t){return[e,2*Math.atan(Math.exp(t))-_t]},(e.geo.mercator=function(){return ws(bs)}).raw=bs;var Es=ps(function(){return 1},Math.asin);(e.geo.orthographic=function(){return Ji(Es)}).raw=Es;var Ss=ps(function(e){return 1/(1+e)},function(e){return 2*Math.atan(e)});(e.geo.stereographic=function(){return Ji(Ss)}).raw=Ss,xs.invert=function(e,t){return[-t,2*Math.atan(Math.exp(e))-_t]},(e.geo.transverseMercator=function(){var e=ws(xs),t=e.center,n=e.rotate;return e.center=function(e){return e?t([-e[1],e[0]]):(e=t(),[e[1],-e[0]])},e.rotate=function(e){return e?n([e[0],e[1],e.length>2?e[2]+90:90]):(e=n(),[e[0],e[1],e[2]-90])},n([0,0,90])}).raw=xs,e.geom={},e.geom.hull=function(e){function r(e){if(e.length<3)return[];var r=Nn(t),i=Nn(n),s,o=e.length,u=[],a=[];for(s=0;s<o;s++)u.push([+r.call(this,e[s],s),+i.call(this,e[s],s),s]);u.sort(ks);for(s=0;s<o;s++)a.push([u[s][0],-u[s][1]]);var f=Cs(u),l=Cs(a),c=l[0]===f[0],h=l[l.length-1]===f[f.length-1],p=[];for(s=f.length-1;s>=0;--s)p.push(e[u[f[s]][2]]);for(s=+c;s<l.length-h;++s)p.push(e[u[l[s]][2]]);return p}var t=Ts,n=Ns;return arguments.length?r(e):(r.x=function(e){return arguments.length?(t=e,r):t},r.y=function(e){return arguments.length?(n=e,r):n},r)},e.geom.polygon=function(e){return W(e,Ls),e};var Ls=e.geom.polygon.prototype=[];Ls.area=function(){var e=-1,t=this.length,n,r=this[t-1],i=0;while(++e<t)n=r,r=this[e],i+=n[1]*r[0]-n[0]*r[1];return i*.5},Ls.centroid=function(e){var t=-1,n=this.length,r=0,i=0,s,o=this[n-1],u;arguments.length||(e=-1/(6*this.area()));while(++t<n)s=o,o=this[t],u=s[0]*o[1]-o[0]*s[1],r+=(s[0]+o[0])*u,i+=(s[1]+o[1])*u;return[r*e,i*e]},Ls.clip=function(e){var t,n=Ms(e),r=-1,i=this.length-Ms(this),s,o,u=this[i-1],a,f,l;while(++r<i){t=e.slice(),e.length=0,a=this[r],f=t[(o=t.length-n)-1],s=-1;while(++s<o)l=t[s],As(l,u,a)?(As(f,u,a)||e.push(Os(f,l,u,a)),e.push(l)):As(f,u,a)&&e.push(Os(f,l,u,a)),f=l;n&&e.push(e[0]),u=a}return e};var _s,Ds,Ps,Hs=[],Bs,js,Fs=[];Vs.prototype.prepare=function(){var e=this.edges,t=e.length,n;while(t--)n=e[t].edge,(!n.b||!n.a)&&e.splice(t,1);return e.sort(Js),e.length},io.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}},so.prototype={insert:function(e,t){var n,r,i;if(e){t.P=e,t.N=e.N,e.N&&(e.N.P=t),e.N=t;if(e.R){e=e.R;while(e.L)e=e.L;e.L=t}else e.R=t;n=e}else this._?(e=fo(this._),t.P=null,t.N=e,e.P=e.L=t,n=e):(t.P=t.N=null,this._=t,n=null);t.L=t.R=null,t.U=n,t.C=!0,e=t;while(n&&n.C)r=n.U,n===r.L?(i=r.R,i&&i.C?(n.C=i.C=!1,r.C=!0,e=r):(e===n.R&&(uo(this,n),e=n,n=e.U),n.C=!1,r.C=!0,ao(this,r))):(i=r.L,i&&i.C?(n.C=i.C=!1,r.C=!0,e=r):(e===n.L&&(ao(this,n),e=n,n=e.U),n.C=!1,r.C=!0,uo(this,r))),n=e.U;this._.C=!1},remove:function(e){e.N&&(e.N.P=e.P),e.P&&(e.P.N=e.N),e.N=e.P=null;var t=e.U,n,r=e.L,i=e.R,s,o;r?i?s=fo(i):s=r:s=i,t?t.L===e?t.L=s:t.R=s:this._=s,r&&i?(o=s.C,s.C=e.C,s.L=r,r.U=s,s!==i?(t=s.U,s.U=e.U,e=s.R,t.L=e,s.R=i,i.U=s):(s.U=t,t=s,e=s.R)):(o=e.C,e=s),e&&(e.U=t);if(o)return;if(e&&e.C){e.C=!1;return}do{if(e===this._)break;if(e===t.L){n=t.R,n.C&&(n.C=!1,t.C=!0,uo(this,t),n=t.R);if(n.L&&n.L.C||n.R&&n.R.C){if(!n.R||!n.R.C)n.L.C=!1,n.C=!0,ao(this,n),n=t.R;n.C=t.C,t.C=n.R.C=!1,uo(this,t),e=this._;break}}else{n=t.L,n.C&&(n.C=!1,t.C=!0,ao(this,t),n=t.L);if(n.L&&n.L.C||n.R&&n.R.C){if(!n.L||!n.L.C)n.R.C=!1,n.C=!0,uo(this,n),n=t.L;n.C=t.C,t.C=n.L.C=!1,ao(this,t),e=this._;break}}n.C=!0,e=t,t=t.U}while(!e.C);e&&(e.C=!1)}},e.geom.voronoi=function(e){function o(e){var t=new Array(e.length),n=s[0][0],r=s[0][1],i=s[1][0],o=s[1][1];return lo(u(e),s).cells.forEach(function(s,u){var a=s.edges,f=s.site,l=t[u]=a.length?a.map(function(e){var t=e.start();return[t.x,t.y]}):f.x>=n&&f.x<=i&&f.y>=r&&f.y<=o?[[n,o],[i,o],[i,r],[n,r]]:[];l.point=e[u]}),t}function u(e){return e.map(function(e,t){return{x:Math.round(r(e,t)/kt)*kt,y:Math.round(i(e,t)/kt)*kt,i:t}})}var t=Ts,n=Ns,r=t,i=n,s=ho;return e?o(e):(o.links=function(e){return lo(u(e)).edges.filter(function(e){return e.l&&e.r}).map(function(t){return{source:e[t.l.i],target:e[t.r.i]}})},o.triangles=function(e){var t=[];return lo(u(e)).cells.forEach(function(n,r){var i=n.site,s=n.edges.sort(Js),o=-1,u=s.length,a,f,l=s[u-1].edge,c=l.l===i?l.r:l.l;while(++o<u)a=l,f=c,l=s[o].edge,c=l.l===i?l.r:l.l,r<f.i&&r<c.i&&po(i,f,c)<0&&t.push([e[r],e[f.i],e[c.i]])}),t},o.x=function(e){return arguments.length?(r=Nn(t=e),o):t},o.y=function(e){return arguments.length?(i=Nn(n=e),o):n},o.clipExtent=function(e){return arguments.length?(s=e==null?ho:e,o):s===ho?null:s},o.size=function(e){return arguments.length?o.clipExtent(e&&[[0,0],e]):s===ho?null:s&&s[1]},o)};var ho=[[-1e6,-1e6],[1e6,1e6]];e.geom.delaunay=function(t){return e.geom.voronoi().triangles(t)},e.geom.quadtree=function(e,t,n,r,i){function a(e){function T(e,t,n,r,i,s,o,u){if(isNaN(n)||isNaN(r))return;if(e.leaf){var a=e.x,f=e.y;if(a!=null)if(b(a-n)+b(f-r)<.01)N(e,t,n,r,i,s,o,u);else{var l=e.point;e.x=e.y=e.point=null,N(e,l,a,f,i,s,o,u),N(e,t,n,r,i,s,o,u)}else e.x=n,e.y=r,e.point=t}else N(e,t,n,r,i,s,o,u)}function N(e,t,n,r,i,s,o,u){var a=(i+o)*.5,f=(s+u)*.5,l=n>=a,c=r>=f,h=c<<1|l;e.leaf=!1,e=e.nodes[h]||(e.nodes[h]=go()),l?i=a:o=a,c?s=f:u=f,T(e,t,n,r,i,s,o,u)}var a,f=Nn(s),l=Nn(o),c,h,p,d,v,m,g,y;if(t!=null)v=t,m=n,g=r,y=i;else{g=y=-(v=m=Infinity),c=[],h=[],d=e.length;if(u)for(p=0;p<d;++p)a=e[p],a.x<v&&(v=a.x),a.y<m&&(m=a.y),a.x>g&&(g=a.x),a.y>y&&(y=a.y),c.push(a.x),h.push(a.y);else for(p=0;p<d;++p){var w=+f(a=e[p],p),E=+l(a,p);w<v&&(v=w),E<m&&(m=E),w>g&&(g=w),E>y&&(y=E),c.push(w),h.push(E)}}var S=g-v,x=y-m;S>x?y=m+S:g=v+x;var C=go();C.add=function(e){T(C,e,+f(e,++p),+l(e,p),v,m,g,y)},C.visit=function(e){yo(e,C,v,m,g,y)},C.find=function(e){return bo(C,e[0],e[1],v,m,g,y)},p=-1;if(t==null){while(++p<d)T(C,e[p],c[p],h[p],v,m,g,y);--p}else e.forEach(C.add);return c=h=e=a=null,C}var s=Ts,o=Ns,u;return(u=arguments.length)?(s=vo,o=mo,u===3&&(i=n,r=t,n=t=0),a(e)):(a.x=function(e){return arguments.length?(s=e,a):s},a.y=function(e){return arguments.length?(o=e,a):o},a.extent=function(e){return arguments.length?(e==null?t=n=r=i=null:(t=+e[0][0],n=+e[0][1],r=+e[1][0],i=+e[1][1]),a):t==null?null:[[t,n],[r,i]]},a.size=function(e){return arguments.length?(e==null?t=n=r=i=null:(t=n=0,r=+e[0],i=+e[1]),a):t==null?null:[r-t,i-n]},a)},e.interpolateRgb=wo,e.interpolateObject=Eo,e.interpolateNumber=So,e.interpolateString=xo;var To=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,No=new RegExp(To.source,"g");e.interpolate=Co,e.interpolators=[function(e,t){var n=typeof t;return(n==="string"?Tn.has(t.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(t)?wo:xo:t instanceof Kt?wo:Array.isArray(t)?ko:n==="object"&&isNaN(t)?Eo:So)(e,t)}],e.interpolateArray=ko;var Lo=function(){return D},Ao=e.map({linear:Lo,poly:jo,quad:function(){return Po},cubic:function(){return Ho},sin:function(){return Fo},exp:function(){return Io},circle:function(){return qo},elastic:Ro,back:Uo,bounce:function(){return zo}}),Oo=e.map({"in":D,out:_o,"in-out":Do,"out-in":function(e){return Do(_o(e))}});e.ease=function(e){var n=e.indexOf("-"),r=n>=0?e.slice(0,n):e,i=n>=0?e.slice(n+1):"in";return r=Ao.get(r)||Lo,i=Oo.get(i)||D,Mo(i(r.apply(null,t.call(arguments,1))))},e.interpolateHcl=Wo,e.interpolateHsl=Xo,e.interpolateLab=Vo,e.interpolateRound=$o,e.transform=function(t){var n=r.createElementNS(e.ns.prefix.svg,"g");return(e.transform=function(e){if(e!=null){n.setAttribute("transform",e);var t=n.transform.baseVal.consolidate()}return new Jo(t?t.matrix:Yo)})(t)},Jo.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var Yo={a:1,b:0,c:0,d:1,e:0,f:0};e.interpolateTransform=iu,e.layout={},e.layout.bundle=function(){return function(e){var t=[],n=-1,r=e.length;while(++n<r)t.push(uu(e[n]));return t}},e.layout.chord=function(){function l(){var t={},l=[],h=e.range(s),p=[],d,v,m,g,y;n=[],r=[],d=0,g=-1;while(++g<s){v=0,y=-1;while(++y<s)v+=i[g][y];l.push(v),p.push(e.range(s)),d+=v}u&&h.sort(function(e,t){return u(l[e],l[t])}),a&&p.forEach(function(e,t){e.sort(function(e,n){return a(i[t][e],i[t][n])})}),d=(Ot-o*s)/d,v=0,g=-1;while(++g<s){m=v,y=-1;while(++y<s){var b=h[g],w=p[b][y],E=i[b][w],S=v,x=v+=E*d;t[b+"-"+w]={index:b,subindex:w,startAngle:S,endAngle:x,value:E}}r[b]={index:b,startAngle:m,endAngle:v,value:l[b]},v+=o}g=-1;while(++g<s){y=g-1;while(++y<s){var T=t[g+"-"+y],N=t[y+"-"+g];(T.value||N.value)&&n.push(T.value<N.value?{source:N,target:T}:{source:T,target:N})}}f&&c()}function c(){n.sort(function(e,t){return f((e.source.value+e.target.value)/2,(t.source.value+t.target.value)/2)})}var t={},n,r,i,s,o=0,u,a,f;return t.matrix=function(e){return arguments.length?(s=(i=e)&&i.length,n=r=null,t):i},t.padding=function(e){return arguments.length?(o=e,n=r=null,t):o},t.sortGroups=function(e){return arguments.length?(u=e,n=r=null,t):u},t.sortSubgroups=function(e){return arguments.length?(a=e,n=null,t):a},t.sortChords=function(e){return arguments.length?(f=e,n&&c(),t):f},t.chords=function(){return n||l(),n},t.groups=function(){return r||l(),r},t},e.layout.force=function(){function b(e){return function(t,n,r,i){if(t.point!==e){var s=t.cx-e.x,o=t.cy-e.y,u=i-n,a=s*s+o*o;if(u*u/p<a){if(a<c){var f=t.charge/a;e.px-=s*f,e.py-=o*f}return!0}if(t.point&&a&&a<c){var f=t.pointCharge/a;e.px-=s*f,e.py-=o*f}}return!t.charge}}function w(n){n.px=e.event.x,n.py=e.event.y,t.resume()}var t={},n=e.dispatch("start","tick","end"),r,i=[1,1],s,o,u=.9,a=vu,f=mu,l=-30,c=gu,h=.1,p=.64,d=[],v=[],m,g,y;return t.tick=function(){if((o*=.99)<.005)return r=null,n.end({type:"end",alpha:o=0}),!0;var t=d.length,s=v.length,a,f,c,p,w,E,S,x,T;for(f=0;f<s;++f){c=v[f],p=c.source,w=c.target,x=w.x-p.x,T=w.y-p.y;if(E=x*x+T*T)E=o*g[f]*((E=Math.sqrt(E))-m[f])/E,x*=E,T*=E,w.x-=x*(S=p.weight+w.weight?p.weight/(p.weight+w.weight):.5),w.y-=T*S,p.x+=x*(S=1-S),p.y+=T*S}if(S=o*h){x=i[0]/2,T=i[1]/2,f=-1;if(S)while(++f<t)c=d[f],c.x+=(x-c.x)*S,c.y+=(T-c.y)*S}if(l){du(a=e.geom.quadtree(d),o,y),f=-1;while(++f<t)(c=d[f]).fixed||a.visit(b(c))}f=-1;while(++f<t)c=d[f],c.fixed?(c.x=c.px,c.y=c.py):(c.x-=(c.px-(c.px=c.x))*u,c.y-=(c.py-(c.py=c.y))*u);n.tick({type:"tick",alpha:o})},t.nodes=function(e){return arguments.length?(d=e,t):d},t.links=function(e){return arguments.length?(v=e,t):v},t.size=function(e){return arguments.length?(i=e,t):i},t.linkDistance=function(e){return arguments.length?(a=typeof e=="function"?e:+e,t):a},t.distance=t.linkDistance,t.linkStrength=function(e){return arguments.length?(f=typeof e=="function"?e:+e,t):f},t.friction=function(e){return arguments.length?(u=+e,t):u},t.charge=function(e){return arguments.length?(l=typeof e=="function"?e:+e,t):l},t.chargeDistance=function(e){return arguments.length?(c=e*e,t):Math.sqrt(c)},t.gravity=function(e){return arguments.length?(h=+e,t):h},t.theta=function(e){return arguments.length?(p=e*e,t):Math.sqrt(p)},t.alpha=function(e){return arguments.length?(e=+e,o?e>0?o=e:(r.c=null,r.t=NaN,r=null,n.end({type:"end",alpha:o=0})):e>0&&(n.start({type:"start",alpha:o=e}),r=Hn(t.tick)),t):o},t.start=function(){function h(t,i){if(!u){u=new Array(n);for(a=0;a<n;++a)u[a]=[];for(a=0;a<r;++a){var s=v[a];u[s.source.index].push(s.target),u[s.target.index].push(s.source)}}var o=u[e],a=-1,f=o.length,l;while(++a<f)if(!isNaN(l=o[a][t]))return l;return Math.random()*i}var e,n=d.length,r=v.length,s=i[0],o=i[1],u,c;for(e=0;e<n;++e)(c=d[e]).index=e,c.weight=0;for(e=0;e<r;++e)c=v[e],typeof c.source=="number"&&(c.source=d[c.source]),typeof c.target=="number"&&(c.target=d[c.target]),++c.source.weight,++c.target.weight;for(e=0;e<n;++e)c=d[e],isNaN(c.x)&&(c.x=h("x",s)),isNaN(c.y)&&(c.y=h("y",o)),isNaN(c.px)&&(c.px=c.x),isNaN(c.py)&&(c.py=c.y);m=[];if(typeof a=="function")for(e=0;e<r;++e)m[e]=+a.call(this,v[e],e);else for(e=0;e<r;++e)m[e]=a;g=[];if(typeof f=="function")for(e=0;e<r;++e)g[e]=+f.call(this,v[e],e);else for(e=0;e<r;++e)g[e]=f;y=[];if(typeof l=="function")for(e=0;e<n;++e)y[e]=+l.call(this,d[e],e);else for(e=0;e<n;++e)y[e]=l;return t.resume()},t.resume=function(){return t.alpha(.1)},t.stop=function(){return t.alpha(0)},t.drag=function(){s||(s=e.behavior.drag().origin(D).on("dragstart.force",lu).on("drag.force",w).on("dragend.force",cu));if(!arguments.length)return s;this.on("mouseover.force",hu).on("mouseout.force",pu).call(s)},e.rebind(t,n,"on")};var vu=20,mu=1,gu=Infinity;e.layout.hierarchy=function(){function r(i){var s=[i],o=[],u;i.depth=0;while((u=s.pop())!=null){o.push(u);if((f=t.call(r,u,u.depth))&&(a=f.length)){var a,f,l;while(--a>=0)s.push(l=f[a]),l.parent=u,l.depth=u.depth+1;n&&(u.value=0),u.children=f}else n&&(u.value=+n.call(r,u,u.depth)||0),delete u.children}return wu(i,function(t){var r,i;e&&(r=t.children)&&r.sort(e),n&&(i=t.parent)&&(i.value+=t.value)}),o}var e=xu,t=Eu,n=Su;return r.sort=function(t){return arguments.length?(e=t,r):e},r.children=function(e){return arguments.length?(t=e,r):t},r.value=function(e){return arguments.length?(n=e,r):n},r.revalue=function(e){return n&&(bu(e,function(e){e.children&&(e.value=0)}),wu(e,function(e){var t;e.children||(e.value=+n.call(r,e,e.depth)||0);if(t=e.parent)t.value+=e.value})),e},r},e.layout.partition=function(){function r(e,t,n,i){var s=e.children;e.x=t,e.y=e.depth*i,e.dx=n,e.dy=i;if(s&&(u=s.length)){var o=-1,u,a,f;n=e.value?n/e.value:0;while(++o<u)r(a=s[o],t,f=a.value*n,i),t+=f}}function i(e){var t=e.children,n=0;if(t&&(s=t.length)){var r=-1,s;while(++r<s)n=Math.max(n,i(t[r]))}return 1+n}function s(e,s){var o=t.call(this,e,s);return r(o[0],0,n[0],n[1]/i(o[0])),o}var t=e.layout.hierarchy(),n=[1,1];return s.size=function(e){return arguments.length?(n=e,s):n},yu(s,t)},e.layout.pie=function(){function o(u){var a=u.length,f=u.map(function(e,n){return+t.call(o,e,n)}),l=+(typeof r=="function"?r.apply(this,arguments):r),c=(typeof i=="function"?i.apply(this,arguments):i)-l,h=Math.min(Math.abs(c)/a,+(typeof s=="function"?s.apply(this,arguments):s)),p=h*(c<0?-1:1),d=e.sum(f),v=d?(c-a*p)/d:0,m=e.range(a),g=[],y;return n!=null&&m.sort(n===Nu?function(e,t){return f[t]-f[e]}:function(e,t){return n(u[e],u[t])}),m.forEach(function(e){g[e]={data:u[e],value:y=f[e],startAngle:l,endAngle:l+=y*v+p,padAngle:h}}),g}var t=Number,n=Nu,r=0,i=Ot,s=0;return o.value=function(e){return arguments.length?(t=e,o):t},o.sort=function(e){return arguments.length?(n=e,o):n},o.startAngle=function(e){return arguments.length?(r=e,o):r},o.endAngle=function(e){return arguments.length?(i=e,o):i},o.padAngle=function(e){return arguments.length?(s=e,o):s},o};var Nu={};e.layout.stack=function(){function u(a,f){if(!(v=a.length))return a;var l=a.map(function(e,n){return t.call(u,e,n)}),c=l.map(function(e){return e.map(function(e,t){return[s.call(u,e,t),o.call(u,e,t)]})}),h=n.call(u,c,f);l=e.permute(l,h),c=e.permute(c,h);var p=r.call(u,c,f),d=l[0].length,v,m,g,y;for(g=0;g<d;++g){i.call(u,l[0][g],y=p[g],c[0][g][1]);for(m=1;m<v;++m)i.call(u,l[m][g],y+=c[m-1][g][1],c[m][g][1])}return a}var t=D,n=Mu,r=_u,i=Lu,s=Cu,o=ku;return u.values=function(e){return arguments.length?(t=e,u):t},u.order=function(e){return arguments.length?(n=typeof e=="function"?e:Au.get(e)||Mu,u):n},u.offset=function(e){return arguments.length?(r=typeof e=="function"?e:Ou.get(e)||_u,u):r},u.x=function(e){return arguments.length?(s=e,u):s},u.y=function(e){return arguments.length?(o=e,u):o},u.out=function(e){return arguments.length?(i=e,u):i},u};var Au=e.map({"inside-out":function(t){var n=t.length,r,i,s=t.map(Du),o=t.map(Pu),u=e.range(n).sort(function(e,t){return s[e]-s[t]}),a=0,f=0,l=[],c=[];for(r=0;r<n;++r)i=u[r],a<f?(a+=o[i],l.push(i)):(f+=o[i],c.push(i));return c.reverse().concat(l)},reverse:function(t){return e.range(t.length).reverse()},"default":Mu}),Ou=e.map({silhouette:function(e){var t=e.length,n=e[0].length,r=[],i=0,s,o,u,a=[];for(o=0;o<n;++o){for(s=0,u=0;s<t;s++)u+=e[s][o][1];u>i&&(i=u),r.push(u)}for(o=0;o<n;++o)a[o]=(i-r[o])/2;return a},wiggle:function(e){var t=e.length,n=e[0],r=n.length,i,s,o,u,a,f,l,c,h,p=[];p[0]=c=h=0;for(s=1;s<r;++s){for(i=0,u=0;i<t;++i)u+=e[i][s][1];for(i=0,a=0,l=n[s][0]-n[s-1][0];i<t;++i){for(o=0,f=(e[i][s][1]-e[i][s-1][1])/(2*l);o<i;++o)f+=(e[o][s][1]-e[o][s-1][1])/l;a+=f*e[i][s][1]}p[s]=c-=u?a/u*l:0,c<h&&(h=c)}for(s=0;s<r;++s)p[s]-=h;return p},expand:function(e){var t=e.length,n=e[0].length,r=1/t,i,s,o,u=[];for(s=0;s<n;++s){for(i=0,o=0;i<t;i++)o+=e[i][s][1];if(o)for(i=0;i<t;i++)e[i][s][1]/=o;else for(i=0;i<t;i++)e[i][s][1]=r}for(s=0;s<n;++s)u[s]=0;return u},zero:_u});e.layout.histogram=function(){function s(s,o){var u=[],a=s.map(n,this),f=r.call(this,a,o),l=i.call(this,f,a,o),c,o=-1,h=a.length,p=l.length-1,d=t?1:1/h,v;while(++o<p)c=u[o]=[],c.dx=l[o+1]-(c.x=l[o]),c.y=0;if(p>0){o=-1;while(++o<h)v=a[o],v>=f[0]&&v<=f[1]&&(c=u[e.bisect(l,v,1,p)-1],c.y+=d,c.push(s[o]))}return u}var t=!0,n=Number,r=Fu,i=Bu;return s.value=function(e){return arguments.length?(n=e,s):n},s.range=function(e){return arguments.length?(r=Nn(e),s):r},s.bins=function(e){return arguments.length?(i=typeof e=="number"?function(t){return ju(t,e)}:Nn(e),s):i},s.frequency=function(e){return arguments.length?(t=!!e,s):t},s},e.layout.pack=function(){function s(e,s){var o=t.call(this,e,s),u=o[0],a=r[0],f=r[1],l=i==null?Math.sqrt:typeof i=="function"?i:function(){return i};u.x=u.y=0,wu(u,function(e){e.r=+l(e.value)}),wu(u,zu);if(n){var c=n*(i?1:Math.max(2*u.r/a,2*u.r/f))/2;wu(u,function(e){e.r+=c}),wu(u,zu),wu(u,function(e){e.r-=c})}return Vu(u,a/2,f/2,i?1:1/Math.max(2*u.r/a,2*u.r/f)),o}var t=e.layout.hierarchy().sort(Iu),n=0,r=[1,1],i;return s.size=function(e){return arguments.length?(r=e,s):r},s.radius=function(e){return arguments.length?(i=e==null||typeof e=="function"?e:+e,s):i},s.padding=function(e){return arguments.length?(n=+e,s):n},yu(s,t)},e.layout.tree=function(){function s(e,s){var f=t.call(this,e,s),c=f[0],h=o(c);wu(h,u),h.parent.m=-h.z,bu(h,a);if(i)bu(c,l);else{var p=c,d=c,v=c;bu(c,function(e){e.x<p.x&&(p=e),e.x>d.x&&(d=e),e.depth>v.depth&&(v=e)});var m=n(p,d)/2-p.x,g=r[0]/(d.x+n(d,p)/2+m),y=r[1]/(v.depth||1);bu(c,function(e){e.x=(e.x+m)*g,e.y=e.depth*y})}return f}function o(e){var t={A:null,children:[e]},n=[t],r;while((r=n.pop())!=null)for(var i=r.children,s,o=0,u=i.length;o<u;++o)n.push((i[o]=s={_:i[o],parent:r,children:(s=i[o].children)&&s.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=s);return t.children[0]}function u(e){var t=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(t.length){Yu(e);var s=(t[0].z+t[t.length-1].z)/2;i?(e.z=i.z+n(e._,i._),e.m=e.z-s):e.z=s}else i&&(e.z=i.z+n(e._,i._));e.parent.A=f(e,i,e.parent.A||r[0])}function a(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function f(e,t,r){if(t){var i=e,s=e,o=t,u=i.parent.children[0],a=i.m,f=s.m,l=o.m,c=u.m,h;while(o=Qu(o),i=Ku(i),o&&i)u=Ku(u),s=Qu(s),s.a=e,h=o.z+l-i.z-a+n(o._,i._),h>0&&(Gu(Zu(o,e,r),e,h),a+=h,f+=h),l+=o.m,a+=i.m,c+=u.m,f+=s.m;o&&!Qu(s)&&(s.t=o,s.m+=l-f),i&&!Ku(u)&&(u.t=i,u.m+=a-c,r=e)}return r}function l(e){e.x*=r[0],e.y=e.depth*r[1]}var t=e.layout.hierarchy().sort(null).value(null),n=Ju,r=[1,1],i=null;return s.separation=function(e){return arguments.length?(n=e,s):n},s.size=function(e){return arguments.length?(i=(r=e)==null?l:null,s):i?null:r},s.nodeSize=function(e){return arguments.length?(i=(r=e)==null?null:l,s):i?r:null},yu(s,t)},e.layout.cluster=function(){function s(e,s){var o=t.call(this,e,s),u=o[0],a,f=0;wu(u,function(e){var t=e.children;t&&t.length?(e.x=ta(t),e.y=ea(t)):(e.x=a?f+=n(e,a):0,e.y=0,a=e)});var l=na(u),c=ra(u),h=l.x-n(l,c)/2,p=c.x+n(c,l)/2;return wu(u,i?function(e){e.x=(e.x-u.x)*r[0],e.y=(u.y-e.y)*r[1]}:function(e){e.x=(e.x-h)/(p-h)*r[0],e.y=(1-(u.y?e.y/u.y:1))*r[1]}),o}var t=e.layout.hierarchy().sort(null).value(null),n=Ju,r=[1,1],i=!1;return s.separation=function(e){return arguments.length?(n=e,s):n},s.size=function(e){return arguments.length?(i=(r=e)==null,s):i?null:r},s.nodeSize=function(e){return arguments.length?(i=(r=e)!=null,s):i?r:null},yu(s,t)},e.layout.treemap=function(){function l(e,t){var n=-1,r=e.length,i,s;while(++n<r)s=(i=e[n]).value*(t<0?0:t),i.area=isNaN(s)||s<=0?0:s}function c(e){var t=e.children;if(t&&t.length){var n=s(e),r=[],i=t.slice(),o,u=Infinity,f,h=a==="slice"?n.dx:a==="dice"?n.dy:a==="slice-dice"?e.depth&1?n.dy:n.dx:Math.min(n.dx,n.dy),v;l(i,n.dx*n.dy/e.value),r.area=0;while((v=i.length)>0)r.push(o=i[v-1]),r.area+=o.area,a!=="squarify"||(f=p(r,h))<=u?(i.pop(),u=f):(r.area-=r.pop().area,d(r,h,n,!1),h=Math.min(n.dx,n.dy),r.length=r.area=0,u=Infinity);r.length&&(d(r,h,n,!0),r.length=r.area=0),t.forEach(c)}}function h(e){var t=e.children;if(t&&t.length){var n=s(e),r=t.slice(),i,o=[];l(r,n.dx*n.dy/e.value),o.area=0;while(i=r.pop())o.push(i),o.area+=i.area,i.z!=null&&(d(o,i.z?n.dx:n.dy,n,!r.length),o.length=o.area=0);t.forEach(h)}}function p(e,t){var n=e.area,r,i=0,s=Infinity,o=-1,u=e.length;while(++o<u){if(!(r=e[o].area))continue;r<s&&(s=r),r>i&&(i=r)}return n*=n,t*=t,n?Math.max(t*i*f/n,n/(t*s*f)):Infinity}function d(e,t,r,i){var s=-1,o=e.length,u=r.x,a=r.y,f=t?n(e.area/t):0,l;if(t==r.dx){if(i||f>r.dy)f=r.dy;while(++s<o)l=e[s],l.x=u,l.y=a,l.dy=f,u+=l.dx=Math.min(r.x+r.dx-u,f?n(l.area/f):0);l.z=!0,l.dx+=r.x+r.dx-u,r.y+=f,r.dy-=f}else{if(i||f>r.dx)f=r.dx;while(++s<o)l=e[s],l.x=u,l.y=a,l.dx=f,a+=l.dy=Math.min(r.y+r.dy-a,f?n(l.area/f):0);l.z=!1,l.dy+=r.y+r.dy-a,r.x+=f,r.dx-=f}}function v(e){var n=u||t(e),i=n[0];return i.x=i.y=0,i.value?(i.dx=r[0],i.dy=r[1]):i.dx=i.dy=0,u&&t.revalue(i),l([i],i.dx*i.dy/i.value),(u?h:c)(i),o&&(u=n),n}var t=e.layout.hierarchy(),n=Math.round,r=[1,1],i=null,s=ia,o=!1,u,a="squarify",f=.5*(1+Math.sqrt(5));return v.size=function(e){return arguments.length?(r=e,v):r},v.padding=function(e){function t(t){var n=e.call(v,t,t.depth);return n==null?ia(t):sa(t,typeof n=="number"?[n,n,n,n]:n)}function n(t){return sa(t,e)}if(!arguments.length)return i;var r;return s=(i=e)==null?ia:(r=typeof e)==="function"?t:r==="number"?(e=[e,e,e,e],n):n,v},v.round=function(e){return arguments.length?(n=e?Math.round:Number,v):n!=Number},v.sticky=function(e){return arguments.length?(o=e,u=null,v):o},v.ratio=function(e){return arguments.length?(f=e,v):f},v.mode=function(e){return arguments.length?(a=e+"",v):a},yu(v,t)},e.random={normal:function(e,t){var n=arguments.length;return n<2&&(t=1),n<1&&(e=0),function(){var n,r,i;do n=Math.random()*2-1,r=Math.random()*2-1,i=n*n+r*r;while(!i||i>1);return e+t*n*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=e.random.normal.apply(e,arguments);return function(){return Math.exp(t())}},bates:function(t){var n=e.random.irwinHall(t);return function(){return n()/t}},irwinHall:function(e){return function(){for(var t=0,n=0;n<e;n++)t+=Math.random();return t}}},e.scale={};var ca={floor:D,ceil:D};e.scale.linear=function(){return pa([0,1],[0,1],Co,!1)};var ba={s:1,g:1,p:1,r:1,e:1};e.scale.log=function(){return Sa(e.scale.linear().domain([0,1]),10,!0,[1,10])};var xa=e.format(".0e"),Ta={floor:function(e){return-Math.ceil(-e)},ceil:function(e){return-Math.floor(-e)}};e.scale.pow=function(){return Na(e.scale.linear(),1,[0,1])},e.scale.sqrt=function(){return e.scale.pow().exponent(.5)},e.scale.ordinal=function(){return ka([],{t:"range",a:[[]]})},e.scale.category10=function(){return e.scale.ordinal().range(La)},e.scale.category20=function(){return e.scale.ordinal().range(Aa)},e.scale.category20b=function(){return e.scale.ordinal().range(Oa)},e.scale.category20c=function(){return e.scale.ordinal().range(Ma)};var La=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(mn),Aa=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(mn),Oa=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(mn),Ma=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(mn);e.scale.quantile=function(){return _a([],[])},e.scale.quantize=function(){return Da(0,1,[0,1])},e.scale.threshold=function(){return Pa([.5],[0,1])},e.scale.identity=function(){return Ha([0,1])},e.svg={},e.svg.arc=function(){function u(){var u=Math.max(0,+e.apply(this,arguments)),f=Math.max(0,+t.apply(this,arguments)),l=i.apply(this,arguments)-_t,c=s.apply(this,arguments)-_t,h=Math.abs(c-l),p=l>c?0:1;f<u&&(d=f,f=u,u=d);if(h>=Mt)return a(f,p)+(u?a(u,1-p):"")+"Z";var d,v,m,g,y=0,b=0,w,E,S,x,T,N,C,k,L=[];if(g=(+o.apply(this,arguments)||0)/2)m=r===ja?Math.sqrt(u*u+f*f):+r.apply(this,arguments),p||(b*=-1),f&&(b=Ft(m/f*Math.sin(g))),u&&(y=Ft(m/u*Math.sin(g)));if(f){w=f*Math.cos(l+b),E=f*Math.sin(l+b),S=f*Math.cos(c-b),x=f*Math.sin(c-b);var A=Math.abs(c-l-2*b)<=At?0:1;if(b&&za(w,E,S,x)===p^A){var O=(l+c)/2;w=f*Math.cos(O),E=f*Math.sin(O),S=x=null}}else w=E=0;if(u){T=u*Math.cos(c-y),N=u*Math.sin(c-y),C=u*Math.cos(l+y),k=u*Math.sin(l+y);var M=Math.abs(l-c+2*y)<=At?0:1;if(y&&za(T,N,C,k)===1-p^M){var _=(l+c)/2;T=u*Math.cos(_),N=u*Math.sin(_),C=k=null}}else T=N=0;if(h>kt&&(d=Math.min(Math.abs(f-u)/2,+n.apply(this,arguments)))>.001){v=u<f^p?0:1;var D=d,P=d;if(h<At){var H=C==null?[T,N]:S==null?[w,E]:Os([w,E],[C,k],[S,x],[T,N]),B=w-H[0],j=E-H[1],F=S-H[0],I=x-H[1],q=1/Math.sin(Math.acos((B*F+j*I)/(Math.sqrt(B*B+j*j)*Math.sqrt(F*F+I*I)))/2),R=Math.sqrt(H[0]*H[0]+H[1]*H[1]);P=Math.min(d,(u-R)/(q-1)),D=Math.min(d,(f-R)/(q+1))}if(S!=null){var U=Wa(C==null?[T,N]:[C,k],[w,E],f,D,p),z=Wa([S,x],[T,N],f,D,p);d===D?L.push("M",U[0],"A",D,",",D," 0 0,",v," ",U[1],"A",f,",",f," 0 ",1-p^za(U[1][0],U[1][1],z[1][0],z[1][1]),",",p," ",z[1],"A",D,",",D," 0 0,",v," ",z[0]):L.push("M",U[0],"A",D,",",D," 0 1,",v," ",z[0])}else L.push("M",w,",",E);if(C!=null){var W=Wa([w,E],[C,k],u,-P,p),X=Wa([T,N],S==null?[w,E]:[S,x],u,-P,p);d===P?L.push("L",X[0],"A",P,",",P," 0 0,",v," ",X[1],"A",u,",",u," 0 ",p^za(X[1][0],X[1][1],W[1][0],W[1][1]),",",1-p," ",W[1],"A",P,",",P," 0 0,",v," ",W[0]):L.push("L",X[0],"A",P,",",P," 0 0,",v," ",W[0])}else L.push("L",T,",",N)}else L.push("M",w,",",E),S!=null&&L.push("A",f,",",f," 0 ",A,",",p," ",S,",",x),L.push("L",T,",",N),C!=null&&L.push("A",u,",",u," 0 ",M,",",1-p," ",C,",",k);return L.push("Z"),L.join("")}function a(e,t){return"M0,"+e+"A"+e+","+e+" 0 1,"+t+" 0,"+ -e+"A"+e+","+e+" 0 1,"+t+" 0,"+e}var e=Fa,t=Ia,n=Ba,r=ja,i=qa,s=Ra,o=Ua;return u.innerRadius=function(t){return arguments.length?(e=Nn(t),u):e},u.outerRadius=function(e){return arguments.length?(t=Nn(e),u):t},u.cornerRadius=function(e){return arguments.length?(n=Nn(e),u):n},u.padRadius=function(e){return arguments.length?(r=e==ja?ja:Nn(e),u):r},u.startAngle=function(e){return arguments.length?(i=Nn(e),u):i},u.endAngle=function(e){return arguments.length?(s=Nn(e),u):s},u.padAngle=function(e){return arguments.length?(o=Nn(e),u):o},u.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +s.apply(this,arguments))/2-_t;return[Math.cos(r)*n,Math.sin(r)*n]},u};var ja="auto";e.svg.line=function(){return Xa(D)};var Va=e.map({linear:$a,"linear-closed":Ja,step:Ka,"step-before":Qa,"step-after":Ga,basis:rf,"basis-open":sf,"basis-closed":of,bundle:uf,cardinal:ef,"cardinal-open":Ya,"cardinal-closed":Za,monotone:mf});Va.forEach(function(e,t){t.key=e,t.closed=/-closed$/.test(e)});var ff=[0,2/3,1/3,0],lf=[0,1/3,2/3,0],cf=[0,1/6,2/3,1/6];e.svg.line.radial=function(){var e=Xa(gf);return e.radius=e.x,delete e.x,e.angle=e.y,delete e.y,e},Qa.reverse=Ga,Ga.reverse=Qa,e.svg.area=function(){return yf(D)},e.svg.area.radial=function(){var e=yf(gf);return e.radius=e.x,delete e.x,e.innerRadius=e.x0,delete e.x0,e.outerRadius=e.x1,delete e.x1,e.angle=e.y,delete e.y,e.startAngle=e.y0,delete e.y0,e.endAngle=e.y1,delete e.y1,e},e.svg.chord=function(){function s(n,r){var i=o(this,e,n,r),s=o(this,t,n,r);return"M"+i.p0+a(i.r,i.p1,i.a1-i.a0)+(u(i,s)?f(i.r,i.p1,i.r,i.p0):f(i.r,i.p1,s.r,s.p0)+a(s.r,s.p1,s.a1-s.a0)+f(s.r,s.p1,i.r,i.p0))+"Z"}function o(e,t,s,o){var u=t.call(e,s,o),a=n.call(e,u,o),f=r.call(e,u,o)-_t,l=i.call(e,u,o)-_t;return{r:a,a0:f,a1:l,p0:[a*Math.cos(f),a*Math.sin(f)],p1:[a*Math.cos(l),a*Math.sin(l)]}}function u(e,t){return e.a0==t.a0&&e.a1==t.a1}function a(e,t,n){return"A"+e+","+e+" 0 "+ +(n>At)+",1 "+t}function f(e,t,n,r){return"Q 0,0 "+r}var e=us,t=as,n=bf,r=qa,i=Ra;return s.radius=function(e){return arguments.length?(n=Nn(e),s):n},s.source=function(t){return arguments.length?(e=Nn(t),s):e},s.target=function(e){return arguments.length?(t=Nn(e),s):t},s.startAngle=function(e){return arguments.length?(r=Nn(e),s):r},s.endAngle=function(e){return arguments.length?(i=Nn(e),s):i},s},e.svg.diagonal=function(){function r(r,i){var s=e.call(this,r,i),o=t.call(this,r,i),u=(s.y+o.y)/2,a=[s,{x:s.x,y:u},{x:o.x,y:u},o];return a=a.map(n),"M"+a[0]+"C"+a[1]+" "+a[2]+" "+a[3]}var e=us,t=as,n=wf;return r.source=function(t){return arguments.length?(e=Nn(t),r):e},r.target=function(e){return arguments.length?(t=Nn(e),r):t},r.projection=function(e){return arguments.length?(n=e,r):n},r},e.svg.diagonal.radial=function(){var t=e.svg.diagonal(),n=wf,r=t.projection;return t.projection=function(e){return arguments.length?r(Ef(n=e)):n},t},e.svg.symbol=function(){function n(n,r){return(Nf.get(e.call(this,n,r))||Tf)(t.call(this,n,r))}var e=xf,t=Sf;return n.type=function(t){return arguments.length?(e=Nn(t),n):e},n.size=function(e){return arguments.length?(t=Nn(e),n):t},n};var Nf=e.map({circle:Tf,cross:function(e){var t=Math.sqrt(e/5)/2;return"M"+ -3*t+","+ -t+"H"+ -t+"V"+ -3*t+"H"+t+"V"+ -t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+ -t+"V"+t+"H"+ -3*t+"Z"},diamond:function(e){var t=Math.sqrt(e/(2*kf)),n=t*kf;return"M0,"+ -t+"L"+n+",0"+" 0,"+t+" "+ -n+",0"+"Z"},square:function(e){var t=Math.sqrt(e)/2;return"M"+ -t+","+ -t+"L"+t+","+ -t+" "+t+","+t+" "+ -t+","+t+"Z"},"triangle-down":function(e){var t=Math.sqrt(e/Cf),n=t*Cf/2;return"M0,"+n+"L"+t+","+ -n+" "+ -t+","+ -n+"Z"},"triangle-up":function(e){var t=Math.sqrt(e/Cf),n=t*Cf/2;return"M0,"+ -n+"L"+t+","+n+" "+ -t+","+n+"Z"}});e.svg.symbolTypes=Nf.keys();var Cf=Math.sqrt(3),kf=Math.tan(30*Dt);K.transition=function(e){var t=Df||++_f,n=jf(e),r=[],i,s,o=Pf||{time:Date.now(),ease:Bo,delay:0,duration:250};for(var u=-1,a=this.length;++u<a;){r.push(i=[]);for(var f=this[u],l=-1,c=f.length;++l<c;)(s=f[l])&&Ff(s,l,n,t,o),i.push(s)}return Of(r,n,t)},K.interrupt=function(e){return this.each(e==null?Lf:Af(jf(e)))};var Lf=Af(jf()),Mf=[],_f=0,Df,Pf;Mf.call=K.call,Mf.empty=K.empty,Mf.node=K.node,Mf.size=K.size,e.transition=function(t,n){return t&&t.transition?Df?t.transition(n):t:e.selection().transition(t)},e.transition.prototype=Mf,Mf.select=function(e){var t=this.id,n=this.namespace,r=[],i,s,o;e=Q(e);for(var u=-1,a=this.length;++u<a;){r.push(i=[]);for(var f=this[u],l=-1,c=f.length;++l<c;)(o=f[l])&&(s=e.call(o,o.__data__,l,u))?("__data__"in o&&(s.__data__=o.__data__),Ff(s,l,n,t,o[n][t]),i.push(s)):i.push(null)}return Of(r,n,t)},Mf.selectAll=function(e){var t=this.id,n=this.namespace,r=[],i,s,o,u,a;e=G(e);for(var f=-1,l=this.length;++f<l;)for(var c=this[f],h=-1,p=c.length;++h<p;)if(o=c[h]){a=o[n][t],s=e.call(o,o.__data__,h,f),r.push(i=[]);for(var d=-1,v=s.length;++d<v;)(u=s[d])&&Ff(u,d,n,t,a),i.push(u)}return Of(r,n,t)},Mf.filter=function(e){var t=[],n,r,i;typeof e!="function"&&(e=ct(e));for(var s=0,o=this.length;s<o;s++){t.push(n=[]);for(var r=this[s],u=0,a=r.length;u<a;u++)(i=r[u])&&e.call(i,i.__data__,u,s)&&n.push(i)}return Of(t,this.namespace,this.id)},Mf.tween=function(e,t){var n=this.id,r=this.namespace;return arguments.length<2?this.node()[r][n].tween.get(e):pt(this,t==null?function(t){t[r][n].tween.remove(e)}:function(i){i[r][n].tween.set(e,t)})},Mf.attr=function(t,n){function s(){this.removeAttribute(i)}function o(){this.removeAttributeNS(i.space,i.local)}function u(e){return e==null?s:(e+="",function(){var t=this.getAttribute(i),n;return t!==e&&(n=r(t,e),function(e){this.setAttribute(i,n(e))})})}function a(e){return e==null?o:(e+="",function(){var t=this.getAttributeNS(i.space,i.local),n;return t!==e&&(n=r(t,e),function(e){this.setAttributeNS(i.space,i.local,n(e))})})}if(arguments.length<2){for(n in t)this.attr(n,t[n]);return this}var r=t=="transform"?iu:Co,i=e.ns.qualify(t);return Hf(this,"attr."+t,n,i.local?a:u)},Mf.attrTween=function(t,n){function i(e,t){var i=n.call(this,e,t,this.getAttribute(r));return i&&function(e){this.setAttribute(r,i(e))}}function s(e,t){var i=n.call(this,e,t,this.getAttributeNS(r.space,r.local));return i&&function(e){this.setAttributeNS(r.space,r.local,i(e))}}var r=e.ns.qualify(t);return this.tween("attr."+t,r.local?s:i)},Mf.style=function(e,t,n){function i(){this.style.removeProperty(e)}function o(t){return t==null?i:(t+="",function(){var r=s(this).getComputedStyle(this,null).getPropertyValue(e),i;return r!==t&&(i=Co(r,t),function(t){this.style.setProperty(e,i(t),n)})})}var r=arguments.length;if(r<3){if(typeof e!="string"){r<2&&(t="");for(n in e)this.style(n,e[n],t);return this}n=""}return Hf(this,"style."+e,t,o)},Mf.styleTween=function(e,t,n){function r(r,i){var o=t.call(this,r,i,s(this).getComputedStyle(this,null).getPropertyValue(e));return o&&function(t){this.style.setProperty(e,o(t),n)}}return arguments.length<3&&(n=""),this.tween("style."+e,r)},Mf.text=function(e){return Hf(this,"text",e,Bf)},Mf.remove=function(){var e=this.namespace;return this.each("end.transition",function(){var t;this[e].count<2&&(t=this.parentNode)&&t.removeChild(this)})},Mf.ease=function(t){var n=this.id,r=this.namespace;return arguments.length<1?this.node()[r][n].ease:(typeof t!="function"&&(t=e.ease.apply(e,arguments)),pt(this,function(e){e[r][n].ease=t}))},Mf.delay=function(e){var t=this.id,n=this.namespace;return arguments.length<1?this.node()[n][t].delay:pt(this,typeof e=="function"?function(r,i,s){r[n][t].delay=+e.call(r,r.__data__,i,s)}:(e=+e,function(r){r[n][t].delay=e}))},Mf.duration=function(e){var t=this.id,n=this.namespace;return arguments.length<1?this.node()[n][t].duration:pt(this,typeof e=="function"?function(r,i,s){r[n][t].duration=Math.max(1,e.call(r,r.__data__,i,s))}:(e=Math.max(1,e),function(r){r[n][t].duration=e}))},Mf.each=function(t,n){var r=this.id,i=this.namespace;if(arguments.length<2){var s=Pf,o=Df;try{Df=r,pt(this,function(e,n,s){Pf=e[i][r],t.call(e,e.__data__,n,s)})}finally{Pf=s,Df=o}}else pt(this,function(s){var o=s[i][r];(o.event||(o.event=e.dispatch("start","end","interrupt"))).on(t,n)});return this},Mf.transition=function(){var e=this.id,t=++_f,n=this.namespace,r=[],i,s,o,u;for(var a=0,f=this.length;a<f;a++){r.push(i=[]);for(var s=this[a],l=0,c=s.length;l<c;l++){if(o=s[l])u=o[n][e],Ff(o,l,n,t,{time:u.time,ease:u.ease,delay:u.delay+u.duration,duration:u.duration});i.push(o)}}return Of(r,n,t)},e.svg.axis=function(){function l(n){n.each(function(){var n=e.select(this),l=this.__chart__||t,c=this.__chart__=t.copy(),h=a==null?c.ticks?c.ticks.apply(c,u):c.domain():a,p=f==null?c.tickFormat?c.tickFormat.apply(c,u):D:f,d=n.selectAll(".tick").data(h,c),v=d.enter().insert("g",".domain").attr("class","tick").style("opacity",kt),m=e.transition(d.exit()).style("opacity",kt).remove(),g=e.transition(d.order()).style("opacity",1),y=Math.max(i,0)+o,b,w=ua(c),E=n.selectAll(".domain").data([0]),S=(E.enter().append("path").attr("class","domain"),e.transition(E));v.append("line"),v.append("text");var x=v.select("line"),T=g.select("line"),N=d.select("text").text(p),C=v.select("text"),k=g.select("text"),L=r==="top"||r==="left"?-1:1,A,O,M,_;r==="bottom"||r==="top"?(b=Rf,A="x",M="y",O="x2",_="y2",N.attr("dy",L<0?"0em":".71em").style("text-anchor","middle"),S.attr("d","M"+w[0]+","+L*s+"V0H"+w[1]+"V"+L*s)):(b=Uf,A="y",M="x",O="y2",_="x2",N.attr("dy",".32em").style("text-anchor",L<0?"end":"start"),S.attr("d","M"+L*s+","+w[0]+"H0V"+w[1]+"H"+L*s)),x.attr(_,L*i),C.attr(M,L*y),T.attr(O,0).attr(_,L*i),k.attr(A,0).attr(M,L*y);if(c.rangeBand){var P=c,H=P.rangeBand()/2;l=c=function(e){return P(e)+H}}else l.rangeBand?l=c:m.call(b,c,l);v.call(b,l,c),g.call(b,c,c)})}var t=e.scale.linear(),r=If,i=6,s=6,o=3,u=[10],a=null,f;return l.scale=function(e){return arguments.length?(t=e,l):t},l.orient=function(e){return arguments.length?(r=e in qf?e+"":If,l):r},l.ticks=function(){return arguments.length?(u=n(arguments),l):u},l.tickValues=function(e){return arguments.length?(a=e,l):a},l.tickFormat=function(e){return arguments.length?(f=e,l):f},l.tickSize=function(e){var t=arguments.length;return t?(i=+e,s=+arguments[t-1],l):i},l.innerTickSize=function(e){return arguments.length?(i=+e,l):i},l.outerTickSize=function(e){return arguments.length?(s=+e,l):s},l.tickPadding=function(e){return arguments.length?(o=+e,l):o},l.tickSubdivide=function(){return arguments.length&&l},l};var If="bottom",qf={top:1,right:1,bottom:1,left:1};e.svg.brush=function(){function h(t){t.each(function(){var t=e.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",m).on("touchstart.brush",m),i=t.selectAll(".background").data([0]);i.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),t.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var s=t.selectAll(".resize").data(c,D);s.exit().remove(),s.enter().append("g").attr("class",function(e){return"resize "+e}).style("cursor",function(e){return zf[e]}).append("rect").attr("x",function(e){return/[ew]$/.test(e)?-3:null}).attr("y",function(e){return/^[ns]/.test(e)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),s.style("display",h.empty()?"none":null);var o=e.transition(t),u=e.transition(i),a;n&&(a=ua(n),u.attr("x",a[0]).attr("width",a[1]-a[0]),d(o)),r&&(a=ua(r),u.attr("y",a[0]).attr("height",a[1]-a[0]),v(o)),p(o)})}function p(e){e.selectAll(".resize").attr("transform",function(e){return"translate("+i[+/e$/.test(e)]+","+o[+/^s/.test(e)]+")"})}function d(e){e.select(".extent").attr("x",i[0]),e.selectAll(".extent,.n>rect,.s>rect").attr("width",i[1]-i[0])}function v(e){e.select(".extent").attr("y",o[0]),e.selectAll(".extent,.e>rect,.w>rect").attr("height",o[1]-o[0])}function m(){function O(){e.event.keyCode==32&&(S||(T=null,N[0]-=i[1],N[1]-=o[1],S=2),q())}function M(){e.event.keyCode==32&&S==2&&(N[0]+=i[1],N[1]+=o[1],S=0,q())}function _(){var t=e.mouse(c),s=!1;C&&(t[0]+=C[0],t[1]+=C[1]),S||(e.event.altKey?(T||(T=[(i[0]+i[1])/2,(o[0]+o[1])/2]),N[0]=i[+(t[0]<T[0])],N[1]=o[+(t[1]<T[1])]):T=null),w&&D(t,n,0)&&(d(y),s=!0),E&&D(t,r,1)&&(v(y),s=!0),s&&(p(y),g({type:"brush",mode:S?"move":"resize"}))}function D(e,t,n){var r=ua(t),s=r[0],c=r[1],h=N[n],p=n?o:i,d=p[1]-p[0],v,m;S&&(s-=h,c-=d+h),v=(n?l:f)?Math.max(s,Math.min(c,e[n])):e[n],S?m=(v+=h)+d:(T&&(h=Math.max(s,Math.min(c,2*T[n]-v))),h<v?(m=v,v=h):m=h);if(p[0]!=v||p[1]!=m)return n?a=null:u=null,p[0]=v,p[1]=m,!0}function P(){_(),y.style("pointer-events","all").selectAll(".resize").style("display",h.empty()?"none":null),e.select("body").style("cursor",null),k.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),x(),g({type:"brushend"})}var c=this,m=e.select(e.event.target),g=t.of(c,arguments),y=e.select(c),b=m.datum(),w=!/^(n|s)$/.test(b)&&n,E=!/^(e|w)$/.test(b)&&r,S=m.classed("extent"),x=xt(c),T,N=e.mouse(c),C,k=e.select(s(c)).on("keydown.brush",O).on("keyup.brush",M);e.event.changedTouches?k.on("touchmove.brush",_).on("touchend.brush",P):k.on("mousemove.brush",_).on("mouseup.brush",P),y.interrupt().selectAll("*").interrupt();if(S)N[0]=i[0]-N[0],N[1]=o[0]-N[1];else if(b){var L=+/w$/.test(b),A=+/^n/.test(b);C=[i[1-L]-N[0],o[1-A]-N[1]],N[0]=i[L],N[1]=o[A]}else e.event.altKey&&(T=N.slice());y.style("pointer-events","none").selectAll(".resize").style("display",null),e.select("body").style("cursor",m.style("cursor")),g({type:"brushstart"}),_()}var t=U(h,"brushstart","brush","brushend"),n=null,r=null,i=[0,0],o=[0,0],u,a,f=!0,l=!0,c=Wf[0];return h.event=function(n){n.each(function(){var n=t.of(this,arguments),r={x:i,y:o,i:u,j:a},s=this.__chart__||r;this.__chart__=r,Df?e.select(this).transition().each("start.brush",function(){u=s.i,a=s.j,i=s.x,o=s.y,n({type:"brushstart"})}).tween("brush:brush",function(){var e=ko(i,r.x),t=ko(o,r.y);return u=a=null,function(s){i=r.x=e(s),o=r.y=t(s),n({type:"brush",mode:"resize"})}}).each("end.brush",function(){u=r.i,a=r.j,n({type:"brush",mode:"resize"}),n({type:"brushend"})}):(n({type:"brushstart"}),n({type:"brush",mode:"resize"}),n({type:"brushend"}))})},h.x=function(e){return arguments.length?(n=e,c=Wf[!n<<1|!r],h):n},h.y=function(e){return arguments.length?(r=e,c=Wf[!n<<1|!r],h):r},h.clamp=function(e){return arguments.length?(n&&r?(f=!!e[0],l=!!e[1]):n?f=!!e:r&&(l=!!e),h):n&&r?[f,l]:n?f:r?l:null},h.extent=function(e){var t,s,f,l,c;if(!arguments.length)return n&&(u?(t=u[0],s=u[1]):(t=i[0],s=i[1],n.invert&&(t=n.invert(t),s=n.invert(s)),s<t&&(c=t,t=s,s=c))),r&&(a?(f=a[0],l=a[1]):(f=o[0],l=o[1],r.invert&&(f=r.invert(f),l=r.invert(l)),l<f&&(c=f,f=l,l=c))),n&&r?[[t,f],[s,l]]:n?[t,s]:r&&[f,l];if(n){t=e[0],s=e[1],r&&(t=t[0],s=s[0]),u=[t,s],n.invert&&(t=n(t),s=n(s)),s<t&&(c=t,t=s,s=c);if(t!=i[0]||s!=i[1])i=[t,s]}if(r){f=e[0],l=e[1],n&&(f=f[1],l=l[1]),a=[f,l],r.invert&&(f=r(f),l=r(l)),l<f&&(c=f,f=l,l=c);if(f!=o[0]||l!=o[1])o=[f,l]}return h},h.clear=function(){return h.empty()||(i=[0,0],o=[0,0],u=a=null),h},h.empty=function(){return!!n&&i[0]==i[1]||!!r&&o[0]==o[1]},e.rebind(h,t,"on")};var zf={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Wf=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Xf=Vn.format=Sr.timeFormat,Vf=Xf.utc,$f=Vf("%Y-%m-%dT%H:%M:%S.%LZ");Xf.iso=Date.prototype.toISOString&&+(new Date("2000-01-01T00:00:00.000Z"))?Jf:$f,Jf.parse=function(e){var t=new Date(e);return isNaN(t)?null:t},Jf.toString=$f.toString,Vn.second=Qn(function(e){return new $n(Math.floor(e/1e3)*1e3)},function(e,t){e.setTime(e.getTime()+Math.floor(t)*1e3)},function(e){return e.getSeconds()}),Vn.seconds=Vn.second.range,Vn.seconds.utc=Vn.second.utc.range,Vn.minute=Qn(function(e){return new $n(Math.floor(e/6e4)*6e4)},function(e,t){e.setTime(e.getTime()+Math.floor(t)*6e4)},function(e){return e.getMinutes()}),Vn.minutes=Vn.minute.range,Vn.minutes.utc=Vn.minute.utc.range,Vn.hour=Qn(function(e){var t=e.getTimezoneOffset()/60;return new $n((Math.floor(e/36e5-t)+t)*36e5)},function(e,t){e.setTime(e.getTime()+Math.floor(t)*36e5)},function(e){return e.getHours()}),Vn.hours=Vn.hour.range,Vn.hours.utc=Vn.hour.utc.range,Vn.month=Qn(function(e){return e=Vn.day(e),e.setDate(1),e},function(e,t){e.setMonth(e.getMonth()+t)},function(e){return e.getMonth()}),Vn.months=Vn.month.range,Vn.months.utc=Vn.month.utc.range;var Gf=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Yf=[[Vn.second,1],[Vn.second,5],[Vn.second,15],[Vn.second,30],[Vn.minute,1],[Vn.minute,5],[Vn.minute,15],[Vn.minute,30],[Vn.hour,1],[Vn.hour,3],[Vn.hour,6],[Vn.hour,12],[Vn.day,1],[Vn.day,2],[Vn.week,1],[Vn.month,1],[Vn.month,3],[Vn.year,1]],Zf=Xf.multi([[".%L",function(e){return e.getMilliseconds()}],[":%S",function(e){return e.getSeconds()}],["%I:%M",function(e){return e.getMinutes()}],["%I %p",function(e){return e.getHours()}],["%a %d",function(e){return e.getDay()&&e.getDate()!=1}],["%b %d",function(e){return e.getDate()!=1}],["%B",function(e){return e.getMonth()}],["%Y",ui]]),el={range:function(t,n,r){return e.range(Math.ceil(t/r)*r,+n,r).map(Qf)},floor:D,ceil:D};Yf.year=Vn.year,Vn.scale=function(){return Kf(e.scale.linear(),Yf,Zf)};var tl=Yf.map(function(e){return[e[0].utc,e[1]]}),nl=Vf.multi([[".%L",function(e){return e.getUTCMilliseconds()}],[":%S",function(e){return e.getUTCSeconds()}],["%I:%M",function(e){return e.getUTCMinutes()}],["%I %p",function(e){return e.getUTCHours()}],["%a %d",function(e){return e.getUTCDay()&&e.getUTCDate()!=1}],["%b %d",function(e){return e.getUTCDate()!=1}],["%B",function(e){return e.getUTCMonth()}],["%Y",ui]]);tl.year=Vn.year.utc,Vn.scale.utc=function(){return Kf(e.scale.linear(),tl,nl)},e.text=Cn(function(e){return e.responseText}),e.json=function(e,t){return kn(e,"application/json",rl,t)},e.html=function(e,t){return kn(e,"text/html",il,t)},e.xml=Cn(function(e){return e.responseXML}),typeof define=="function"&&define.amd?(this.d3=e,define("d3",e)):typeof module=="object"&&module.exports?module.exports=e:this.d3=e}(),function(e){function s(e){this.owner=e}function o(e,t){if(Object.create)t.prototype=Object.create(e.prototype);else{var n=function(){};n.prototype=e.prototype,t.prototype=new n}return t.prototype.constructor=t,t}function u(e){var t=this.internal=new a(this);t.loadConfig(e),t.beforeInit(e),t.init(),t.afterInit(e),function r(e,t,n){Object.keys(e).forEach(function(i){t[i]=e[i].bind(n),Object.keys(e[i]).length>0&&r(e[i],t[i],n)})}(n,this,this)}function a(t){var n=this;n.d3=e.d3?e.d3:typeof require!="undefined"?require("d3"):undefined,n.api=t,n.config=n.getDefaultConfig(),n.data={},n.cache={},n.axes={}}function f(e){s.call(this,e)}function C(e,t){function p(e,t){e.attr("transform",function(e){return"translate("+Math.ceil(t(e)+l)+", 0)"})}function d(e,t){e.attr("transform",function(e){return"translate(0,"+Math.ceil(t(e))+")"})}function v(e){var t=e[0],n=e[e.length-1];return t<n?[t,n]:[n,t]}function m(e){var t,n,r=[];if(e.ticks)return e.ticks.apply(e,f);n=e.domain();for(t=Math.ceil(n[0]);t<n[1];t++)r.push(t);return r.length>0&&r[0]>0&&r.unshift(r[0]-(r[1]-r[0])),r}function g(){var e=n.copy(),r;return t.isCategory&&(r=n.domain(),e.domain([r[0],r[1]-1])),e}function y(e){var t=a?a(e):e;return typeof t!="undefined"?t:""}function b(e){if(N)return N;var t={h:11.5,w:5.5};return e.select("text").text(y).each(function(e){var n=this.getBoundingClientRect(),r=y(e),i=n.height,s=r?n.width/r.length:undefined;i&&s&&(t.h=i,t.w=s)}).text(""),N=t,t}function w(n){return t.withoutTransition?n:e.transition(n)}function E(a){a.each(function(){function z(e,n){function a(e,t){s=undefined;for(var r=1;r<t.length;r++){t.charAt(r)===" "&&(s=r),i=t.substr(0,r+1),o=I.w*i.length;if(n<o)return a(e.concat(t.substr(0,s?s:r)),t.slice(s?s+1:r))}return e.concat(t)}var r=y(e),i,s,o,u=[];if(Object.prototype.toString.call(r)==="[object Array]")return r;if(!n||n<=0)n=U?95:t.isCategory?Math.ceil(c(S[1])-c(S[0]))-12:110;return a(u,r+"")}function W(e,t){var n=I.h;return t===0&&(r==="left"||r==="right"?n=-((q[e.index]-1)*(I.h/2)-3):n=".71em"),n}function X(e){var t=n(e)+(h?0:l);return O[0]<t&&t<O[1]?i:0}function $(e){return e?e>0?"start":"end":"middle"}function J(e){return e?"rotate("+e+")":""}function K(e){return e?8*Math.sin(Math.PI*(e/180)):0}function Q(e){return e?11.5-2.5*(e/15)*(e>0?1:-1):R}var a=E.g=e.select(this),f=this.__chart__||n,c=this.__chart__=g(),S=u?u:m(c),x=a.selectAll(".tick").data(S,c),T=x.enter().insert("g",".domain").attr("class","tick").style("opacity",1e-6),N=x.exit().remove(),C=w(x).style("opacity",1),k,L,A,O=n.rangeExtent?n.rangeExtent():v(n.range()),M=a.selectAll(".domain").data([0]),_=(M.enter().append("path").attr("class","domain"),w(M));T.append("line"),T.append("text");var D=T.select("line"),P=C.select("line"),H=T.select("text"),B=C.select("text");t.isCategory?(l=Math.ceil((c(1)-c(0))/2),L=h?0:l,A=h?l:0):l=L=0;var j,F,I=b(a.select(".tick")),q=[],R=Math.max(i,0)+o,U=r==="left"||r==="right";j=x.select("text"),F=j.selectAll("tspan").data(function(e,n){var r=t.tickMultiline?z(e,t.tickWidth):[].concat(y(e));return q[n]=r.length,r.map(function(e){return{index:n,splitted:e}})}),F.enter().append("tspan"),F.exit().remove(),F.text(function(e){return e.splitted});var V=t.tickTextRotate;switch(r){case"bottom":k=p,D.attr("y2",i),H.attr("y",R),P.attr("x1",L).attr("x2",L).attr("y2",X),B.attr("x",0).attr("y",Q(V)).style("text-anchor",$(V)).attr("transform",J(V)),F.attr("x",0).attr("dy",W).attr("dx",K(V)),_.attr("d","M"+O[0]+","+s+"V0H"+O[1]+"V"+s);break;case"top":k=p,D.attr("y2",-i),H.attr("y",-R),P.attr("x2",0).attr("y2",-i),B.attr("x",0).attr("y",-R),j.style("text-anchor","middle"),F.attr("x",0).attr("dy","0em"),_.attr("d","M"+O[0]+","+ -s+"V0H"+O[1]+"V"+ -s);break;case"left":k=d,D.attr("x2",-i),H.attr("x",-R),P.attr("x2",-i).attr("y1",A).attr("y2",A),B.attr("x",-R).attr("y",l),j.style("text-anchor","end"),F.attr("x",-R).attr("dy",W),_.attr("d","M"+ -s+","+O[0]+"H0V"+O[1]+"H"+ -s);break;case"right":k=d,D.attr("x2",i),H.attr("x",R),P.attr("x2",i).attr("y2",0),B.attr("x",R).attr("y",0),j.style("text-anchor","start"),F.attr("x",R).attr("dy",W),_.attr("d","M"+s+","+O[0]+"H0V"+O[1]+"H"+s)}if(c.rangeBand){var G=c,Y=G.rangeBand()/2;f=c=function(e){return G(e)+Y}}else f.rangeBand?f=c:N.call(k,c);T.call(k,f),C.call(k,c)})}var n=e.scale.linear(),r="bottom",i=6,s,o=3,u=null,a,f,l=0,c=!0,h;return t=t||{},s=t.withOuterTick?6:0,E.scale=function(e){return arguments.length?(n=e,E):n},E.orient=function(e){return arguments.length?(r=e in{top:1,right:1,bottom:1,left:1}?e+"":"bottom",E):r},E.tickFormat=function(e){return arguments.length?(a=e,E):a},E.tickCentered=function(e){return arguments.length?(h=e,E):h},E.tickOffset=function(){return l},E.tickInterval=function(){var e,n;return t.isCategory?e=l*2:(n=E.g.select("path.domain").node().getTotalLength()-s*2,e=n/E.g.selectAll("line").size()),e===Infinity?0:e},E.ticks=function(){return arguments.length?(f=arguments,E):f},E.tickCulling=function(e){return arguments.length?(c=e,E):c},E.tickValues=function(e){if(typeof e=="function")u=function(){return e(n.domain())};else{if(!arguments.length)return u;u=e}return E},E}var t={version:"0.4.11"},n,r,i;t.generate=function(e){return new u(e)},t.chart={fn:u.prototype,internal:{fn:a.prototype,axis:{fn:f.prototype}}},n=t.chart.fn,r=t.chart.internal.fn,i=t.chart.internal.axis.fn,r.beforeInit=function(){},r.afterInit=function(){},r.init=function(){var e=this,t=e.config;e.initParams();if(t.data_url)e.convertUrlToData(t.data_url,t.data_mimeType,t.data_headers,t.data_keys,e.initWithData);else if(t.data_json)e.initWithData(e.convertJsonToData(t.data_json,t.data_keys));else if(t.data_rows)e.initWithData(e.convertRowsToData(t.data_rows));else{if(!t.data_columns)throw Error("url or json or rows or columns is required.");e.initWithData(e.convertColumnsToData(t.data_columns))}},r.initParams=function(){var e=this,t=e.d3,n=e.config;e.clipId="c3-"+ +(new Date)+"-clip",e.clipIdForXAxis=e.clipId+"-xaxis",e.clipIdForYAxis=e.clipId+"-yaxis",e.clipIdForGrid=e.clipId+"-grid",e.clipIdForSubchart=e.clipId+"-subchart",e.clipPath=e.getClipPath(e.clipId),e.clipPathForXAxis=e.getClipPath(e.clipIdForXAxis),e.clipPathForYAxis=e.getClipPath(e.clipIdForYAxis),e.clipPathForGrid=e.getClipPath(e.clipIdForGrid),e.clipPathForSubchart=e.getClipPath(e.clipIdForSubchart),e.dragStart=null,e.dragging=!1,e.flowing=!1,e.cancelClick=!1,e.mouseover=!1,e.transiting=!1,e.color=e.generateColor(),e.levelColor=e.generateLevelColor(),e.dataTimeFormat=n.data_xLocaltime?t.time.format:t.time.format.utc,e.axisTimeFormat=n.axis_x_localtime?t.time.format:t.time.format.utc,e.defaultAxisTimeFormat=e.axisTimeFormat.multi([[".%L",function(e){return e.getMilliseconds()}],[":%S",function(e){return e.getSeconds()}],["%I:%M",function(e){return e.getMinutes()}],["%I %p",function(e){return e.getHours()}],["%-m/%-d",function(e){return e.getDay()&&e.getDate()!==1}],["%-m/%-d",function(e){return e.getDate()!==1}],["%-m/%-d",function(e){return e.getMonth()}],["%Y/%-m/%-d",function(){return!0}]]),e.hiddenTargetIds=[],e.hiddenLegendIds=[],e.focusedTargetIds=[],e.defocusedTargetIds=[],e.xOrient=n.axis_rotated?"left":"bottom",e.yOrient=n.axis_rotated?n.axis_y_inner?"top":"bottom":n.axis_y_inner?"right":"left",e.y2Orient=n.axis_rotated?n.axis_y2_inner?"bottom":"top":n.axis_y2_inner?"left":"right",e.subXOrient=n.axis_rotated?"left":"bottom",e.isLegendRight=n.legend_position==="right",e.isLegendInset=n.legend_position==="inset",e.isLegendTop=n.legend_inset_anchor==="top-left"||n.legend_inset_anchor==="top-right",e.isLegendLeft=n.legend_inset_anchor==="top-left"||n.legend_inset_anchor==="bottom-left",e.legendStep=0,e.legendItemWidth=0,e.legendItemHeight=0,e.currentMaxTickWidths={x:0,y:0,y2:0},e.rotated_padding_left=30,e.rotated_padding_right=n.axis_rotated&&!n.axis_x_show?0:30,e.rotated_padding_top=5,e.withoutFadeIn={},e.intervalForObserveInserted=undefined,e.axes.subx=t.selectAll([])},r.initChartElements=function(){this.initBar&&this.initBar(),this.initLine&&this.initLine(),this.initArc&&this.initArc(),this.initGauge&&this.initGauge(),this.initText&&this.initText()},r.initWithData=function(e){var t=this,n=t.d3,r=t.config,i,s,o=!0;t.axis=new f(t),t.initPie&&t.initPie(),t.initBrush&&t.initBrush(),t.initZoom&&t.initZoom(),r.bindto?typeof r.bindto.node=="function"?t.selectChart=r.bindto:t.selectChart=n.select(r.bindto):t.selectChart=n.selectAll([]),t.selectChart.empty()&&(t.selectChart=n.select(document.createElement("div")).style("opacity",0),t.observeInserted(t.selectChart),o=!1),t.selectChart.html("").classed("c3",!0),t.data.xs={},t.data.targets=t.convertDataToTargets(e),r.data_filter&&(t.data.targets=t.data.targets.filter(r.data_filter)),r.data_hide&&t.addHiddenTargetIds(r.data_hide===!0?t.mapToIds(t.data.targets):r.data_hide),r.legend_hide&&t.addHiddenLegendIds(r.legend_hide===!0?t.mapToIds(t.data.targets):r.legend_hide),t.hasType("gauge")&&(r.legend_show=!1),t.updateSizes(),t.updateScales(),t.x.domain(n.extent(t.getXDomain(t.data.targets))),t.y.domain(t.getYDomain(t.data.targets,"y")),t.y2.domain(t.getYDomain(t.data.targets,"y2")),t.subX.domain(t.x.domain()),t.subY.domain(t.y.domain()),t.subY2.domain(t.y2.domain()),t.orgXDomain=t.x.domain(),t.brush&&t.brush.scale(t.subX),r.zoom_enabled&&t.zoom.scale(t.x),t.svg=t.selectChart.append("svg").style("overflow","hidden").on("mouseenter",function(){return r.onmouseover.call(t)}).on("mouseleave",function(){return r.onmouseout.call(t)}),t.config.svg_classname&&t.svg.attr("class",t.config.svg_classname),i=t.svg.append("defs"),t.clipChart=t.appendClip(i,t.clipId),t.clipXAxis=t.appendClip(i,t.clipIdForXAxis),t.clipYAxis=t.appendClip(i,t.clipIdForYAxis),t.clipGrid=t.appendClip(i,t.clipIdForGrid),t.clipSubchart=t.appendClip(i,t.clipIdForSubchart),t.updateSvgSize(),s=t.main=t.svg.append("g").attr("transform",t.getTranslate("main")),t.initSubchart&&t.initSubchart(),t.initTooltip&&t.initTooltip(),t.initLegend&&t.initLegend(),t.initTitle&&t.initTitle(),s.append("text").attr("class",l.text+" "+l.empty).attr("text-anchor","middle").attr("dominant-baseline","middle"),t.initRegion(),t.initGrid(),s.append("g").attr("clip-path",t.clipPath).attr("class",l.chart),r.grid_lines_front&&t.initGridLines(),t.initEventRect(),t.initChartElements(),s.insert("rect",r.zoom_privileged?null:"g."+l.regions).attr("class",l.zoomRect).attr("width",t.width).attr("height",t.height).style("opacity",0).on("dblclick.zoom",null),r.axis_x_extent&&t.brush.extent(t.getDefaultExtent()),t.axis.init(),t.updateTargets(t.data.targets),o&&(t.updateDimension(),t.config.oninit.call(t),t.redraw({withTransition:!1,withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransitionForAxis:!1})),t.bindResize(),t.api.element=t.selectChart.node()},r.smoothLines=function(e,t){var n=this;t==="grid"&&e.each(function(){var e=n.d3.select(this),t=e.attr("x1"),r=e.attr("x2"),i=e.attr("y1"),s=e.attr("y2");e.attr({x1:Math.ceil(t),x2:Math.ceil(r),y1:Math.ceil(i),y2:Math.ceil(s)})})},r.updateSizes=function(){var e=this,t=e.config,n=e.legend?e.getLegendHeight():0,r=e.legend?e.getLegendWidth():0,i=e.isLegendRight||e.isLegendInset?0:n,s=e.hasArcType(),o=t.axis_rotated||s?0:e.getHorizontalAxisHeight("x"),u=t.subchart_show&&!s?t.subchart_size_height+o:0;e.currentWidth=e.getCurrentWidth(),e.currentHeight=e.getCurrentHeight(),e.margin=t.axis_rotated?{top:e.getHorizontalAxisHeight("y2")+e.getCurrentPaddingTop(),right:s?0:e.getCurrentPaddingRight(),bottom:e.getHorizontalAxisHeight("y")+i+e.getCurrentPaddingBottom(),left:u+(s?0:e.getCurrentPaddingLeft())}:{top:4+e.getCurrentPaddingTop(),right:s?0:e.getCurrentPaddingRight(),bottom:o+u+i+e.getCurrentPaddingBottom(),left:s?0:e.getCurrentPaddingLeft()},e.margin2=t.axis_rotated?{top:e.margin.top,right:NaN,bottom:20+i,left:e.rotated_padding_left}:{top:e.currentHeight-u-i,right:NaN,bottom:o+i,left:e.margin.left},e.margin3={top:0,right:NaN,bottom:0,left:0},e.updateSizeForLegend&&e.updateSizeForLegend(n,r),e.width=e.currentWidth-e.margin.left-e.margin.right,e.height=e.currentHeight-e.margin.top-e.margin.bottom,e.width<0&&(e.width=0),e.height<0&&(e.height=0),e.width2=t.axis_rotated?e.margin.left-e.rotated_padding_left-e.rotated_padding_right:e.width,e.height2=t.axis_rotated?e.height:e.currentHeight-e.margin2.top-e.margin2.bottom,e.width2<0&&(e.width2=0),e.height2<0&&(e.height2=0),e.arcWidth=e.width-(e.isLegendRight?r+10:0),e.arcHeight=e.height-(e.isLegendRight?0:10),e.hasType("gauge")&&!t.gauge_fullCircle&&(e.arcHeight+=e.height-e.getGaugeLabelHeight()),e.updateRadius&&e.updateRadius(),e.isLegendRight&&s&&(e.margin3.left=e.arcWidth/2+e.radiusExpanded*1.1)},r.updateTargets=function(e){var t=this;t.updateTargetsForText(e),t.updateTargetsForBar(e),t.updateTargetsForLine(e),t.hasArcType()&&t.updateTargetsForArc&&t.updateTargetsForArc(e),t.updateTargetsForSubchart&&t.updateTargetsForSubchart(e),t.showTargets()},r.showTargets=function(){var e=this;e.svg.selectAll("."+l.target).filter(function(t){return e.isTargetToShow(t.id)}).transition().duration(e.config.transition_duration).style("opacity",1)},r.redraw=function(e,t){var n=this,r=n.main,i=n.d3,s=n.config,o=n.getShapeIndices(n.isAreaType),u=n.getShapeIndices(n.isBarType),a=n.getShapeIndices(n.isLineType),f,c,h,p,d,v,m,g,y,b,w,S,x,T=n.hasArcType(),N,C,k,L,A,O,M,_,D,P,H=n.filterTargetsToShow(n.data.targets),B,j,F,I,q=n.xv.bind(n),R,U;e=e||{},f=E(e,"withY",!0),c=E(e,"withSubchart",!0),h=E(e,"withTransition",!0),v=E(e,"withTransform",!1),m=E(e,"withUpdateXDomain",!1),g=E(e,"withUpdateOrgXDomain",!1),y=E(e,"withTrimXDomain",!0),x=E(e,"withUpdateXAxis",m),b=E(e,"withLegend",!1),w=E(e,"withEventRect",!0),S=E(e,"withDimension",!0),p=E(e,"withTransitionForExit",h),d=E(e,"withTransitionForAxis",h),O=h?s.transition_duration:0,M=p?O:0,_=d?O:0,t=t||n.axis.generateTransitions(_),b&&s.legend_show?n.updateLegend(n.mapToIds(n.data.targets),e,t):S&&n.updateDimension(!0),n.isCategorized()&&H.length===0&&n.x.domain([0,n.axes.x.selectAll(".tick").size()]),H.length?(n.updateXDomain(H,m,g,y),s.axis_x_tick_values||(B=n.axis.updateXAxisTickValues(H))):(n.xAxis.tickValues([]),n.subXAxis.tickValues([])),s.zoom_rescale&&!e.flow&&(I=n.x.orgDomain()),n.y.domain(n.getYDomain(H,"y",I)),n.y2.domain(n.getYDomain(H,"y2",I)),!s.axis_y_tick_values&&s.axis_y_tick_count&&n.yAxis.tickValues(n.axis.generateTickValues(n.y.domain(),s.axis_y_tick_count)),!s.axis_y2_tick_values&&s.axis_y2_tick_count&&n.y2Axis.tickValues(n.axis.generateTickValues(n.y2.domain(),s.axis_y2_tick_count)),n.axis.redraw(t,T),n.axis.updateLabels(h);if((m||x)&&H.length)if(s.axis_x_tick_culling&&B){for(j=1;j<B.length;j++)if(B.length/j<s.axis_x_tick_culling_max){F=j;break}n.svg.selectAll("."+l.axisX+" .tick text").each(function(e){var t=B.indexOf(e);t>=0&&i.select(this).style("display",t%F?"none":"block")})}else n.svg.selectAll("."+l.axisX+" .tick text").style("display","block");N=n.generateDrawArea?n.generateDrawArea(o,!1):undefined,C=n.generateDrawBar?n.generateDrawBar(u):undefined,k=n.generateDrawLine?n.generateDrawLine(a,!1):undefined,L=n.generateXYForText(o,u,a,!0),A=n.generateXYForText(o,u,a,!1),f&&(n.subY.domain(n.getYDomain(H,"y")),n.subY2.domain(n.getYDomain(H,"y2"))),n.updateXgridFocus(),r.select("text."+l.text+"."+l.empty).attr("x",n.width/2).attr("y",n.height/2).text(s.data_empty_label_text).transition().style("opacity",H.length?0:1),n.updateGrid(O),n.updateRegion(O),n.updateBar(M),n.updateLine(M),n.updateArea(M),n.updateCircle(),n.hasDataLabel()&&n.updateText(M),n.redrawTitle&&n.redrawTitle(),n.redrawArc&&n.redrawArc(O,M,v),n.redrawSubchart&&n.redrawSubchart(c,t,O,M,o,u,a),r.selectAll("."+l.selectedCircles).filter(n.isBarType.bind(n)).selectAll("circle").remove(),s.interaction_enabled&&!e.flow&&w&&(n.redrawEventRect(),n.updateZoom&&n.updateZoom()),n.updateCircleY(),R=(n.config.axis_rotated?n.circleY:n.circleX).bind(n),U=(n.config.axis_rotated?n.circleX:n.circleY).bind(n),e.flow&&(P=n.generateFlow({targets:H,flow:e.flow,duration:e.flow.duration,drawBar:C,drawLine:k,drawArea:N,cx:R,cy:U,xv:q,xForText:L,yForText:A})),(O||P)&&n.isTabVisible()?i.transition().duration(O).each(function(){var t=[];[n.redrawBar(C,!0),n.redrawLine(k,!0),n.redrawArea(N,!0),n.redrawCircle(R,U,!0),n.redrawText(L,A,e.flow,!0),n.redrawRegion(!0),n.redrawGrid(!0)].forEach(function(e){e.forEach(function(e){t.push(e)})}),D=n.generateWait(),t.forEach(function(e){D.add(e)})}).call(D,function(){P&&P(),s.onrendered&&s.onrendered.call(n)}):(n.redrawBar(C),n.redrawLine(k),n.redrawArea(N),n.redrawCircle(R,U),n.redrawText(L,A,e.flow),n.redrawRegion(),n.redrawGrid(),s.onrendered&&s.onrendered.call(n)),n.mapToIds(n.data.targets).forEach(function(e){n.withoutFadeIn[e]=!0})},r.updateAndRedraw=function(e){var t=this,n=t.config,r;e=e||{},e.withTransition=E(e,"withTransition",!0),e.withTransform=E(e,"withTransform",!1),e.withLegend=E(e,"withLegend",!1),e.withUpdateXDomain=!0,e.withUpdateOrgXDomain=!0,e.withTransitionForExit=!1,e.withTransitionForTransform=E(e,"withTransitionForTransform",e.withTransition),t.updateSizes();if(!e.withLegend||!n.legend_show)r=t.axis.generateTransitions(e.withTransitionForAxis?n.transition_duration:0),t.updateScales(),t.updateSvgSize(),t.transformAll(e.withTransitionForTransform,r);t.redraw(e,r)},r.redrawWithoutRescale=function(){this.redraw({withY:!1,withSubchart:!1,withEventRect:!1,withTransitionForAxis:!1})},r.isTimeSeries=function(){return this.config.axis_x_type==="timeseries"},r.isCategorized=function(){return this.config.axis_x_type.indexOf("categor")>=0},r.isCustomX=function(){var e=this,t=e.config;return!e.isTimeSeries()&&(t.data_x||w(t.data_xs))},r.isTimeSeriesY=function(){return this.config.axis_y_type==="timeseries"},r.getTranslate=function(e){var t=this,n=t.config,r,i;return e==="main"?(r=g(t.margin.left),i=g(t.margin.top)):e==="context"?(r=g(t.margin2.left),i=g(t.margin2.top)):e==="legend"?(r=t.margin3.left,i=t.margin3.top):e==="x"?(r=0,i=n.axis_rotated?0:t.height):e==="y"?(r=0,i=n.axis_rotated?t.height:0):e==="y2"?(r=n.axis_rotated?0:t.width,i=n.axis_rotated?1:0):e==="subx"?(r=0,i=n.axis_rotated?0:t.height2):e==="arc"&&(r=t.arcWidth/2,i=t.arcHeight/2),"translate("+r+","+i+")"},r.initialOpacity=function(e){return e.value!==null&&this.withoutFadeIn[e.id]?1:0},r.initialOpacityForCircle=function(e){return e.value!==null&&this.withoutFadeIn[e.id]?this.opacityForCircle(e):0},r.opacityForCircle=function(e){var t=this.config.point_show?1:0;return c(e.value)?this.isScatterType(e)?.5:t:0},r.opacityForText=function(){return this.hasDataLabel()?1:0},r.xx=function(e){return e?this.x(e.x):null},r.xv=function(e){var t=this,n=e.value;return t.isTimeSeries()?n=t.parseDate(e.value):t.isCategorized()&&typeof e.value=="string"&&(n=t.config.axis_x_categories.indexOf(e.value)),Math.ceil(t.x(n))},r.yv=function(e){var t=this,n=e.axis&&e.axis==="y2"?t.y2:t.y;return Math.ceil(n(e.value))},r.subxx=function(e){return e?this.subX(e.x):null},r.transformMain=function(e,t){var n=this,r,i,s;t&&t.axisX?r=t.axisX:(r=n.main.select("."+l.axisX),e&&(r=r.transition())),t&&t.axisY?i=t.axisY:(i=n.main.select("."+l.axisY),e&&(i=i.transition())),t&&t.axisY2?s=t.axisY2:(s=n.main.select("."+l.axisY2),e&&(s=s.transition())),(e?n.main.transition():n.main).attr("transform",n.getTranslate("main")),r.attr("transform",n.getTranslate("x")),i.attr("transform",n.getTranslate("y")),s.attr("transform",n.getTranslate("y2")),n.main.select("."+l.chartArcs).attr("transform",n.getTranslate("arc"))},r.transformAll=function(e,t){var n=this;n.transformMain(e,t),n.config.subchart_show&&n.transformContext(e,t),n.legend&&n.transformLegend(e)},r.updateSvgSize=function(){var e=this,t=e.svg.select(".c3-brush .background");e.svg.attr("width",e.currentWidth).attr("height",e.currentHeight),e.svg.selectAll(["#"+e.clipId,"#"+e.clipIdForGrid]).select("rect").attr("width",e.width).attr("height",e.height),e.svg.select("#"+e.clipIdForXAxis).select("rect").attr("x",e.getXAxisClipX.bind(e)).attr("y",e.getXAxisClipY.bind(e)).attr("width",e.getXAxisClipWidth.bind(e)).attr("height",e.getXAxisClipHeight.bind(e)),e.svg.select("#"+e.clipIdForYAxis).select("rect").attr("x",e.getYAxisClipX.bind(e)).attr("y",e.getYAxisClipY.bind(e)).attr("width",e.getYAxisClipWidth.bind(e)).attr("height",e.getYAxisClipHeight.bind(e)),e.svg.select("#"+e.clipIdForSubchart).select("rect").attr("width",e.width).attr("height",t.size()?t.attr("height"):0),e.svg.select("."+l.zoomRect).attr("width",e.width).attr("height",e.height),e.selectChart.style("max-height",e.currentHeight+"px")},r.updateDimension=function(e){var t=this;e||(t.config.axis_rotated?(t.axes.x.call(t.xAxis),t.axes.subx.call(t.subXAxis)):(t.axes.y.call(t.yAxis),t.axes.y2.call(t.y2Axis))),t.updateSizes(),t.updateScales(),t.updateSvgSize(),t.transformAll(!1)},r.observeInserted=function(t){var n=this,r;if(typeof MutationObserver=="undefined"){e.console.error("MutationObserver not defined.");return}r=new MutationObserver(function(i){i.forEach(function(i){i.type==="childList"&&i.previousSibling&&(r.disconnect(),n.intervalForObserveInserted=e.setInterval(function(){t.node().parentNode&&(e.clearInterval(n.intervalForObserveInserted),n.updateDimension(),n.brush&&n.brush.update(),n.config.oninit.call(n),n.redraw({withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransition:!1,withTransitionForTransform:!1,withLegend:!0}),t.transition().style("opacity",1))},10))})}),r.observe(t.node(),{attributes:!0,childList:!0,characterData:!0})},r.bindResize=function(){var t=this,n=t.config;t.resizeFunction=t.generateResize(),t.resizeFunction.add(function(){n.onresize.call(t)}),n.resize_auto&&t.resizeFunction.add(function(){t.resizeTimeout!==undefined&&e.clearTimeout(t.resizeTimeout),t.resizeTimeout=e.setTimeout(function(){delete t.resizeTimeout,t.api.flush()},100)}),t.resizeFunction.add(function(){n.onresized.call(t)});if(e.attachEvent)e.attachEvent("onresize",t.resizeFunction);else if(e.addEventListener)e.addEventListener("resize",t.resizeFunction,!1);else{var r=e.onresize;if(!r)r=t.generateResize();else if(!r.add||!r.remove)r=t.generateResize(),r.add(e.onresize);r.add(t.resizeFunction),e.onresize=r}},r.generateResize=function(){function t(){e.forEach(function(e){e()})}var e=[];return t.add=function(t){e.push(t)},t.remove=function(t){for(var n=0;n<e.length;n++)if(e[n]===t){e.splice(n,1);break}},t},r.endall=function(e,t){var n=0;e.each(function(){++n}).each("end",function(){--n||t.apply(this,arguments)})},r.generateWait=function(){var e=[],t=function(t,n){var r=setInterval(function(){var t=0;e.forEach(function(e){if(e.empty()){t+=1;return}try{e.transition()}catch(n){t+=1}}),t===e.length&&(clearInterval(r),n&&n())},10)};return t.add=function(t){e.push(t)},t},r.parseDate=function(t){var n=this,r;return t instanceof Date?r=t:typeof t=="string"?r=n.dataTimeFormat(n.config.data_xFormat).parse(t):typeof t=="number"&&!isNaN(t)&&(r=new Date(+t)),(!r||isNaN(+r))&&e.console.error("Failed to parse x '"+t+"' to Date object"),r},r.isTabVisible=function(){var e;return typeof document.hidden!="undefined"?e="hidden":typeof document.mozHidden!="undefined"?e="mozHidden":typeof document.msHidden!="undefined"?e="msHidden":typeof document.webkitHidden!="undefined"&&(e="webkitHidden"),document[e]?!1:!0},r.getDefaultConfig=function(){var e={bindto:"#chart",svg_classname:undefined,size_width:undefined,size_height:undefined,padding_left:undefined,padding_right:undefined,padding_top:undefined,padding_bottom:undefined,resize_auto:!0,zoom_enabled:!1,zoom_extent:undefined,zoom_privileged:!1,zoom_rescale:!1,zoom_onzoom:function(){},zoom_onzoomstart:function(){},zoom_onzoomend:function(){},zoom_x_min:undefined,zoom_x_max:undefined,interaction_brighten:!0,interaction_enabled:!0,onmouseover:function(){},onmouseout:function(){},onresize:function(){},onresized:function(){},oninit:function(){},onrendered:function(){},transition_duration:350,data_x:undefined,data_xs:{},data_xFormat:"%Y-%m-%d",data_xLocaltime:!0,data_xSort:!0,data_idConverter:function(e){return e},data_names:{},data_classes:{},data_groups:[],data_axes:{},data_type:undefined,data_types:{},data_labels:{},data_order:"desc",data_regions:{},data_color:undefined,data_colors:{},data_hide:!1,data_filter:undefined,data_selection_enabled:!1,data_selection_grouped:!1,data_selection_isselectable:function(){return!0},data_selection_multiple:!0,data_selection_draggable:!1,data_onclick:function(){},data_onmouseover:function(){},data_onmouseout:function(){},data_onselected:function(){},data_onunselected:function(){},data_url:undefined,data_headers:undefined,data_json:undefined,data_rows:undefined,data_columns:undefined,data_mimeType:undefined,data_keys:undefined,data_empty_label_text:"",subchart_show:!1,subchart_size_height:60,subchart_axis_x_show:!0,subchart_onbrush:function(){},color_pattern:[],color_threshold:{},legend_show:!0,legend_hide:!1,legend_position:"bottom",legend_inset_anchor:"top-left",legend_inset_x:10,legend_inset_y:0,legend_inset_step:undefined,legend_item_onclick:undefined,legend_item_onmouseover:undefined,legend_item_onmouseout:undefined,legend_equally:!1,legend_padding:0,legend_item_tile_width:10,legend_item_tile_height:10,axis_rotated:!1,axis_x_show:!0,axis_x_type:"indexed",axis_x_localtime:!0,axis_x_categories:[],axis_x_tick_centered:!1,axis_x_tick_format:undefined,axis_x_tick_culling:{},axis_x_tick_culling_max:10,axis_x_tick_count:undefined,axis_x_tick_fit:!0,axis_x_tick_values:null,axis_x_tick_rotate:0,axis_x_tick_outer:!0,axis_x_tick_multiline:!0,axis_x_tick_width:null,axis_x_max:undefined,axis_x_min:undefined,axis_x_padding:{},axis_x_height:undefined,axis_x_extent:undefined,axis_x_label:{},axis_y_show:!0,axis_y_type:undefined,axis_y_max:undefined,axis_y_min:undefined,axis_y_inverted:!1,axis_y_center:undefined,axis_y_inner:undefined,axis_y_label:{},axis_y_tick_format:undefined,axis_y_tick_outer:!0,axis_y_tick_values:null,axis_y_tick_rotate:0,axis_y_tick_count:undefined,axis_y_tick_time_value:undefined,axis_y_tick_time_interval:undefined,axis_y_padding:{},axis_y_default:undefined,axis_y2_show:!1,axis_y2_max:undefined,axis_y2_min:undefined,axis_y2_inverted:!1,axis_y2_center:undefined,axis_y2_inner:undefined,axis_y2_label:{},axis_y2_tick_format:undefined,axis_y2_tick_outer:!0,axis_y2_tick_values:null,axis_y2_tick_count:undefined,axis_y2_padding:{},axis_y2_default:undefined,grid_x_show:!1,grid_x_type:"tick",grid_x_lines:[],grid_y_show:!1,grid_y_lines:[],grid_y_ticks:10,grid_focus_show:!0,grid_lines_front:!0,point_show:!0,point_r:2.5,point_sensitivity:10,point_focus_expand_enabled:!0,point_focus_expand_r:undefined,point_select_r:undefined,line_connectNull:!1,line_step_type:"step",bar_width:undefined,bar_width_ratio:.6,bar_width_max:undefined,bar_zerobased:!0,area_zerobased:!0,area_above:!1,pie_label_show:!0,pie_label_format:undefined,pie_label_threshold:.05,pie_label_ratio:undefined,pie_expand:{},pie_expand_duration:50,gauge_fullCircle:!1,gauge_label_show:!0,gauge_label_format:undefined,gauge_min:0,gauge_max:100,gauge_startingAngle:-1*Math.PI/2,gauge_units:undefined,gauge_width:undefined,gauge_expand:{},gauge_expand_duration:50,donut_label_show:!0,donut_label_format:undefined,donut_label_threshold:.05,donut_label_ratio:undefined,donut_width:undefined,donut_title:"",donut_expand:{},donut_expand_duration:50,spline_interpolation_type:"cardinal",regions:[],tooltip_show:!0,tooltip_grouped:!0,tooltip_format_title:undefined,tooltip_format_name:undefined,tooltip_format_value:undefined,tooltip_position:undefined,tooltip_contents:function(e,t,n,r){return this.getTooltipContent?this.getTooltipContent(e,t,n,r):""},tooltip_init_show:!1,tooltip_init_x:0,tooltip_init_position:{top:"0px",left:"50px"},tooltip_onshow:function(){},tooltip_onhide:function(){},title_text:undefined,title_padding:{top:0,right:0,bottom:0,left:0},title_position:"top-center"};return Object.keys(this.additionalConfig).forEach(function(t){e[t]=this.additionalConfig[t]},this),e},r.additionalConfig={},r.loadConfig=function(e){function s(){var e=r.shift();return e&&n&&typeof n=="object"&&e in n?(n=n[e],s()):e?undefined:n}var t=this.config,n,r,i;Object.keys(t).forEach(function(o){n=e,r=o.split("_"),i=s(),v(i)&&(t[o]=i)})},r.getScale=function(e,t,n){return(n?this.d3.time.scale():this.d3.scale.linear()).range([e,t])},r.getX=function(e,t,n,r){var i=this,s=i.getScale(e,t,i.isTimeSeries()),o=n?s.domain(n):s,u;i.isCategorized()?(r=r||function(){return 0},s=function(e,t){var n=o(e)+r(e);return t?n:Math.ceil(n)}):s=function(e,t){var n=o(e);return t?n:Math.ceil(n)};for(u in o)s[u]=o[u];return s.orgDomain=function(){return o.domain()},i.isCategorized()&&(s.domain=function(e){return arguments.length?(o.domain(e),s):(e=this.orgDomain(),[e[0],e[1]+1])}),s},r.getY=function(e,t,n){var r=this.getScale(e,t,this.isTimeSeriesY());return n&&r.domain(n),r},r.getYScale=function(e){return this.axis.getId(e)==="y2"?this.y2:this.y},r.getSubYScale=function(e){return this.axis.getId(e)==="y2"?this.subY2:this.subY},r.updateScales=function(){var e=this,t=e.config,n=!e.x;e.xMin=t.axis_rotated?1:0,e.xMax=t.axis_rotated?e.height:e.width,e.yMin=t.axis_rotated?0:e.height,e.yMax=t.axis_rotated?e.width:1,e.subXMin=e.xMin,e.subXMax=e.xMax,e.subYMin=t.axis_rotated?0:e.height2,e.subYMax=t.axis_rotated?e.width2:1,e.x=e.getX(e.xMin,e.xMax,n?undefined:e.x.orgDomain(),function(){return e.xAxis.tickOffset()}),e.y=e.getY(e.yMin,e.yMax,n?t.axis_y_default:e.y.domain()),e.y2=e.getY(e.yMin,e.yMax,n?t.axis_y2_default:e.y2.domain()),e.subX=e.getX(e.xMin,e.xMax,e.orgXDomain,function(t){return t%1?0:e.subXAxis.tickOffset()}),e.subY=e.getY(e.subYMin,e.subYMax,n?t.axis_y_default:e.subY.domain()),e.subY2=e.getY(e.subYMin,e.subYMax,n?t.axis_y2_default:e.subY2.domain()),e.xAxisTickFormat=e.axis.getXAxisTickFormat(),e.xAxisTickValues=e.axis.getXAxisTickValues(),e.yAxisTickValues=e.axis.getYAxisTickValues(),e.y2AxisTickValues=e.axis.getY2AxisTickValues(),e.xAxis=e.axis.getXAxis(e.x,e.xOrient,e.xAxisTickFormat,e.xAxisTickValues,t.axis_x_tick_outer),e.subXAxis=e.axis.getXAxis(e.subX,e.subXOrient,e.xAxisTickFormat,e.xAxisTickValues,t.axis_x_tick_outer),e.yAxis=e.axis.getYAxis(e.y,e.yOrient,t.axis_y_tick_format,e.yAxisTickValues,t.axis_y_tick_outer),e.y2Axis=e.axis.getYAxis(e.y2,e.y2Orient,t.axis_y2_tick_format,e.y2AxisTickValues,t.axis_y2_tick_outer),n||(e.brush&&e.brush.scale(e.subX),t.zoom_enabled&&e.zoom.scale(e.x)),e.updateArc&&e.updateArc()},r.getYDomainMin=function(e){var t=this,n=t.config,r=t.mapToIds(e),i=t.getValuesAsIdKeyed(e),s,o,u,a,f,l;if(n.data_groups.length>0){l=t.hasNegativeValueInTargets(e);for(s=0;s<n.data_groups.length;s++){a=n.data_groups[s].filter(function(e){return r.indexOf(e)>=0});if(a.length===0)continue;u=a[0],l&&i[u]&&i[u].forEach(function(e,t){i[u][t]=e<0?e:0});for(o=1;o<a.length;o++){f=a[o];if(!i[f])continue;i[f].forEach(function(e,n){t.axis.getId(f)===t.axis.getId(u)&&i[u]&&!(l&&+e>0)&&(i[u][n]+=+e)})}}}return t.d3.min(Object.keys(i).map(function(e){return t.d3.min(i[e])}))},r.getYDomainMax=function(e){var t=this,n=t.config,r=t.mapToIds(e),i=t.getValuesAsIdKeyed(e),s,o,u,a,f,l;if(n.data_groups.length>0){l=t.hasPositiveValueInTargets(e);for(s=0;s<n.data_groups.length;s++){a=n.data_groups[s].filter(function(e){return r.indexOf(e)>=0});if(a.length===0)continue;u=a[0],l&&i[u]&&i[u].forEach(function(e,t){i[u][t]=e>0?e:0});for(o=1;o<a.length;o++){f=a[o];if(!i[f])continue;i[f].forEach(function(e,n){t.axis.getId(f)===t.axis.getId(u)&&i[u]&&!(l&&+e<0)&&(i[u][n]+=+e)})}}}return t.d3.max(Object.keys(i).map(function(e){return t.d3.max(i[e])}))},r.getYDomain=function(e,t,n){var r=this,i=r.config,s=e.filter(function(e){return r.axis.getId(e.id)===t}),o=n?r.filterByXDomain(s,n):s,u=t==="y2"?i.axis_y2_min:i.axis_y_min,a=t==="y2"?i.axis_y2_max:i.axis_y_max,f=r.getYDomainMin(o),l=r.getYDomainMax(o),h,p,d,v,m,g=t==="y2"?i.axis_y2_center:i.axis_y_center,b,E,S,x,T,N,C=r.hasType("bar",o)&&i.bar_zerobased||r.hasType("area",o)&&i.area_zerobased,k=t==="y2"?i.axis_y2_inverted:i.axis_y_inverted,L=r.hasDataLabel()&&i.axis_rotated,A=r.hasDataLabel()&&!i.axis_rotated;f=c(u)?u:c(a)?f<a?f:a-10:f,l=c(a)?a:c(u)?u<l?l:u+10:l;if(o.length===0)return t==="y2"?r.y2.domain():r.y.domain();isNaN(f)&&(f=0),isNaN(l)&&(l=f),f===l&&(f<0?l=0:f=0),T=f>=0&&l>=0,N=f<=0&&l<=0;if(c(u)&&T||c(a)&&N)C=!1;return C&&(T&&(f=0),N&&(l=0)),p=Math.abs(l-f),d=v=m=p*.1,typeof g!="undefined"&&(b=Math.max(Math.abs(f),Math.abs(l)),l=g+b,f=g-b),L?(E=r.getDataLabelLength(f,l,"width"),S=y(r.y.range()),x=[E[0]/S,E[1]/S],v+=p*(x[1]/(1-x[0]-x[1])),m+=p*(x[0]/(1-x[0]-x[1]))):A&&(E=r.getDataLabelLength(f,l,"height"),v+=r.axis.convertPixelsToAxisPadding(E[1],p),m+=r.axis.convertPixelsToAxisPadding(E[0],p)),t==="y"&&w(i.axis_y_padding)&&(v=r.axis.getPadding(i.axis_y_padding,"top",v,p),m=r.axis.getPadding(i.axis_y_padding,"bottom",m,p)),t==="y2"&&w(i.axis_y2_padding)&&(v=r.axis.getPadding(i.axis_y2_padding,"top",v,p),m=r.axis.getPadding(i.axis_y2_padding,"bottom",m,p)),C&&(T&&(m=f),N&&(v=-l)),h=[f-m,l+v],k?h.reverse():h},r.getXDomainMin=function(e){var t=this,n=t.config;return v(n.axis_x_min)?t.isTimeSeries()?this.parseDate(n.axis_x_min):n.axis_x_min:t.d3.min(e,function(e){return t.d3.min(e.values,function(e){return e.x})})},r.getXDomainMax=function(e){var t=this,n=t.config;return v(n.axis_x_max)?t.isTimeSeries()?this.parseDate(n.axis_x_max):n.axis_x_max:t.d3.max(e,function(e){return t.d3.max(e.values,function(e){return e.x})})},r.getXDomainPadding=function(e){var t=this,n=t.config,r=e[1]-e[0],i,s,o,u;return t.isCategorized()?s=0:t.hasType("bar")?(i=t.getMaxDataCount(),s=i>1?r/(i-1)/2:.5):s=r*.01,typeof n.axis_x_padding=="object"&&w(n.axis_x_padding)?(o=c(n.axis_x_padding.left)?n.axis_x_padding.left:s,u=c(n.axis_x_padding.right)?n.axis_x_padding.right:s):typeof n.axis_x_padding=="number"?o=u=n.axis_x_padding:o=u=s,{left:o,right:u}},r.getXDomain=function(e){var t=this,n=[t.getXDomainMin(e),t.getXDomainMax(e)],r=n[0],i=n[1],s=t.getXDomainPadding(n),o=0,u=0;r-i===0&&!t.isCategorized()&&(t.isTimeSeries()?(r=new Date(r.getTime()*.5),i=new Date(i.getTime()*1.5)):(r=r===0?1:r*.5,i=i===0?-1:i*1.5));if(r||r===0)o=t.isTimeSeries()?new Date(r.getTime()-s.left):r-s.left;if(i||i===0)u=t.isTimeSeries()?new Date(i.getTime()+s.right):i+s.right;return[o,u]},r.updateXDomain=function(e,t,n,r,i){var s=this,o=s.config;return n&&(s.x.domain(i?i:s.d3.extent(s.getXDomain(e))),s.orgXDomain=s.x.domain(),o.zoom_enabled&&s.zoom.scale(s.x).updateScaleExtent(),s.subX.domain(s.x.domain()),s.brush&&s.brush.scale(s.subX)),t&&(s.x.domain(i?i:!s.brush||s.brush.empty()?s.orgXDomain:s.brush.extent()),o.zoom_enabled&&s.zoom.scale(s.x).updateScaleExtent()),r&&s.x.domain(s.trimXDomain(s.x.orgDomain())),s.x.domain()},r.trimXDomain=function(e){var t=this.getZoomDomain(),n=t[0],r=t[1];return e[0]<=n&&(e[1]=+e[1]+(n-e[0]),e[0]=n),r<=e[1]&&(e[0]=+e[0]-(e[1]-r),e[1]=r),e},r.isX=function(e){var t=this,n=t.config;return n.data_x&&e===n.data_x||w(n.data_xs)&&S(n.data_xs,e)},r.isNotX=function(e){return!this.isX(e)},r.getXKey=function(e){var t=this,n=t.config;return n.data_x?n.data_x:w(n.data_xs)?n.data_xs[e]:null},r.getXValuesOfXKey=function(e,t){var n=this,r,i=t&&w(t)?n.mapToIds(t):[];return i.forEach(function(t){n.getXKey(t)===e&&(r=n.data.xs[t])}),r},r.getIndexByX=function(e){var t=this,n=t.filterByX(t.data.targets,e);return n.length?n[0].index:null},r.getXValue=function(e,t){var n=this;return e in n.data.xs&&n.data.xs[e]&&c(n.data.xs[e][t])?n.data.xs[e][t]:t},r.getOtherTargetXs=function(){var e=this,t=Object.keys(e.data.xs);return t.length?e.data.xs[t[0]]:null},r.getOtherTargetX=function(e){var t=this.getOtherTargetXs();return t&&e<t.length?t[e]:null},r.addXs=function(e){var t=this;Object.keys(e).forEach(function(n){t.config.data_xs[n]=e[n]})},r.hasMultipleX=function(e){return this.d3.set(Object.keys(e).map(function(t){return e[t]})).size()>1},r.isMultipleX=function(){return w(this.config.data_xs)||!this.config.data_xSort||this.hasType("scatter")},r.addName=function(e){var t=this,n;return e&&(n=t.config.data_names[e.id],e.name=n!==undefined?n:e.id),e},r.getValueOnIndex=function(e,t){var n=e.filter(function(e){return e.index===t});return n.length?n[0]:null},r.updateTargetX=function(e,t){var n=this;e.forEach(function(e){e.values.forEach(function(r,i){r.x=n.generateTargetX(t[i],e.id,i)}),n.data.xs[e.id]=t})},r.updateTargetXs=function(e,t){var n=this;e.forEach(function(e){t[e.id]&&n.updateTargetX([e],t[e.id])})},r.generateTargetX=function(e,t,n){var r=this,i;return r.isTimeSeries()?i=e?r.parseDate(e):r.parseDate(r.getXValue(t,n)):r.isCustomX()&&!r.isCategorized()?i=c(e)?+e:r.getXValue(t,n):i=n,i},r.cloneTarget=function(e){return{id:e.id,id_org:e.id_org,values:e.values.map(function(e){return{x:e.x,value:e.value,id:e.id}})}},r.updateXs=function(){var e=this;e.data.targets.length&&(e.xs=[],e.data.targets[0].values.forEach(function(t){e.xs[t.index]=t.x}))},r.getPrevX=function(e){var t=this.xs[e-1];return typeof t!="undefined"?t:null},r.getNextX=function(e){var t=this.xs[e+1];return typeof t!="undefined"?t:null},r.getMaxDataCount=function(){var e=this;return e.d3.max(e.data.targets,function(e){return e.values.length})},r.getMaxDataCountTarget=function(e){var t=e.length,n=0,r;return t>1?e.forEach(function(e){e.values.length>n&&(r=e,n=e.values.length)}):r=t?e[0]:null,r},r.getEdgeX=function(e){var t=this;return e.length?[t.d3.min(e,function(e){return e.values[0].x}),t.d3.max(e,function(e){return e.values[e.values.length-1].x})]:[0,0]},r.mapToIds=function(e){return e.map(function(e){return e.id})},r.mapToTargetIds=function(e){var t=this;return e?[].concat(e):t.mapToIds(t.data.targets)},r.hasTarget=function(e,t){var n=this.mapToIds(e),r;for(r=0;r<n.length;r++)if(n[r]===t)return!0;return!1},r.isTargetToShow=function(e){return this.hiddenTargetIds.indexOf(e)<0},r.isLegendToShow=function(e){return this.hiddenLegendIds.indexOf(e)<0},r.filterTargetsToShow=function(e){var t=this;return e.filter(function(e){return t.isTargetToShow(e.id)})},r.mapTargetsToUniqueXs=function(e){var t=this,n=t.d3.set(t.d3.merge(e.map(function(e){return e.values.map(function(e){return+e.x})}))).values();return n=t.isTimeSeries()?n.map(function(e){return new Date(+e)}):n.map(function(e){return+e}),n.sort(function(e,t){return e<t?-1:e>t?1:e>=t?0:NaN})},r.addHiddenTargetIds=function(e){this.hiddenTargetIds=this.hiddenTargetIds.concat(e)},r.removeHiddenTargetIds=function(e){this.hiddenTargetIds=this.hiddenTargetIds.filter(function(t){return e.indexOf(t)<0})},r.addHiddenLegendIds=function(e){this.hiddenLegendIds=this.hiddenLegendIds.concat(e)},r.removeHiddenLegendIds=function(e){this.hiddenLegendIds=this.hiddenLegendIds.filter(function(t){return e.indexOf(t)<0})},r.getValuesAsIdKeyed=function(e){var t={};return e.forEach(function(e){t[e.id]=[],e.values.forEach(function(n){t[e.id].push(n.value)})}),t},r.checkValueInTargets=function(e,t){var n=Object.keys(e),r,i,s;for(r=0;r<n.length;r++){s=e[n[r]].values;for(i=0;i<s.length;i++)if(t(s[i].value))return!0}return!1},r.hasNegativeValueInTargets=function(e){return this.checkValueInTargets(e,function(e){return e<0})},r.hasPositiveValueInTargets=function(e){return this.checkValueInTargets(e,function(e){return e>0})},r.isOrderDesc=function(){var e=this.config;return typeof e.data_order=="string"&&e.data_order.toLowerCase()==="desc"},r.isOrderAsc=function(){var e=this.config;return typeof e.data_order=="string"&&e.data_order.toLowerCase()==="asc"},r.orderTargets=function(e){var t=this,n=t.config,r=t.isOrderAsc(),i=t.isOrderDesc();return r||i?e.sort(function(e,t){var n=function(e,t){return e+Math.abs(t.value)},i=e.values.reduce(n,0),s=t.values.reduce(n,0);return r?s-i:i-s}):h(n.data_order)&&e.sort(n.data_order),e},r.filterByX=function(e,t){return this.d3.merge(e.map(function(e){return e.values})).filter(function(e){return e.x-t===0})},r.filterRemoveNull=function(e){return e.filter(function(e){return c(e.value)})},r.filterByXDomain=function(e,t){return e.map(function(e){return{id:e.id,id_org:e.id_org,values:e.values.filter(function(e){return t[0]<=e.x&&e.x<=t[1]})}})},r.hasDataLabel=function(){var e=this.config;return typeof e.data_labels=="boolean"&&e.data_labels?!0:typeof e.data_labels=="object"&&w(e.data_labels)?!0:!1},r.getDataLabelLength=function(e,t,n){var r=this,i=[0,0],s=1.3;return r.selectChart.select("svg").selectAll(".dummy").data([e,t]).enter().append("text").text(function(e){return r.dataLabelFormat(e.id)(e)}).each(function(e,t){i[t]=this.getBoundingClientRect()[n]*s}).remove(),i},r.isNoneArc=function(e){return this.hasTarget(this.data.targets,e.id)},r.isArc=function(e){return"data"in e&&this.hasTarget(this.data.targets,e.data.id)},r.findSameXOfValues=function(e,t){var n,r=e[t].x,i=[];for(n=t-1;n>=0;n--){if(r!==e[n].x)break;i.push(e[n])}for(n=t;n<e.length;n++){if(r!==e[n].x)break;i.push(e[n])}return i},r.findClosestFromTargets=function(e,t){var n=this,r;return r=e.map(function(e){return n.findClosest(e.values,t)}),n.findClosest(r,t)},r.findClosest=function(e,t){var n=this,r=n.config.point_sensitivity,i;return e.filter(function(e){return e&&n.isBarType(e.id)}).forEach(function(e){var t=n.main.select("."+l.bars+n.getTargetSelectorSuffix(e.id)+" ."+l.bar+"-"+e.index).node();!i&&n.isWithinBar(t)&&(i=e)}),e.filter(function(e){return e&&!n.isBarType(e.id)}).forEach(function(e){var s=n.dist(e,t);s<r&&(r=s,i=e)}),i},r.dist=function(e,t){var n=this,r=n.config,i=r.axis_rotated?1:0,s=r.axis_rotated?0:1,o=n.circleY(e,e.index),u=n.x(e.x);return Math.sqrt(Math.pow(u-t[i],2)+Math.pow(o-t[s],2))},r.convertValuesToStep=function(e){var t=[].concat(e),n;if(!this.isCategorized())return e;for(n=e.length+1;0<n;n--)t[n]=t[n-1];return t[0]={x:t[0].x-1,value:t[0].value,id:t[0].id},t[e.length+1]={x:t[e.length].x+1,value:t[e.length].value,id:t[e.length].id},t},r.updateDataAttributes=function(e,t){var n=this,r=n.config,i=r["data_"+e];return typeof t=="undefined"?i:(Object.keys(t).forEach(function(e){i[e]=t[e]}),n.redraw({withLegend:!0}),i)},r.convertUrlToData=function(e,t,n,r,i){var s=this,o=t?t:"csv",u=s.d3.xhr(e);n&&Object.keys(n).forEach(function(e){u.header(e,n[e])}),u.get(function(e,t){var n;if(!t)throw new Error(e.responseURL+" "+e.status+" ("+e.statusText+")");o==="json"?n=s.convertJsonToData(JSON.parse(t.response),r):o==="tsv"?n=s.convertTsvToData(t.response):n=s.convertCsvToData(t.response),i.call(s,n)})},r.convertXsvToData=function(e,t){var n=t.parseRows(e),r;return n.length===1?(r=[{}],n[0].forEach(function(e){r[0][e]=null})):r=t.parse(e),r},r.convertCsvToData=function(e){return this.convertXsvToData(e,this.d3.csv)},r.convertTsvToData=function(e){return this.convertXsvToData(e,this.d3.tsv)},r.convertJsonToData=function(e,t){var n=this,r=[],i,s;return t?(t.x?(i=t.value.concat(t.x),n.config.data_x=t.x):i=t.value,r.push(i),e.forEach(function(e){var t=[];i.forEach(function(r){var i=n.findValueInJson(e,r);d(i)&&(i=null),t.push(i)}),r.push(t)}),s=n.convertRowsToData(r)):(Object.keys(e).forEach(function(t){r.push([t].concat(e[t]))}),s=n.convertColumnsToData(r)),s},r.findValueInJson=function(e,t){t=t.replace(/\[(\w+)\]/g,".$1"),t=t.replace(/^\./,"");var n=t.split(".");for(var r=0;r<n.length;++r){var i=n[r];if(!(i in e))return;e=e[i]}return e},r.convertRowsToData=function(e){var t=e[0],n={},r=[],i,s;for(i=1;i<e.length;i++){n={};for(s=0;s<e[i].length;s++){if(d(e[i][s]))throw new Error("Source data is missing a component at ("+i+","+s+")!");n[t[s]]=e[i][s]}r.push(n)}return r},r.convertColumnsToData=function(e){var t=[],n,r,i;for(n=0;n<e.length;n++){i=e[n][0];for(r=1;r<e[n].length;r++){d(t[r-1])&&(t[r-1]={});if(d(e[n][r]))throw new Error("Source data is missing a component at ("+n+","+r+")!");t[r-1][i]=e[n][r]}}return t},r.convertDataToTargets=function(e,t){var n=this,r=n.config,i=n.d3.keys(e[0]).filter(n.isNotX,n),s=n.d3.keys(e[0]).filter(n.isX,n),o;return i.forEach(function(i){var o=n.getXKey(i);n.isCustomX()||n.isTimeSeries()?s.indexOf(o)>=0?n.data.xs[i]=(t&&n.data.xs[i]?n.data.xs[i]:[]).concat(e.map(function(e){return e[o]}).filter(c).map(function(e,t){return n.generateTargetX(e,i,t)})):r.data_x?n.data.xs[i]=n.getOtherTargetXs():w(r.data_xs)&&(n.data.xs[i]=n.getXValuesOfXKey(o,n.data.targets)):n.data.xs[i]=e.map(function(e,t){return t})}),i.forEach(function(e){if(!n.data.xs[e])throw new Error('x is not defined for id = "'+e+'".')}),o=i.map(function(t,i){var s=r.data_idConverter(t);return{id:s,id_org:t,values:e.map(function(e,o){var u=n.getXKey(t),a=e[u],f=e[t]!==null&&!isNaN(e[t])?+e[t]:null,l;n.isCustomX()&&n.isCategorized()&&i===0&&!d(a)?(i===0&&o===0&&(r.axis_x_categories=[]),l=r.axis_x_categories.indexOf(a),l===-1&&(l=r.axis_x_categories.length,r.axis_x_categories.push(a))):l=n.generateTargetX(a,t,o);if(d(e[t])||n.data.xs[t].length<=o)l=undefined;return{x:l,value:f,id:s}}).filter(function(e){return v(e.x)})}}),o.forEach(function(e){var t;r.data_xSort&&(e.values=e.values.sort(function(e,t){var n=e.x||e.x===0?e.x:Infinity,r=t.x||t.x===0?t.x:Infinity;return n-r})),t=0,e.values.forEach(function(e){e.index=t++}),n.data.xs[e.id].sort(function(e,t){return e-t})}),n.hasNegativeValue=n.hasNegativeValueInTargets(o),n.hasPositiveValue=n.hasPositiveValueInTargets(o),r.data_type&&n.setTargetType(n.mapToIds(o).filter(function(e){return!(e in r.data_types)}),r.data_type),o.forEach(function(e){n.addCache(e.id_org,e)}),o},r.load=function(e,t){var n=this;e&&(t.filter&&(e=e.filter(t.filter)),(t.type||t.types)&&e.forEach(function(e){var r=t.types&&t.types[e.id]?t.types[e.id]:t.type;n.setTargetType(e.id,r)}),n.data.targets.forEach(function(t){for(var n=0;n<e.length;n++)if(t.id===e[n].id){t.values=e[n].values,e.splice(n,1);break}}),n.data.targets=n.data.targets.concat(e)),n.updateTargets(n.data.targets),n.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),t.done&&t.done()},r.loadFromArgs=function(e){var t=this;e.data?t.load(t.convertDataToTargets(e.data),e):e.url?t.convertUrlToData(e.url,e.mimeType,e.headers,e.keys,function(n){t.load(t.convertDataToTargets(n),e)}):e.json?t.load(t.convertDataToTargets(t.convertJsonToData(e.json,e.keys)),e):e.rows?t.load(t.convertDataToTargets(t.convertRowsToData(e.rows)),e):e.columns?t.load(t.convertDataToTargets(t.convertColumnsToData(e.columns)),e):t.load(null,e)},r.unload=function(e,t){var n=this;t||(t=function(){}),e=e.filter(function(e){return n.hasTarget(n.data.targets,e)});if(!e||e.length===0){t();return}n.svg.selectAll(e.map(function(e){return n.selectorTarget(e)})).transition().style("opacity",0).remove().call(n.endall,t),e.forEach(function(e){n.withoutFadeIn[e]=!1,n.legend&&n.legend.selectAll("."+l.legendItem+n.getTargetSelectorSuffix(e)).remove(),n.data.targets=n.data.targets.filter(function(t){return t.id!==e})})},r.categoryName=function(e){var t=this.config;return e<t.axis_x_categories.length?t.axis_x_categories[e]:e},r.initEventRect=function(){var e=this;e.main.select("."+l.chart).append("g").attr("class",l.eventRects).style("fill-opacity",0)},r.redrawEventRect=function(){var e=this,t=e.config,n,r,i=e.isMultipleX(),s=e.main.select("."+l.eventRects).style("cursor",t.zoom_enabled?t.axis_rotated?"ns-resize":"ew-resize":null).classed(l.eventRectsMultiple,i).classed(l.eventRectsSingle,!i);s.selectAll("."+l.eventRect).remove(),e.eventRect=s.selectAll("."+l.eventRect),i?(n=e.eventRect.data([0]),e.generateEventRectsForMultipleXs(n.enter()),e.updateEventRect(n)):(r=e.getMaxDataCountTarget(e.data.targets),s.datum(r?r.values:[]),e.eventRect=s.selectAll("."+l.eventRect),n=e.eventRect.data(function(e){return e}),e.generateEventRectsForSingleX(n.enter()),e.updateEventRect(n),n.exit().remove())},r.updateEventRect=function(e){var t=this,n=t.config,r,i,s,o,u,a;e=e||t.eventRect.data(function(e){return e}),t.isMultipleX()?(r=0,i=0,s=t.width,o=t.height):((t.isCustomX()||t.isTimeSeries())&&!t.isCategorized()?(t.updateXs(),u=function(e){var r=t.getPrevX(e.index),i=t.getNextX(e.index);return r===null&&i===null?n.axis_rotated?t.height:t.width:(r===null&&(r=t.x.domain()[0]),i===null&&(i=t.x.domain()[1]),Math.max(0,(t.x(i)-t.x(r))/2))},a=function(e){var n=t.getPrevX(e.index),r=t.getNextX(e.index),i=t.data.xs[e.id][e.index];return n===null&&r===null?0:(n===null&&(n=t.x.domain()[0]),(t.x(i)+t.x(n))/2)}):(u=t.getEventRectWidth(),a=function(e){return t.x(e.x)-u/2}),r=n.axis_rotated?0:a,i=n.axis_rotated?a:0,s=n.axis_rotated?t.width:u,o=n.axis_rotated?u:t.height),e.attr("class",t.classEvent.bind(t)).attr("x",r).attr("y",i).attr("width",s).attr("height",o)},r.generateEventRectsForSingleX=function(e){var t=this,n=t.d3,r=t.config;e.append("rect").attr("class",t.classEvent.bind(t)).style("cursor",r.data_selection_enabled&&r.data_selection_grouped?"pointer":null).on("mouseover",function(e){var n=e.index;if(t.dragging||t.flowing)return;if(t.hasArcType())return;r.point_focus_expand_enabled&&t.expandCircles(n,null,!0),t.expandBars(n,null,!0),t.main.selectAll("."+l.shape+"-"+n).each(function(e){r.data_onmouseover.call(t.api,e)})}).on("mouseout",function(e){var n=e.index;if(!t.config)return;if(t.hasArcType())return;t.hideXGridFocus(),t.hideTooltip(),t.unexpandCircles(),t.unexpandBars(),t.main.selectAll("."+l.shape+"-"+n).each(function(e){r.data_onmouseout.call(t.api,e)})}).on("mousemove",function(e){var i,s=e.index,o=t.svg.select("."+l.eventRect+"-"+s);if(t.dragging||t.flowing)return;if(t.hasArcType())return;t.isStepType(e)&&t.config.line_step_type==="step-after"&&n.mouse(this)[0]<t.x(t.getXValue(e.id,s))&&(s-=1),i=t.filterTargetsToShow(t.data.targets).map(function(e){return t.addName(t.getValueOnIndex(e.values,s))}),r.tooltip_grouped&&(t.showTooltip(i,this),t.showXGridFocus(i));if(r.tooltip_grouped&&(!r.data_selection_enabled||r.data_selection_grouped))return;t.main.selectAll("."+l.shape+"-"+s).each(function(){n.select(this).classed(l.EXPANDED,!0),r.data_selection_enabled&&o.style("cursor",r.data_selection_grouped?"pointer":null),r.tooltip_grouped||(t.hideXGridFocus(),t.hideTooltip(),r.data_selection_grouped||(t.unexpandCircles(s),t.unexpandBars(s)))}).filter(function(e){return t.isWithinShape(this,e)}).each(function(e){r.data_selection_enabled&&(r.data_selection_grouped||r.data_selection_isselectable(e))&&o.style("cursor","pointer"),r.tooltip_grouped||(t.showTooltip([e],this),t.showXGridFocus([e]),r.point_focus_expand_enabled&&t.expandCircles(s,e.id,!0),t.expandBars(s,e.id,!0))})}).on("click",function(e){var i=e.index;if(t.hasArcType()||!t.toggleShape)return;if(t.cancelClick){t.cancelClick=!1;return}t.isStepType(e)&&r.line_step_type==="step-after"&&n.mouse(this)[0]<t.x(t.getXValue(e.id,i))&&(i-=1),t.main.selectAll("."+l.shape+"-"+i).each(function(e){if(r.data_selection_grouped||t.isWithinShape(this,e))t.toggleShape(this,e,i),t.config.data_onclick.call(t.api,e,this)})}).call(r.data_selection_draggable&&t.drag?n.behavior.drag().origin(Object).on("drag",function(){t.drag(n.mouse(this))}).on("dragstart",function(){t.dragstart(n.mouse(this))}).on("dragend",function(){t.dragend()}):function(){})},r.generateEventRectsForMultipleXs=function(e){function i(){t.svg.select("."+l.eventRect).style("cursor",null),t.hideXGridFocus(),t.hideTooltip(),t.unexpandCircles(),t.unexpandBars()}var t=this,n=t.d3,r=t.config;e.append("rect").attr("x",0).attr("y",0).attr("width",t.width).attr("height",t.height).attr("class",l.eventRect).on("mouseout",function(){if(!t.config)return;if(t.hasArcType())return;i()}).on("mousemove",function(){var e=t.filterTargetsToShow(t.data.targets),s,o,u,a;if(t.dragging)return;if(t.hasArcType(e))return;s=n.mouse(this),o=t.findClosestFromTargets(e,s),t.mouseover&&(!o||o.id!==t.mouseover.id)&&(r.data_onmouseout.call(t.api,t.mouseover),t.mouseover=undefined);if(!o){i();return}t.isScatterType(o)||!r.tooltip_grouped?u=[o]:u=t.filterByX(e,o.x),a=u.map(function(e){return t.addName(e)}),t.showTooltip(a,this),r.point_focus_expand_enabled&&t.expandCircles(o.index,o.id,!0),t.expandBars(o.index,o.id,!0),t.showXGridFocus(a);if(t.isBarType(o.id)||t.dist(o,s)<r.point_sensitivity)t.svg.select("."+l.eventRect).style("cursor","pointer"),t.mouseover||(r.data_onmouseover.call(t.api,o),t.mouseover=o)}).on("click",function(){var e=t.filterTargetsToShow(t.data.targets),i,s;if(t.hasArcType(e))return;i=n.mouse(this),s=t.findClosestFromTargets(e,i);if(!s)return;(t.isBarType(s.id)||t.dist(s,i)<r.point_sensitivity)&&t.main.selectAll("."+l.shapes+t.getTargetSelectorSuffix(s.id)).selectAll("."+l.shape+"-"+s.index).each(function(){if(r.data_selection_grouped||t.isWithinShape(this,s))t.toggleShape(this,s,s.index),t.config.data_onclick.call(t.api,s,this)})}).call(r.data_selection_draggable&&t.drag?n.behavior.drag().origin(Object).on("drag",function(){t.drag(n.mouse(this))}).on("dragstart",function(){t.dragstart(n.mouse(this))}).on("dragend",function(){t.dragend()}):function(){})},r.dispatchEvent=function(t,n,r){var i=this,s="."+l.eventRect+(i.isMultipleX()?"":"-"+n),o=i.main.select(s).node(),u=o.getBoundingClientRect(),a=u.left+(r?r[0]:0),f=u.top+(r?r[1]:0),c=document.createEvent("MouseEvents");c.initMouseEvent(t,!0,!0,e,0,a,f,a,f,!1,!1,!1,!1,0,null),o.dispatchEvent(c)},r.getCurrentWidth=function(){var e=this,t=e.config;return t.size_width?t.size_width:e.getParentWidth()},r.getCurrentHeight=function(){var e=this,t=e.config,n=t.size_height?t.size_height:e.getParentHeight();return n>0?n:320/(e.hasType("gauge")&&!t.gauge_fullCircle?2:1)},r.getCurrentPaddingTop=function(){var e=this,t=e.config,n=c(t.padding_top)?t.padding_top:0;return e.title&&e.title.node()&&(n+=e.getTitlePadding()),n},r.getCurrentPaddingBottom=function(){var e=this.config;return c(e.padding_bottom)?e.padding_bottom:0},r.getCurrentPaddingLeft=function(e){var t=this,n=t.config;return c(n.padding_left)?n.padding_left:n.axis_rotated?n.axis_x_show?Math.max(m(t.getAxisWidthByAxisId("x",e)),40):1:!n.axis_y_show||n.axis_y_inner?t.axis.getYAxisLabelPosition().isOuter?30:1:m(t.getAxisWidthByAxisId("y",e))},r.getCurrentPaddingRight=function(){var e=this,t=e.config,n=10,r=e.isLegendRight?e.getLegendWidth()+20:0;return c(t.padding_right)?t.padding_right+1:t.axis_rotated?n+r:!t.axis_y2_show||t.axis_y2_inner?2+r+(e.axis.getY2AxisLabelPosition().isOuter?20:0):m(e.getAxisWidthByAxisId("y2"))+r},r.getParentRectValue=function(e){var t=this.selectChart.node(),n;while(t&&t.tagName!=="BODY"){try{n=t.getBoundingClientRect()[e]}catch(r){e==="width"&&(n=t.offsetWidth)}if(n)break;t=t.parentNode}return n},r.getParentWidth=function(){return this.getParentRectValue("width")},r.getParentHeight=function(){var e=this.selectChart.style("height");return e.indexOf("px")>0?+e.replace("px",""):0},r.getSvgLeft=function(e){var t=this,n=t.config,r=n.axis_rotated||!n.axis_rotated&&!n.axis_y_inner,i=n.axis_rotated?l.axisX:l.axisY,s=t.main.select("."+i).node(),o=s&&r?s.getBoundingClientRect():{right:0},u=t.selectChart.node().getBoundingClientRect(),a=t.hasArcType(),f=o.right-u.left-(a?0:t.getCurrentPaddingLeft(e));return f>0?f:0},r.getAxisWidthByAxisId=function(e,t){var n=this,r=n.axis.getLabelPositionById(e);return n.axis.getMaxTickWidth(e,t)+(r.isInner?20:40)},r.getHorizontalAxisHeight=function(e){var t=this,n=t.config,r=30;return e==="x"&&!n.axis_x_show?8:e==="x"&&n.axis_x_height?n.axis_x_height:e==="y"&&!n.axis_y_show?n.legend_show&&!t.isLegendRight&&!t.isLegendInset?10:1:e==="y2"&&!n.axis_y2_show?t.rotated_padding_top:(e==="x"&&!n.axis_rotated&&n.axis_x_tick_rotate&&(r=30+t.axis.getMaxTickWidth(e)*Math.cos(Math.PI*(90-n.axis_x_tick_rotate)/180)),e==="y"&&n.axis_rotated&&n.axis_y_tick_rotate&&(r=30+t.axis.getMaxTickWidth(e)*Math.cos(Math.PI*(90-n.axis_y_tick_rotate)/180)),r+(t.axis.getLabelPositionById(e).isInner?0:10)+(e==="y2"?-10:0))},r.getEventRectWidth=function(){return Math.max(0,this.xAxis.tickInterval())},r.getShapeIndices=function(e){var t=this,n=t.config,r={},i=0,s,o;return t.filterTargetsToShow(t.data.targets.filter(e,t)).forEach(function(e){for(s=0;s<n.data_groups.length;s++){if(n.data_groups[s].indexOf(e.id)<0)continue;for(o=0;o<n.data_groups[s].length;o++)if(n.data_groups[s][o]in r){r[e.id]=r[n.data_groups[s][o]];break}}d(r[e.id])&&(r[e.id]=i++)}),r.__max__=i-1,r},r.getShapeX=function(e,t,n,r){var i=this,s=r?i.subX:i.x;return function(r){var i=r.id in n?n[r.id]:0;return r.x||r.x===0?s(r.x)-e*(t/2-i):0}},r.getShapeY=function(e){var t=this;return function(n){var r=e?t.getSubYScale(n.id):t.getYScale(n.id);return r(n.value)}},r.getShapeOffset=function(e,t,n){var r=this,i=r.orderTargets(r.filterTargetsToShow(r.data.targets.filter(e,r))),s=i.map(function(e){return e.id});return function(e,o){var u=n?r.getSubYScale(e.id):r.getYScale(e.id),a=u(0),f=a;return i.forEach(function(n){var i=r.isStepType(e)?r.convertValuesToStep(n.values):n.values;if(n.id===e.id||t[n.id]!==t[e.id])return;if(s.indexOf(n.id)<s.indexOf(e.id)){if(typeof i[o]=="undefined"||+i[o].x!==+e.x)o=-1,i.forEach(function(t,n){t.x===e.x&&(o=n)});o in i&&i[o].value*e.value>=0&&(f+=u(i[o].value)-a)}}),f}},r.isWithinShape=function(e,t){var n=this,r=n.d3.select(e),i;return n.isTargetToShow(t.id)?e.nodeName==="circle"?i=n.isStepType(t)?n.isWithinStep(e,n.getYScale(t.id)(t.value)):n.isWithinCircle(e,n.pointSelectR(t)*1.5):e.nodeName==="path"&&(i=r.classed(l.bar)?n.isWithinBar(e):!0):i=!1,i},r.getInterpolate=function(e){var t=this,n=t.isInterpolationType(t.config.spline_interpolation_type)?t.config.spline_interpolation_type:"cardinal";return t.isSplineType(e)?n:t.isStepType(e)?t.config.line_step_type:"linear"},r.initLine=function(){var e=this;e.main.select("."+l.chart).append("g").attr("class",l.chartLines)},r.updateTargetsForLine=function(e){var t=this,n=t.config,r,i,s=t.classChartLine.bind(t),o=t.classLines.bind(t),u=t.classAreas.bind(t),a=t.classCircles.bind(t),f=t.classFocus.bind(t);r=t.main.select("."+l.chartLines).selectAll("."+l.chartLine).data(e).attr("class",function(e){return s(e)+f(e)}),i=r.enter().append("g").attr("class",s).style("opacity",0).style("pointer-events","none"),i.append("g").attr("class",o),i.append("g").attr("class",u),i.append("g").attr("class",function(e){return t.generateClass(l.selectedCircles,e.id)}),i.append("g").attr("class",a).style("cursor",function(e){return n.data_selection_isselectable(e)?"pointer":null}),e.forEach(function(e){t.main.selectAll("."+l.selectedCircles+t.getTargetSelectorSuffix(e.id)).selectAll("."+l.selectedCircle).each(function(t){t.value=e.values[t.index].value})})},r.updateLine=function(e){var t=this;t.mainLine=t.main.selectAll("."+l.lines).selectAll("."+l.line).data(t.lineData.bind(t)),t.mainLine.enter().append("path").attr("class",t.classLine.bind(t)).style("stroke",t.color),t.mainLine.style("opacity",t.initialOpacity.bind(t)).style("shape-rendering",function(e){return t.isStepType(e)?"crispEdges":""}).attr("transform",null),t.mainLine.exit().transition().duration(e).style("opacity",0).remove()},r.redrawLine=function(e,t){return[(t?this.mainLine.transition(Math.random().toString()):this.mainLine).attr("d",e).style("stroke",this.color).style("opacity",1)]},r.generateDrawLine=function(e,t){var n=this,r=n.config,i=n.d3.svg.line(),s=n.generateGetLinePoints(e,t),o=t?n.getSubYScale:n.getYScale,u=function(e){return(t?n.subxx:n.xx).call(n,e)},a=function(e,t){return r.data_groups.length>0?s(e,t)[0][1]:o.call(n,e.id)(e.value)};return i=r.axis_rotated?i.x(a).y(u):i.x(u).y(a),r.line_connectNull||(i=i.defined(function(e){return e.value!=null})),function(e){var s=r.line_connectNull?n.filterRemoveNull(e.values):e.values,u=t?n.x:n.subX,a=o.call(n,e.id),f=0,l=0,c;return n.isLineType(e)?r.data_regions[e.id]?c=n.lineWithRegions(s,u,a,r.data_regions[e.id]):(n.isStepType(e)&&(s=n.convertValuesToStep(s)),c=i.interpolate(n.getInterpolate(e))(s)):(s[0]&&(f=u(s[0].x),l=a(s[0].value)),c=r.axis_rotated?"M "+l+" "+f:"M "+f+" "+l),c?c:"M 0 0"}},r.generateGetLinePoints=function(e,t){var n=this,r=n.config,i=e.__max__+1,s=n.getShapeX(0,i,e,!!t),o=n.getShapeY(!!t),u=n.getShapeOffset(n.isLineType,e,!!t),a=t?n.getSubYScale:n.getYScale;return function(e,t){var i=a.call(n,e.id)(0),f=u(e,t)||i,l=s(e),c=o(e);return r.axis_rotated&&(0<e.value&&c<i||e.value<0&&i<c)&&(c=i),[[l,c-(i-f)],[l,c-(i-f)],[l,c-(i-f)],[l,c-(i-f)]]}},r.lineWithRegions=function(e,t,n,r){function T(e,t){var n;for(n=0;n<t.length;n++)if(t[n].start<e&&e<=t[n].end)return!0;return!1}function N(e){return"M"+e[0][0]+" "+e[0][1]+" "+e[1][0]+" "+e[1][1]}var i=this,s=i.config,o=-1,u,a,f="M",l,c,h,p,m,g,y,b,w=i.isCategorized()?.5:0,E,S,x=[];if(v(r))for(u=0;u<r.length;u++)x[u]={},d(r[u].start)?x[u].start=e[0].x:x[u].start=i.isTimeSeries()?i.parseDate(r[u].start):r[u].start,d(r[u].end)?x[u].end=e[e.length-1].x:x[u].end=i.isTimeSeries()?i.parseDate(r[u].end):r[u].end;E=s.axis_rotated?function(e){return n(e.value)}:function(e){return t(e.x)},S=s.axis_rotated?function(e){return t(e.x)}:function(e){return n(e.value)},i.isTimeSeries()?l=function(e,r,i,o){var u=e.x.getTime(),a=r.x-e.x,f=new Date(u+a*i),l=new Date(u+a*(i+o)),c;return s.axis_rotated?c=[[n(h(i)),t(f)],[n(h(i+o)),t(l)]]:c=[[t(f),n(h(i))],[t(l),n(h(i+o))]],N(c)}:l=function(e,r,i,o){var u;return s.axis_rotated?u=[[n(h(i),!0),t(c(i))],[n(h(i+o),!0),t(c(i+o))]]:u=[[t(c(i),!0),n(h(i))],[t(c(i+o),!0),n(h(i+o))]],N(u)};for(u=0;u<e.length;u++){if(d(x)||!T(e[u].x,x))f+=" "+E(e[u])+" "+S(e[u]);else{c=i.getScale(e[u-1].x+w,e[u].x+w,i.isTimeSeries()),h=i.getScale(e[u-1].value,e[u].value),p=t(e[u].x)-t(e[u-1].x),m=n(e[u].value)-n(e[u-1].value),g=Math.sqrt(Math.pow(p,2)+Math.pow(m,2)),y=2/g,b=y*2;for(a=y;a<=1;a+=b)f+=l(e[u-1],e[u],a,y)}o=e[u].x}return f},r.updateArea=function(e){var t=this,n=t.d3;t.mainArea=t.main.selectAll("."+l.areas).selectAll("."+l.area).data(t.lineData.bind(t)),t.mainArea.enter().append("path").attr("class",t.classArea.bind(t)).style("fill",t.color).style("opacity",function(){return t.orgAreaOpacity=+n.select(this).style("opacity"),0}),t.mainArea.style("opacity",t.orgAreaOpacity),t.mainArea.exit().transition().duration(e).style("opacity",0).remove()},r.redrawArea=function(e,t){return[(t?this.mainArea.transition(Math.random().toString()):this.mainArea).attr("d",e).style("fill",this.color).style("opacity",this.orgAreaOpacity)]},r.generateDrawArea=function(e,t){var n=this,r=n.config,i=n.d3.svg.area(),s=n.generateGetAreaPoints(e,t),o=t?n.getSubYScale:n.getYScale,u=function(e){return(t?n.subxx:n.xx).call(n,e)},a=function(e,t){return r.data_groups.length>0?s(e,t)[0][1]:o.call(n,e.id)(n.getAreaBaseValue(e.id))},f=function(e,t){return r.data_groups.length>0?s(e,t)[1][1]:o.call(n,e.id)(e.value)};return i=r.axis_rotated?i.x0(a).x1(f).y(u):i.x(u).y0(r.area_above?0:a).y1(f),r.line_connectNull||(i=i.defined(function(e){return e.value!==null})),function(e){var t=r.line_connectNull?n.filterRemoveNull(e.values):e.values,s=0,o=0,u;return n.isAreaType(e)?(n.isStepType(e)&&(t=n.convertValuesToStep(t)),u=i.interpolate(n.getInterpolate(e))(t)):(t[0]&&(s=n.x(t[0].x),o=n.getYScale(e.id)(t[0].value)),u=r.axis_rotated?"M "+o+" "+s:"M "+s+" "+o),u?u:"M 0 0"}},r.getAreaBaseValue=function(){return 0},r.generateGetAreaPoints=function(e,t){var n=this,r=n.config,i=e.__max__+1,s=n.getShapeX(0,i,e,!!t),o=n.getShapeY(!!t),u=n.getShapeOffset(n.isAreaType,e,!!t),a=t?n.getSubYScale:n.getYScale;return function(e,t){var i=a.call(n,e.id)(0),f=u(e,t)||i,l=s(e),c=o(e);return r.axis_rotated&&(0<e.value&&c<i||e.value<0&&i<c)&&(c=i),[[l,f],[l,c-(i-f)],[l,c-(i-f)],[l,f]]}},r.updateCircle=function(){var e=this;e.mainCircle=e.main.selectAll("."+l.circles).selectAll("."+l.circle).data(e.lineOrScatterData.bind(e)),e.mainCircle.enter().append("circle").attr("class",e.classCircle.bind(e)).attr("r",e.pointR.bind(e)).style("fill",e.color),e.mainCircle.style("opacity",e.initialOpacityForCircle.bind(e)),e.mainCircle.exit().remove()},r.redrawCircle=function(e,t,n){var r=this.main.selectAll("."+l.selectedCircle);return[(n?this.mainCircle.transition(Math.random().toString()):this.mainCircle).style("opacity",this.opacityForCircle.bind(this)).style("fill",this.color).attr("cx",e).attr("cy",t),(n?r.transition(Math.random().toString()):r).attr("cx",e).attr("cy",t)]},r.circleX=function(e){return e.x||e.x===0?this.x(e.x):null},r.updateCircleY=function(){var e=this,t,n;e.config.data_groups.length>0?(t=e.getShapeIndices(e.isLineType),n=e.generateGetLinePoints(t),e.circleY=function(e,t){return n(e,t)[0][1]}):e.circleY=function(t){return e.getYScale(t.id)(t.value)}},r.getCircles=function(e,t){var n=this;return(t?n.main.selectAll("."+l.circles+n.getTargetSelectorSuffix(t)):n.main).selectAll("."+l.circle+(c(e)?"-"+e:""))},r.expandCircles=function(e,t,n){var r=this,i=r.pointExpandedR.bind(r);n&&r.unexpandCircles(),r.getCircles(e,t).classed(l.EXPANDED,!0).attr("r",i)},r.unexpandCircles=function(e){var t=this,n=t.pointR.bind(t);t.getCircles(e).filter(function(){return t.d3.select(this).classed(l.EXPANDED)}).classed(l.EXPANDED,!1).attr("r",n)},r.pointR=function(e){var t=this,n=t.config;return t.isStepType(e)?0:h(n.point_r)?n.point_r(e):n.point_r},r.pointExpandedR=function(e){var t=this,n=t.config;return n.point_focus_expand_enabled?n.point_focus_expand_r?n.point_focus_expand_r:t.pointR(e)*1.75:t.pointR(e)},r.pointSelectR=function(e){var t=this,n=t.config;return h(n.point_select_r)?n.point_select_r(e):n.point_select_r?n.point_select_r:t.pointR(e)*4},r.isWithinCircle=function(e,t){var n=this.d3,r=n.mouse(e),i=n.select(e),s=+i.attr("cx"),o=+i.attr("cy");return Math.sqrt(Math.pow(s-r[0],2)+Math.pow(o-r[1],2))<t},r.isWithinStep=function(e,t){return Math.abs(t-this.d3.mouse(e)[1])<30},r.initBar=function(){var e=this;e.main.select("."+l.chart).append("g").attr("class",l.chartBars)},r.updateTargetsForBar=function(e){var t=this,n=t.config,r,i,s=t.classChartBar.bind(t),o=t.classBars.bind(t),u=t.classFocus.bind(t);r=t.main.select("."+l.chartBars).selectAll("."+l.chartBar).data(e).attr("class",function(e){return s(e)+u(e)}),i=r.enter().append("g").attr("class",s).style("opacity",0).style("pointer-events","none"),i.append("g").attr("class",o).style("cursor",function(e){return n.data_selection_isselectable(e)?"pointer":null})},r.updateBar=function(e){var t=this,n=t.barData.bind(t),r=t.classBar.bind(t),i=t.initialOpacity.bind(t),s=function(e){return t.color(e.id)};t.mainBar=t.main.selectAll("."+l.bars).selectAll("."+l.bar).data(n),t.mainBar.enter().append("path").attr("class",r).style("stroke",s).style("fill",s),t.mainBar.style("opacity",i),t.mainBar.exit().transition().duration(e).style("opacity",0).remove()},r.redrawBar=function(e,t){return[(t?this.mainBar.transition(Math.random().toString()):this.mainBar).attr("d",e).style("fill",this.color).style("opacity",1)]},r.getBarW=function(e,t){var n=this,r=n.config,i=typeof r.bar_width=="number"?r.bar_width:t?e.tickInterval()*r.bar_width_ratio/t:0;return r.bar_width_max&&i>r.bar_width_max?r.bar_width_max:i},r.getBars=function(e,t){var n=this;return(t?n.main.selectAll("."+l.bars+n.getTargetSelectorSuffix(t)):n.main).selectAll("."+l.bar+(c(e)?"-"+e:""))},r.expandBars=function(e,t,n){var r=this;n&&r.unexpandBars(),r.getBars(e,t).classed(l.EXPANDED,!0)},r.unexpandBars=function(e){var t=this;t.getBars(e).classed(l.EXPANDED,!1)},r.generateDrawBar=function(e,t){var n=this,r=n.config,i=n.generateGetBarPoints(e,t);return function(e,t){var n=i(e,t),s=r.axis_rotated?1:0,o=r.axis_rotated?0:1,u="M "+n[0][s]+","+n[0][o]+" "+"L"+n[1][s]+","+n[1][o]+" "+"L"+n[2][s]+","+n[2][o]+" "+"L"+n[3][s]+","+n[3][o]+" "+"z";return u}},r.generateGetBarPoints=function(e,t){var n=this,r=t?n.subXAxis:n.xAxis,i=e.__max__+1,s=n.getBarW(r,i),o=n.getShapeX(s,i,e,!!t),u=n.getShapeY(!!t),a=n.getShapeOffset(n.isBarType,e,!!t),f=t?n.getSubYScale:n.getYScale;return function(e,t){var r=f.call(n,e.id)(0),i=a(e,t)||r,l=o(e),c=u(e);return n.config.axis_rotated&&(0<e.value&&c<r||e.value<0&&r<c)&&(c=r),[[l,i],[l,c-(r-i)],[l+s,c-(r-i)],[l+s,i]]}},r.isWithinBar=function(e){var t=this.d3.mouse(e),n=e.getBoundingClientRect(),r=e.pathSegList.getItem(0),i=e.pathSegList.getItem(1),s=Math.min(r.x,i.x),o=Math.min(r.y,i.y),u=n.width,a=n.height,f=2,l=s-f,c=s+u+f,h=o+a+f,p=o-f;return l<t[0]&&t[0]<c&&p<t[1]&&t[1]<h},r.initText=function(){var e=this;e.main.select("."+l.chart).append("g").attr("class",l.chartTexts),e.mainText=e.d3.selectAll([])},r.updateTargetsForText=function(e){var t=this,n,r,i=t.classChartText.bind(t),s=t.classTexts.bind(t),o=t.classFocus.bind(t);n=t.main.select("."+l.chartTexts).selectAll("."+l.chartText).data(e).attr("class",function(e){return i(e)+o(e)}),r=n.enter().append("g").attr("class",i).style("opacity",0).style("pointer-events","none"),r.append("g").attr("class",s)},r.updateText=function(e){var t=this,n=t.config,r=t.barOrLineData.bind(t),i=t.classText.bind(t);t.mainText=t.main.selectAll("."+l.texts).selectAll("."+l.text).data(r),t.mainText.enter().append("text").attr("class",i).attr("text-anchor",function(e){return n.axis_rotated?e.value<0?"end":"start":"middle"}).style("stroke","none").style("fill",function(e){return t.color(e)}).style("fill-opacity",0),t.mainText.text(function(e,n,r){return t.dataLabelFormat(e.id)(e.value,e.id,n,r)}),t.mainText.exit().transition().duration(e).style("fill-opacity",0).remove()},r.redrawText=function(e,t,n,r){return[(r?this.mainText.transition():this.mainText).attr("x",e).attr("y",t).style("fill",this.color).style("fill-opacity",n?0:this.opacityForText.bind(this))]},r.getTextRect=function(e,t,n){var r=this.d3.select("body").append("div").classed("c3",!0),i=r.append("svg").style("visibility","hidden").style("position","fixed").style("top",0).style("left",0),s=this.d3.select(n).style("font"),o;return i.selectAll(".dummy").data([e]).enter().append("text").classed(t?t:"",!0).style("font",s).text(e).each(function(){o=this.getBoundingClientRect()}),r.remove(),o},r.generateXYForText=function(e,t,n,r){var i=this,s=i.generateGetAreaPoints(e,!1),o=i.generateGetBarPoints(t,!1),u=i.generateGetLinePoints(n,!1),a=r?i.getXForText:i.getYForText;return function(e,t){var n=i.isAreaType(e)?s:i.isBarType(e)?o:u;return a.call(i,n(e,t),e,this)}},r.getXForText=function(e,t,n){var r=this,i=n.getBoundingClientRect(),s,o;return r.config.axis_rotated?(o=r.isBarType(t)?4:6,s=e[2][1]+o*(t.value<0?-1:1)):s=r.hasType("bar")?(e[2][0]+e[0][0])/2:e[0][0],t.value===null&&(s>r.width?s=r.width-i.width:s<0&&(s=4)),s},r.getYForText=function(e,t,n){var r=this,i=n.getBoundingClientRect(),s;return r.config.axis_rotated?s=(e[0][0]+e[2][0]+i.height*.6)/2:(s=e[2][1],t.value<0||t.value===0&&!r.hasPositiveValue?(s+=i.height,r.isBarType(t)&&r.isSafari()?s-=3:!r.isBarType(t)&&r.isChrome()&&(s+=3)):s+=r.isBarType(t)?-3:-6),t.value===null&&!r.config.axis_rotated&&(s<i.height?s=i.height:s>this.height&&(s=this.height-4)),s},r.setTargetType=function(e,t){var n=this,r=n.config;n.mapToTargetIds(e).forEach(function(e){n.withoutFadeIn[e]=t===r.data_types[e],r.data_types[e]=t}),e||(r.data_type=t)},r.hasType=function(e,t){var n=this,r=n.config.data_types,i=!1;return t=t||n.data.targets,t&&t.length?t.forEach(function(t){var n=r[t.id];if(n&&n.indexOf(e)>=0||!n&&e==="line")i=!0}):Object.keys(r).length?Object.keys(r).forEach(function(t){r[t]===e&&(i=!0)}):i=n.config.data_type===e,i},r.hasArcType=function(e){return this.hasType("pie",e)||this.hasType("donut",e)||this.hasType("gauge",e)},r.isLineType=function(e){var t=this.config,n=p(e)?e:e.id;return!t.data_types[n]||["line","spline","area","area-spline","step","area-step"].indexOf(t.data_types[n])>=0},r.isStepType=function(e){var t=p(e)?e:e.id;return["step","area-step"].indexOf(this.config.data_types[t])>=0},r.isSplineType=function(e){var t=p(e)?e:e.id;return["spline","area-spline"].indexOf(this.config.data_types[t])>=0},r.isAreaType=function(e){var t=p(e)?e:e.id;return["area","area-spline","area-step"].indexOf(this.config.data_types[t])>=0},r.isBarType=function(e){var t=p(e)?e:e.id;return this.config.data_types[t]==="bar"},r.isScatterType=function(e){var t=p(e)?e:e.id;return this.config.data_types[t]==="scatter"},r.isPieType=function(e){var t=p(e)?e:e.id;return this.config.data_types[t]==="pie"},r.isGaugeType=function(e){var t=p(e)?e:e.id;return this.config.data_types[t]==="gauge"},r.isDonutType=function(e){var t=p(e)?e:e.id;return this.config.data_types[t]==="donut"},r.isArcType=function(e){return this.isPieType(e)||this.isDonutType(e)||this.isGaugeType(e)},r.lineData=function(e){return this.isLineType(e)?[e]:[]},r.arcData=function(e){return this.isArcType(e.data)?[e]:[]},r.barData=function(e){return this.isBarType(e)?e.values:[]},r.lineOrScatterData=function(e){return this.isLineType(e)||this.isScatterType(e)?e.values:[]},r.barOrLineData=function(e){return this.isBarType(e)||this.isLineType(e)?e.values:[]},r.isInterpolationType=function(e){return["linear","linear-closed","basis","basis-open","basis-closed","bundle","cardinal","cardinal-open","cardinal-closed","monotone"].indexOf(e)>=0},r.initGrid=function(){var e=this,t=e.config,n=e.d3;e.grid=e.main.append("g").attr("clip-path",e.clipPathForGrid).attr("class",l.grid),t.grid_x_show&&e.grid.append("g").attr("class",l.xgrids),t.grid_y_show&&e.grid.append("g").attr("class",l.ygrids),t.grid_focus_show&&e.grid.append("g").attr("class",l.xgridFocus).append("line").attr("class",l.xgridFocus),e.xgrid=n.selectAll([]),t.grid_lines_front||e.initGridLines()},r.initGridLines=function(){var e=this,t=e.d3;e.gridLines=e.main.append("g").attr("clip-path",e.clipPathForGrid).attr("class",l.grid+" "+l.gridLines),e.gridLines.append("g").attr("class",l.xgridLines),e.gridLines.append("g").attr("class",l.ygridLines),e.xgridLines=t.selectAll([])},r.updateXGrid=function(e){var t=this,n=t.config,r=t.d3,i=t.generateGridData(n.grid_x_type,t.x),s=t.isCategorized()?t.xAxis.tickOffset():0;t.xgridAttr=n.axis_rotated?{x1:0,x2:t.width,y1:function(e){return t.x(e)-s},y2:function(e){return t.x(e)-s}}:{x1:function(e){return t.x(e)+s},x2:function(e){return t.x(e)+s},y1:0,y2:t.height},t.xgrid=t.main.select("."+l.xgrids).selectAll("."+l.xgrid).data(i),t.xgrid.enter().append("line").attr("class",l.xgrid),e||t.xgrid.attr(t.xgridAttr).style("opacity",function(){return+r.select(this).attr(n.axis_rotated?"y1":"x1")===(n.axis_rotated?t.height:0)?0:1}),t.xgrid.exit().remove()},r.updateYGrid=function(){var e=this,t=e.config,n=e.yAxis.tickValues()||e.y.ticks(t.grid_y_ticks);e.ygrid=e.main.select("."+l.ygrids).selectAll("."+l.ygrid).data(n),e.ygrid.enter().append("line").attr("class",l.ygrid),e.ygrid.attr("x1",t.axis_rotated?e.y:0).attr("x2",t.axis_rotated?e.y:e.width).attr("y1",t.axis_rotated?0:e.y).attr("y2",t.axis_rotated?e.height:e.y),e.ygrid.exit().remove(),e.smoothLines(e.ygrid,"grid")},r.gridTextAnchor=function(e){return e.position?e.position:"end"},r.gridTextDx=function(e){return e.position==="start"?4:e.position==="middle"?0:-4},r.xGridTextX=function(e){return e.position==="start"?-this.height:e.position==="middle"?-this.height/2:0},r.yGridTextX=function(e){return e.position==="start"?0:e.position==="middle"?this.width/2:this.width},r.updateGrid=function(e){var t=this,n=t.main,r=t.config,i,s,o;t.grid.style("visibility",t.hasArcType()?"hidden":"visible"),n.select("line."+l.xgridFocus).style("visibility","hidden"),r.grid_x_show&&t.updateXGrid(),t.xgridLines=n.select("."+l.xgridLines).selectAll("."+l.xgridLine).data(r.grid_x_lines),i=t.xgridLines.enter().append("g").attr("class",function(e){return l.xgridLine+(e["class"]?" "+e["class"]:"")}),i.append("line").style("opacity",0),i.append("text").attr("text-anchor",t.gridTextAnchor).attr("transform",r.axis_rotated?"":"rotate(-90)").attr("dx",t.gridTextDx).attr("dy",-5).style("opacity",0),t.xgridLines.exit().transition().duration(e).style("opacity",0).remove(),r.grid_y_show&&t.updateYGrid(),t.ygridLines=n.select("."+l.ygridLines).selectAll("."+l.ygridLine).data(r.grid_y_lines),s=t.ygridLines.enter().append("g").attr("class",function(e){return l.ygridLine+(e["class"]?" "+e["class"]:"")}),s.append("line").style("opacity",0),s.append("text").attr("text-anchor",t.gridTextAnchor).attr("transform",r.axis_rotated?"rotate(-90)":"").attr("dx",t.gridTextDx).attr("dy",-5).style("opacity",0),o=t.yv.bind(t),t.ygridLines.select("line").transition().duration(e).attr("x1",r.axis_rotated?o:0).attr("x2",r.axis_rotated?o:t.width).attr("y1",r.axis_rotated?0:o).attr("y2",r.axis_rotated?t.height:o).style("opacity",1),t.ygridLines.select("text").transition().duration(e).attr("x",r.axis_rotated?t.xGridTextX.bind(t):t.yGridTextX.bind(t)).attr("y",o).text(function(e){return e.text}).style("opacity",1),t.ygridLines.exit().transition().duration(e).style("opacity",0).remove()},r.redrawGrid=function(e){var t=this,n=t.config,r=t.xv.bind(t),i=t.xgridLines.select("line"),s=t.xgridLines.select("text");return[(e?i.transition():i).attr("x1",n.axis_rotated?0:r).attr("x2",n.axis_rotated?t.width:r).attr("y1",n.axis_rotated?r:0).attr("y2",n.axis_rotated?r:t.height).style("opacity",1),(e?s.transition():s).attr("x",n.axis_rotated?t.yGridTextX.bind(t):t.xGridTextX.bind(t)).attr("y",r).text(function(e){return e.text}).style("opacity",1)]},r.showXGridFocus=function(e){var t=this,n=t.config,r=e.filter(function(e){return e&&c(e.value)}),i=t.main.selectAll("line."+l.xgridFocus),s=t.xx.bind(t);if(!n.tooltip_show)return;if(t.hasType("scatter")||t.hasArcType())return;i.style("visibility","visible").data([r[0]]).attr(n.axis_rotated?"y1":"x1",s).attr(n.axis_rotated?"y2":"x2",s),t.smoothLines(i,"grid")},r.hideXGridFocus=function(){this.main.select("line."+l.xgridFocus).style("visibility","hidden")},r.updateXgridFocus=function(){var e=this,t=e.config;e.main.select("line."+l.xgridFocus).attr("x1",t.axis_rotated?0:-10).attr("x2",t.axis_rotated?e.width:-10).attr("y1",t.axis_rotated?-10:0).attr("y2",t.axis_rotated?-10:e.height)},r.generateGridData=function(e,t){var n=this,r=[],i,s,o,u,a=n.main.select("."+l.axisX).selectAll(".tick").size();if(e==="year"){i=n.getXDomain(),s=i[0].getFullYear(),o=i[1].getFullYear();for(u=s;u<=o;u++)r.push(new Date(u+"-01-01 00:00:00"))}else r=t.ticks(10),r.length>a&&(r=r.filter(function(e){return(""+e).indexOf(".")<0}));return r},r.getGridFilterToRemove=function(e){return e?function(t){var n=!1;return[].concat(e).forEach(function(e){if("value"in e&&t.value===e.value||"class"in e&&t["class"]===e["class"])n=!0}),n}:function(){return!0}},r.removeGridLines=function(e,t){var n=this,r=n.config,i=n.getGridFilterToRemove(e),s=function(e){return!i(e)},o=t?l.xgridLines:l.ygridLines,u=t?l.xgridLine:l.ygridLine;n.main.select("."+o).selectAll("."+u).filter(i).transition().duration(r.transition_duration).style("opacity",0).remove(),t?r.grid_x_lines=r.grid_x_lines.filter(s):r.grid_y_lines=r.grid_y_lines.filter(s)},r.initTooltip=function(){var e=this,t=e.config,n;e.tooltip=e.selectChart.style("position","relative").append("div").attr("class",l.tooltipContainer).style("position","absolute").style("pointer-events","none").style("display","none");if(t.tooltip_init_show){if(e.isTimeSeries()&&p(t.tooltip_init_x)){t.tooltip_init_x=e.parseDate(t.tooltip_init_x);for(n=0;n<e.data.targets[0].values.length;n++)if(e.data.targets[0].values[n].x-t.tooltip_init_x===0)break;t.tooltip_init_x=n}e.tooltip.html(t.tooltip_contents.call(e,e.data.targets.map(function(n){return e.addName(n.values[t.tooltip_init_x])}),e.axis.getXAxisTickFormat(),e.getYFormat(e.hasArcType()),e.color)),e.tooltip.style("top",t.tooltip_init_position.top).style("left",t.tooltip_init_position.left).style("display","block")}},r.getTooltipContent=function(e,t,n,r){var i=this,s=i.config,o=s.tooltip_format_title||t,u=s.tooltip_format_name||function(e){return e},a=s.tooltip_format_value||n,f,l,c,h,p,d,v=i.isOrderAsc();if(s.data_groups.length===0)e.sort(function(e,t){var n=e?e.value:null,r=t?t.value:null;return v?n-r:r-n});else{var m=i.orderTargets(i.data.targets).map(function(e){return e.id});e.sort(function(e,t){var n=e?e.value:null,r=t?t.value:null;return n>0&&r>0&&(n=e?m.indexOf(e.id):null,r=t?m.indexOf(t.id):null),v?n-r:r-n})}for(l=0;l<e.length;l++){if(!e[l]||!e[l].value&&e[l].value!==0)continue;f||(c=x(o?o(e[l].x):e[l].x),f="<table class='"+i.CLASS.tooltip+"'>"+(c||c===0?"<tr><th colspan='2'>"+c+"</th></tr>":"")),h=x(a(e[l].value,e[l].ratio,e[l].id,e[l].index,e));if(h!==undefined){if(e[l].name===null)continue;p=x(u(e[l].name,e[l].ratio,e[l].id,e[l].index)),d=i.levelColor?i.levelColor(e[l].value):r(e[l].id),f+="<tr class='"+i.CLASS.tooltipName+"-"+i.getTargetSelectorSuffix(e[l].id)+"'>",f+="<td class='name'><span style='background-color:"+d+"'></span>"+p+"</td>",f+="<td class='value'>"+h+"</td>",f+="</tr>"}}return f+"</table>"},r.tooltipPosition=function(e,t,n,r){var i=this,s=i.config,o=i.d3,u,a,f,l,c,h=i.hasArcType(),p=o.mouse(r);return h?(a=(i.width-(i.isLegendRight?i.getLegendWidth():0))/2+p[0],l=i.height/2+p[1]+20):(u=i.getSvgLeft(!0),s.axis_rotated?(a=u+p[0]+100,f=a+t,c=i.currentWidth-i.getCurrentPaddingRight(),l=i.x(e[0].x)+20):(a=u+i.getCurrentPaddingLeft(!0)+i.x(e[0].x)+20,f=a+t,c=u+i.currentWidth-i.getCurrentPaddingRight(),l=p[1]+15),f>c&&(a-=f-c+20),l+n>i.currentHeight&&(l-=n+30)),l<0&&(l=0),{top:l,left:a}},r.showTooltip=function(e,t){var n=this,i=n.config,s,o,u,a=n.hasArcType(),f=e.filter(function(e){return e&&c(e.value)}),l=i.tooltip_position||r.tooltipPosition;if(f.length===0||!i.tooltip_show)return;n.tooltip.html(i.tooltip_contents.call(n,e,n.axis.getXAxisTickFormat(),n.getYFormat(a),n.color)).style("display","block"),s=n.tooltip.property("offsetWidth"),o=n.tooltip.property("offsetHeight"),u=l.call(this,f,s,o,t),n.tooltip.style("top",u.top+"px").style("left",u.left+"px")},r.hideTooltip=function(){this.tooltip.style("display","none")},r.initLegend=function(){var e=this;e.legendItemTextBox={},e.legendHasRendered=!1,e.legend=e.svg.append("g").attr("transform",e.getTranslate("legend"));if(!e.config.legend_show){e.legend.style("visibility","hidden"),e.hiddenLegendIds=e.mapToIds(e.data.targets);return}e.updateLegendWithDefaults()},r.updateLegendWithDefaults=function(){var e=this;e.updateLegend(e.mapToIds(e.data.targets),{withTransform:!1,withTransitionForTransform:!1,withTransition:!1})},r.updateSizeForLegend=function(e,t){var n=this,r=n.config,i={top:n.isLegendTop?n.getCurrentPaddingTop()+r.legend_inset_y+5.5:n.currentHeight-e-n.getCurrentPaddingBottom()-r.legend_inset_y,left:n.isLegendLeft?n.getCurrentPaddingLeft()+r.legend_inset_x+.5:n.currentWidth-t-n.getCurrentPaddingRight()-r.legend_inset_x+.5};n.margin3={top:n.isLegendRight?0:n.isLegendInset?i.top:n.currentHeight-e,right:NaN,bottom:0,left:n.isLegendRight?n.currentWidth-t:n.isLegendInset?i.left:0}},r.transformLegend=function(e){var t=this;(e?t.legend.transition():t.legend).attr("transform",t.getTranslate("legend"))},r.updateLegendStep=function(e){this.legendStep=e},r.updateLegendItemWidth=function(e){this.legendItemWidth=e},r.updateLegendItemHeight=function(e){this.legendItemHeight=e},r.getLegendWidth=function(){var e=this;return e.config.legend_show?e.isLegendRight||e.isLegendInset?e.legendItemWidth*(e.legendStep+1):e.currentWidth:0},r.getLegendHeight=function(){var e=this,t=0;return e.config.legend_show&&(e.isLegendRight?t=e.currentHeight:t=Math.max(20,e.legendItemHeight)*(e.legendStep+1)),t},r.opacityForLegend=function(e){return e.classed(l.legendItemHidden)?null:1},r.opacityForUnfocusedLegend=function(e){return e.classed(l.legendItemHidden)?null:.3},r.toggleFocusLegend=function(e,t){var n=this;e=n.mapToTargetIds(e),n.legend.selectAll("."+l.legendItem).filter(function(t){return e.indexOf(t)>=0}).classed(l.legendItemFocused,t).transition().duration(100).style("opacity",function(){var e=t?n.opacityForLegend:n.opacityForUnfocusedLegend;return e.call(n,n.d3.select(this))})},r.revertLegend=function(){var e=this,t=e.d3;e.legend.selectAll("."+l.legendItem).classed(l.legendItemFocused,!1).transition().duration(100).style("opacity",function(){return e.opacityForLegend(t.select(this))})},r.showLegend=function(e){var t=this,n=t.config;n.legend_show||(n.legend_show=!0,t.legend.style("visibility","visible"),t.legendHasRendered||t.updateLegendWithDefaults()),t.removeHiddenLegendIds(e),t.legend.selectAll(t.selectorLegends(e)).style("visibility","visible").transition().style("opacity",function(){return t.opacityForLegend(t.d3.select(this))})},r.hideLegend=function(e){var t=this,n=t.config;n.legend_show&&b(e)&&(n.legend_show=!1,t.legend.style("visibility","hidden")),t.addHiddenLegendIds(e),t.legend.selectAll(t.selectorLegends(e)).style("opacity",0).style("visibility","hidden")},r.clearLegendItemTextBoxCache=function(){this.legendItemTextBox={}},r.updateLegend=function(e,t,n){function j(e,t){return r.legendItemTextBox[t]||(r.legendItemTextBox[t]=r.getTextRect(e.textContent,l.legendItem,e)),r.legendItemTextBox[t]}function F(t,n,s){function v(e,t){t||(p=(h-T-c)/2,p<w&&(p=(h-c)/2,T=0,O++)),A[e]=O,L[O]=r.isLegendInset?10:p,N[e]=T,T+=c}var o=s===0,u=s===e.length-1,a=j(t,n),f=a.width+S+(u&&!r.isLegendRight&&!r.isLegendInset?0:g)+i.legend_padding,l=a.height+m,c=r.isLegendRight||r.isLegendInset?l:f,h=r.isLegendRight||r.isLegendInset?r.getLegendHeight():r.getLegendWidth(),p,d;o&&(T=0,O=0,y=0,b=0);if(i.legend_show&&!r.isLegendToShow(n)){C[n]=k[n]=A[n]=N[n]=0;return}C[n]=f,k[n]=l;if(!y||f>=y)y=f;if(!b||l>=b)b=l;d=r.isLegendRight||r.isLegendInset?b:y,i.legend_equally?(Object.keys(C).forEach(function(e){C[e]=y}),Object.keys(k).forEach(function(e){k[e]=b}),p=(h-d*e.length)/2,p<w?(T=0,O=0,e.forEach(function(e){v(e)})):v(n,!0)):v(n)}var r=this,i=r.config,s,o,u,a,f,c,h,p,d,m=4,g=10,y=0,b=0,w=10,S=i.legend_item_tile_width+5,x,T=0,N={},C={},k={},L=[0],A={},O=0,M,_,D,P,H,B;e=e.filter(function(e){return!v(i.data_names[e])||i.data_names[e]!==null}),t=t||{},M=E(t,"withTransition",!0),_=E(t,"withTransitionForTransform",!0),r.isLegendInset&&(O=i.legend_inset_step?i.legend_inset_step:e.length,r.updateLegendStep(O)),r.isLegendRight?(s=function(e){return y*A[e]},a=function(e){return L[A[e]]+N[e]}):r.isLegendInset?(s=function(e){return y*A[e]+10},a=function(e){return L[A[e]]+N[e]}):(s=function(e){return L[A[e]]+N[e]},a=function(e){return b*A[e]}),o=function(e,t){return s(e,t)+4+i.legend_item_tile_width},f=function(e,t){return a(e,t)+9},u=function(e,t){return s(e,t)},c=function(e,t){return a(e,t)-5},h=function(e,t){return s(e,t)-2},p=function(e,t){return s(e,t)-2+i.legend_item_tile_width},d=function(e,t){return a(e,t)+4},x=r.legend.selectAll("."+l.legendItem).data(e).enter().append("g").attr("class",function(e){return r.generateClass(l.legendItem,e)}).style("visibility",function(e){return r.isLegendToShow(e)?"visible":"hidden"}).style("cursor","pointer").on("click",function(e){i.legend_item_onclick?i.legend_item_onclick.call(r,e):r.d3.event.altKey?(r.api.hide(),r.api.show(e)):(r.api.toggle(e),r.isTargetToShow(e)?r.api.focus(e):r.api.revert())}).on("mouseover",function(e){i.legend_item_onmouseover?i.legend_item_onmouseover.call(r,e):(r.d3.select(this).classed(l.legendItemFocused,!0),!r.transiting&&r.isTargetToShow(e)&&r.api.focus(e))}).on("mouseout",function(e){i.legend_item_onmouseout?i.legend_item_onmouseout.call(r,e):(r.d3.select(this).classed(l.legendItemFocused,!1),r.api.revert())}),x.append("text").text(function(e){return v(i.data_names[e])?i.data_names[e]:e}).each(function(e,t){F(this,e,t)}).style("pointer-events","none").attr("x",r.isLegendRight||r.isLegendInset?o:-200).attr("y",r.isLegendRight||r.isLegendInset?-200:f),x.append("rect").attr("class",l.legendItemEvent).style("fill-opacity",0).attr("x",r.isLegendRight||r.isLegendInset?u:-200).attr("y",r.isLegendRight||r.isLegendInset?-200:c),x.append("line").attr("class",l.legendItemTile).style("stroke",r.color).style("pointer-events","none").attr("x1",r.isLegendRight||r.isLegendInset?h:-200).attr("y1",r.isLegendRight||r.isLegendInset?-200:d).attr("x2",r.isLegendRight||r.isLegendInset?p:-200).attr("y2",r.isLegendRight||r.isLegendInset?-200:d).attr("stroke-width",i.legend_item_tile_height),B=r.legend.select("."+l.legendBackground+" rect"),r.isLegendInset&&y>0&&B.size()===0&&(B=r.legend.insert("g","."+l.legendItem).attr("class",l.legendBackground).append("rect")),D=r.legend.selectAll("text").data(e).text(function(e){return v(i.data_names[e])?i.data_names[e]:e}).each(function(e,t){F(this,e,t)}),(M?D.transition():D).attr("x",o).attr("y",f),P=r.legend.selectAll("rect."+l.legendItemEvent).data(e),(M?P.transition():P).attr("width",function(e){return C[e]}).attr("height",function(e){return k[e]}).attr("x",u).attr("y",c),H=r.legend.selectAll("line."+l.legendItemTile).data(e),(M?H.transition():H).style("stroke",r.color).attr("x1",h).attr("y1",d).attr("x2",p).attr("y2",d),B&&(M?B.transition():B).attr("height",r.getLegendHeight()-12).attr("width",y*(O+1)+10),r.legend.selectAll("."+l.legendItem).classed(l.legendItemHidden,function(e){return!r.isTargetToShow(e)}),r.updateLegendItemWidth(y),r.updateLegendItemHeight(b),r.updateLegendStep(O),r.updateSizes(),r.updateScales(),r.updateSvgSize(),r.transformAll(_,n),r.legendHasRendered=!0},r.initTitle=function(){var e=this;e.title=e.svg.append("text").text(e.config.title_text).attr("class",e.CLASS.title)},r.redrawTitle=function(){var e=this;e.title.attr("x",e.xForTitle.bind(e)).attr("y",e.yForTitle.bind(e))},r.xForTitle=function(){var e=this,t=e.config,n=t.title_position||"left",r;return n.indexOf("right")>=0?r=e.currentWidth-e.getTextRect(e.title.node().textContent,e.CLASS.title,e.title.node()).width-t.title_padding.right:n.indexOf("center")>=0?r=(e.currentWidth-e.getTextRect(e.title.node().textContent,e.CLASS.title,e.title.node()).width)/2:r=t.title_padding.left,r},r.yForTitle=function(){var e=this;return e.config.title_padding.top+e.getTextRect(e.title.node().textContent,e.CLASS.title,e.title.node()).height},r.getTitlePadding=function(){var e=this;return e.yForTitle()+e.config.title_padding.bottom},o(s,f),f.prototype.init=function(){var t=this.owner,n=t.config,r=t.main;t.axes.x=r.append("g").attr("class",l.axis+" "+l.axisX).attr("clip-path",t.clipPathForXAxis).attr("transform",t.getTranslate("x")).style("visibility",n.axis_x_show?"visible":"hidden"),t.axes.x.append("text").attr("class",l.axisXLabel).attr("transform",n.axis_rotated?"rotate(-90)":"").style("text-anchor",this.textAnchorForXAxisLabel.bind(this)),t.axes.y=r.append("g").attr("class",l.axis+" "+l.axisY).attr("clip-path",n.axis_y_inner?"":t.clipPathForYAxis).attr("transform",t.getTranslate("y")).style("visibility",n.axis_y_show?"visible":"hidden"),t.axes.y.append("text").attr("class",l.axisYLabel).attr("transform",n.axis_rotated?"":"rotate(-90)").style("text-anchor",this.textAnchorForYAxisLabel.bind(this)),t.axes.y2=r.append("g").attr("class",l.axis+" "+l.axisY2).attr("transform",t.getTranslate("y2")).style("visibility",n.axis_y2_show?"visible":"hidden"),t.axes.y2.append("text").attr("class",l.axisY2Label).attr("transform",n.axis_rotated?"":"rotate(-90)").style("text-anchor",this.textAnchorForY2AxisLabel.bind(this))},f.prototype.getXAxis=function(t,n,r,i,s,o,u){var a=this.owner,f=a.config,l={isCategory:a.isCategorized(),withOuterTick:s,tickMultiline:f.axis_x_tick_multiline,tickWidth:f.axis_x_tick_width,tickTextRotate:u?0:f.axis_x_tick_rotate,withoutTransition:o},c=C(a.d3,l).scale(t).orient(n);return a.isTimeSeries()&&i&&typeof i!="function"&&(i=i.map(function(e){return a.parseDate(e)})),c.tickFormat(r).tickValues(i),a.isCategorized()&&(c.tickCentered(f.axis_x_tick_centered),b(f.axis_x_tick_culling)&&(f.axis_x_tick_culling=!1)),c},f.prototype.updateXAxisTickValues=function(t,n){var r=this.owner,i=r.config,s;if(i.axis_x_tick_fit||i.axis_x_tick_count)s=this.generateTickValues(r.mapTargetsToUniqueXs(t),i.axis_x_tick_count,r.isTimeSeries());return n?n.tickValues(s):(r.xAxis.tickValues(s),r.subXAxis.tickValues(s)),s},f.prototype.getYAxis=function(t,n,r,i,s,o,u){var a=this.owner,f=a.config,l={withOuterTick:s,withoutTransition:o,tickTextRotate:u?0:f.axis_y_tick_rotate},c=C(a.d3,l).scale(t).orient(n).tickFormat(r);return a.isTimeSeriesY()?c.ticks(a.d3.time[f.axis_y_tick_time_value],f.axis_y_tick_time_interval):c.tickValues(i),c},f.prototype.getId=function(t){var n=this.owner.config;return t in n.data_axes?n.data_axes[t]:"y"},f.prototype.getXAxisTickFormat=function(){var t=this.owner,n=t.config,r=t.isTimeSeries()?t.defaultAxisTimeFormat:t.isCategorized()?t.categoryName:function(e){return e<0?e.toFixed(0):e};return n.axis_x_tick_format&&(h(n.axis_x_tick_format)?r=n.axis_x_tick_format:t.isTimeSeries()&&(r=function(e){return e?t.axisTimeFormat(n.axis_x_tick_format)(e):""})),h(r)?function(e){return r.call(t,e)}:r},f.prototype.getTickValues=function(t,n){return t?t:n?n.tickValues():undefined},f.prototype.getXAxisTickValues=function(){return this.getTickValues(this.owner.config.axis_x_tick_values,this.owner.xAxis)},f.prototype.getYAxisTickValues=function(){return this.getTickValues(this.owner.config.axis_y_tick_values,this.owner.yAxis)},f.prototype.getY2AxisTickValues=function(){return this.getTickValues(this.owner.config.axis_y2_tick_values,this.owner.y2Axis)},f.prototype.getLabelOptionByAxisId=function(t){var n=this.owner,r=n.config,i;return t==="y"?i=r.axis_y_label:t==="y2"?i=r.axis_y2_label:t==="x"&&(i=r.axis_x_label),i},f.prototype.getLabelText=function(t){var n=this.getLabelOptionByAxisId(t);return p(n)?n:n?n.text:null},f.prototype.setLabelText=function(t,n){var r=this.owner,i=r.config,s=this.getLabelOptionByAxisId(t);p(s)?t==="y"?i.axis_y_label=n:t==="y2"?i.axis_y2_label=n:t==="x"&&(i.axis_x_label=n):s&&(s.text=n)},f.prototype.getLabelPosition=function(t,n){var r=this.getLabelOptionByAxisId(t),i=r&&typeof r=="object"&&r.position?r.position:n;return{isInner:i.indexOf("inner")>=0,isOuter:i.indexOf("outer")>=0,isLeft:i.indexOf("left")>=0,isCenter:i.indexOf("center")>=0,isRight:i.indexOf("right")>=0,isTop:i.indexOf("top")>=0,isMiddle:i.indexOf("middle")>=0,isBottom:i.indexOf("bottom")>=0}},f.prototype.getXAxisLabelPosition=function(){return this.getLabelPosition("x",this.owner.config.axis_rotated?"inner-top":"inner-right")},f.prototype.getYAxisLabelPosition=function(){return this.getLabelPosition("y",this.owner.config.axis_rotated?"inner-right":"inner-top")},f.prototype.getY2AxisLabelPosition=function(){return this.getLabelPosition("y2",this.owner.config.axis_rotated?"inner-right":"inner-top")},f.prototype.getLabelPositionById=function(t){return t==="y2"?this.getY2AxisLabelPosition():t==="y"?this.getYAxisLabelPosition():this.getXAxisLabelPosition()},f.prototype.textForXAxisLabel=function(){return this.getLabelText("x")},f.prototype.textForYAxisLabel=function(){return this.getLabelText("y")},f.prototype.textForY2AxisLabel=function(){return this.getLabelText("y2")},f.prototype.xForAxisLabel=function(t,n){var r=this.owner;return t?n.isLeft?0:n.isCenter?r.width/2:r.width:n.isBottom?-r.height:n.isMiddle?-r.height/2:0},f.prototype.dxForAxisLabel=function(t,n){return t?n.isLeft?"0.5em":n.isRight?"-0.5em":"0":n.isTop?"-0.5em":n.isBottom?"0.5em":"0"},f.prototype.textAnchorForAxisLabel=function(t,n){return t?n.isLeft?"start":n.isCenter?"middle":"end":n.isBottom?"start":n.isMiddle?"middle":"end"},f.prototype.xForXAxisLabel=function(){return this.xForAxisLabel(!this.owner.config.axis_rotated,this.getXAxisLabelPosition())},f.prototype.xForYAxisLabel=function(){return this.xForAxisLabel(this.owner.config.axis_rotated,this.getYAxisLabelPosition())},f.prototype.xForY2AxisLabel=function(){return this.xForAxisLabel(this.owner.config.axis_rotated,this.getY2AxisLabelPosition())},f.prototype.dxForXAxisLabel=function(){return this.dxForAxisLabel(!this.owner.config.axis_rotated,this.getXAxisLabelPosition())},f.prototype.dxForYAxisLabel=function(){return this.dxForAxisLabel(this.owner.config.axis_rotated,this.getYAxisLabelPosition())},f.prototype.dxForY2AxisLabel=function(){return this.dxForAxisLabel(this.owner.config.axis_rotated,this.getY2AxisLabelPosition())},f.prototype.dyForXAxisLabel=function(){var t=this.owner,n=t.config,r=this.getXAxisLabelPosition();return n.axis_rotated?r.isInner?"1.2em":-25-this.getMaxTickWidth("x"):r.isInner?"-0.5em":n.axis_x_height?n.axis_x_height-10:"3em"},f.prototype.dyForYAxisLabel=function(){var t=this.owner,n=this.getYAxisLabelPosition();return t.config.axis_rotated?n.isInner?"-0.5em":"3em":n.isInner?"1.2em":-10-(t.config.axis_y_inner?0:this.getMaxTickWidth("y")+10)},f.prototype.dyForY2AxisLabel=function(){var t=this.owner,n=this.getY2AxisLabelPosition();return t.config.axis_rotated?n.isInner?"1.2em":"-2.2em":n.isInner?"-0.5em":15+(t.config.axis_y2_inner?0:this.getMaxTickWidth("y2")+15)},f.prototype.textAnchorForXAxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(!t.config.axis_rotated,this.getXAxisLabelPosition())},f.prototype.textAnchorForYAxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(t.config.axis_rotated,this.getYAxisLabelPosition())},f.prototype.textAnchorForY2AxisLabel=function(){var t=this.owner;return this.textAnchorForAxisLabel(t.config.axis_rotated,this.getY2AxisLabelPosition())},f.prototype.getMaxTickWidth=function(t,n){var r=this.owner,i=r.config,s=0,o,u,a,f,l;return n&&r.currentMaxTickWidths[t]?r.currentMaxTickWidths[t]:(r.svg&&(o=r.filterTargetsToShow(r.data.targets),t==="y"?(u=r.y.copy().domain(r.getYDomain(o,"y")),a=this.getYAxis(u,r.yOrient,i.axis_y_tick_format,r.yAxisTickValues,!1,!0,!0)):t==="y2"?(u=r.y2.copy().domain(r.getYDomain(o,"y2")),a=this.getYAxis(u,r.y2Orient,i.axis_y2_tick_format,r.y2AxisTickValues,!1,!0,!0)):(u=r.x.copy().domain(r.getXDomain(o)),a=this.getXAxis(u,r.xOrient,r.xAxisTickFormat,r.xAxisTickValues,!1,!0,!0),this.updateXAxisTickValues(o,a)),f=r.d3.select("body").append("div").classed("c3",!0),l=f.append("svg").style("visibility","hidden").style("position","fixed").style("top",0).style("left",0),l.append("g").call(a).each(function(){r.d3.select(this).selectAll("text").each(function(){var e=this.getBoundingClientRect();s<e.width&&(s=e.width)}),f.remove()})),r.currentMaxTickWidths[t]=s<=0?r.currentMaxTickWidths[t]:s,r.currentMaxTickWidths[t])},f.prototype.updateLabels=function(t){var n=this.owner,r=n.main.select("."+l.axisX+" ."+l.axisXLabel),i=n.main.select("."+l.axisY+" ."+l.axisYLabel),s=n.main.select("."+l.axisY2+" ."+l.axisY2Label);(t?r.transition():r).attr("x",this.xForXAxisLabel.bind(this)).attr("dx",this.dxForXAxisLabel.bind(this)).attr("dy",this.dyForXAxisLabel.bind(this)).text(this.textForXAxisLabel.bind(this)),(t?i.transition():i).attr("x",this.xForYAxisLabel.bind(this)).attr("dx",this.dxForYAxisLabel.bind(this)).attr("dy",this.dyForYAxisLabel.bind(this)).text(this.textForYAxisLabel.bind(this)),(t?s.transition():s).attr("x",this.xForY2AxisLabel.bind(this)).attr("dx",this.dxForY2AxisLabel.bind(this)).attr("dy",this.dyForY2AxisLabel.bind(this)).text(this.textForY2AxisLabel.bind(this))},f.prototype.getPadding=function(t,n,r,i){var s=typeof t=="number"?t:t[n];return c(s)?t.unit==="ratio"?t[n]*i:this.convertPixelsToAxisPadding(s,i):r},f.prototype.convertPixelsToAxisPadding=function(t,n){var r=this.owner,i=r.config.axis_rotated?r.width:r.height;return n*(t/i)},f.prototype.generateTickValues=function(t,n,r){var i=t,s,o,u,a,f,l,c;if(n){s=h(n)?n():n;if(s===1)i=[t[0]];else if(s===2)i=[t[0],t[t.length-1]];else if(s>2){a=s-2,o=t[0],u=t[t.length-1],f=(u-o)/(a+1),i=[o];for(l=0;l<a;l++)c=+o+f*(l+1),i.push(r?new Date(c):c);i.push(u)}}return r||(i=i.sort(function(e,t){return e-t})),i},f.prototype.generateTransitions=function(t){var n=this.owner,r=n.axes;return{axisX:t?r.x.transition().duration(t):r.x,axisY:t?r.y.transition().duration(t):r.y,axisY2:t?r.y2.transition().duration(t):r.y2,axisSubX:t?r.subx.transition().duration(t):r.subx}},f.prototype.redraw=function(t,n){var r=this.owner;r.axes.x.style("opacity",n?0:1),r.axes.y.style("opacity",n?0:1),r.axes.y2.style("opacity",n?0:1),r.axes.subx.style("opacity",n?0:1),t.axisX.call(r.xAxis),t.axisY.call(r.yAxis),t.axisY2.call(r.y2Axis),t.axisSubX.call(r.subXAxis)},r.getClipPath=function(t){var n=e.navigator.appVersion.toLowerCase().indexOf("msie 9.")>=0;return"url("+(n?"":document.URL.split("#")[0])+"#"+t+")"},r.appendClip=function(e,t){return e.append("clipPath").attr("id",t).append("rect")},r.getAxisClipX=function(e){var t=Math.max(30,this.margin.left);return e?-(1+t):-(t-1)},r.getAxisClipY=function(e){return e?-20:-this.margin.top},r.getXAxisClipX=function(){var e=this;return e.getAxisClipX(!e.config.axis_rotated)},r.getXAxisClipY=function(){var e=this;return e.getAxisClipY(!e.config.axis_rotated)},r.getYAxisClipX=function(){var e=this;return e.config.axis_y_inner?-1:e.getAxisClipX(e.config.axis_rotated)},r.getYAxisClipY=function(){var e=this;return e.getAxisClipY(e.config.axis_rotated)},r.getAxisClipWidth=function(e){var t=this,n=Math.max(30,t.margin.left),r=Math.max(30,t.margin.right);return e?t.width+2+n+r:t.margin.left+20},r.getAxisClipHeight=function(e){return(e?this.margin.bottom:this.margin.top+this.height)+20},r.getXAxisClipWidth=function(){var e=this;return e.getAxisClipWidth(!e.config.axis_rotated)},r.getXAxisClipHeight=function(){var e=this;return e.getAxisClipHeight(!e.config.axis_rotated)},r.getYAxisClipWidth=function(){var e=this;return e.getAxisClipWidth(e.config.axis_rotated)+(e.config.axis_y_inner?20:0)},r.getYAxisClipHeight=function(){var e=this;return e.getAxisClipHeight(e.config.axis_rotated)},r.initPie=function(){var e=this,t=e.d3,n=e.config;e.pie=t.layout.pie().value(function(e){return e.values.reduce(function(e,t){return e+t.value},0)}),n.data_order||e.pie.sort(null)},r.updateRadius=function(){var e=this,t=e.config,n=t.gauge_width||t.donut_width;e.radiusExpanded=Math.min(e.arcWidth,e.arcHeight)/2,e.radius=e.radiusExpanded*.95,e.innerRadiusRatio=n?(e.radius-n)/e.radius:.6,e.innerRadius=e.hasType("donut")||e.hasType("gauge")?e.radius*e.innerRadiusRatio:0},r.updateArc=function(){var e=this;e.svgArc=e.getSvgArc(),e.svgArcExpanded=e.getSvgArcExpanded(),e.svgArcExpandedSub=e.getSvgArcExpanded(.98)},r.updateAngle=function(e){var t=this,n=t.config,r=!1,i=0,s,o,u,a;return n?(t.pie(t.filterTargetsToShow(t.data.targets)).forEach(function(t){!r&&t.data.id===e.data.id&&(r=!0,e=t,e.index=i),i++}),isNaN(e.startAngle)&&(e.startAngle=0),isNaN(e.endAngle)&&(e.endAngle=e.startAngle),t.isGaugeType(e.data)&&(s=n.gauge_min,o=n.gauge_max,u=Math.PI*(n.gauge_fullCircle?2:1)/(o-s),a=e.value<s?0:e.value<o?e.value-s:o-s,e.startAngle=n.gauge_startingAngle,e.endAngle=e.startAngle+u*a),r?e:null):null},r.getSvgArc=function(){var e=this,t=e.d3.svg.arc().outerRadius(e.radius).innerRadius(e.innerRadius),n=function(n,r){var i;return r?t(n):(i=e.updateAngle(n),i?t(i):"M 0 0")};return n.centroid=t.centroid,n},r.getSvgArcExpanded=function(e){var t=this,n=t.d3.svg.arc().outerRadius(t.radiusExpanded*(e?e:1)).innerRadius(t.innerRadius);return function(e){var r=t.updateAngle(e);return r?n(r):"M 0 0"}},r.getArc=function(e,t,n){return n||this.isArcType(e.data)?this.svgArc(e,t):"M 0 0"},r.transformForArcLabel=function(e){var t=this,n=t.config,r=t.updateAngle(e),i,s,o,u,a,f="";return r&&!t.hasType("gauge")&&(i=this.svgArc.centroid(r),s=isNaN(i[0])?0:i[0],o=isNaN(i[1])?0:i[1],u=Math.sqrt(s*s+o*o),t.hasType("donut")&&n.donut_label_ratio?a=h(n.donut_label_ratio)?n.donut_label_ratio(e,t.radius,u):n.donut_label_ratio:t.hasType("pie")&&n.pie_label_ratio?a=h(n.pie_label_ratio)?n.pie_label_ratio(e,t.radius,u):n.pie_label_ratio:a=t.radius&&u?(36/t.radius>.375?1.175-36/t.radius:.8)*t.radius/u:0,f="translate("+s*a+","+o*a+")"),f},r.getArcRatio=function(e){var t=this,n=t.config,r=Math.PI*(t.hasType("gauge")&&!n.gauge_fullCircle?1:2);return e?(e.endAngle-e.startAngle)/r:null},r.convertToArcData=function(e){return this.addName({id:e.data.id,value:e.value,ratio:this.getArcRatio(e),index:e.index})},r.textForArcLabel=function(e){var t=this,n,r,i,s,o;return t.shouldShowArcLabel()?(n=t.updateAngle(e),r=n?n.value:null,i=t.getArcRatio(n),s=e.data.id,!t.hasType("gauge")&&!t.meetsArcLabelThreshold(i)?"":(o=t.getArcLabelFormat(),o?o(r,i,s):t.defaultArcValueFormat(r,i))):""},r.expandArc=function(t){var n=this,r;if(n.transiting){r=e.setInterval(function(){n.transiting||(e.clearInterval(r),n.legend.selectAll(".c3-legend-item-focused").size()>0&&n.expandArc(t))},10);return}t=n.mapToTargetIds(t),n.svg.selectAll(n.selectorTargets(t,"."+l.chartArc)).each(function(e){if(!n.shouldExpand(e.data.id))return;n.d3.select(this).selectAll("path").transition().duration(n.expandDuration(e.data.id)).attr("d",n.svgArcExpanded).transition().duration(n.expandDuration(e.data.id)*2).attr("d",n.svgArcExpandedSub).each(function(e){n.isDonutType(e.data)})})},r.unexpandArc=function(e){var t=this;if(t.transiting)return;e=t.mapToTargetIds(e),t.svg.selectAll(t.selectorTargets(e,"."+l.chartArc)).selectAll("path").transition().duration(function(e){return t.expandDuration(e.data.id)}).attr("d",t.svgArc),t.svg.selectAll("."+l.arc).style("opacity",1)},r.expandDuration=function(e){var t=this,n=t.config;return t.isDonutType(e)?n.donut_expand_duration:t.isGaugeType(e)?n.gauge_expand_duration:t.isPieType(e)?n.pie_expand_duration:50},r.shouldExpand=function(e){var t=this,n=t.config;return t.isDonutType(e)&&n.donut_expand||t.isGaugeType(e)&&n.gauge_expand||t.isPieType(e)&&n.pie_expand},r.shouldShowArcLabel=function(){var e=this,t=e.config,n=!0;return e.hasType("donut")?n=t.donut_label_show:e.hasType("pie")&&(n=t.pie_label_show),n},r.meetsArcLabelThreshold=function(e){var t=this,n=t.config,r=t.hasType("donut")?n.donut_label_threshold:n.pie_label_threshold;return e>=r},r.getArcLabelFormat=function(){var e=this,t=e.config,n=t.pie_label_format;return e.hasType("gauge")?n=t.gauge_label_format:e.hasType("donut")&&(n=t.donut_label_format),n},r.getArcTitle=function(){var e=this;return e.hasType("donut")?e.config.donut_title:""},r.updateTargetsForArc=function(e){var t=this,n=t.main,r,i,s=t.classChartArc.bind(t),o=t.classArcs.bind(t),u=t.classFocus.bind(t);r=n.select("."+l.chartArcs).selectAll("."+l.chartArc).data(t.pie(e)).attr("class",function(e){return s(e)+u(e.data)}),i=r.enter().append("g").attr("class",s),i.append("g").attr("class",o),i.append("text").attr("dy",t.hasType("gauge")?"-.1em":".35em").style("opacity",0).style("text-anchor","middle").style("pointer-events","none")},r.initArc=function(){var e=this;e.arcs=e.main.select("."+l.chart).append("g").attr("class",l.chartArcs).attr("transform",e.getTranslate("arc")),e.arcs.append("text").attr("class",l.chartArcsTitle).style("text-anchor","middle").text(e.getArcTitle())},r.redrawArc=function(e,t,n){var r=this,i=r.d3,s=r.config,o=r.main,u;u=o.selectAll("."+l.arcs).selectAll("."+l.arc).data(r.arcData.bind(r)),u.enter().append("path").attr("class",r.classArc.bind(r)).style("fill",function(e){return r.color(e.data)}).style("cursor",function(e){return s.interaction_enabled&&s.data_selection_isselectable(e)?"pointer":null}).style("opacity",0).each(function(e){r.isGaugeType(e.data)&&(e.startAngle=e.endAngle=s.gauge_startingAngle),this._current=e}),u.attr("transform",function(e){return!r.isGaugeType(e.data)&&n?"scale(0)":""}).style("opacity",function(e){return e===this._current?0:1}).on("mouseover",s.interaction_enabled?function(e){var t,n;if(r.transiting)return;t=r.updateAngle(e),t&&(n=r.convertToArcData(t),r.expandArc(t.data.id),r.api.focus(t.data.id),r.toggleFocusLegend(t.data.id,!0),r.config.data_onmouseover(n,this))}:null).on("mousemove",s.interaction_enabled?function(e){var t=r.updateAngle(e),n,i;t&&(n=r.convertToArcData(t),i=[n],r.showTooltip(i,this))}:null).on("mouseout",s.interaction_enabled?function(e){var t,n;if(r.transiting)return;t=r.updateAngle(e),t&&(n=r.convertToArcData(t),r.unexpandArc(t.data.id),r.api.revert(),r.revertLegend(),r.hideTooltip(),r.config.data_onmouseout(n,this))}:null).on("click",s.interaction_enabled?function(e,t){var n=r.updateAngle(e),i;n&&(i=r.convertToArcData(n),r.toggleShape&&r.toggleShape(this,i,t),r.config.data_onclick.call(r.api,i,this))}:null).each(function(){r.transiting=!0}).transition().duration(e).attrTween("d",function(e){var t=r.updateAngle(e),n;return t?(isNaN(this._current.startAngle)&&(this._current.startAngle=0),isNaN(this._current.endAngle)&&(this._current.endAngle=this._current.startAngle),n=i.interpolate(this._current,t),this._current=n(0),function(t){var i=n(t);return i.data=e.data,r.getArc(i,!0)}):function(){return"M 0 0"}}).attr("transform",n?"scale(1)":"").style("fill",function(e){return r.levelColor?r.levelColor(e.data.values[0].value):r.color(e.data.id)}).style("opacity",1).call(r.endall,function(){r.transiting=!1}),u.exit().transition().duration(t).style("opacity",0).remove(),o.selectAll("."+l.chartArc).select("text").style("opacity",0).attr("class",function(e){return r.isGaugeType(e.data)?l.gaugeValue:""}).text(r.textForArcLabel.bind(r)).attr("transform",r.transformForArcLabel.bind(r)).style("font-size",function(e){return r.isGaugeType(e.data)?Math.round(r.radius/5)+"px":""}).transition().duration(e).style("opacity",function(e){return r.isTargetToShow(e.data.id)&&r.isArcType(e.data)?1:0}),o.select("."+l.chartArcsTitle).style("opacity",r.hasType("donut")||r.hasType("gauge")?1:0),r.hasType("gauge")&&(r.arcs.select("."+l.chartArcsBackground).attr("d",function(){var e={data:[{value:s.gauge_max}],startAngle:s.gauge_startingAngle,endAngle:-1*s.gauge_startingAngle};return r.getArc(e,!0,!0)}),r.arcs.select("."+l.chartArcsGaugeUnit).attr("dy",".75em").text(s.gauge_label_show?s.gauge_units:""),r.arcs.select("."+l.chartArcsGaugeMin).attr("dx",-1*(r.innerRadius+(r.radius-r.innerRadius)/(s.gauge_fullCircle?1:2))+"px").attr("dy","1.2em").text(s.gauge_label_show?s.gauge_min:""),r.arcs.select("."+l.chartArcsGaugeMax).attr("dx",r.innerRadius+(r.radius-r.innerRadius)/(s.gauge_fullCircle?1:2)+"px").attr("dy","1.2em").text(s.gauge_label_show?s.gauge_max:""))},r.initGauge=function(){var e=this.arcs;this.hasType("gauge")&&(e.append("path").attr("class",l.chartArcsBackground),e.append("text").attr("class",l.chartArcsGaugeUnit).style("text-anchor","middle").style("pointer-events","none"),e.append("text").attr("class",l.chartArcsGaugeMin).style("text-anchor","middle").style("pointer-events","none"),e.append("text").attr("class",l.chartArcsGaugeMax).style("text-anchor","middle").style("pointer-events","none"))},r.getGaugeLabelHeight=function(){return this.config.gauge_label_show?20:0},r.initRegion=function(){var e=this;e.region=e.main.append("g").attr("clip-path",e.clipPath).attr("class",l.regions)},r.updateRegion=function(e){var t=this,n=t.config;t.region.style("visibility",t.hasArcType()?"hidden":"visible"),t.mainRegion=t.main.select("."+l.regions).selectAll("."+l.region).data(n.regions),t.mainRegion.enter().append("g").append("rect").style("fill-opacity",0),t.mainRegion.attr("class",t.classRegion.bind(t)),t.mainRegion.exit().transition().duration(e).style("opacity",0).remove()},r.redrawRegion=function(e){var t=this,n=t.mainRegion.selectAll("rect").each(function(){var e=t.d3.select(this.parentNode).datum();t.d3.select(this).datum(e)}),r=t.regionX.bind(t),i=t.regionY.bind(t),s=t.regionWidth.bind(t),o=t.regionHeight.bind(t);return[(e?n.transition():n).attr("x",r).attr("y",i).attr("width",s).attr("height",o).style("fill-opacity",function(e){return c(e.opacity)?e.opacity:.1})]},r.regionX=function(e){var t=this,n=t.config,r,i=e.axis==="y"?t.y:t.y2;return e.axis==="y"||e.axis==="y2"?r=n.axis_rotated?"start"in e?i(e.start):0:0:r=n.axis_rotated?0:"start"in e?t.x(t.isTimeSeries()?t.parseDate(e.start):e.start):0,r},r.regionY=function(e){var t=this,n=t.config,r,i=e.axis==="y"?t.y:t.y2;return e.axis==="y"||e.axis==="y2"?r=n.axis_rotated?0:"end"in e?i(e.end):0:r=n.axis_rotated?"start"in e?t.x(t.isTimeSeries()?t.parseDate(e.start):e.start):0:0,r},r.regionWidth=function(e){var t=this,n=t.config,r=t.regionX(e),i,s=e.axis==="y"?t.y:t.y2;return e.axis==="y"||e.axis==="y2"?i=n.axis_rotated?"end"in e?s(e.end):t.width:t.width:i=n.axis_rotated?t.width:"end"in e?t.x(t.isTimeSeries()?t.parseDate(e.end):e.end):t.width,i<r?0:i-r},r.regionHeight=function(e){var t=this,n=t.config,r=this.regionY(e),i,s=e.axis==="y"?t.y:t.y2;return e.axis==="y"||e.axis==="y2"?i=n.axis_rotated?t.height:"start"in e?s(e.start):t.height:i=n.axis_rotated?"end"in e?t.x(t.isTimeSeries()?t.parseDate(e.end):e.end):t.height:t.height,i<r?0:i-r},r.isRegionOnX=function(e){return!e.axis||e.axis==="x"},r.drag=function(e){var t=this,n=t.config,r=t.main,i=t.d3,s,o,u,a,f,c,h,p;if(t.hasArcType())return;if(!n.data_selection_enabled)return;if(n.zoom_enabled&&!t.zoom.altDomain)return;if(!n.data_selection_multiple)return;s=t.dragStart[0],o=t.dragStart[1],u=e[0],a=e[1],f=Math.min(s,u),c=Math.max(s,u),h=n.data_selection_grouped?t.margin.top:Math.min(o,a),p=n.data_selection_grouped?t.height:Math.max(o,a),r.select("."+l.dragarea).attr("x",f).attr("y",h).attr("width",c-f).attr("height",p-h),r.selectAll("."+l.shapes).selectAll("."+l.shape).filter(function(e){return n.data_selection_isselectable(e)}).each(function(e,n){var r=i.select(this),s=r.classed(l.SELECTED),o=r.classed(l.INCLUDED),u,a,d,v,m,g=!1,y;if(r.classed(l.circle))u=r.attr("cx")*1,a=r.attr("cy")*1,m=t.togglePoint,g=f<u&&u<c&&h<a&&a<p;else{if(!r.classed(l.bar))return;y=T(this),u=y.x,a=y.y,d=y.width,v=y.height,m=t.togglePath,g=!(c<u||u+d<f)&&!(p<a||a+v<h)}g^o&&(r.classed(l.INCLUDED,!o),r.classed(l.SELECTED,!s),m.call(t,!s,r,e,n))})},r.dragstart=function(e){var t=this,n=t.config;if(t.hasArcType())return;if(!n.data_selection_enabled)return;t.dragStart=e,t.main.select("."+l.chart).append("rect").attr("class",l.dragarea).style("opacity",.1),t.dragging=!0},r.dragend=function(){var e=this,t=e.config;if(e.hasArcType())return;if(!t.data_selection_enabled)return;e.main.select("."+l.dragarea).transition().duration(100).style("opacity",0).remove(),e.main.selectAll("."+l.shape).classed(l.INCLUDED,!1),e.dragging=!1},r.selectPoint=function(e,t,n){var r=this,i=r.config,s=(i.axis_rotated?r.circleY:r.circleX).bind(r),o=(i.axis_rotated?r.circleX:r.circleY).bind(r),u=r.pointSelectR.bind(r);i.data_onselected.call(r.api,t,e.node()),r.main.select("."+l.selectedCircles+r.getTargetSelectorSuffix(t.id)).selectAll("."+l.selectedCircle+"-"+n).data([t]).enter().append("circle").attr("class",function(){return r.generateClass(l.selectedCircle,n)}).attr("cx",s).attr("cy",o).attr("stroke",function(){return r.color(t)}).attr("r",function(e){return r.pointSelectR(e)*1.4}).transition().duration(100).attr("r",u)},r.unselectPoint=function(e,t,n){var r=this;r.config.data_onunselected.call(r.api,t,e.node()),r.main.select("."+l.selectedCircles+r.getTargetSelectorSuffix(t.id)).selectAll("."+l.selectedCircle+"-"+n).transition().duration(100).attr("r",0).remove()},r.togglePoint=function(e,t,n,r){e?this.selectPoint(t,n,r):this.unselectPoint(t,n,r)},r.selectPath=function(e,t){var n=this;n.config.data_onselected.call(n,t,e.node()),n.config.interaction_brighten&&e.transition().duration(100).style("fill",function(){return n.d3.rgb(n.color(t)).brighter(.75)})},r.unselectPath=function(e,t){var n=this;n.config.data_onunselected.call(n,t,e.node()),n.config.interaction_brighten&&e.transition().duration(100).style("fill",function(){return n.color(t)})},r.togglePath=function(e,t,n,r){e?this.selectPath(t,n,r):this.unselectPath(t,n,r)},r.getToggle=function(e,t){var n=this,r;return e.nodeName==="circle"?n.isStepType(t)?r=function(){}:r=n.togglePoint:e.nodeName==="path"&&(r=n.togglePath),r},r.toggleShape=function(e,t,n){var r=this,i=r.d3,s=r.config,o=i.select(e),u=o.classed(l.SELECTED),a=r.getToggle(e,t).bind(r);s.data_selection_enabled&&s.data_selection_isselectable(t)&&(s.data_selection_multiple||r.main.selectAll("."+l.shapes+(s.data_selection_grouped?r.getTargetSelectorSuffix(t.id):"")).selectAll("."+l.shape).each(function(e,t){var n=i.select(this);n.classed(l.SELECTED)&&a(!1,n.classed(l.SELECTED,!1),e,t)}),o.classed(l.SELECTED,!u),a(!u,o,t,n))},r.initBrush=function(){var e=this,t=e.d3;e.brush=t.svg.brush().on("brush",function(){e.redrawForBrush()}),e.brush.update=function(){return e.context&&e.context.select("."+l.brush).call(this),this},e.brush.scale=function(t){return e.config.axis_rotated?this.y(t):this.x(t)}},r.initSubchart=function(){var e=this,t=e.config,n=e.context=e.svg.append("g").attr("transform",e.getTranslate("context")),r=t.subchart_show?"visible":"hidden";n.style("visibility",r),n.append("g").attr("clip-path",e.clipPathForSubchart).attr("class",l.chart),n.select("."+l.chart).append("g").attr("class",l.chartBars),n.select("."+l.chart).append("g").attr("class",l.chartLines),n.append("g").attr("clip-path",e.clipPath).attr("class",l.brush).call(e.brush),e.axes.subx=n.append("g").attr("class",l.axisX).attr("transform",e.getTranslate("subx")).attr("clip-path",t.axis_rotated?"":e.clipPathForXAxis).style("visibility",t.subchart_axis_x_show?r:"hidden")},r.updateTargetsForSubchart=function(e){var t=this,n=t.context,r=t.config,i,s,o,u,a=t.classChartBar.bind(t),f=t.classBars.bind(t),c=t.classChartLine.bind(t),h=t.classLines.bind(t),p=t.classAreas.bind(t);r.subchart_show&&(u=n.select("."+l.chartBars).selectAll("."+l.chartBar).data(e).attr("class",a),o=u.enter().append("g").style("opacity",0).attr("class",a),o.append("g").attr("class",f),s=n.select("."+l.chartLines).selectAll("."+l.chartLine).data(e).attr("class",c),i=s.enter().append("g").style("opacity",0).attr("class",c),i.append("g").attr("class",h),i.append("g").attr("class",p),n.selectAll("."+l.brush+" rect").attr(r.axis_rotated?"width":"height",r.axis_rotated?t.width2:t.height2))},r.updateBarForSubchart=function(e){var t=this;t.contextBar=t.context.selectAll("."+l.bars).selectAll("."+l.bar).data(t.barData.bind(t)),t.contextBar.enter().append("path").attr("class",t.classBar.bind(t)).style("stroke","none").style("fill",t.color),t.contextBar.style("opacity",t.initialOpacity.bind(t)),t.contextBar.exit().transition().duration(e).style("opacity",0).remove()},r.redrawBarForSubchart=function(e,t,n){(t?this.contextBar.transition(Math.random().toString()).duration(n):this.contextBar).attr("d",e).style("opacity",1)},r.updateLineForSubchart=function(e){var t=this;t.contextLine=t.context.selectAll("."+l.lines).selectAll("."+l.line).data(t.lineData.bind(t)),t.contextLine.enter().append("path").attr("class",t.classLine.bind(t)).style("stroke",t.color),t.contextLine.style("opacity",t.initialOpacity.bind(t)),t.contextLine.exit().transition().duration(e).style("opacity",0).remove()},r.redrawLineForSubchart=function(e,t,n){(t?this.contextLine.transition(Math.random().toString()).duration(n):this.contextLine).attr("d",e).style("opacity",1)},r.updateAreaForSubchart=function(e){var t=this,n=t.d3;t.contextArea=t.context.selectAll("."+l.areas).selectAll("."+l.area).data(t.lineData.bind(t)),t.contextArea.enter().append("path").attr("class",t.classArea.bind(t)).style("fill",t.color).style("opacity",function(){return t.orgAreaOpacity=+n.select(this).style("opacity"),0}),t.contextArea.style("opacity",0),t.contextArea.exit().transition().duration(e).style("opacity",0).remove()},r.redrawAreaForSubchart=function(e,t,n){(t?this.contextArea.transition(Math.random().toString()).duration(n):this.contextArea).attr("d",e).style("fill",this.color).style("opacity",this.orgAreaOpacity)},r.redrawSubchart=function(e,t,n,r,i,s,o){var u=this,a=u.d3,f=u.config,l,c,h;u.context.style("visibility",f.subchart_show?"visible":"hidden"),f.subchart_show&&(a.event&&a.event.type==="zoom"&&u.brush.extent(u.x.orgDomain()).update(),e&&(u.brush.empty()||u.brush.extent(u.x.orgDomain()).update(),l=u.generateDrawArea(i,!0),c=u.generateDrawBar(s,!0),h=u.generateDrawLine(o,!0),u.updateBarForSubchart(n),u.updateLineForSubchart(n),u.updateAreaForSubchart(n),u.redrawBarForSubchart(c,n,n),u.redrawLineForSubchart(h,n,n),u.redrawAreaForSubchart(l,n,n)))},r.redrawForBrush=function(){var e=this,t=e.x;e.redraw({withTransition:!1,withY:e.config.zoom_rescale,withSubchart:!1,withUpdateXDomain:!0,withDimension:!1}),e.config.subchart_onbrush.call(e.api,t.orgDomain())},r.transformContext=function(e,t){var n=this,r;t&&t.axisSubX?r=t.axisSubX:(r=n.context.select("."+l.axisX),e&&(r=r.transition())),n.context.attr("transform",n.getTranslate("context")),r.attr("transform",n.getTranslate("subx"))},r.getDefaultExtent=function(){var e=this,t=e.config,n=h(t.axis_x_extent)?t.axis_x_extent(e.getXDomain(e.data.targets)):t.axis_x_extent;return e.isTimeSeries()&&(n=[e.parseDate(n[0]),e.parseDate(n[1])]),n},r.initZoom=function(){var e=this,t=e.d3,n=e.config,r;e.zoom=t.behavior.zoom().on("zoomstart",function(){r=t.event.sourceEvent,e.zoom.altDomain=t.event.sourceEvent.altKey?e.x.orgDomain():null,n.zoom_onzoomstart.call(e.api,t.event.sourceEvent)}).on("zoom",function(){e.redrawForZoom.call(e)}).on("zoomend",function(){var i=t.event.sourceEvent;if(i&&r.clientX===i.clientX&&r.clientY===i.clientY)return;e.redrawEventRect(),e.updateZoom(),n.zoom_onzoomend.call(e.api,e.x.orgDomain())}),e.zoom.scale=function(e){return n.axis_rotated?this.y(e):this.x(e)},e.zoom.orgScaleExtent=function(){var t=n.zoom_extent?n.zoom_extent:[1,10];return[t[0],Math.max(e.getMaxDataCount()/t[1],t[1])]},e.zoom.updateScaleExtent=function(){var t=y(e.x.orgDomain())/y(e.getZoomDomain()),n=this.orgScaleExtent();return this.scaleExtent([n[0]*t,n[1]*t]),this}},r.getZoomDomain=function(){var e=this,t=e.config,n=e.d3,r=n.min([e.orgXDomain[0],t.zoom_x_min]),i=n.max([e.orgXDomain[1],t.zoom_x_max]);return[r,i]},r.updateZoom=function(){var e=this,t=e.config.zoom_enabled?e.zoom:function(){};e.main.select("."+l.zoomRect).call(t).on("dblclick.zoom",null),e.main.selectAll("."+l.eventRect).call(t).on("dblclick.zoom",null)},r.redrawForZoom=function(){var e=this,t=e.d3,n=e.config,r=e.zoom,i=e.x;if(!n.zoom_enabled)return;if(e.filterTargetsToShow(e.data.targets).length===0)return;if(t.event.sourceEvent.type==="mousemove"&&r.altDomain){i.domain(r.altDomain),r.scale(i).updateScaleExtent();return}e.isCategorized()&&i.orgDomain()[0]===e.orgXDomain[0]&&i.domain([e.orgXDomain[0]-1e-10,i.orgDomain()[1]]),e.redraw({withTransition:!1,withY:n.zoom_rescale,withSubchart:!1,withEventRect:!1,withDimension:!1}),t.event.sourceEvent.type==="mousemove"&&(e.cancelClick=!0),n.zoom_onzoom.call(e.api,i.orgDomain())},r.generateColor=function(){var e=this,t=e.config,n=e.d3,r=t.data_colors,i=w(t.color_pattern)?t.color_pattern:n.scale.category10().range(),s=t.data_color,o=[];return function(e){var t=e.id||e.data&&e.data.id||e,n;return r[t]instanceof Function?n=r[t](e):r[t]?n=r[t]:(o.indexOf(t)<0&&o.push(t),n=i[o.indexOf(t)%i.length],r[t]=n),s instanceof Function?s(n,e):n}},r.generateLevelColor=function(){var e=this,t=e.config,n=t.color_pattern,r=t.color_threshold,i=r.unit==="value",s=r.values&&r.values.length?r.values:[],o=r.max||100;return w(t.color_threshold)?function(e){var t,r,u=n[n.length-1];for(t=0;t<s.length;t++){r=i?e:e*100/o;if(r<s[t]){u=n[t];break}}return u}:null},r.getYFormat=function(e){var t=this,n=e&&!t.hasType("gauge")?t.defaultArcValueFormat:t.yFormat,r=e&&!t.hasType("gauge")?t.defaultArcValueFormat:t.y2Format;return function(e,i,s){var o=t.axis.getId(s)==="y2"?r:n;return o.call(t,e,i)}},r.yFormat=function(e){var t=this,n=t.config,r=n.axis_y_tick_format?n.axis_y_tick_format:t.defaultValueFormat;return r(e)},r.y2Format=function(e){var t=this,n=t.config,r=n.axis_y2_tick_format?n.axis_y2_tick_format:t.defaultValueFormat;return r(e)},r.defaultValueFormat=function(e){return c(e)?+e:""},r.defaultArcValueFormat=function(e,t){return(t*100).toFixed(1)+"%"},r.dataLabelFormat=function(e){var t=this,n=t.config.data_labels,r,i=function(e){return c(e)?+e:""};return typeof n.format=="function"?r=n.format:typeof n.format=="object"?n.format[e]?r=n.format[e]===!0?i:n.format[e]:r=function(){return""}:r=i,r},r.hasCaches=function(e){for(var t=0;t<e.length;t++)if(!(e[t]in this.cache))return!1;return!0},r.addCache=function(e,t){this.cache[e]=this.cloneTarget(t)},r.getCaches=function(e){var t=[],n;for(n=0;n<e.length;n++)e[n]in this.cache&&t.push(this.cloneTarget(this.cache[e[n]]));return t};var l=r.CLASS={target:"c3-target",chart:"c3-chart",chartLine:"c3-chart-line",chartLines:"c3-chart-lines",chartBar:"c3-chart-bar",chartBars:"c3-chart-bars",chartText:"c3-chart-text",chartTexts:"c3-chart-texts",chartArc:"c3-chart-arc",chartArcs:"c3-chart-arcs",chartArcsTitle:"c3-chart-arcs-title",chartArcsBackground:"c3-chart-arcs-background",chartArcsGaugeUnit:"c3-chart-arcs-gauge-unit",chartArcsGaugeMax:"c3-chart-arcs-gauge-max",chartArcsGaugeMin:"c3-chart-arcs-gauge-min",selectedCircle:"c3-selected-circle",selectedCircles:"c3-selected-circles",eventRect:"c3-event-rect",eventRects:"c3-event-rects",eventRectsSingle:"c3-event-rects-single",eventRectsMultiple:"c3-event-rects-multiple",zoomRect:"c3-zoom-rect",brush:"c3-brush",focused:"c3-focused",defocused:"c3-defocused",region:"c3-region",regions:"c3-regions",title:"c3-title",tooltipContainer:"c3-tooltip-container",tooltip:"c3-tooltip",tooltipName:"c3-tooltip-name",shape:"c3-shape",shapes:"c3-shapes",line:"c3-line",lines:"c3-lines",bar:"c3-bar",bars:"c3-bars",circle:"c3-circle",circles:"c3-circles",arc:"c3-arc",arcs:"c3-arcs",area:"c3-area",areas:"c3-areas",empty:"c3-empty",text:"c3-text",texts:"c3-texts",gaugeValue:"c3-gauge-value",grid:"c3-grid",gridLines:"c3-grid-lines",xgrid:"c3-xgrid",xgrids:"c3-xgrids",xgridLine:"c3-xgrid-line",xgridLines:"c3-xgrid-lines",xgridFocus:"c3-xgrid-focus",ygrid:"c3-ygrid",ygrids:"c3-ygrids",ygridLine:"c3-ygrid-line",ygridLines:"c3-ygrid-lines",axis:"c3-axis",axisX:"c3-axis-x",axisXLabel:"c3-axis-x-label",axisY:"c3-axis-y",axisYLabel:"c3-axis-y-label",axisY2:"c3-axis-y2",axisY2Label:"c3-axis-y2-label",legendBackground:"c3-legend-background",legendItem:"c3-legend-item",legendItemEvent:"c3-legend-item-event",legendItemTile:"c3-legend-item-tile",legendItemHidden:"c3-legend-item-hidden",legendItemFocused:"c3-legend-item-focused",dragarea:"c3-dragarea",EXPANDED:"_expanded_",SELECTED:"_selected_",INCLUDED:"_included_"};r.generateClass=function(e,t){return" "+e+" "+e+this.getTargetSelectorSuffix(t)},r.classText=function(e){return this.generateClass(l.text,e.index)},r.classTexts=function(e){return this.generateClass(l.texts,e.id)},r.classShape=function(e){return this.generateClass(l.shape,e.index)},r.classShapes=function(e){return this.generateClass(l.shapes,e.id)},r.classLine=function(e){return this.classShape(e)+this.generateClass(l.line,e.id)},r.classLines=function(e){return this.classShapes(e)+this.generateClass(l.lines,e.id)},r.classCircle=function(e){return this.classShape(e)+this.generateClass(l.circle,e.index)},r.classCircles=function(e){return this.classShapes(e)+this.generateClass(l.circles,e.id)},r.classBar=function(e){return this.classShape(e)+this.generateClass(l.bar,e.index)},r.classBars=function(e){return this.classShapes(e)+this.generateClass(l.bars,e.id)},r.classArc=function(e){return this.classShape(e.data)+this.generateClass(l.arc,e.data.id)},r.classArcs=function(e){return this.classShapes(e.data)+this.generateClass(l.arcs,e.data.id)},r.classArea=function(e){return this.classShape(e)+this.generateClass(l.area,e.id)},r.classAreas=function(e){return this.classShapes(e)+this.generateClass(l.areas,e.id)},r.classRegion=function(e,t){return this.generateClass(l.region,t)+" "+("class"in e?e["class"]:"")},r.classEvent=function(e){return this.generateClass(l.eventRect,e.index)},r.classTarget=function(e){var t=this,n=t.config.data_classes[e],r="";return n&&(r=" "+l.target+"-"+n),t.generateClass(l.target,e)+r},r.classFocus=function(e){return this.classFocused(e)+this.classDefocused(e)},r.classFocused=function(e){return" "+(this.focusedTargetIds.indexOf(e.id)>=0?l.focused:"")},r.classDefocused=function(e){return" "+(this.defocusedTargetIds.indexOf(e.id)>=0?l.defocused:"")},r.classChartText=function(e){return l.chartText+this.classTarget(e.id)},r.classChartLine=function(e){return l.chartLine+this.classTarget(e.id)},r.classChartBar=function(e){return l.chartBar+this.classTarget(e.id)},r.classChartArc=function(e){return l.chartArc+this.classTarget(e.data.id)},r.getTargetSelectorSuffix=function(e){return e||e===0?("-"+e).replace(/[\s?!@#$%^&*()_=+,.<>'":;\[\]\/|~`{}\\]/g,"-"):""},r.selectorTarget=function(e,t){return(t||"")+"."+l.target+this.getTargetSelectorSuffix(e)},r.selectorTargets=function(e,t){var n=this;return e=e||[],e.length?e.map(function(e){return n.selectorTarget(e,t)}):null},r.selectorLegend=function(e){return"."+l.legendItem+this.getTargetSelectorSuffix(e)},r.selectorLegends=function(e){var t=this;return e&&e.length?e.map(function(e){return t.selectorLegend(e)}):null};var c=r.isValue=function(e){return e||e===0},h=r.isFunction=function(e){return typeof e=="function"},p=r.isString=function(e){return typeof e=="string"},d=r.isUndefined=function(e){return typeof e=="undefined"},v=r.isDefined=function(e){return typeof e!="undefined"},m=r.ceil10=function(e){return Math.ceil(e/10)*10},g=r.asHalfPixel=function(e){return Math.ceil(e)+.5},y=r.diffDomain=function(e){return e[1]-e[0]},b=r.isEmpty=function(e){return typeof e=="undefined"||e===null||p(e)&&e.length===0||typeof e=="object"&&Object.keys(e).length===0},w=r.notEmpty=function(e){return!r.isEmpty(e)},E=r.getOption=function(e,t,n){return v(e[t])?e[t]:n},S=r.hasValue=function(e,t){var n=!1;return Object.keys(e).forEach(function(r){e[r]===t&&(n=!0)}),n},x=r.sanitise=function(e){return typeof e=="string"?e.replace(/</g,"&lt;").replace(/>/g,"&gt;"):e},T=r.getPathBox=function(e){var t=e.getBoundingClientRect(),n=[e.pathSegList.getItem(0),e.pathSegList.getItem(1)],r=n[0].x,i=Math.min(n[0].y,n[1].y);return{x:r,y:i,width:t.width,height:t.height}};n.focus=function(e){var t=this.internal,n;e=t.mapToTargetIds(e),n=t.svg.selectAll(t.selectorTargets(e.filter(t.isTargetToShow,t))),this.revert(),this.defocus(),n.classed(l.focused,!0).classed(l.defocused,!1),t.hasArcType()&&t.expandArc(e),t.toggleFocusLegend(e,!0),t.focusedTargetIds=e,t.defocusedTargetIds=t.defocusedTargetIds.filter(function(t){return e.indexOf(t)<0})},n.defocus=function(e){var t=this.internal,n;e=t.mapToTargetIds(e),n=t.svg.selectAll(t.selectorTargets(e.filter(t.isTargetToShow,t))),n.classed(l.focused,!1).classed(l.defocused,!0),t.hasArcType()&&t.unexpandArc(e),t.toggleFocusLegend(e,!1),t.focusedTargetIds=t.focusedTargetIds.filter(function(t){return e.indexOf(t)<0}),t.defocusedTargetIds=e},n.revert=function(e){var t=this.internal,n;e=t.mapToTargetIds(e),n=t.svg.selectAll(t.selectorTargets(e)),n.classed(l.focused,!1).classed(l.defocused,!1),t.hasArcType()&&t.unexpandArc(e),t.config.legend_show&&(t.showLegend(e.filter(t.isLegendToShow.bind(t))),t.legend.selectAll(t.selectorLegends(e)).filter(function(){return t.d3.select(this).classed(l.legendItemFocused)}).classed(l.legendItemFocused,!1)),t.focusedTargetIds=[],t.defocusedTargetIds=[]},n.show=function(e,t){var n=this.internal,r;e=n.mapToTargetIds(e),t=t||{},n.removeHiddenTargetIds(e),r=n.svg.selectAll(n.selectorTargets(e)),r.transition().style("opacity",1,"important").call(n.endall,function(){r.style("opacity",null).style("opacity",1)}),t.withLegend&&n.showLegend(e),n.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},n.hide=function(e,t){var n=this.internal,r;e=n.mapToTargetIds(e),t=t||{},n.addHiddenTargetIds(e),r=n.svg.selectAll(n.selectorTargets(e)),r.transition().style("opacity",0,"important").call(n.endall,function(){r.style("opacity",null).style("opacity",0)}),t.withLegend&&n.hideLegend(e),n.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},n.toggle=function(e,t){var n=this,r=this.internal;r.mapToTargetIds(e).forEach(function(e){r.isTargetToShow(e)?n.hide(e,t):n.show(e,t)})},n.zoom=function(e){var t=this.internal;return e&&(t.isTimeSeries()&&(e=e.map(function(e){return t.parseDate(e)})),t.brush.extent(e),t.redraw({withUpdateXDomain:!0,withY:t.config.zoom_rescale}),t.config.zoom_onzoom.call(this,t.x.orgDomain())),t.brush.extent()},n.zoom.enable=function(e){var t=this.internal;t.config.zoom_enabled=e,t.updateAndRedraw()},n.unzoom=function(){var e=this.internal;e.brush.clear().update(),e.redraw({withUpdateXDomain:!0})},n.zoom.max=function(e){var t=this.internal,n=t.config,r=t.d3;if(e!==0&&!e)return n.zoom_x_max;n.zoom_x_max=r.max([t.orgXDomain[1],e])},n.zoom.min=function(e){var t=this.internal,n=t.config,r=t.d3;if(e!==0&&!e)return n.zoom_x_min;n.zoom_x_min=r.min([t.orgXDomain[0],e])},n.zoom.range=function(e){if(!arguments.length)return{max:this.domain.max(),min:this.domain.min()};v(e.max)&&this.domain.max(e.max),v(e.min)&&this.domain.min(e.min)},n.load=function(e){var t=this.internal,r=t.config;e.xs&&t.addXs(e.xs),"names"in e&&n.data.names.bind(this)(e.names),"classes"in e&&Object.keys(e.classes).forEach(function(t){r.data_classes[t]=e.classes[t]}),"categories"in e&&t.isCategorized()&&(r.axis_x_categories=e.categories),"axes"in e&&Object.keys(e.axes).forEach(function(t){r.data_axes[t]=e.axes[t]}),"colors"in e&&Object.keys(e.colors).forEach(function(t){r.data_colors[t]=e.colors[t]});if("cacheIds"in e&&t.hasCaches(e.cacheIds)){t.load(t.getCaches(e.cacheIds),e.done);return}"unload"in e?t.unload(t.mapToTargetIds(typeof e.unload=="boolean"&&e.unload?null:e.unload),function(){t.loadFromArgs(e)}):t.loadFromArgs(e)},n.unload=function(e){var t=this.internal;e=e||{},e instanceof Array?e={ids:e}:typeof e=="string"&&(e={ids:[e]}),t.unload(t.mapToTargetIds(e.ids),function(){t.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),e.done&&e.done()})},n.flow=function(e){var t=this.internal,n,r,i=[],s=t.getMaxDataCount(),o,u,a,f,l=0,h=0,p,d;if(e.json)r=t.convertJsonToData(e.json,e.keys);else if(e.rows)r=t.convertRowsToData(e.rows);else{if(!e.columns)return;r=t.convertColumnsToData(e.columns)}n=t.convertDataToTargets(r,!0),t.data.targets.forEach(function(e){var r=!1,s,o;for(s=0;s<n.length;s++)if(e.id===n[s].id){r=!0,e.values[e.values.length-1]&&(h=e.values[e.values.length-1].index+1),l=n[s].values.length;for(o=0;o<l;o++)n[s].values[o].index=h+o,t.isTimeSeries()||(n[s].values[o].x=h+o);e.values=e.values.concat(n[s].values),n.splice(s,1);break}r||i.push(e.id)}),t.data.targets.forEach(function(e){var n,r;for(n=0;n<i.length;n++)if(e.id===i[n]){h=e.values[e.values.length-1].index+1;for(r=0;r<l;r++)e.values.push({id:e.id,index:h+r,x:t.isTimeSeries()?t.getOtherTargetX(h+r):h+r,value:null})}}),t.data.targets.length&&n.forEach(function(e){var n,r=[];for(n=t.data.targets[0].values[0].index;n<h;n++)r.push({id:e.id,index:n,x:t.isTimeSeries()?t.getOtherTargetX(n):n,value:null});e.values.forEach(function(e){e.index+=h,t.isTimeSeries()||(e.x+=h)}),e.values=r.concat(e.values)}),t.data.targets=t.data.targets.concat(n),o=t.getMaxDataCount(),a=t.data.targets[0],f=a.values[0],v(e.to)?(l=0,d=t.isTimeSeries()?t.parseDate(e.to):e.to,a.values.forEach(function(e){e.x<d&&l++})):v(e.length)&&(l=e.length),s?s===1&&t.isTimeSeries()&&(p=(a.values[a.values.length-1].x-f.x)/2,u=[new Date(+f.x-p),new Date(+f.x+p)],t.updateXDomain(null,!0,!0,!1,u)):(t.isTimeSeries()?a.values.length>1?p=a.values[a.values.length-1].x-f.x:p=f.x-t.getXDomain(t.data.targets)[0]:p=1,u=[f.x-p,f.x],t.updateXDomain(null,!0,!0,!1,u)),t.updateTargets(t.data.targets),t.redraw({flow:{index:f.index,length:l,duration:c(e.duration)?e.duration:t.config.transition_duration,done:e.done,orgDataCount:s},withLegend:!0,withTransition:s>1,withTrimXDomain:!1,withUpdateXAxis:!0})},r.generateFlow=function(e){var t=this,n=t.config,r=t.d3;return function(){var i=e.targets,s=e.flow,o=e.drawBar,u=e.drawLine,a=e.drawArea,f=e.cx,c=e.cy,h=e.xv,p=e.xForText,d=e.yForText,v=e.duration,m,g=1,b,w=s.index,E=s.length,S=t.getValueOnIndex(t.data.targets[0].values,w),x=t.getValueOnIndex(t.data.targets[0].values,w+E),T=t.x.domain(),N,C=s.duration||v,k=s.done||function(){},L=t.generateWait(),A=t.xgrid||r.selectAll([]),O=t.xgridLines||r.selectAll([]),M=t.mainRegion||r.selectAll([]),_=t.mainText||r.selectAll([]),D=t.mainBar||r.selectAll([]),P=t.mainLine||r.selectAll([]),H=t.mainArea||r.selectAll([]),B=t.mainCircle||r.selectAll([]);t.flowing=!0,t.data.targets.forEach(function(e){e.values.splice(0,E)}),N=t.updateXDomain(i,!0,!0),t.updateXGrid&&t.updateXGrid(!0),s.orgDataCount?s.orgDataCount===1||(S&&S.x)===(x&&x.x)?m=t.x(T[0])-t.x(N[0]):t.isTimeSeries()?m=t.x(T[0])-t.x(N[0]):m=t.x(S.x)-t.x(x.x):t.data.targets[0].values.length!==1?m=t.x(T[0])-t.x(N[0]):t.isTimeSeries()?(S=t.getValueOnIndex(t.data.targets[0].values,0),x=t.getValueOnIndex(t.data.targets[0].values,t.data.targets[0].values.length-1),m=t.x(S.x)-t.x(x.x)):m=y(N)/2,g=y(T)/y(N),b="translate("+m+",0) scale("+g+",1)",t.hideXGridFocus(),r.transition().ease("linear").duration(C).each(function(){L.add(t.axes.x.transition().call(t.xAxis)),L.add(D.transition().attr("transform",b)),L.add(P.transition().attr("transform",b)),L.add(H.transition().attr("transform",b)),L.add(B.transition().attr("transform",b)),L.add(_.transition().attr("transform",b)),L.add(M.filter(t.isRegionOnX).transition().attr("transform",b)),L.add(A.transition().attr("transform",b)),L.add(O.transition().attr("transform",b))}).call(L,function(){var e,r=[],i=[],s=[];if(E){for(e=0;e<E;e++)r.push("."+l.shape+"-"+(w+e)),i.push("."+l.text+"-"+(w+e)),s.push("."+l.eventRect+"-"+(w+e));t.svg.selectAll("."+l.shapes).selectAll(r).remove(),t.svg.selectAll("."+l.texts).selectAll(i).remove(),t.svg.selectAll("."+l.eventRects).selectAll(s).remove(),t.svg.select("."+l.xgrid).remove()}A.attr("transform",null).attr(t.xgridAttr),O.attr("transform",null),O.select("line").attr("x1",n.axis_rotated?0:h).attr("x2",n.axis_rotated?t.width:h),O.select("text").attr("x",n.axis_rotated?t.width:0).attr("y",h),D.attr("transform",null).attr("d",o),P.attr("transform",null).attr("d",u),H.attr("transform",null).attr("d",a),B.attr("transform",null).attr("cx",f).attr("cy",c),_.attr("transform",null).attr("x",p).attr("y",d).style("fill-opacity",t.opacityForText.bind(t)),M.attr("transform",null),M.select("rect").filter(t.isRegionOnX).attr("x",t.regionX.bind(t)).attr("width",t.regionWidth.bind(t)),n.interaction_enabled&&t.redrawEventRect(),k(),t.flowing=!1})}},n.selected=function(e){var t=this.internal,n=t.d3;return n.merge(t.main.selectAll("."+l.shapes+t.getTargetSelectorSuffix(e)).selectAll("."+l.shape).filter(function(){return n.select(this).classed(l.SELECTED)}).map(function(e){return e.map(function(e){var t=e.__data__;return t.data?t.data:t})}))},n.select=function(e,t,n){var r=this.internal,i=r.d3,s=r.config;if(!s.data_selection_enabled)return;r.main.selectAll("."+l.shapes).selectAll("."+l.shape).each(function(o,u){var a=i.select(this),f=o.data?o.data.id:o.id,c=r.getToggle(this,o).bind(r),h=s.data_selection_grouped||!e||e.indexOf(f)>=0,p=!t||t.indexOf(u)>=0,d=a.classed(l.SELECTED);if(a.classed(l.line)||a.classed(l.area))return;h&&p?s.data_selection_isselectable(o)&&!d&&c(!0,a.classed(l.SELECTED,!0),o,u):v(n)&&n&&d&&c(!1,a.classed(l.SELECTED,!1),o,u)})},n.unselect=function(e,t){var n=this.internal,r=n.d3,i=n.config;if(!i.data_selection_enabled)return;n.main.selectAll("."+l.shapes).selectAll("."+l.shape).each(function(s,o){var u=r.select(this),a=s.data?s.data.id:s.id,f=n.getToggle(this,s).bind(n),c=i.data_selection_grouped||!e||e.indexOf(a)>=0,h=!t||t.indexOf(o)>=0,p=u.classed(l.SELECTED);if(u.classed(l.line)||u.classed(l.area))return;c&&h&&i.data_selection_isselectable(s)&&p&&f(!1,u.classed(l.SELECTED,!1),s,o)})},n.transform=function(e,t){var n=this.internal,r=["pie","donut"].indexOf(e)>=0?{withTransform:!0}:null;n.transformTo(t,e,r)},r.transformTo=function(e,t,n){var r=this,i=!r.hasArcType(),s=n||{withTransitionForAxis:i};s.withTransitionForTransform=!1,r.transiting=!1,r.setTargetType(e,t),r.updateTargets(r.data.targets),r.updateAndRedraw(s)},n.groups=function(e){var t=this.internal,n=t.config;return d(e)?n.data_groups:(n.data_groups=e,t.redraw(),n.data_groups)},n.xgrids=function(e){var t=this.internal,n=t.config;return e?(n.grid_x_lines=e,t.redrawWithoutRescale(),n.grid_x_lines):n.grid_x_lines},n.xgrids.add=function(e){var t=this.internal;return this.xgrids(t.config.grid_x_lines.concat(e?e:[]))},n.xgrids.remove=function(e){var t=this.internal;t.removeGridLines(e,!0)},n.ygrids=function(e){var t=this.internal,n=t.config;return e?(n.grid_y_lines=e,t.redrawWithoutRescale(),n.grid_y_lines):n.grid_y_lines},n.ygrids.add=function(e){var t=this.internal;return this.ygrids(t.config.grid_y_lines.concat(e?e:[]))},n.ygrids.remove=function(e){var t=this.internal;t.removeGridLines(e,!1)},n.regions=function(e){var t=this.internal,n=t.config;return e?(n.regions=e,t.redrawWithoutRescale(),n.regions):n.regions},n.regions.add=function(e){var t=this.internal,n=t.config;return e?(n.regions=n.regions.concat(e),t.redrawWithoutRescale(),n.regions):n.regions},n.regions.remove=function(e){var t=this.internal,n=t.config,r,i,s;return e=e||{},r=t.getOption(e,"duration",n.transition_duration),i=t.getOption(e,"classes",[l.region]),s=t.main.select("."+l.regions).selectAll(i.map(function(e){return"."+e})),(r?s.transition().duration(r):s).style("opacity",0).remove(),n.regions=n.regions.filter(function(e){var t=!1;return e["class"]?(e["class"].split(" ").forEach(function(e){i.indexOf(e)>=0&&(t=!0)}),!t):!0}),n.regions},n.data=function(e){var t=this.internal.data.targets;return typeof e=="undefined"?t:t.filter(function(t){return[].concat(e).indexOf(t.id)>=0})},n.data.shown=function(e){return this.internal.filterTargetsToShow(this.data(e))},n.data.values=function(e){var t,n=null;return e&&(t=this.data(e),n=t[0]?t[0].values.map(function(e){return e.value}):null),n},n.data.names=function(e){return this.internal.clearLegendItemTextBoxCache(),this.internal.updateDataAttributes("names",e)},n.data.colors=function(e){return this.internal.updateDataAttributes("colors",e)},n.data.axes=function(e){return this.internal.updateDataAttributes("axes",e)},n.category=function(e,t){var n=this.internal,r=n.config;return arguments.length>1&&(r.axis_x_categories[e]=t,n.redraw()),r.axis_x_categories[e]},n.categories=function(e){var t=this.internal,n=t.config;return arguments.length?(n.axis_x_categories=e,t.redraw(),n.axis_x_categories):n.axis_x_categories},n.color=function(e){var t=this.internal;return t.color(e)},n.x=function(e){var t=this.internal;return arguments.length&&(t.updateTargetX(t.data.targets,e),t.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),t.data.xs},n.xs=function(e){var t=this.internal;return arguments.length&&(t.updateTargetXs(t.data.targets,e),t.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),t.data.xs},n.axis=function(){},n.axis.labels=function(e){var t=this.internal;arguments.length&&(Object.keys(e).forEach(function(n){t.axis.setLabelText(n,e[n])}),t.axis.updateLabels())},n.axis.max=function(e){var t=this.internal,n=t.config;if(!arguments.length)return{x:n.axis_x_max,y:n.axis_y_max,y2:n.axis_y2_max};typeof e=="object"?(c(e.x)&&(n.axis_x_max=e.x),c(e.y)&&(n.axis_y_max=e.y),c(e.y2)&&(n.axis_y2_max=e.y2)):n.axis_y_max=n.axis_y2_max=e,t.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})},n.axis.min=function(e){var t=this.internal,n=t.config;if(!arguments.length)return{x:n.axis_x_min,y:n.axis_y_min,y2:n.axis_y2_min};typeof e=="object"?(c(e.x)&&(n.axis_x_min=e.x),c(e.y)&&(n.axis_y_min=e.y),c(e.y2)&&(n.axis_y2_min=e.y2)):n.axis_y_min=n.axis_y2_min=e,t.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})},n.axis.range=function(e){if(!arguments.length)return{max:this.axis.max(),min:this.axis.min()};v(e.max)&&this.axis.max(e.max),v(e.min)&&this.axis.min(e.min)},n.legend=function(){},n.legend.show=function(e){var t=this.internal;t.showLegend(t.mapToTargetIds(e)),t.updateAndRedraw({withLegend:!0})},n.legend.hide=function(e){var t=this.internal;t.hideLegend(t.mapToTargetIds(e)),t.updateAndRedraw({withLegend:!0})},n.resize=function(e){var t=this.internal,n=t.config;n.size_width=e?e.width:null,n.size_height=e?e.height:null,this.flush()},n.flush=function(){var e=this.internal;e.updateAndRedraw({withLegend:!0,withTransition:!1,withTransitionForTransform:!1})},n.destroy=function(){var t=this.internal;e.clearInterval(t.intervalForObserveInserted),t.resizeTimeout!==undefined&&e.clearTimeout(t.resizeTimeout);if(e.detachEvent)e.detachEvent("onresize",t.resizeFunction);else if(e.removeEventListener)e.removeEventListener("resize",t.resizeFunction);else{var n=e.onresize;n&&n.add&&n.remove&&n.remove(t.resizeFunction)}return t.selectChart.classed("c3",!1).html(""),Object.keys(t).forEach(function(e){t[e]=null}),null},n.tooltip=function(){},n.tooltip.show=function(e){var t=this.internal,n,r;e.mouse&&(r=e.mouse),e.data?t.isMultipleX()?(r=[t.x(e.data.x),t.getYScale(e.data.id)(e.data.value)],n=null):n=c(e.data.index)?e.data.index:t.getIndexByX(e.data.x):typeof e.x!="undefined"?n=t.getIndexByX(e.x):typeof e.index!="undefined"&&(n=e.index),t.dispatchEvent("mouseover",n,r),t.dispatchEvent("mousemove",n,r),t.config.tooltip_onshow.call(t,e.data)},n.tooltip.hide=function(){this.internal.dispatchEvent("mouseout",0),this.internal.config.tooltip_onhide.call(this)};var N;r.isSafari=function(){var t=e.navigator.userAgent;return t.indexOf("Safari")>=0&&t.indexOf("Chrome")<0},r.isChrome=function(){var t=e.navigator.userAgent;return t.indexOf("Chrome")>=0},Function.prototype.bind||(Function.prototype.bind=function(e){if(typeof this!="function")throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var t=Array.prototype.slice.call(arguments,1),n=this,r=function(){},i=function(){return n.apply(this instanceof r?this:e,t.concat(Array.prototype.slice.call(arguments)))};return r.prototype=this.prototype,i.prototype=new r,i}),function(){"SVGPathSeg"in e||(e.SVGPathSeg=function(e,t,n){this.pathSegType=e,this.pathSegTypeAsLetter=t,this._owningPathSegList=n},SVGPathSeg.PATHSEG_UNKNOWN=0,SVGPathSeg.PATHSEG_CLOSEPATH=1,SVGPathSeg.PATHSEG_MOVETO_ABS=2,SVGPathSeg.PATHSEG_MOVETO_REL=3,SVGPathSeg.PATHSEG_LINETO_ABS=4,SVGPathSeg.PATHSEG_LINETO_REL=5,SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS=6,SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL=7,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS=8,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL=9,SVGPathSeg.PATHSEG_ARC_ABS=10,SVGPathSeg.PATHSEG_ARC_REL=11,SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS=12,SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL=13,SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS=14,SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL=15,SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS=16,SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL=17,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS=18,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL=19,SVGPathSeg.prototype._segmentChanged=function(){this._owningPathSegList&&this._owningPathSegList.segmentChanged(this)},e.SVGPathSegClosePath=function(e){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CLOSEPATH,"z",e)},SVGPathSegClosePath.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegClosePath.prototype.toString=function(){return"[object SVGPathSegClosePath]"},SVGPathSegClosePath.prototype._asPathString=function(){return this.pathSegTypeAsLetter},SVGPathSegClosePath.prototype.clone=function(){return new SVGPathSegClosePath(undefined)},e.SVGPathSegMovetoAbs=function(e,t,n){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_MOVETO_ABS,"M",e),this._x=t,this._y=n},SVGPathSegMovetoAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegMovetoAbs.prototype.toString=function(){return"[object SVGPathSegMovetoAbs]"},SVGPathSegMovetoAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},SVGPathSegMovetoAbs.prototype.clone=function(){return new SVGPathSegMovetoAbs(undefined,this._x,this._y)},Object.defineProperty(SVGPathSegMovetoAbs.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegMovetoAbs.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}),e.SVGPathSegMovetoRel=function(e,t,n){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_MOVETO_REL,"m",e),this._x=t,this._y=n},SVGPathSegMovetoRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegMovetoRel.prototype.toString=function(){return"[object SVGPathSegMovetoRel]"},SVGPathSegMovetoRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},SVGPathSegMovetoRel.prototype.clone=function(){return new SVGPathSegMovetoRel(undefined,this._x,this._y)},Object.defineProperty(SVGPathSegMovetoRel.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegMovetoRel.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}),e.SVGPathSegLinetoAbs=function(e,t,n){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_ABS,"L",e),this._x=t,this._y=n},SVGPathSegLinetoAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegLinetoAbs.prototype.toString=function(){return"[object SVGPathSegLinetoAbs]"},SVGPathSegLinetoAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},SVGPathSegLinetoAbs.prototype.clone=function(){return new SVGPathSegLinetoAbs(undefined,this._x,this._y)},Object.defineProperty(SVGPathSegLinetoAbs.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegLinetoAbs.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}),e.SVGPathSegLinetoRel=function(e,t,n){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_REL,"l",e),this._x=t,this._y=n},SVGPathSegLinetoRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegLinetoRel.prototype.toString=function(){return"[object SVGPathSegLinetoRel]"},SVGPathSegLinetoRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},SVGPathSegLinetoRel.prototype.clone=function(){return new SVGPathSegLinetoRel(undefined,this._x,this._y)},Object.defineProperty(SVGPathSegLinetoRel.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegLinetoRel.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}),e.SVGPathSegCurvetoCubicAbs=function(e,t,n,r,i,s,o){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS,"C",e),this._x=t,this._y=n,this._x1=r,this._y1=i,this._x2=s,this._y2=o},SVGPathSegCurvetoCubicAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoCubicAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicAbs]"},SVGPathSegCurvetoCubicAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},SVGPathSegCurvetoCubicAbs.prototype.clone=function(){return new SVGPathSegCurvetoCubicAbs(undefined,this._x,this._y,this._x1,this._y1,this._x2,this._y2)},Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype,"x1",{get:function(){return this._x1},set:function(e){this._x1=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype,"y1",{get:function(){return this._y1},set:function(e){this._y1=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype,"x2",{get:function(){return this._x2},set:function(e){this._x2=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype,"y2",{get:function(){return this._y2},set:function(e){this._y2=e,this._segmentChanged()},enumerable:!0}),e.SVGPathSegCurvetoCubicRel=function(e,t,n,r,i,s,o){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL,"c",e),this._x=t,this._y=n,this._x1=r,this._y1=i,this._x2=s,this._y2=o},SVGPathSegCurvetoCubicRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoCubicRel.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicRel]"},SVGPathSegCurvetoCubicRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},SVGPathSegCurvetoCubicRel.prototype.clone=function(){return new SVGPathSegCurvetoCubicRel(undefined,this._x,this._y,this._x1,this._y1,this._x2,this._y2)},Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"x1",{get:function(){return this._x1},set:function(e){this._x1=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"y1",{get:function(){return this._y1},set:function(e){this._y1=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"x2",{get:function(){return this._x2},set:function(e){this._x2=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"y2",{get:function(){return this._y2},set:function(e){this._y2=e,this._segmentChanged()},enumerable:!0}),e.SVGPathSegCurvetoQuadraticAbs=function(e,t,n,r,i){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS,"Q",e),this._x=t,this._y=n,this._x1=r,this._y1=i},SVGPathSegCurvetoQuadraticAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoQuadraticAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticAbs]"},SVGPathSegCurvetoQuadraticAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x+" "+this._y},SVGPathSegCurvetoQuadraticAbs.prototype.clone=function(){return new SVGPathSegCurvetoQuadraticAbs(undefined,this._x,this._y,this._x1,this._y1)},Object.defineProperty(SVGPathSegCurvetoQuadraticAbs.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticAbs.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticAbs.prototype,"x1",{get:function(){return this._x1},set:function(e){this._x1=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticAbs.prototype,"y1",{get:function(){return this._y1},set:function(e){this._y1=e,this._segmentChanged()},enumerable:!0}),e.SVGPathSegCurvetoQuadraticRel=function(e,t,n,r,i){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL,"q",e),this._x=t,this._y=n,this._x1=r,this._y1=i},SVGPathSegCurvetoQuadraticRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoQuadraticRel.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticRel]"},SVGPathSegCurvetoQuadraticRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x+" "+this._y},SVGPathSegCurvetoQuadraticRel.prototype.clone=function(){return new SVGPathSegCurvetoQuadraticRel(undefined,this._x,this._y,this._x1,this._y1)},Object.defineProperty(SVGPathSegCurvetoQuadraticRel.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticRel.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticRel.prototype,"x1",{get:function(){return this._x1},set:function(e){this._x1=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticRel.prototype,"y1",{get:function(){return this._y1},set:function(e){this._y1=e,this._segmentChanged()},enumerable:!0}),e.SVGPathSegArcAbs=function(e,t,n,r,i,s,o,u){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_ARC_ABS,"A",e),this._x=t,this._y=n,this._r1=r,this._r2=i,this._angle=s,this._largeArcFlag=o,this._sweepFlag=u},SVGPathSegArcAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegArcAbs.prototype.toString=function(){return"[object SVGPathSegArcAbs]"},SVGPathSegArcAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._r1+" "+this._r2+" "+this._angle+" "+(this._largeArcFlag?"1":"0")+" "+(this._sweepFlag?"1":"0")+" "+this._x+" "+this._y},SVGPathSegArcAbs.prototype.clone=function(){return new SVGPathSegArcAbs(undefined,this._x,this._y,this._r1,this._r2,this._angle,this._largeArcFlag,this._sweepFlag)},Object.defineProperty(SVGPathSegArcAbs.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcAbs.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcAbs.prototype,"r1",{get:function(){return this._r1},set:function(e){this._r1=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcAbs.prototype,"r2",{get:function(){return this._r2},set:function(e){this._r2=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcAbs.prototype,"angle",{get:function(){return this._angle},set:function(e){this._angle=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcAbs.prototype,"largeArcFlag",{get:function(){return this._largeArcFlag},set:function(e){this._largeArcFlag=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcAbs.prototype,"sweepFlag",{get:function(){return this._sweepFlag},set:function(e){this._sweepFlag=e,this._segmentChanged()},enumerable:!0}),e.SVGPathSegArcRel=function(e,t,n,r,i,s,o,u){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_ARC_REL,"a",e),this._x=t,this._y=n,this._r1=r,this._r2=i,this._angle=s,this._largeArcFlag=o,this._sweepFlag=u},SVGPathSegArcRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegArcRel.prototype.toString=function(){return"[object SVGPathSegArcRel]"},SVGPathSegArcRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._r1+" "+this._r2+" "+this._angle+" "+(this._largeArcFlag?"1":"0")+" "+(this._sweepFlag?"1":"0")+" "+this._x+" "+this._y},SVGPathSegArcRel.prototype.clone=function(){return new SVGPathSegArcRel(undefined,this._x,this._y,this._r1,this._r2,this._angle,this._largeArcFlag,this._sweepFlag)},Object.defineProperty(SVGPathSegArcRel.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcRel.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcRel.prototype,"r1",{get:function(){return this._r1},set:function(e){this._r1=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcRel.prototype,"r2",{get:function(){return this._r2},set:function(e){this._r2=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcRel.prototype,"angle",{get:function(){return this._angle},set:function(e){this._angle=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcRel.prototype,"largeArcFlag",{get:function(){return this._largeArcFlag},set:function(e){this._largeArcFlag=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcRel.prototype,"sweepFlag",{get:function(){return this._sweepFlag},set:function(e){this._sweepFlag=e,this._segmentChanged()},enumerable:!0}),e.SVGPathSegLinetoHorizontalAbs=function(e,t){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS,"H",e),this._x=t},SVGPathSegLinetoHorizontalAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegLinetoHorizontalAbs.prototype.toString=function(){return"[object SVGPathSegLinetoHorizontalAbs]"},SVGPathSegLinetoHorizontalAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x},SVGPathSegLinetoHorizontalAbs.prototype.clone=function(){return new SVGPathSegLinetoHorizontalAbs(undefined,this._x)},Object.defineProperty(SVGPathSegLinetoHorizontalAbs.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0}),e.SVGPathSegLinetoHorizontalRel=function(e,t){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL,"h",e),this._x=t},SVGPathSegLinetoHorizontalRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegLinetoHorizontalRel.prototype.toString=function(){return"[object SVGPathSegLinetoHorizontalRel]"},SVGPathSegLinetoHorizontalRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x},SVGPathSegLinetoHorizontalRel.prototype.clone=function(){return new SVGPathSegLinetoHorizontalRel(undefined,this._x)},Object.defineProperty(SVGPathSegLinetoHorizontalRel.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0}),e.SVGPathSegLinetoVerticalAbs=function(e,t){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS,"V",e),this._y=t},SVGPathSegLinetoVerticalAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegLinetoVerticalAbs.prototype.toString=function(){return"[object SVGPathSegLinetoVerticalAbs]"},SVGPathSegLinetoVerticalAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._y},SVGPathSegLinetoVerticalAbs.prototype.clone=function(){return new SVGPathSegLinetoVerticalAbs(undefined,this._y)},Object.defineProperty(SVGPathSegLinetoVerticalAbs.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}),e.SVGPathSegLinetoVerticalRel=function(e,t){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL,"v",e),this._y=t},SVGPathSegLinetoVerticalRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegLinetoVerticalRel.prototype.toString=function(){return"[object SVGPathSegLinetoVerticalRel]"},SVGPathSegLinetoVerticalRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._y},SVGPathSegLinetoVerticalRel.prototype.clone=function(){return new SVGPathSegLinetoVerticalRel(undefined,this._y)},Object.defineProperty(SVGPathSegLinetoVerticalRel.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}),e.SVGPathSegCurvetoCubicSmoothAbs=function(e,t,n,r,i){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS,"S",e),this._x=t,this._y=n,this._x2=r,this._y2=i},SVGPathSegCurvetoCubicSmoothAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoCubicSmoothAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicSmoothAbs]"},SVGPathSegCurvetoCubicSmoothAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},SVGPathSegCurvetoCubicSmoothAbs.prototype.clone=function(){return new SVGPathSegCurvetoCubicSmoothAbs(undefined,this._x,this._y,this._x2,this._y2)},Object.defineProperty(SVGPathSegCurvetoCubicSmoothAbs.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicSmoothAbs.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicSmoothAbs.prototype,"x2",{get:function(){return this._x2},set:function(e){this._x2=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicSmoothAbs.prototype,"y2",{get:function(){return this._y2},set:function(e){this._y2=e,this._segmentChanged()},enumerable:!0}),e.SVGPathSegCurvetoCubicSmoothRel=function(e,t,n,r,i){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL,"s",e),this._x=t,this._y=n,this._x2=r,this._y2=i},SVGPathSegCurvetoCubicSmoothRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoCubicSmoothRel.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicSmoothRel]"},SVGPathSegCurvetoCubicSmoothRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},SVGPathSegCurvetoCubicSmoothRel.prototype.clone=function(){return new SVGPathSegCurvetoCubicSmoothRel(undefined,this._x,this._y,this._x2,this._y2)},Object.defineProperty(SVGPathSegCurvetoCubicSmoothRel.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicSmoothRel.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicSmoothRel.prototype,"x2",{get:function(){return this._x2},set:function(e){this._x2=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicSmoothRel.prototype,"y2",{get:function(){return this._y2},set:function(e){this._y2=e,this._segmentChanged()},enumerable:!0}),e.SVGPathSegCurvetoQuadraticSmoothAbs=function(e,t,n){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS,"T",e),this._x=t,this._y=n},SVGPathSegCurvetoQuadraticSmoothAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoQuadraticSmoothAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticSmoothAbs]"},SVGPathSegCurvetoQuadraticSmoothAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},SVGPathSegCurvetoQuadraticSmoothAbs.prototype.clone=function(){return new SVGPathSegCurvetoQuadraticSmoothAbs(undefined,this._x,this._y)},Object.defineProperty(SVGPathSegCurvetoQuadraticSmoothAbs.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticSmoothAbs.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}),e.SVGPathSegCurvetoQuadraticSmoothRel=function(e,t,n){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL,"t",e),this._x=t,this._y=n},SVGPathSegCurvetoQuadraticSmoothRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoQuadraticSmoothRel.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticSmoothRel]"},SVGPathSegCurvetoQuadraticSmoothRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},SVGPathSegCurvetoQuadraticSmoothRel.prototype.clone=function(){return new SVGPathSegCurvetoQuadraticSmoothRel(undefined,this._x,this._y)},Object.defineProperty(SVGPathSegCurvetoQuadraticSmoothRel.prototype,"x",{get:function(){return this._x},set:function(e){this._x=e,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticSmoothRel.prototype,"y",{get:function(){return this._y},set:function(e){this._y=e,this._segmentChanged()},enumerable:!0}),SVGPathElement.prototype.createSVGPathSegClosePath=function(){return new SVGPathSegClosePath(undefined)},SVGPathElement.prototype.createSVGPathSegMovetoAbs=function(e,t){return new SVGPathSegMovetoAbs(undefined,e,t)},SVGPathElement.prototype.createSVGPathSegMovetoRel=function(e,t){return new SVGPathSegMovetoRel(undefined,e,t)},SVGPathElement.prototype.createSVGPathSegLinetoAbs=function(e,t){return new SVGPathSegLinetoAbs(undefined,e,t)},SVGPathElement.prototype.createSVGPathSegLinetoRel=function(e,t){return new SVGPathSegLinetoRel(undefined,e,t)},SVGPathElement.prototype.createSVGPathSegCurvetoCubicAbs=function(e,t,n,r,i,s){return new SVGPathSegCurvetoCubicAbs(undefined,e,t,n,r,i,s)},SVGPathElement.prototype.createSVGPathSegCurvetoCubicRel=function(e,t,n,r,i,s){return new SVGPathSegCurvetoCubicRel(undefined,e,t,n,r,i,s)},SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticAbs=function(e,t,n,r){return new SVGPathSegCurvetoQuadraticAbs(undefined,e,t,n,r)},SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticRel=function(e,t,n,r){return new SVGPathSegCurvetoQuadraticRel(undefined,e,t,n,r)},SVGPathElement.prototype.createSVGPathSegArcAbs=function(e,t,n,r,i,s,o){return new SVGPathSegArcAbs(undefined,e,t,n,r,i,s,o)},SVGPathElement.prototype.createSVGPathSegArcRel=function(e,t,n,r,i,s,o){return new SVGPathSegArcRel(undefined,e,t,n,r,i,s,o)},SVGPathElement.prototype.createSVGPathSegLinetoHorizontalAbs=function(e){return new SVGPathSegLinetoHorizontalAbs(undefined,e)},SVGPathElement.prototype.createSVGPathSegLinetoHorizontalRel=function(e){return new SVGPathSegLinetoHorizontalRel(undefined,e)},SVGPathElement.prototype.createSVGPathSegLinetoVerticalAbs=function(e){return new SVGPathSegLinetoVerticalAbs(undefined,e)},SVGPathElement.prototype.createSVGPathSegLinetoVerticalRel=function(e){return new SVGPathSegLinetoVerticalRel(undefined,e)},SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothAbs=function(e,t,n,r){return new SVGPathSegCurvetoCubicSmoothAbs(undefined,e,t,n,r)},SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothRel=function(e,t,n,r){return new SVGPathSegCurvetoCubicSmoothRel(undefined,e,t,n,r)},SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothAbs=function(e,t){return new SVGPathSegCurvetoQuadraticSmoothAbs(undefined,e,t)},SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothRel=function(e,t){return new SVGPathSegCurvetoQuadraticSmoothRel(undefined,e,t)}),"SVGPathSegList"in e||(e.SVGPathSegList=function(e){this._pathElement=e,this._list=this._parsePath(this._pathElement.getAttribute("d")),this._mutationObserverConfig={attributes:!0,attributeFilter:["d"]},this._pathElementMutationObserver=new MutationObserver(this._updateListFromPathMutations.bind(this)),this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)},Object.defineProperty(SVGPathSegList.prototype,"numberOfItems",{get:function(){return this._checkPathSynchronizedToList(),this._list.length},enumerable:!0}),Object.defineProperty(SVGPathElement.prototype,"pathSegList",{get:function(){return this._pathSegList||(this._pathSegList=new SVGPathSegList(this)),this._pathSegList},enumerable:!0}),Object.defineProperty(SVGPathElement.prototype,"normalizedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),Object.defineProperty(SVGPathElement.prototype,"animatedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),Object.defineProperty(SVGPathElement.prototype,"animatedNormalizedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),SVGPathSegList.prototype._checkPathSynchronizedToList=function(){this._updateListFromPathMutations(this._pathElementMutationObserver.takeRecords())},SVGPathSegList.prototype._updateListFromPathMutations=function(e){if(!this._pathElement)return;var t=!1;e.forEach(function(e){e.attributeName=="d"&&(t=!0)}),t&&(this._list=this._parsePath(this._pathElement.getAttribute("d")))},SVGPathSegList.prototype._writeListToPath=function(){this._pathElementMutationObserver.disconnect(),this._pathElement.setAttribute("d",SVGPathSegList._pathSegArrayAsString(this._list)),this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)},SVGPathSegList.prototype.segmentChanged=function(e){this._writeListToPath()},SVGPathSegList.prototype.clear=function(){this._checkPathSynchronizedToList(),this._list.forEach(function(e){e._owningPathSegList=null}),this._list=[],this._writeListToPath()},SVGPathSegList.prototype.initialize=function(e){return this._checkPathSynchronizedToList(),this._list=[e],e._owningPathSegList=this,this._writeListToPath(),e},SVGPathSegList.prototype._checkValidIndex=function(e){if(isNaN(e)||e<0||e>=this.numberOfItems)throw"INDEX_SIZE_ERR"},SVGPathSegList.prototype.getItem=function(e){return this._checkPathSynchronizedToList(),this._checkValidIndex(e),this._list[e]},SVGPathSegList.prototype.insertItemBefore=function(e,t){return this._checkPathSynchronizedToList(),t>this.numberOfItems&&(t=this.numberOfItems),e._owningPathSegList&&(e=e.clone()),this._list.splice(t,0,e),e._owningPathSegList=this,this._writeListToPath(),e},SVGPathSegList.prototype.replaceItem=function(e,t){return this._checkPathSynchronizedToList(),e._owningPathSegList&&(e=e.clone()),this._checkValidIndex(t),this._list[t]=e,e._owningPathSegList=this,this._writeListToPath(),e},SVGPathSegList.prototype.removeItem=function(e){this._checkPathSynchronizedToList(),this._checkValidIndex(e);var t=this._list[e];return this._list.splice(e,1),this._writeListToPath(),t},SVGPathSegList.prototype.appendItem=function(e){return this._checkPathSynchronizedToList(),e._owningPathSegList&&(e=e.clone()),this._list.push(e),e._owningPathSegList=this,this._writeListToPath(),e},SVGPathSegList._pathSegArrayAsString=function(e){var t="",n=!0;return e.forEach(function(e){n?(n=!1,t+=e._asPathString()):t+=" "+e._asPathString()}),t},SVGPathSegList.prototype._parsePath=function(e){if(!e||e.length==0)return[];var t=this,n=function(){this.pathSegList=[]};n.prototype.appendSegment=function(e){this.pathSegList.push(e)};var r=function(e){this._string=e,this._currentIndex=0,this._endIndex=this._string.length,this._previousCommand=SVGPathSeg.PATHSEG_UNKNOWN,this._skipOptionalSpaces()};r.prototype._isCurrentSpace=function(){var e=this._string[this._currentIndex];return e<=" "&&(e==" "||e=="\n"||e=="	"||e=="\r"||e=="\f")},r.prototype._skipOptionalSpaces=function(){while(this._currentIndex<this._endIndex&&this._isCurrentSpace())this._currentIndex++;return this._currentIndex<this._endIndex},r.prototype._skipOptionalSpacesOrDelimiter=function(){return this._currentIndex<this._endIndex&&!this._isCurrentSpace()&&this._string.charAt(this._currentIndex)!=","?!1:(this._skipOptionalSpaces()&&this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)==","&&(this._currentIndex++,this._skipOptionalSpaces()),this._currentIndex<this._endIndex)},r.prototype.hasMoreData=function(){return this._currentIndex<this._endIndex},r.prototype.peekSegmentType=function(){var e=this._string[this._currentIndex];return this._pathSegTypeFromChar(e)},r.prototype._pathSegTypeFromChar=function(e){switch(e){case"Z":case"z":return SVGPathSeg.PATHSEG_CLOSEPATH;case"M":return SVGPathSeg.PATHSEG_MOVETO_ABS;case"m":return SVGPathSeg.PATHSEG_MOVETO_REL;case"L":return SVGPathSeg.PATHSEG_LINETO_ABS;case"l":return SVGPathSeg.PATHSEG_LINETO_REL;case"C":return SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS;case"c":return SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL;case"Q":return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS;case"q":return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL;case"A":return SVGPathSeg.PATHSEG_ARC_ABS;case"a":return SVGPathSeg.PATHSEG_ARC_REL;case"H":return SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS;case"h":return SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL;case"V":return SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS;case"v":return SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL;case"S":return SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS;case"s":return SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL;case"T":return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS;case"t":return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL;default:return SVGPathSeg.PATHSEG_UNKNOWN}},r.prototype._nextCommandHelper=function(e,t){return(e=="+"||e=="-"||e=="."||e>="0"&&e<="9")&&t!=SVGPathSeg.PATHSEG_CLOSEPATH?t==SVGPathSeg.PATHSEG_MOVETO_ABS?SVGPathSeg.PATHSEG_LINETO_ABS:t==SVGPathSeg.PATHSEG_MOVETO_REL?SVGPathSeg.PATHSEG_LINETO_REL:t:SVGPathSeg.PATHSEG_UNKNOWN},r.prototype.initialCommandIsMoveTo=function(){if(!this.hasMoreData())return!0;var e=this.peekSegmentType();return e==SVGPathSeg.PATHSEG_MOVETO_ABS||e==SVGPathSeg.PATHSEG_MOVETO_REL},r.prototype._parseNumber=function(){var e=0,t=0,n=1,r=0,i=1,s=1,o=this._currentIndex;this._skipOptionalSpaces(),this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)=="+"?this._currentIndex++:this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)=="-"&&(this._currentIndex++,i=-1);if(this._currentIndex==this._endIndex||(this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")&&this._string.charAt(this._currentIndex)!=".")return undefined;var u=this._currentIndex;while(this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)>="0"&&this._string.charAt(this._currentIndex)<="9")this._currentIndex++;if(this._currentIndex!=u){var a=this._currentIndex-1,f=1;while(a>=u)t+=f*(this._string.charAt(a--)-"0"),f*=10}if(this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)=="."){this._currentIndex++;if(this._currentIndex>=this._endIndex||this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")return undefined;while(this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)>="0"&&this._string.charAt(this._currentIndex)<="9")r+=(this._string.charAt(this._currentIndex++)-"0")*(n*=.1)}if(this._currentIndex!=o&&this._currentIndex+1<this._endIndex&&(this._string.charAt(this._currentIndex)=="e"||this._string.charAt(this._currentIndex)=="E")&&this._string.charAt(this._currentIndex+1)!="x"&&this._string.charAt(this._currentIndex+1)!="m"){this._currentIndex++,this._string.charAt(this._currentIndex)=="+"?this._currentIndex++:this._string.charAt(this._currentIndex)=="-"&&(this._currentIndex++,s=-1);if(this._currentIndex>=this._endIndex||this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")return undefined;while(this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)>="0"&&this._string.charAt(this._currentIndex)<="9")e*=10,e+=this._string.charAt(this._currentIndex)-"0",this._currentIndex++}var l=t+r;return l*=i,e&&(l*=Math.pow(10,s*e)),o==this._currentIndex?undefined:(this._skipOptionalSpacesOrDelimiter(),l)},r.prototype._parseArcFlag=function(){if(this._currentIndex>=this._endIndex)return undefined;var e=!1,t=this._string.charAt(this._currentIndex++);if(t=="0")e=!1;else{if(t!="1")return undefined;e=!0}return this._skipOptionalSpacesOrDelimiter(),e},r.prototype.parseSegment=function(){var e=this._string[this._currentIndex],n=this._pathSegTypeFromChar(e);if(n==SVGPathSeg.PATHSEG_UNKNOWN){if(this._previousCommand==SVGPathSeg.PATHSEG_UNKNOWN)return null;n=this._nextCommandHelper(e,this._previousCommand);if(n==SVGPathSeg.PATHSEG_UNKNOWN)return null}else this._currentIndex++;this._previousCommand=n;switch(n){case SVGPathSeg.PATHSEG_MOVETO_REL:return new SVGPathSegMovetoRel(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_MOVETO_ABS:return new SVGPathSegMovetoAbs(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_REL:return new SVGPathSegLinetoRel(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_ABS:return new SVGPathSegLinetoAbs(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL:return new SVGPathSegLinetoHorizontalRel(t,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS:return new SVGPathSegLinetoHorizontalAbs(t,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL:return new SVGPathSegLinetoVerticalRel(t,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS:return new SVGPathSegLinetoVerticalAbs(t,this._parseNumber());case SVGPathSeg.PATHSEG_CLOSEPATH:return this._skipOptionalSpaces(),new SVGPathSegClosePath(t);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL:var r={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicRel(t,r.x,r.y,r.x1,r.y1,r.x2,r.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS:var r={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicAbs(t,r.x,r.y,r.x1,r.y1,r.x2,r.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL:var r={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicSmoothRel(t,r.x,r.y,r.x2,r.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:var r={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicSmoothAbs(t,r.x,r.y,r.x2,r.y2);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL:var r={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoQuadraticRel(t,r.x,r.y,r.x1,r.y1);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS:var r={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoQuadraticAbs(t,r.x,r.y,r.x1,r.y1);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:return new SVGPathSegCurvetoQuadraticSmoothRel(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:return new SVGPathSegCurvetoQuadraticSmoothAbs(t,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_ARC_REL:var r={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegArcRel(t,r.x,r.y,r.x1,r.y1,r.arcAngle,r.arcLarge,r.arcSweep);case SVGPathSeg.PATHSEG_ARC_ABS:var r={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegArcAbs(t,r.x,r.y,r.x1,r.y1,r.arcAngle,r.arcLarge,r.arcSweep);default:throw"Unknown path seg type."}};var i=new n,s=new r(e);if(!s.initialCommandIsMoveTo())return[];while(s.hasMoreData()){var o=s.parseSegment();if(!o)return[];i.appendSegment(o)}return i.pathSegList})}(),typeof define=="function"&&define.amd?define("c3",["d3"],function(){return t}):"undefined"!=typeof exports&&"undefined"!=typeof module?module.exports=t:e.c3=t}(window),!function t(e,n,r){function i(o,u){if(!n[o]){if(!e[o]){var a="function"==typeof require&&require;if(!u&&a)return a(o,!0);if(s)return s(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};e[o][0].call(l.exports,function(t){var n=e[o][1][t];return i(n?n:t)},l,l.exports,t,e,n,r)}return n[o].exports}for(var s="function"==typeof require&&require,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(e,t,n){var r=e("./svg-pan-zoom.js");!function(e,n){"function"==typeof define&&define.amd?define("svg-pan-zoom",[],function(){return r}):"undefined"!=typeof t&&t.exports&&(t.exports=r,e.svgPanZoom=r)}(window,document)},{"./svg-pan-zoom.js":4}],2:[function(e,t,n){var r=e("./svg-utilities");t.exports={enable:function(e){var t=e.svg.querySelector("defs");t||(t=document.createElementNS(r.svgNS,"defs"),e.svg.appendChild(t));var n=t.querySelector("style#svg-pan-zoom-controls-styles");if(!n){var i=document.createElementNS(r.svgNS,"style");i.setAttribute("id","svg-pan-zoom-controls-styles"),i.setAttribute("type","text/css"),i.textContent=".svg-pan-zoom-control { cursor: pointer; fill: black; fill-opacity: 0.333; } .svg-pan-zoom-control:hover { fill-opacity: 0.8; } .svg-pan-zoom-control-background { fill: white; fill-opacity: 0.5; } .svg-pan-zoom-control-background { fill-opacity: 0.8; }",t.appendChild(i)}var s=document.createElementNS(r.svgNS,"g");s.setAttribute("id","svg-pan-zoom-controls"),s.setAttribute("transform","translate("+(e.width-70)+" "+(e.height-76)+") scale(0.75)"),s.setAttribute("class","svg-pan-zoom-control"),s.appendChild(this._createZoomIn(e)),s.appendChild(this._createZoomReset(e)),s.appendChild(this._createZoomOut(e)),e.svg.appendChild(s),e.controlIcons=s},_createZoomIn:function(e){var t=document.createElementNS(r.svgNS,"g");t.setAttribute("id","svg-pan-zoom-zoom-in"),t.setAttribute("transform","translate(30.5 5) scale(0.015)"),t.setAttribute("class","svg-pan-zoom-control"),t.addEventListener("click",function(){e.getPublicInstance().zoomIn()},!1),t.addEventListener("touchstart",function(){e.getPublicInstance().zoomIn()},!1);var n=document.createElementNS(r.svgNS,"rect");n.setAttribute("x","0"),n.setAttribute("y","0"),n.setAttribute("width","1500"),n.setAttribute("height","1400"),n.setAttribute("class","svg-pan-zoom-control-background"),t.appendChild(n);var i=document.createElementNS(r.svgNS,"path");return i.setAttribute("d","M1280 576v128q0 26 -19 45t-45 19h-320v320q0 26 -19 45t-45 19h-128q-26 0 -45 -19t-19 -45v-320h-320q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h320v-320q0 -26 19 -45t45 -19h128q26 0 45 19t19 45v320h320q26 0 45 19t19 45zM1536 1120v-960 q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5t84.5 -203.5z"),i.setAttribute("class","svg-pan-zoom-control-element"),t.appendChild(i),t},_createZoomReset:function(e){var t=document.createElementNS(r.svgNS,"g");t.setAttribute("id","svg-pan-zoom-reset-pan-zoom"),t.setAttribute("transform","translate(5 35) scale(0.4)"),t.setAttribute("class","svg-pan-zoom-control"),t.addEventListener("click",function(){e.getPublicInstance().reset()},!1),t.addEventListener("touchstart",function(){e.getPublicInstance().reset()},!1);var n=document.createElementNS(r.svgNS,"rect");n.setAttribute("x","2"),n.setAttribute("y","2"),n.setAttribute("width","182"),n.setAttribute("height","58"),n.setAttribute("class","svg-pan-zoom-control-background"),t.appendChild(n);var i=document.createElementNS(r.svgNS,"path");i.setAttribute("d","M33.051,20.632c-0.742-0.406-1.854-0.609-3.338-0.609h-7.969v9.281h7.769c1.543,0,2.701-0.188,3.473-0.562c1.365-0.656,2.048-1.953,2.048-3.891C35.032,22.757,34.372,21.351,33.051,20.632z"),i.setAttribute("class","svg-pan-zoom-control-element"),t.appendChild(i);var s=document.createElementNS(r.svgNS,"path");return s.setAttribute("d","M170.231,0.5H15.847C7.102,0.5,0.5,5.708,0.5,11.84v38.861C0.5,56.833,7.102,61.5,15.847,61.5h154.384c8.745,0,15.269-4.667,15.269-10.798V11.84C185.5,5.708,178.976,0.5,170.231,0.5z M42.837,48.569h-7.969c-0.219-0.766-0.375-1.383-0.469-1.852c-0.188-0.969-0.289-1.961-0.305-2.977l-0.047-3.211c-0.03-2.203-0.41-3.672-1.142-4.406c-0.732-0.734-2.103-1.102-4.113-1.102h-7.05v13.547h-7.055V14.022h16.524c2.361,0.047,4.178,0.344,5.45,0.891c1.272,0.547,2.351,1.352,3.234,2.414c0.731,0.875,1.31,1.844,1.737,2.906s0.64,2.273,0.64,3.633c0,1.641-0.414,3.254-1.242,4.84s-2.195,2.707-4.102,3.363c1.594,0.641,2.723,1.551,3.387,2.73s0.996,2.98,0.996,5.402v2.32c0,1.578,0.063,2.648,0.19,3.211c0.19,0.891,0.635,1.547,1.333,1.969V48.569z M75.579,48.569h-26.18V14.022h25.336v6.117H56.454v7.336h16.781v6H56.454v8.883h19.125V48.569z M104.497,46.331c-2.44,2.086-5.887,3.129-10.34,3.129c-4.548,0-8.125-1.027-10.731-3.082s-3.909-4.879-3.909-8.473h6.891c0.224,1.578,0.662,2.758,1.316,3.539c1.196,1.422,3.246,2.133,6.15,2.133c1.739,0,3.151-0.188,4.236-0.562c2.058-0.719,3.087-2.055,3.087-4.008c0-1.141-0.504-2.023-1.512-2.648c-1.008-0.609-2.607-1.148-4.796-1.617l-3.74-0.82c-3.676-0.812-6.201-1.695-7.576-2.648c-2.328-1.594-3.492-4.086-3.492-7.477c0-3.094,1.139-5.664,3.417-7.711s5.623-3.07,10.036-3.07c3.685,0,6.829,0.965,9.431,2.895c2.602,1.93,3.966,4.73,4.093,8.402h-6.938c-0.128-2.078-1.057-3.555-2.787-4.43c-1.154-0.578-2.587-0.867-4.301-0.867c-1.907,0-3.428,0.375-4.565,1.125c-1.138,0.75-1.706,1.797-1.706,3.141c0,1.234,0.561,2.156,1.682,2.766c0.721,0.406,2.25,0.883,4.589,1.43l6.063,1.43c2.657,0.625,4.648,1.461,5.975,2.508c2.059,1.625,3.089,3.977,3.089,7.055C108.157,41.624,106.937,44.245,104.497,46.331z M139.61,48.569h-26.18V14.022h25.336v6.117h-18.281v7.336h16.781v6h-16.781v8.883h19.125V48.569z M170.337,20.14h-10.336v28.43h-7.266V20.14h-10.383v-6.117h27.984V20.14z"),s.setAttribute("class","svg-pan-zoom-control-element"),t.appendChild(s),t},_createZoomOut:function(e){var t=document.createElementNS(r.svgNS,"g");t.setAttribute("id","svg-pan-zoom-zoom-out"),t.setAttribute("transform","translate(30.5 70) scale(0.015)"),t.setAttribute("class","svg-pan-zoom-control"),t.addEventListener("click",function(){e.getPublicInstance().zoomOut()},!1),t.addEventListener("touchstart",function(){e.getPublicInstance().zoomOut()},!1);var n=document.createElementNS(r.svgNS,"rect");n.setAttribute("x","0"),n.setAttribute("y","0"),n.setAttribute("width","1500"),n.setAttribute("height","1400"),n.setAttribute("class","svg-pan-zoom-control-background"),t.appendChild(n);var i=document.createElementNS(r.svgNS,"path");return i.setAttribute("d","M1280 576v128q0 26 -19 45t-45 19h-896q-26 0 -45 -19t-19 -45v-128q0 -26 19 -45t45 -19h896q26 0 45 19t19 45zM1536 1120v-960q0 -119 -84.5 -203.5t-203.5 -84.5h-960q-119 0 -203.5 84.5t-84.5 203.5v960q0 119 84.5 203.5t203.5 84.5h960q119 0 203.5 -84.5 t84.5 -203.5z"),i.setAttribute("class","svg-pan-zoom-control-element"),t.appendChild(i),t},disable:function(e){e.controlIcons&&(e.controlIcons.parentNode.removeChild(e.controlIcons),e.controlIcons=null)}}},{"./svg-utilities":5}],3:[function(e,t,n){var r=e("./svg-utilities"),i=e("./utilities"),s=function(e,t){this.init(e,t)};s.prototype.init=function(e,t){this.viewport=e,this.options=t,this.originalState={zoom:1,x:0,y:0},this.activeState={zoom:1,x:0,y:0},this.updateCTMCached=i.proxy(this.updateCTM,this),this.requestAnimationFrame=i.createRequestAnimationFrame(this.options.refreshRate),this.viewBox={x:0,y:0,width:0,height:0},this.cacheViewBox();var n=this.processCTM();this.setCTM(n),this.updateCTM()},s.prototype.cacheViewBox=function(){var e=this.options.svg.getAttribute("viewBox");if(e){var t=e.split(/[\s\,]/).filter(function(e){return e}).map(parseFloat);this.viewBox.x=t[0],this.viewBox.y=t[1],this.viewBox.width=t[2],this.viewBox.height=t[3];var n=Math.min(this.options.width/this.viewBox.width,this.options.height/this.viewBox.height);this.activeState.zoom=n,this.activeState.x=(this.options.width-this.viewBox.width*n)/2,this.activeState.y=(this.options.height-this.viewBox.height*n)/2,this.updateCTMOnNextFrame(),this.options.svg.removeAttribute("viewBox")}else this.simpleViewBoxCache()},s.prototype.simpleViewBoxCache=function(){var e=this.viewport.getBBox();this.viewBox.x=e.x,this.viewBox.y=e.y,this.viewBox.width=e.width,this.viewBox.height=e.height},s.prototype.getViewBox=function(){return i.extend({},this.viewBox)},s.prototype.processCTM=function(){var e=this.getCTM();if(this.options.fit||this.options.contain){var t;t=this.options.fit?Math.min(this.options.width/this.viewBox.width,this.options.height/this.viewBox.height):Math.max(this.options.width/this.viewBox.width,this.options.height/this.viewBox.height),e.a=t,e.d=t,e.e=-this.viewBox.x*t,e.f=-this.viewBox.y*t}if(this.options.center){var n=.5*(this.options.width-(this.viewBox.width+2*this.viewBox.x)*e.a),r=.5*(this.options.height-(this.viewBox.height+2*this.viewBox.y)*e.a);e.e=n,e.f=r}return this.originalState.zoom=e.a,this.originalState.x=e.e,this.originalState.y=e.f,e},s.prototype.getOriginalState=function(){return i.extend({},this.originalState)},s.prototype.getState=function(){return i.extend({},this.activeState)},s.prototype.getZoom=function(){return this.activeState.zoom},s.prototype.getRelativeZoom=function(){return this.activeState.zoom/this.originalState.zoom},s.prototype.computeRelativeZoom=function(e){return e/this.originalState.zoom},s.prototype.getPan=function(){return{x:this.activeState.x,y:this.activeState.y}},s.prototype.getCTM=function(){var e=this.options.svg.createSVGMatrix();return e.a=this.activeState.zoom,e.b=0,e.c=0,e.d=this.activeState.zoom,e.e=this.activeState.x,e.f=this.activeState.y,e},s.prototype.setCTM=function(e){var t=this.isZoomDifferent(e),n=this.isPanDifferent(e);if(t||n){if(t&&this.options.beforeZoom(this.getRelativeZoom(),this.computeRelativeZoom(e.a))===!1&&(e.a=e.d=this.activeState.zoom,t=!1),n){var r=this.options.beforePan(this.getPan(),{x:e.e,y:e.f}),s=!1,o=!1;r===!1?(e.e=this.getPan().x,e.f=this.getPan().y,s=o=!0):i.isObject(r)&&(r.x===!1?(e.e=this.getPan().x,s=!0):i.isNumber(r.x)&&(e.e=r.x),r.y===!1?(e.f=this.getPan().y,o=!0):i.isNumber(r.y)&&(e.f=r.y)),s&&o&&(n=!1)}(t||n)&&(this.updateCache(e),this.updateCTMOnNextFrame(),t&&this.options.onZoom(this.getRelativeZoom()),n&&this.options.onPan(this.getPan()))}},s.prototype.isZoomDifferent=function(e){return this.activeState.zoom!==e.a},s.prototype.isPanDifferent=function(e){return this.activeState.x!==e.e||this.activeState.y!==e.f},s.prototype.updateCache=function(e){this.activeState.zoom=e.a,this.activeState.x=e.e,this.activeState.y=e.f},s.prototype.pendingUpdate=!1,s.prototype.updateCTMOnNextFrame=function(){this.pendingUpdate||(this.pendingUpdate=!0,this.requestAnimationFrame.call(window,this.updateCTMCached))},s.prototype.updateCTM=function(){r.setCTM(this.viewport,this.getCTM(),this.defs),this.pendingUpdate=!1},t.exports=function(e,t){return new s(e,t)}},{"./svg-utilities":5,"./utilities":7}],4:[function(e,t,n){var r=e("./uniwheel"),i=e("./control-icons"),s=e("./utilities"),o=e("./svg-utilities"),u=e("./shadow-viewport"),a=function(e,t){this.init(e,t)},f={viewportSelector:".svg-pan-zoom_viewport",panEnabled:!0,controlIconsEnabled:!1,zoomEnabled:!0,dblClickZoomEnabled:!0,mouseWheelZoomEnabled:!0,preventMouseEventsDefault:!0,zoomScaleSensitivity:.1,minZoom:.5,maxZoom:10,fit:!0,contain:!1,center:!0,refreshRate:"auto",beforeZoom:null,onZoom:null,beforePan:null,onPan:null,customEventsHandler:null,eventsListenerElement:null};a.prototype.init=function(e,t){var n=this;this.svg=e,this.defs=e.querySelector("defs"),o.setupSvgAttributes(this.svg),this.options=s.extend(s.extend({},f),t),this.state="none";var r=o.getBoundingClientRectNormalized(e);this.width=r.width,this.height=r.height,this.viewport=u(o.getOrCreateViewport(this.svg,this.options.viewportSelector),{svg:this.svg,width:this.width,height:this.height,fit:this.options.fit,contain:this.options.contain,center:this.options.center,refreshRate:this.options.refreshRate,beforeZoom:function(e,t){return n.viewport&&n.options.beforeZoom?n.options.beforeZoom(e,t):void 0},onZoom:function(e){return n.viewport&&n.options.onZoom?n.options.onZoom(e):void 0},beforePan:function(e,t){return n.viewport&&n.options.beforePan?n.options.beforePan(e,t):void 0},onPan:function(e){return n.viewport&&n.options.onPan?n.options.onPan(e):void 0}});var a=this.getPublicInstance();a.setBeforeZoom(this.options.beforeZoom),a.setOnZoom(this.options.onZoom),a.setBeforePan(this.options.beforePan),a.setOnPan(this.options.onPan),this.options.controlIconsEnabled&&i.enable(this),this.lastMouseWheelEventTime=Date.now(),this.setupHandlers()},a.prototype.setupHandlers=function(){var e=this,t=null;if(this.eventListeners={mousedown:function(n){var r=e.handleMouseDown(n,t);return t=n,r},touchstart:function(n){var r=e.handleMouseDown(n,t);return t=n,r},mouseup:function(t){return e.handleMouseUp(t)},touchend:function(t){return e.handleMouseUp(t)},mousemove:function(t){return e.handleMouseMove(t)},touchmove:function(t){return e.handleMouseMove(t)},mouseleave:function(t){return e.handleMouseUp(t)},touchleave:function(t){return e.handleMouseUp(t)},touchcancel:function(t){return e.handleMouseUp(t)}},null!=this.options.customEventsHandler){this.options.customEventsHandler.init({svgElement:this.svg,eventsListenerElement:this.options.eventsListenerElement,instance:this.getPublicInstance()});var n=this.options.customEventsHandler.haltEventListeners;if(n&&n.length)for(var r=n.length-1;r>=0;r--)this.eventListeners.hasOwnProperty(n[r])&&delete this.eventListeners[n[r]]}for(var i in this.eventListeners)(this.options.eventsListenerElement||this.svg).addEventListener(i,this.eventListeners[i],!1);this.options.mouseWheelZoomEnabled&&(this.options.mouseWheelZoomEnabled=!1,this.enableMouseWheelZoom())},a.prototype.enableMouseWheelZoom=function(){if(!this.options.mouseWheelZoomEnabled){var e=this;this.wheelListener=function(t){return e.handleMouseWheel(t)},r.on(this.options.eventsListenerElement||this.svg,this.wheelListener,!1),this.options.mouseWheelZoomEnabled=!0}},a.prototype.disableMouseWheelZoom=function(){this.options.mouseWheelZoomEnabled&&(r.off(this.options.eventsListenerElement||this.svg,this.wheelListener,!1),this.options.mouseWheelZoomEnabled=!1)},a.prototype.handleMouseWheel=function(e){if(this.options.zoomEnabled&&"none"===this.state){this.options.preventMouseEventsDefault&&(e.preventDefault?e.preventDefault():e.returnValue=!1);var t=e.deltaY||1,n=Date.now()-this.lastMouseWheelEventTime,r=3+Math.max(0,30-n);this.lastMouseWheelEventTime=Date.now(),"deltaMode"in e&&0===e.deltaMode&&e.wheelDelta&&(t=0===e.deltaY?0:Math.abs(e.wheelDelta)/e.deltaY),t=t>-0.3&&.3>t?t:(t>0?1:-1)*Math.log(Math.abs(t)+10)/r;var i=this.svg.getScreenCTM().inverse(),s=o.getEventPoint(e,this.svg).matrixTransform(i),u=Math.pow(1+this.options.zoomScaleSensitivity,-1*t);this.zoomAtPoint(u,s)}},a.prototype.zoomAtPoint=function(e,t,n){var r=this.viewport.getOriginalState();n?(e=Math.max(this.options.minZoom*r.zoom,Math.min(this.options.maxZoom*r.zoom,e)),e/=this.getZoom()):this.getZoom()*e<this.options.minZoom*r.zoom?e=this.options.minZoom*r.zoom/this.getZoom():this.getZoom()*e>this.options.maxZoom*r.zoom&&(e=this.options.maxZoom*r.zoom/this.getZoom());var i=this.viewport.getCTM(),s=t.matrixTransform(i.inverse()),o=this.svg.createSVGMatrix().translate(s.x,s.y).scale(e).translate(-s.x,-s.y),u=i.multiply(o);u.a!==i.a&&this.viewport.setCTM(u)},a.prototype.zoom=function(e,t){this.zoomAtPoint(e,o.getSvgCenterPoint(this.svg,this.width,this.height),t)},a.prototype.publicZoom=function(e,t){t&&(e=this.computeFromRelativeZoom(e)),this.zoom(e,t)},a.prototype.publicZoomAtPoint=function(e,t,n){if(n&&(e=this.computeFromRelativeZoom(e)),"SVGPoint"!==s.getType(t)){if(!("x"in t&&"y"in t))throw new Error("Given point is invalid");t=o.createSVGPoint(this.svg,t.x,t.y)}this.zoomAtPoint(e,t,n)},a.prototype.getZoom=function(){return this.viewport.getZoom()},a.prototype.getRelativeZoom=function(){return this.viewport.getRelativeZoom()},a.prototype.computeFromRelativeZoom=function(e){return e*this.viewport.getOriginalState().zoom},a.prototype.resetZoom=function(){var e=this.viewport.getOriginalState();this.zoom(e.zoom,!0)},a.prototype.resetPan=function(){this.pan(this.viewport.getOriginalState())},a.prototype.reset=function(){this.resetZoom(),this.resetPan()},a.prototype.handleDblClick=function(e){if(this.options.preventMouseEventsDefault&&(e.preventDefault?e.preventDefault():e.returnValue=!1),this.options.controlIconsEnabled){var t=e.target.getAttribute("class")||"";if(t.indexOf("svg-pan-zoom-control")>-1)return!1}var n;n=e.shiftKey?1/(2*(1+this.options.zoomScaleSensitivity)):2*(1+this.options.zoomScaleSensitivity);var r=o.getEventPoint(e,this.svg).matrixTransform(this.svg.getScreenCTM().inverse());this.zoomAtPoint(n,r)},a.prototype.handleMouseDown=function(e,t){this.options.preventMouseEventsDefault&&(e.preventDefault?e.preventDefault():e.returnValue=!1),s.mouseAndTouchNormalize(e,this.svg),this.options.dblClickZoomEnabled&&s.isDblClick(e,t)?this.handleDblClick(e):(this.state="pan",this.firstEventCTM=this.viewport.getCTM(),this.stateOrigin=o.getEventPoint(e,this.svg).matrixTransform(this.firstEventCTM.inverse()))},a.prototype.handleMouseMove=function(e){if(this.options.preventMouseEventsDefault&&(e.preventDefault?e.preventDefault():e.returnValue=!1),"pan"===this.state&&this.options.panEnabled){var t=o.getEventPoint(e,this.svg).matrixTransform(this.firstEventCTM.inverse()),n=this.firstEventCTM.translate(t.x-this.stateOrigin.x,t.y-this.stateOrigin.y);this.viewport.setCTM(n)}},a.prototype.handleMouseUp=function(e){this.options.preventMouseEventsDefault&&(e.preventDefault?e.preventDefault():e.returnValue=!1),"pan"===this.state&&(this.state="none")},a.prototype.fit=function(){var e=this.viewport.getViewBox(),t=Math.min(this.width/e.width,this.height/e.height);this.zoom(t,!0)},a.prototype.contain=function(){var e=this.viewport.getViewBox(),t=Math.max(this.width/e.width,this.height/e.height);this.zoom(t,!0)},a.prototype.center=function(){var e=this.viewport.getViewBox(),t=.5*(this.width-(e.width+2*e.x)*this.getZoom()),n=.5*(this.height-(e.height+2*e.y)*this.getZoom());this.getPublicInstance().pan({x:t,y:n})},a.prototype.updateBBox=function(){this.viewport.simpleViewBoxCache()},a.prototype.pan=function(e){var t=this.viewport.getCTM();t.e=e.x,t.f=e.y,this.viewport.setCTM(t)},a.prototype.panBy=function(e){var t=this.viewport.getCTM();t.e+=e.x,t.f+=e.y,this.viewport.setCTM(t)},a.prototype.getPan=function(){var e=this.viewport.getState();return{x:e.x,y:e.y}},a.prototype.resize=function(){var e=o.getBoundingClientRectNormalized(this.svg);this.width=e.width,this.height=e.height;var t=this.viewport;t.options.width=this.width,t.options.height=this.height,t.processCTM(),this.options.controlIconsEnabled&&(this.getPublicInstance().disableControlIcons(),this.getPublicInstance().enableControlIcons())},a.prototype.destroy=function(){var e=this;this.beforeZoom=null,this.onZoom=null,this.beforePan=null,this.onPan=null,null!=this.options.customEventsHandler&&this.options.customEventsHandler.destroy({svgElement:this.svg,eventsListenerElement:this.options.eventsListenerElement,instance:this.getPublicInstance()});for(var t in this.eventListeners)(this.options.eventsListenerElement||this.svg).removeEventListener(t,this.eventListeners[t],!1);this.disableMouseWheelZoom(),this.getPublicInstance().disableControlIcons(),this.reset(),l=l.filter(function(t){return t.svg!==e.svg}),delete this.options,delete this.publicInstance,delete this.pi,this.getPublicInstance=function(){return null}},a.prototype.getPublicInstance=function(){var e=this;return this.publicInstance||(this.publicInstance=this.pi={enablePan:function(){return e.options.panEnabled=!0,e.pi},disablePan:function(){return e.options.panEnabled=!1,e.pi},isPanEnabled:function(){return!!e.options.panEnabled},pan:function(t){return e.pan(t),e.pi},panBy:function(t){return e.panBy(t),e.pi},getPan:function(){return e.getPan()},setBeforePan:function(t){return e.options.beforePan=null===t?null:s.proxy(t,e.publicInstance),e.pi},setOnPan:function(t){return e.options.onPan=null===t?null:s.proxy(t,e.publicInstance),e.pi},enableZoom:function(){return e.options.zoomEnabled=!0,e.pi},disableZoom:function(){return e.options.zoomEnabled=!1,e.pi},isZoomEnabled:function(){return!!e.options.zoomEnabled},enableControlIcons:function(){return e.options.controlIconsEnabled||(e.options.controlIconsEnabled=!0,i.enable(e)),e.pi},disableControlIcons:function(){return e.options.controlIconsEnabled&&(e.options.controlIconsEnabled=!1,i.disable(e)),e.pi},isControlIconsEnabled:function(){return!!e.options.controlIconsEnabled},enableDblClickZoom:function(){return e.options.dblClickZoomEnabled=!0,e.pi},disableDblClickZoom:function(){return e.options.dblClickZoomEnabled=!1,e.pi},isDblClickZoomEnabled:function(){return!!e.options.dblClickZoomEnabled},enableMouseWheelZoom:function(){return e.enableMouseWheelZoom(),e.pi},disableMouseWheelZoom:function(){return e.disableMouseWheelZoom(),e.pi},isMouseWheelZoomEnabled:function(){return!!e.options.mouseWheelZoomEnabled},setZoomScaleSensitivity:function(t){return e.options.zoomScaleSensitivity=t,e.pi},setMinZoom:function(t){return e.options.minZoom=t,e.pi},setMaxZoom:function(t){return e.options.maxZoom=t,e.pi},setBeforeZoom:function(t){return e.options.beforeZoom=null===t?null:s.proxy(t,e.publicInstance),e.pi},setOnZoom:function(t){return e.options.onZoom=null===t?null:s.proxy(t,e.publicInstance),e.pi},zoom:function(t){return e.publicZoom(t,!0),e.pi},zoomBy:function(t){return e.publicZoom(t,!1),e.pi},zoomAtPoint:function(t,n){return e.publicZoomAtPoint(t,n,!0),e.pi},zoomAtPointBy:function(t,n){return e.publicZoomAtPoint(t,n,!1),e.pi},zoomIn:function(){return this.zoomBy(1+e.options.zoomScaleSensitivity),e.pi},zoomOut:function(){return this.zoomBy(1/(1+e.options.zoomScaleSensitivity)),e.pi},getZoom:function(){return e.getRelativeZoom()},resetZoom:function(){return e.resetZoom(),e.pi},resetPan:function(){return e.resetPan(),e.pi},reset:function(){return e.reset(),e.pi},fit:function(){return e.fit(),e.pi},contain:function(){return e.contain(),e.pi},center:function(){return e.center(),e.pi},updateBBox:function(){return e.updateBBox(),e.pi},resize:function(){return e.resize(),e.pi},getSizes:function(){return{width:e.width,height:e.height,realZoom:e.getZoom(),viewBox:e.viewport.getViewBox()}},destroy:function(){return e.destroy(),e.pi}}),this.publicInstance};var l=[],c=function(e,t){var n=s.getSvg(e);if(null===n)return null;for(var r=l.length-1;r>=0;r--)if(l[r].svg===n)return l[r].instance.getPublicInstance();return l.push({svg:n,instance:new a(n,t)}),l[l.length-1].instance.getPublicInstance()};t.exports=c},{"./control-icons":2,"./shadow-viewport":3,"./svg-utilities":5,"./uniwheel":6,"./utilities":7}],5:[function(e,t,n){var r=e("./utilities"),i="unknown";document.documentMode&&(i="ie"),t.exports={svgNS:"http://www.w3.org/2000/svg",xmlNS:"http://www.w3.org/XML/1998/namespace",xmlnsNS:"http://www.w3.org/2000/xmlns/",xlinkNS:"http://www.w3.org/1999/xlink",evNS:"http://www.w3.org/2001/xml-events",getBoundingClientRectNormalized:function(e){if(e.clientWidth&&e.clientHeight)return{width:e.clientWidth,height:e.clientHeight};if(e.getBoundingClientRect())return e.getBoundingClientRect();throw new Error("Cannot get BoundingClientRect for SVG.")},getOrCreateViewport:function(e,t){var n=null;if(n=r.isElement(t)?t:e.querySelector(t),!n){var i=Array.prototype.slice.call(e.childNodes||e.children).filter(function(e){return"defs"!==e.nodeName&&"#text"!==e.nodeName});1===i.length&&"g"===i[0].nodeName&&null===i[0].getAttribute("transform")&&(n=i[0])}if(!n){var s="viewport-"+(new Date).toISOString().replace(/\D/g,"");n=document.createElementNS(this.svgNS,"g"),n.setAttribute("id",s);var o=e.childNodes||e.children;if(o&&o.length>0)for(var u=o.length;u>0;u--)"defs"!==o[o.length-u].nodeName&&n.appendChild(o[o.length-u]);e.appendChild(n)}var a=[];return n.getAttribute("class")&&(a=n.getAttribute("class").split(" ")),~a.indexOf("svg-pan-zoom_viewport")||(a.push("svg-pan-zoom_viewport"),n.setAttribute("class",a.join(" "))),n},setupSvgAttributes:function(e){if(e.setAttribute("xmlns",this.svgNS),e.setAttributeNS(this.xmlnsNS,"xmlns:xlink",this.xlinkNS),e.setAttributeNS(this.xmlnsNS,"xmlns:ev",this.evNS),null!==e.parentNode){var t=e.getAttribute("style")||"";-1===t.toLowerCase().indexOf("overflow")&&e.setAttribute("style","overflow: hidden; "+t)}},internetExplorerRedisplayInterval:300,refreshDefsGlobal:r.throttle(function(){for(var e=document.querySelectorAll("defs"),t=e.length,n=0;t>n;n++){var r=e[n];r.parentNode.insertBefore(r,r)}},this.internetExplorerRedisplayInterval),setCTM:function(e,t,n){var r=this,s="matrix("+t.a+","+t.b+","+t.c+","+t.d+","+t.e+","+t.f+")";e.setAttributeNS(null,"transform",s),"transform"in e.style?e.style.transform=s:"-ms-transform"in e.style?e.style["-ms-transform"]=s:"-webkit-transform"in e.style&&(e.style["-webkit-transform"]=s),"ie"===i&&n&&(n.parentNode.insertBefore(n,n),window.setTimeout(function(){r.refreshDefsGlobal()},r.internetExplorerRedisplayInterval))},getEventPoint:function(e,t){var n=t.createSVGPoint();return r.mouseAndTouchNormalize(e,t),n.x=e.clientX,n.y=e.clientY,n},getSvgCenterPoint:function(e,t,n){return this.createSVGPoint(e,t/2,n/2)},createSVGPoint:function(e,t,n){var r=e.createSVGPoint();return r.x=t,r.y=n,r}}},{"./utilities":7}],6:[function(e,t,n){t.exports=function(){function e(e,t,n){var r=function(e){!e&&(e=window.event);var n={originalEvent:e,target:e.target||e.srcElement,type:"wheel",deltaMode:"MozMousePixelScroll"==e.type?0:1,deltaX:0,delatZ:0,preventDefault:function(){e.preventDefault?e.preventDefault():e.returnValue=!1}};return"mousewheel"==f?(n.deltaY=-1/40*e.wheelDelta,e.wheelDeltaX&&(n.deltaX=-1/40*e.wheelDeltaX)):n.deltaY=e.detail,t(n)};return c.push({element:e,fn:r,capture:n}),r}function t(e,t){for(var n=0;n<c.length;n++)if(c[n].element===e&&c[n].capture===t)return c[n].fn;return function(){}}function n(e,t){for(var n=0;n<c.length;n++)if(c[n].element===e&&c[n].capture===t)return c.splice(n,1)}function r(t,n,r,i){var s;s="wheel"===f?r:e(t,r,i),t[u](l+n,s,i||!1)}function i(e,r,i,s){"wheel"===f?cb=i:cb=t(e,s),e[a](l+r,cb,s||!1),n(e,s)}function s(e,t,n){r(e,f,t,n),"DOMMouseScroll"==f&&r(e,"MozMousePixelScroll",t,n)}function o(e,t,n){i(e,f,t,n),"DOMMouseScroll"==f&&i(e,"MozMousePixelScroll",t,n)}var u,a,f,l="",c=[];return window.addEventListener?(u="addEventListener",a="removeEventListener"):(u="attachEvent",a="detachEvent",l="on"),f="onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll",{on:s,off:o}}()},{}],7:[function(e,t,n){function r(e){return function(t){window.setTimeout(t,e)}}t.exports={extend:function(e,t){e=e||{};for(var n in t)this.isObject(t[n])?e[n]=this.extend(e[n],t[n]):e[n]=t[n];return e},isElement:function(e){return e instanceof HTMLElement||e instanceof SVGElement||e instanceof SVGSVGElement||e&&"object"==typeof e&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName},isObject:function(e){return"[object Object]"===Object.prototype.toString.call(e)},isNumber:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},getSvg:function(e){var t,n;if(this.isElement(e))t=e;else{if(!("string"==typeof e||e instanceof String))throw new Error("Provided selector is not an HTML object nor String");if(t=document.querySelector(e),!t)throw new Error("Provided selector did not find any elements. Selector: "+e)}if("svg"===t.tagName.toLowerCase())n=t;else if("object"===t.tagName.toLowerCase())n=t.contentDocument.documentElement;else{if("embed"!==t.tagName.toLowerCase())throw"img"===t.tagName.toLowerCase()?new Error('Cannot script an SVG in an "img" element. Please use an "object" element or an in-line SVG.'):new Error("Cannot get SVG.");n=t.getSVGDocument().documentElement}return n},proxy:function(e,t){return function(){return e.apply(t,arguments)}},getType:function(e){return Object.prototype.toString.apply(e).replace(/^\[object\s/,"").replace(/\]$/,"")},mouseAndTouchNormalize:function(e,t){if(void 0===e.clientX||null===e.clientX)if(e.clientX=0,e.clientY=0,void 0!==e.changedTouches&&e.changedTouches.length){if(void 0!==e.changedTouches[0].clientX)e.clientX=e.changedTouches[0].clientX,e.clientY=e.changedTouches[0].clientY;else if(void 0!==e.changedTouches[0].pageX){var n=t.getBoundingClientRect();e.clientX=e.changedTouches[0].pageX-n.left,e.clientY=e.changedTouches[0].pageY-n.top}}else void 0!==e.originalEvent&&void 0!==e.originalEvent.clientX&&(e.clientX=e.originalEvent.clientX,e.clientY=e.originalEvent.clientY)},isDblClick:function(e,t){if(2===e.detail)return!0;if(void 0!==t&&null!==t){var n=e.timeStamp-t.timeStamp,r=Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2));return 250>n&&10>r}return!1},now:Date.now||function(){return(new Date).getTime()},throttle:function(e,t,n){var r,i,s,o=this,u=null,a=0;n||(n={});var f=function(){a=n.leading===!1?0:o.now(),u=null,s=e.apply(r,i),u||(r=i=null)};return function(){var c=o.now();a||n.leading!==!1||(a=c);var h=t-(c-a);return r=this,i=arguments,0>=h||h>t?(clearTimeout(u),u=null,a=c,s=e.apply(r,i),u||(r=i=null)):u||n.trailing===!1||(u=setTimeout(f,h)),s}},createRequestAnimationFrame:function(e){var t=null;return"auto"!==e&&60>e&&e>1&&(t=Math.floor(1e3/e)),null===t?window.requestAnimationFrame||r(33):r(t)}}},{}]},{},[1]),define("jswish",["jquery","config","preferences","history","modal","jquery-ui","splitter","bootstrap","pane","tabbed","notebook","navbar","search","editor","query","runner","term","laconic","d3","c3","svg-pan-zoom"],function(e,t,n,r,i){n.setDefault("semantic-highlighting",!0),n.setDefault("emacs-keybinding",!1),function(e){function u(t,n){e(".swish-event-receiver").trigger(t,n)}function a(){e(".swish-logo").append(e.el.b(e.el.span({style:"color:darkblue"},"SWI"),e.el.span({style:"color:maroon"},"SH"))).css("margin-left","30px").css("font-size","24px").addClass("navbar-brand")}function f(){e("#modal").length==0&&(e("body").append(e.el.div({id:"modal"})),e("#modal").swishModal())}function l(){e(".tile").tile(),e(window).resize(function(){e(".tile").tile("resize")}),e("body").on("click","button.close-pane",function(){closePane(e(this).parent())}),e(".tabbed").tabbed()}function c(){e(window).resize(function(){e(".reactive-size").trigger("reactive-resize")})}var n="swish",s={menu:{File:{"Save ...":function(){u("save","as")},"Info & history ...":function(){u("fileInfo")},"Open recent":{type:"submenu",action:function(t){r.openRecent(t,e(this).data("document"))},update:r.updateRecentUL},Share:"--",Download:function(){u("download")},"Start TogetherJS ...":function(){e("body").swish("collaborate")},"Print group":"--","Print ...":function(){u("print")}},Edit:{"Clear messages":function(){u("clearMessages")},Changes:"--","View changes":function(){u("diff")},Edit:"--","Find (Ctrl-F)":function(){u("edit-command","find")},"Find and replace (Shift-Ctrl-F)":function(){u("edit-command","replace")},"Jump to line (Alt-G)":function(){u("edit-command","jumpToLine")},Options:"--","Semantic highlighting":{preference:"semantic-highlighting",type:"checkbox"},"Emacs Keybinding":{preference:"emacs-keybinding",type:"checkbox",value:"false"}},Examples:function(t,n){e("body").swish("populateExamples",t,n)},Help:{"About ...":function(){u("help",{file:"about.html"})},Topics:"--","Help ...":function(){u("help",{file:"help.html"})},"Runner ...":function(){u("help",{file:"runner.html"})},"Debugging ...":function(){u("help",{file:"debug.html"})},"Notebook ...":function(){u("help",{file:"notebook.html"})},"Editor ...":function(){u("help",{file:"editor.html"})},Background:"--","Limitations ...":function(){u("help",{file:"beware.html"})},"Caveats ...":function(){u("help",{file:"caveats.html"})},"Background ...":function(){u("help",{file:"background.html"})}}}},o={_init:function(t){return a(),f(),l(),c(),e("#search").search(),t=t||{},this.addClass("swish"),this.each(function(){var r=e(this),i={};e("#navbar").navbar(s.menu);var o=e(".prolog-editor").prologEditor({save:!0});i.runner=e(".prolog-runners").prologRunners(),i.query=e(".prolog-query").queryEditor({source:function(){return r.swish("prologSource")},sourceID:function(){return o.prologEditor("getSourceID")},examples:r.swish("examples"),runner:i.runner,editor:o[0]}),e(".notebook").notebook(),t.show_beware&&u("help",{file:"beware.html",notagain:"beware"}),r.data(n,i),window.location.href.indexOf("&togetherjs=")>0&&r.swish("collaborate")})},trigger:function(e,t){return u(e,t),this},playFile:function(n){var r=this;typeof n=="string"&&(n={file:n});var s=this.find(".storage").storage("match",n);if(s&&s.storage("expose","Already open"))return this;var o=t.http.locations.web_storage+n.file;return e.ajax({url:o,type:"GET",data:{format:"json"},success:function(e){function t(t){for(var r=0;r<t.length;r++){var i=t[r];n[i]&&(e[i]=n[i])}}e.url=o,e.st_type="gitty",t(["line","regex","showAllMatches","newTab","noHistory","prompt"]),r.swish("setSource",e)},error:function(e){i.ajaxError(e)}}),this},playURL:function(t){var n=this,r=this.find(".storage").storage("match",t);if(r&&r.storage("expose","Already open"))return this;e.ajax({url:t.url,type:"GET",data:{format:"json"},success:function(e){function i(e){for(var n=0;n<e.length;n++){var i=e[n];t[i]&&(r[i]=t[i])}}var r;if(typeof e=="string")r={data:e},r.st_type="external";else{if(typeof e!="object"||typeof e.data!="string"){alert("Invalid data");return}r=e,r.st_type="filesys"}r.url=t.url,i(["line","regex","showAllMatches","newTab","noHistory","prompt"]),n.swish("setSource",r)},error:function(e){i.ajaxError(e)}})},setSource:function(e){u("source",e),this.find(".storage").storage("match",e)||this.swish("exitFullscreen")&&u("source",e)},openExampleFunction:function(e){var t=this;return e.type=="divider"?"--":e.type=="store"?function(){o.playFile.call(t,e.file)}:function(){o.playURL.call(t,{url:e.href})}},populateExamples:function(n,r){var i=this;return i.off("examples-changed").on("examples-changed",function(){e("#navbar").navbar("clearDropdown",r),i.swish("populateExamples",n,r)}),e.ajax(t.http.locations.swish_examples,{dataType:"json",success:function(t){for(var n=0;n<t.length;n++){var s=t[n],o,u;if(s=="--"||s.type=="divider")o="--",u="--";else{var a=s.file||s.href;o=s.title,u=i.swish("openExampleFunction",s),a&&(u.typeIcon=a.split(".").pop())}e("#navbar").navbar("extendDropdown",r,o,u)}}}),this},prologSource:function(){var t=[],n;return(n=e(".prolog-editor").prologEditor("getSource","source"))&&t.push(n),(n=e(".background.prolog.source").text())&&t.push(n),t.join("\n\n")},breakpoints:function(e){return this.find(".prolog-editor").prologEditor("getBreakpoints",e)||[]},tabData:function(e){return e=e||{},e.active?this.find(".tab-pane.active .storage").storage("getData",e):this.find(".storage").storage("getData",e)},examples:function(t){var n=e(".examples.prolog").text();if(n)return e().prologEditor("getExamples",n,!1);if(t!=1)return function(){return e(".prolog-editor").prologEditor("getExamples")}},fullscreen:function(t){if(!t.hasClass("fullscreen")){var n=this.find(".container.swish");t.addClass("fullscreen hamburger"),t.data("fullscreen_origin",t.parent()[0]),e(n.children()[0]).hide(),n.append(t)}return this},exitFullscreen:function(){var t=this.find(".container.swish"),n=e(t.children()[1]);return n&&n.hasClass("fullscreen")?(n.removeClass("fullscreen hamburger"),e(n.data("fullscreen_origin")).append(n),e.removeData(n,"fullscreen_origin"),e(t.children()[0]).show(),!0):!1},collaborate:function(){var t=this;return e(this).attr("data-end-togetherjs-html","End collaboration"),require(["https://togetherjs.com/togetherjs-min.js"],function(){TogetherJS(t)}),this}};e.fn.swish=function(t){if(o[t])return o[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return o._init.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery."+n)}}(jQuery)}),require.config({urlArgs:"ts="+(new Date).getTime(),waitSeconds:60,paths:{jquery:"../bower_components/jquery/dist/jquery.min","jquery-ui":"../bower_components/jquery-ui/jquery-ui.min",laconic:"../bower_components/laconic/laconic",bootstrap:"../bower_components/bootstrap/dist/js/bootstrap.min",typeahead:"../bower_components/typeahead.js/dist/typeahead.bundle.min",splitter:"../bower_components/jquery.splitter/js/jquery.splitter-0.15.0",tagmanager:"../bower_components/tagmanager/tagmanager",sha1:"../bower_components/js-sha1/src/sha1",c3:"../bower_components/c3/c3",d3:"../bower_components/d3/d3","svg-pan-zoom":"../bower_components/svg-pan-zoom/dist/svg-pan-zoom.min",sparkline:"../bower_components/sparkline/dist/jquery.sparkline","cm/mode/prolog":"codemirror/mode/prolog","cm/addon/hover/prolog-hover":"codemirror/addon/hover/prolog-hover","cm/addon/hover/text-hover":"codemirror/addon/hover/text-hover","cm/addon/hint/templates-hint":"codemirror/addon/hint/templates-hint","cm/addon/hint/show-context-info":"codemirror/addon/hint/show-context-info",cm:"../bower_components/codemirror"},shim:{bootstrap:{deps:["jquery"]},typeahead:{deps:["jquery"]},splitter:{deps:["jquery"]},laconic:{deps:["jquery"]},tagmanager:{deps:["jquery"]}}}),require(["jquery","config","jswish"],function(e,t,n){require([t.http.locations.pengines+"/pengines.js"],function(){e(function(){e("body").swish(t.swish||{})})})}),define("swish",function(){});
\ No newline at end of file
diff --git a/web/js/swish-min.js.gz b/web/js/swish-min.js.gz
index e7316cb..2ebf707 100644
Binary files a/web/js/swish-min.js.gz and b/web/js/swish-min.js.gz differ